From b16b9e4656e7199c2aec74a4c8ebc7a875d3ba73 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Mon, 2 Feb 2015 15:02:49 +0100 Subject: massive reduction of unneeded files --- nx-X11/programs/Xserver/GL/apple/Imakefile | 49 - nx-X11/programs/Xserver/GL/apple/aglGlx.c | 1355 ----- nx-X11/programs/Xserver/GL/apple/indirect.c | 1380 ----- nx-X11/programs/Xserver/GL/dri/Imakefile | 35 - .../programs/Xserver/GL/dri/Imakefile.NX.reference | 35 - .../Xserver/GL/dri/Imakefile.XF86.reference | 34 - nx-X11/programs/Xserver/GL/dri/dri-def.cpp | 50 - nx-X11/programs/Xserver/GL/dri/dri.c | 2109 ------- nx-X11/programs/Xserver/GL/dri/dri.h | 345 -- nx-X11/programs/Xserver/GL/dri/drimodule.c | 127 - nx-X11/programs/Xserver/GL/dri/dristruct.h | 105 - nx-X11/programs/Xserver/GL/dri/sarea.h | 94 - nx-X11/programs/Xserver/GL/dri/xf86dri.c | 649 --- nx-X11/programs/Xserver/GL/windows/ChangeLog | 64 - nx-X11/programs/Xserver/GL/windows/Imakefile | 36 - nx-X11/programs/Xserver/GL/windows/glwindows.h | 64 - nx-X11/programs/Xserver/GL/windows/glwrap.c | 583 -- nx-X11/programs/Xserver/GL/windows/indirect.c | 1605 ------ nx-X11/programs/Xserver/XFree86.def | 5 - nx-X11/programs/Xserver/Xnest.def | 4 - nx-X11/programs/Xserver/Xorg.def | 5 - nx-X11/programs/Xserver/XpConfig/C/Imakefile | 8 - nx-X11/programs/Xserver/XpConfig/C/print/Imakefile | 23 - nx-X11/programs/Xserver/XpConfig/C/print/Xprinters | 49 - .../Xserver/XpConfig/C/print/attributes/Imakefile | 8 - .../Xserver/XpConfig/C/print/attributes/document | 49 - .../Xserver/XpConfig/C/print/attributes/job | 25 - .../Xserver/XpConfig/C/print/attributes/printer | 96 - .../Xserver/XpConfig/C/print/ddx-config/Imakefile | 8 - .../XpConfig/C/print/ddx-config/raster/Imakefile | 6 - .../Xserver/XpConfig/C/print/ddx-config/raster/pcl | 39 - .../XpConfig/C/print/ddx-config/raster/postscript | 0 .../C/print/models/CANONBJ10E-GS/Imakefile | 15 - .../C/print/models/CANONBJ10E-GS/model-config | 23 - .../C/print/models/CANONC3200-PS/Imakefile | 15 - .../C/print/models/CANONC3200-PS/fonts/Imakefile | 45 - .../C/print/models/CANONC3200-PS/model-config | 40 - .../XpConfig/C/print/models/GSdefault/Imakefile | 14 - .../XpConfig/C/print/models/GSdefault/model-config | 137 - .../XpConfig/C/print/models/HPDJ1600C/Imakefile | 14 - .../C/print/models/HPDJ1600C/fonts/9nb00051.pmf | Bin 5740 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00052.pmf | Bin 5736 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00053.pmf | Bin 5740 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00054.pmf | Bin 5744 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00055.pmf | Bin 5740 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00056.pmf | Bin 5724 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00057.pmf | Bin 5632 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00058.pmf | Bin 5740 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00059.pmf | Bin 5720 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00060.pmf | Bin 5740 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00061.pmf | Bin 5720 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00062.pmf | Bin 5728 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00063.pmf | Bin 5728 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00064.pmf | Bin 5720 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00065.pmf | Bin 5728 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00066.pmf | Bin 5732 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00067.pmf | Bin 5736 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00068.pmf | Bin 5732 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00069.pmf | Bin 5740 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00070.pmf | Bin 5744 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00071.pmf | Bin 5740 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00072.pmf | Bin 5724 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00073.pmf | Bin 5720 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00074.pmf | Bin 5724 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00075.pmf | Bin 5724 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00076.pmf | Bin 5716 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00077.pmf | Bin 5720 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00079.pmf | Bin 5656 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00080.pmf | Bin 5664 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00081.pmf | Bin 5672 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00082.pmf | Bin 5660 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00083.pmf | Bin 5720 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00084.pmf | Bin 5724 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00085.pmf | Bin 5724 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00086.pmf | Bin 5716 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00087.pmf | Bin 5752 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00088.pmf | Bin 5720 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00089.pmf | Bin 5744 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00090.pmf | Bin 5736 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00091.pmf | Bin 5744 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00092.pmf | Bin 5736 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00093.pmf | Bin 5728 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/9nb00094.pmf | Bin 5728 -> 0 bytes .../C/print/models/HPDJ1600C/fonts/Imakefile | 57 - .../XpConfig/C/print/models/HPDJ1600C/fonts/README | 197 - .../C/print/models/HPDJ1600C/fonts/fonts.alias | 0 .../C/print/models/HPDJ1600C/fonts/fonts.dir | 45 - .../C/print/models/HPDJ1600C/fonts/lpr0ye1a.pmf | Bin 4296 -> 0 bytes .../XpConfig/C/print/models/HPDJ1600C/model-config | 40 - .../XpConfig/C/print/models/HPLJ4050-PS/Imakefile | 15 - .../C/print/models/HPLJ4050-PS/fonts/Imakefile | 45 - .../C/print/models/HPLJ4050-PS/model-config | 36 - .../XpConfig/C/print/models/HPLJ4family/Imakefile | 14 - .../C/print/models/HPLJ4family/fonts/9nb00051.pmf | Bin 5740 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00052.pmf | Bin 5736 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00053.pmf | Bin 5740 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00054.pmf | Bin 5744 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00055.pmf | Bin 5740 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00056.pmf | Bin 5724 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00057.pmf | Bin 5632 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00058.pmf | Bin 5740 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00059.pmf | Bin 5720 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00060.pmf | Bin 5740 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00061.pmf | Bin 5720 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00062.pmf | Bin 5728 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00063.pmf | Bin 5728 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00064.pmf | Bin 5720 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00065.pmf | Bin 5728 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00066.pmf | Bin 5732 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00067.pmf | Bin 5736 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00068.pmf | Bin 5732 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00069.pmf | Bin 5740 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00070.pmf | Bin 5744 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00071.pmf | Bin 5740 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00072.pmf | Bin 5724 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00073.pmf | Bin 5720 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00074.pmf | Bin 5724 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00075.pmf | Bin 5724 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00076.pmf | Bin 5716 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00077.pmf | Bin 5720 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00079.pmf | Bin 5656 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00080.pmf | Bin 5664 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00081.pmf | Bin 5672 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00082.pmf | Bin 5660 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00083.pmf | Bin 5720 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00084.pmf | Bin 5724 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00085.pmf | Bin 5724 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00086.pmf | Bin 5716 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00087.pmf | Bin 5752 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00088.pmf | Bin 5720 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00089.pmf | Bin 5744 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00090.pmf | Bin 5736 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00091.pmf | Bin 5744 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00092.pmf | Bin 5736 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00093.pmf | Bin 5728 -> 0 bytes .../C/print/models/HPLJ4family/fonts/9nb00094.pmf | Bin 5728 -> 0 bytes .../C/print/models/HPLJ4family/fonts/Imakefile | 56 - .../C/print/models/HPLJ4family/fonts/README | 203 - .../C/print/models/HPLJ4family/fonts/fonts.alias | 0 .../C/print/models/HPLJ4family/fonts/fonts.dir | 45 - .../C/print/models/HPLJ4family/fonts/lpr0ye1a.pmf | Bin 4296 -> 0 bytes .../C/print/models/HPLJ4family/model-config | 39 - .../Xserver/XpConfig/C/print/models/Imakefile | 45 - .../C/print/models/PS2PDFspooldir-GS/Imakefile | 35 - .../C/print/models/PS2PDFspooldir-GS/model-config | 72 - .../models/PS2PDFspooldir-GS/ps2pdf_spooltodir.sh | 130 - .../XpConfig/C/print/models/PSdefault/Imakefile | 14 - .../models/PSdefault/fonts/AvantGarde-Book.pmf | Bin 6716 -> 0 bytes .../PSdefault/fonts/AvantGarde-BookOblique.pmf | Bin 6728 -> 0 bytes .../models/PSdefault/fonts/AvantGarde-Demi.pmf | Bin 6712 -> 0 bytes .../PSdefault/fonts/AvantGarde-DemiOblique.pmf | Bin 6724 -> 0 bytes .../print/models/PSdefault/fonts/Courier-Bold.pmf | Bin 6612 -> 0 bytes .../models/PSdefault/fonts/Courier-BoldOblique.pmf | Bin 6636 -> 0 bytes .../models/PSdefault/fonts/Courier-Oblique.pmf | Bin 6608 -> 0 bytes .../C/print/models/PSdefault/fonts/Courier.pmf | Bin 6592 -> 0 bytes .../models/PSdefault/fonts/Helvetica-Bold.pmf | Bin 6680 -> 0 bytes .../PSdefault/fonts/Helvetica-BoldOblique.pmf | Bin 6692 -> 0 bytes .../models/PSdefault/fonts/Helvetica-Oblique.pmf | Bin 6688 -> 0 bytes .../C/print/models/PSdefault/fonts/Helvetica.pmf | Bin 6672 -> 0 bytes .../C/print/models/PSdefault/fonts/Imakefile | 41 - .../models/PSdefault/fonts/LubalinGraph-Book.pmf | Bin 6628 -> 0 bytes .../PSdefault/fonts/LubalinGraph-BookOblique.pmf | Bin 6640 -> 0 bytes .../models/PSdefault/fonts/LubalinGraph-Demi.pmf | Bin 6624 -> 0 bytes .../PSdefault/fonts/LubalinGraph-DemiOblique.pmf | Bin 6636 -> 0 bytes .../PSdefault/fonts/NewCenturySchlbk-Bold.pmf | Bin 6644 -> 0 bytes .../fonts/NewCenturySchlbk-BoldItalic.pmf | Bin 6656 -> 0 bytes .../PSdefault/fonts/NewCenturySchlbk-Italic.pmf | Bin 6652 -> 0 bytes .../PSdefault/fonts/NewCenturySchlbk-Roman.pmf | Bin 6648 -> 0 bytes .../print/models/PSdefault/fonts/Souvenir-Demi.pmf | Bin 6680 -> 0 bytes .../models/PSdefault/fonts/Souvenir-DemiItalic.pmf | Bin 6692 -> 0 bytes .../models/PSdefault/fonts/Souvenir-Light.pmf | Bin 6684 -> 0 bytes .../PSdefault/fonts/Souvenir-LightItalic.pmf | Bin 6696 -> 0 bytes .../C/print/models/PSdefault/fonts/Symbol.pmf | Bin 6556 -> 0 bytes .../C/print/models/PSdefault/fonts/Times-Bold.pmf | Bin 6660 -> 0 bytes .../models/PSdefault/fonts/Times-BoldItalic.pmf | Bin 6672 -> 0 bytes .../print/models/PSdefault/fonts/Times-Italic.pmf | Bin 6668 -> 0 bytes .../C/print/models/PSdefault/fonts/Times-Roman.pmf | Bin 6664 -> 0 bytes .../print/models/PSdefault/fonts/ZapfDingbats.pmf | Bin 6676 -> 0 bytes .../XpConfig/C/print/models/PSdefault/model-config | 136 - .../XpConfig/C/print/models/PSspooldir/Imakefile | 34 - .../C/print/models/PSspooldir/model-config | 71 - .../C/print/models/PSspooldir/spooltodir.sh | 127 - .../XpConfig/C/print/models/SPSPARC2/Imakefile | 15 - .../C/print/models/SPSPARC2/fonts/Imakefile | 28 - .../XpConfig/C/print/models/SPSPARC2/model-config | 18 - nx-X11/programs/Xserver/XpConfig/Imakefile | 761 --- nx-X11/programs/Xserver/XpConfig/README | 318 -- nx-X11/programs/Xserver/XpConfig/en_US/Imakefile | 8 - .../Xserver/XpConfig/en_US/print/Imakefile | 26 - .../XpConfig/en_US/print/attributes/Imakefile | 18 - .../XpConfig/en_US/print/attributes/document | 13 - nx-X11/programs/Xserver/Xprint/AttrValid.c | 702 --- nx-X11/programs/Xserver/Xprint/AttrValid.h | 216 - nx-X11/programs/Xserver/Xprint/DiPrint.h | 81 - nx-X11/programs/Xserver/Xprint/Imakefile | 135 - nx-X11/programs/Xserver/Xprint/Init.c | 1934 ------- nx-X11/programs/Xserver/Xprint/Oid.c | 3184 ----------- nx-X11/programs/Xserver/Xprint/Oid.h | 294 - nx-X11/programs/Xserver/Xprint/OidDefs.h | 171 - nx-X11/programs/Xserver/Xprint/OidStrs.h | 173 - nx-X11/programs/Xserver/Xprint/Util.c | 372 -- nx-X11/programs/Xserver/Xprint/ValTree.c | 193 - nx-X11/programs/Xserver/Xprint/Xprt.html | 115 - nx-X11/programs/Xserver/Xprint/Xprt.man | 196 - nx-X11/programs/Xserver/Xprint/Xprt.sgml | 371 -- nx-X11/programs/Xserver/Xprint/attributes.c | 1740 ------ nx-X11/programs/Xserver/Xprint/attributes.h | 131 - nx-X11/programs/Xserver/Xprint/ddxInit.c | 397 -- nx-X11/programs/Xserver/Xprint/etc/Imakefile | 24 - .../Xserver/Xprint/etc/Xsession.d/Imakefile | 24 - .../Xprint/etc/Xsession.d/cde_xsessiond_xprint.sh | 30 - .../programs/Xserver/Xprint/etc/init.d/Imakefile | 97 - .../programs/Xserver/Xprint/etc/init.d/xprint.cpp | 1277 ----- .../Xserver/Xprint/etc/profile.d/Imakefile | 14 - .../Xserver/Xprint/etc/profile.d/xprint.csh | 16 - .../Xserver/Xprint/etc/profile.d/xprint.sh | 16 - nx-X11/programs/Xserver/Xprint/mediaSizes.c | 783 --- nx-X11/programs/Xserver/Xprint/pcl-mono/Imakefile | 6 - nx-X11/programs/Xserver/Xprint/pcl/Imakefile | 76 - nx-X11/programs/Xserver/Xprint/pcl/Pcl.h | 625 --- nx-X11/programs/Xserver/Xprint/pcl/PclArc.c | 270 - nx-X11/programs/Xserver/Xprint/pcl/PclArea.c | 486 -- nx-X11/programs/Xserver/Xprint/pcl/PclAttVal.c | 207 - nx-X11/programs/Xserver/Xprint/pcl/PclAttr.c | 87 - nx-X11/programs/Xserver/Xprint/pcl/PclColor.c | 851 --- nx-X11/programs/Xserver/Xprint/pcl/PclCursor.c | 115 - nx-X11/programs/Xserver/Xprint/pcl/PclDef.h | 68 - nx-X11/programs/Xserver/Xprint/pcl/PclFonts.c | 74 - nx-X11/programs/Xserver/Xprint/pcl/PclGC.c | 1046 ---- nx-X11/programs/Xserver/Xprint/pcl/PclInit.c | 631 --- nx-X11/programs/Xserver/Xprint/pcl/PclLine.c | 316 -- nx-X11/programs/Xserver/Xprint/pcl/PclMisc.c | 306 -- nx-X11/programs/Xserver/Xprint/pcl/PclPixel.c | 159 - nx-X11/programs/Xserver/Xprint/pcl/PclPixmap.c | 85 - nx-X11/programs/Xserver/Xprint/pcl/PclPolygon.c | 353 -- nx-X11/programs/Xserver/Xprint/pcl/PclPrint.c | 711 --- nx-X11/programs/Xserver/Xprint/pcl/PclSFonts.c | 429 -- nx-X11/programs/Xserver/Xprint/pcl/PclSFonts.h | 116 - nx-X11/programs/Xserver/Xprint/pcl/PclSpans.c | 139 - nx-X11/programs/Xserver/Xprint/pcl/PclText.c | 936 ---- nx-X11/programs/Xserver/Xprint/pcl/PclWindow.c | 452 -- nx-X11/programs/Xserver/Xprint/pcl/Pclmap.h | 213 - nx-X11/programs/Xserver/Xprint/pdf/README | 1 - nx-X11/programs/Xserver/Xprint/ps/Imakefile | 89 - nx-X11/programs/Xserver/Xprint/ps/Ps.h | 590 -- nx-X11/programs/Xserver/Xprint/ps/PsArc.c | 182 - nx-X11/programs/Xserver/Xprint/ps/PsArea.c | 393 -- nx-X11/programs/Xserver/Xprint/ps/PsAttVal.c | 290 - nx-X11/programs/Xserver/Xprint/ps/PsAttr.c | 117 - nx-X11/programs/Xserver/Xprint/ps/PsCache.c | 328 -- nx-X11/programs/Xserver/Xprint/ps/PsColor.c | 258 - nx-X11/programs/Xserver/Xprint/ps/PsDef.h | 97 - nx-X11/programs/Xserver/Xprint/ps/PsFTFonts.c | 85 - nx-X11/programs/Xserver/Xprint/ps/PsFonts.c | 876 --- nx-X11/programs/Xserver/Xprint/ps/PsGC.c | 419 -- nx-X11/programs/Xserver/Xprint/ps/PsImageUtil.c | 329 -- nx-X11/programs/Xserver/Xprint/ps/PsInit.c | 667 --- nx-X11/programs/Xserver/Xprint/ps/PsLine.c | 192 - nx-X11/programs/Xserver/Xprint/ps/PsMisc.c | 324 -- nx-X11/programs/Xserver/Xprint/ps/PsPixel.c | 157 - nx-X11/programs/Xserver/Xprint/ps/PsPixmap.c | 617 --- nx-X11/programs/Xserver/Xprint/ps/PsPolygon.c | 262 - nx-X11/programs/Xserver/Xprint/ps/PsPrint.c | 462 -- nx-X11/programs/Xserver/Xprint/ps/PsSpans.c | 166 - nx-X11/programs/Xserver/Xprint/ps/PsText.c | 586 -- nx-X11/programs/Xserver/Xprint/ps/PsWindow.c | 462 -- nx-X11/programs/Xserver/Xprint/ps/psout.c | 1792 ------ nx-X11/programs/Xserver/Xprint/ps/psout.h | 335 -- nx-X11/programs/Xserver/Xprint/ps/psout_ft.c | 335 -- .../programs/Xserver/Xprint/ps/psout_ftpstype1.c | 185 - .../programs/Xserver/Xprint/ps/psout_ftpstype3.c | 468 -- nx-X11/programs/Xserver/Xprint/ps/ttf2pt1wrap.c | 14 - nx-X11/programs/Xserver/Xprint/raster/Imakefile | 28 - nx-X11/programs/Xserver/Xprint/raster/Raster.c | 1580 ------ nx-X11/programs/Xserver/Xprint/raster/Raster.h | 118 - .../programs/Xserver/Xprint/raster/RasterAttVal.c | 269 - nx-X11/programs/Xserver/Xprint/spooler.c | 204 - nx-X11/programs/Xserver/Xprint/spooler.h | 76 - nx-X11/programs/Xserver/Xprint/svg/README | 1 - nx-X11/programs/Xserver/Xprint/windows/README | 1 - nx-X11/programs/Xserver/Xvfb.def | 4 - nx-X11/programs/Xserver/afb/Imakefile | 67 - nx-X11/programs/Xserver/afb/README | 10 - nx-X11/programs/Xserver/afb/Xdaniver.doc | 218 - nx-X11/programs/Xserver/afb/afb.h | 1132 ---- nx-X11/programs/Xserver/afb/afbbitblt.c | 477 -- nx-X11/programs/Xserver/afb/afbblt.c | 563 -- nx-X11/programs/Xserver/afb/afbbres.c | 325 -- nx-X11/programs/Xserver/afb/afbbresd.c | 216 - nx-X11/programs/Xserver/afb/afbbstore.c | 156 - nx-X11/programs/Xserver/afb/afbclip.c | 248 - nx-X11/programs/Xserver/afb/afbcmap.c | 125 - nx-X11/programs/Xserver/afb/afbfillarc.c | 359 -- nx-X11/programs/Xserver/afb/afbfillrct.c | 294 - nx-X11/programs/Xserver/afb/afbfillsp.c | 1131 ---- nx-X11/programs/Xserver/afb/afbfont.c | 79 - nx-X11/programs/Xserver/afb/afbgc.c | 711 --- nx-X11/programs/Xserver/afb/afbgetsp.c | 167 - nx-X11/programs/Xserver/afb/afbhrzvert.c | 211 - nx-X11/programs/Xserver/afb/afbimage.c | 301 - nx-X11/programs/Xserver/afb/afbimggblt.c | 474 -- nx-X11/programs/Xserver/afb/afbline.c | 706 --- nx-X11/programs/Xserver/afb/afbmisc.c | 96 - nx-X11/programs/Xserver/afb/afbmodule.c | 63 - nx-X11/programs/Xserver/afb/afbpixmap.c | 300 - nx-X11/programs/Xserver/afb/afbply1rct.c | 300 - nx-X11/programs/Xserver/afb/afbplygblt.c | 465 -- nx-X11/programs/Xserver/afb/afbpntarea.c | 657 --- nx-X11/programs/Xserver/afb/afbpntwin.c | 128 - nx-X11/programs/Xserver/afb/afbpolypnt.c | 148 - nx-X11/programs/Xserver/afb/afbpushpxl.c | 259 - nx-X11/programs/Xserver/afb/afbscrinit.c | 248 - nx-X11/programs/Xserver/afb/afbsetsp.c | 269 - nx-X11/programs/Xserver/afb/afbtegblt.c | 588 -- nx-X11/programs/Xserver/afb/afbtile.c | 859 --- nx-X11/programs/Xserver/afb/afbwindow.c | 318 -- nx-X11/programs/Xserver/afb/afbzerarc.c | 210 - nx-X11/programs/Xserver/cfb/Imakefile | 6 - nx-X11/programs/Xserver/cfb/Imakefile.inc | 303 - nx-X11/programs/Xserver/cfb/cfb.h | 1327 ----- nx-X11/programs/Xserver/cfb/cfb16.h | 94 - nx-X11/programs/Xserver/cfb/cfb24.h | 98 - nx-X11/programs/Xserver/cfb/cfb32.h | 94 - nx-X11/programs/Xserver/cfb/cfb8bit.c | 471 -- nx-X11/programs/Xserver/cfb/cfb8bit.h | 1572 ------ nx-X11/programs/Xserver/cfb/cfb8line.c | 1504 ----- nx-X11/programs/Xserver/cfb/cfballpriv.c | 94 - nx-X11/programs/Xserver/cfb/cfbbitblt.c | 1454 ----- nx-X11/programs/Xserver/cfb/cfbblt.c | 933 ---- nx-X11/programs/Xserver/cfb/cfbbres.c | 342 -- nx-X11/programs/Xserver/cfb/cfbbresd.c | 406 -- nx-X11/programs/Xserver/cfb/cfbbstore.c | 145 - nx-X11/programs/Xserver/cfb/cfbcmap.c | 121 - nx-X11/programs/Xserver/cfb/cfbcppl.c | 490 -- nx-X11/programs/Xserver/cfb/cfbfillarc.c | 374 -- nx-X11/programs/Xserver/cfb/cfbfillrct.c | 307 -- nx-X11/programs/Xserver/cfb/cfbfillsp.c | 1006 ---- nx-X11/programs/Xserver/cfb/cfbgc.c | 811 --- nx-X11/programs/Xserver/cfb/cfbgetsp.c | 215 - nx-X11/programs/Xserver/cfb/cfbglblt8.c | 479 -- nx-X11/programs/Xserver/cfb/cfbhrzvert.c | 556 -- nx-X11/programs/Xserver/cfb/cfbigblt8.c | 108 - nx-X11/programs/Xserver/cfb/cfbimage.c | 206 - nx-X11/programs/Xserver/cfb/cfbline.c | 757 --- nx-X11/programs/Xserver/cfb/cfbmap.h | 344 -- nx-X11/programs/Xserver/cfb/cfbmodule.c | 65 - nx-X11/programs/Xserver/cfb/cfbmskbits.c | 1402 ----- nx-X11/programs/Xserver/cfb/cfbmskbits.h | 897 --- nx-X11/programs/Xserver/cfb/cfbpixmap.c | 376 -- nx-X11/programs/Xserver/cfb/cfbply1rct.c | 363 -- nx-X11/programs/Xserver/cfb/cfbpntwin.c | 771 --- nx-X11/programs/Xserver/cfb/cfbpolypnt.c | 204 - nx-X11/programs/Xserver/cfb/cfbpush8.c | 186 - nx-X11/programs/Xserver/cfb/cfbrctstp8.c | 595 -- nx-X11/programs/Xserver/cfb/cfbrrop.c | 229 - nx-X11/programs/Xserver/cfb/cfbrrop.h | 343 -- nx-X11/programs/Xserver/cfb/cfbscrinit.c | 232 - nx-X11/programs/Xserver/cfb/cfbsetsp.c | 318 -- nx-X11/programs/Xserver/cfb/cfbsolid.c | 1367 ----- nx-X11/programs/Xserver/cfb/cfbtab.h | 16 - nx-X11/programs/Xserver/cfb/cfbteblt8.c | 591 -- nx-X11/programs/Xserver/cfb/cfbtegblt.c | 220 - nx-X11/programs/Xserver/cfb/cfbtile32.c | 519 -- nx-X11/programs/Xserver/cfb/cfbtileodd.c | 1247 ----- nx-X11/programs/Xserver/cfb/cfbunmap.h | 165 - nx-X11/programs/Xserver/cfb/cfbwindow.c | 337 -- nx-X11/programs/Xserver/cfb/cfbzerarc.c | 322 -- nx-X11/programs/Xserver/cfb/module/Imakefile | 11 - nx-X11/programs/Xserver/cfb/stip68kgnu.h | 123 - nx-X11/programs/Xserver/cfb/stipmips.s | 281 - nx-X11/programs/Xserver/cfb/stipple68k.s | 231 - nx-X11/programs/Xserver/cfb/stipsparc.s | 290 - nx-X11/programs/Xserver/cfb/stipsprc32.s | 291 - nx-X11/programs/Xserver/cfb16/Imakefile | 10 - nx-X11/programs/Xserver/cfb16/cfbmodule.c | 65 - nx-X11/programs/Xserver/cfb16/module/Imakefile | 12 - nx-X11/programs/Xserver/cfb24/Imakefile | 6 - nx-X11/programs/Xserver/cfb24/cfbmodule.c | 65 - nx-X11/programs/Xserver/cfb24/cfbrrop24.h | 54 - nx-X11/programs/Xserver/cfb24/module/Imakefile | 12 - nx-X11/programs/Xserver/cfb32/Imakefile | 10 - nx-X11/programs/Xserver/cfb32/cfbmodule.c | 65 - nx-X11/programs/Xserver/cfb32/module/Imakefile | 12 - nx-X11/programs/Xserver/hw/darwin/Imakefile | 92 - nx-X11/programs/Xserver/hw/darwin/XDarwin.man | 205 - .../hw/darwin/bundle/Dutch.lproj/Credits.rtf | 168 - .../Xserver/hw/darwin/bundle/Dutch.lproj/Imakefile | 36 - .../darwin/bundle/Dutch.lproj/Localizable.strings | Bin 1426 -> 0 bytes .../bundle/Dutch.lproj/MainMenu.nib/classes.nib | 72 - .../bundle/Dutch.lproj/MainMenu.nib/objects.nib | Bin 22024 -> 0 bytes .../darwin/bundle/Dutch.lproj/XDarwinHelp.html.cpp | 103 - .../hw/darwin/bundle/English.lproj/Credits.rtf | 168 - .../hw/darwin/bundle/English.lproj/Imakefile | 34 - .../bundle/English.lproj/InfoPlist.strings.cpp | 5 - .../bundle/English.lproj/Localizable.strings | 23 - .../bundle/English.lproj/MainMenu.nib/classes.nib | 72 - .../bundle/English.lproj/MainMenu.nib/objects.nib | Bin 20829 -> 0 bytes .../bundle/English.lproj/XDarwinHelp.html.cpp | 96 - .../hw/darwin/bundle/French.lproj/Credits.rtf | 166 - .../hw/darwin/bundle/French.lproj/Imakefile | 36 - .../darwin/bundle/French.lproj/Localizable.strings | Bin 1492 -> 0 bytes .../bundle/French.lproj/MainMenu.nib/classes.nib | 72 - .../bundle/French.lproj/MainMenu.nib/objects.nib | Bin 21114 -> 0 bytes .../bundle/French.lproj/XDarwinHelp.html.cpp | 101 - .../hw/darwin/bundle/German.lproj/Credits.rtf | 168 - .../hw/darwin/bundle/German.lproj/Imakefile | 36 - .../darwin/bundle/German.lproj/Localizable.strings | Bin 1458 -> 0 bytes .../bundle/German.lproj/MainMenu.nib/classes.nib | 72 - .../bundle/German.lproj/MainMenu.nib/objects.nib | Bin 21182 -> 0 bytes .../bundle/German.lproj/XDarwinHelp.html.cpp | 96 - nx-X11/programs/Xserver/hw/darwin/bundle/Imakefile | 15 - .../hw/darwin/bundle/Japanese.lproj/Credits.rtf | 193 - .../hw/darwin/bundle/Japanese.lproj/Imakefile | 36 - .../bundle/Japanese.lproj/Localizable.strings | Bin 1152 -> 0 bytes .../bundle/Japanese.lproj/MainMenu.nib/classes.nib | 72 - .../bundle/Japanese.lproj/MainMenu.nib/objects.nib | Bin 21854 -> 0 bytes .../bundle/Japanese.lproj/XDarwinHelp.html.cpp | 141 - .../hw/darwin/bundle/Portuguese.lproj/Credits.rtf | 171 - .../hw/darwin/bundle/Portuguese.lproj/Imakefile | 36 - .../bundle/Portuguese.lproj/Localizable.strings | Bin 1504 -> 0 bytes .../Portuguese.lproj/MainMenu.nib/classes.nib | 72 - .../Portuguese.lproj/MainMenu.nib/objects.nib | Bin 21112 -> 0 bytes .../bundle/Portuguese.lproj/XDarwinHelp.html.cpp | 211 - .../hw/darwin/bundle/Spanish.lproj/Credits.rtf | 168 - .../hw/darwin/bundle/Spanish.lproj/Imakefile | 36 - .../bundle/Spanish.lproj/Localizable.strings | Bin 1480 -> 0 bytes .../bundle/Spanish.lproj/MainMenu.nib/classes.nib | 72 - .../bundle/Spanish.lproj/MainMenu.nib/objects.nib | Bin 20952 -> 0 bytes .../bundle/Spanish.lproj/XDarwinHelp.html.cpp | 111 - .../hw/darwin/bundle/Swedish.lproj/Credits.rtf | 168 - .../hw/darwin/bundle/Swedish.lproj/Imakefile | 36 - .../bundle/Swedish.lproj/Localizable.strings | Bin 1464 -> 0 bytes .../bundle/Swedish.lproj/MainMenu.nib/classes.nib | 72 - .../bundle/Swedish.lproj/MainMenu.nib/objects.nib | Bin 20858 -> 0 bytes .../bundle/Swedish.lproj/XDarwinHelp.html.cpp | 103 - .../programs/Xserver/hw/darwin/bundle/XDarwin.icns | Bin 69465 -> 0 bytes .../Xserver/hw/darwin/bundle/ko.lproj/Credits.rtf | 168 - .../Xserver/hw/darwin/bundle/ko.lproj/Imakefile | 36 - .../hw/darwin/bundle/ko.lproj/Localizable.strings | Bin 1332 -> 0 bytes .../bundle/ko.lproj/MainMenu.nib/classes.nib | 72 - .../bundle/ko.lproj/MainMenu.nib/objects.nib | Bin 21433 -> 0 bytes .../hw/darwin/bundle/ko.lproj/XDarwinHelp.html.cpp | 96 - .../Xserver/hw/darwin/bundle/startXClients.cpp | 24 - nx-X11/programs/Xserver/hw/darwin/darwin.c | 1108 ---- nx-X11/programs/Xserver/hw/darwin/darwin.h | 153 - nx-X11/programs/Xserver/hw/darwin/darwinClut8.h | 532 -- nx-X11/programs/Xserver/hw/darwin/darwinEvents.c | 481 -- nx-X11/programs/Xserver/hw/darwin/darwinKeyboard.c | 1027 ---- nx-X11/programs/Xserver/hw/darwin/darwinKeyboard.h | 52 - nx-X11/programs/Xserver/hw/darwin/darwinXinput.c | 310 -- nx-X11/programs/Xserver/hw/darwin/iokit/Imakefile | 25 - nx-X11/programs/Xserver/hw/darwin/iokit/xfIOKit.c | 772 --- nx-X11/programs/Xserver/hw/darwin/iokit/xfIOKit.h | 57 - .../Xserver/hw/darwin/iokit/xfIOKitCursor.c | 735 --- .../Xserver/hw/darwin/iokit/xfIOKitStartup.c | 126 - nx-X11/programs/Xserver/hw/darwin/quartz/Imakefile | 113 - .../Xserver/hw/darwin/quartz/Preferences.h | 138 - .../Xserver/hw/darwin/quartz/Preferences.m | 597 -- .../Xserver/hw/darwin/quartz/XApplication.h | 47 - .../Xserver/hw/darwin/quartz/XApplication.m | 47 - .../darwin/quartz/XDarwin.pbproj/project.pbxproj | 2519 --------- .../Xserver/hw/darwin/quartz/XDarwinStartup.c | 164 - .../Xserver/hw/darwin/quartz/XDarwinStartup.man | 75 - nx-X11/programs/Xserver/hw/darwin/quartz/XServer.h | 138 - nx-X11/programs/Xserver/hw/darwin/quartz/XServer.m | 1539 ------ nx-X11/programs/Xserver/hw/darwin/quartz/applewm.c | 722 --- .../programs/Xserver/hw/darwin/quartz/applewmExt.h | 85 - .../programs/Xserver/hw/darwin/quartz/cr/Imakefile | 35 - .../programs/Xserver/hw/darwin/quartz/cr/XView.h | 42 - .../programs/Xserver/hw/darwin/quartz/cr/XView.m | 74 - nx-X11/programs/Xserver/hw/darwin/quartz/cr/cr.h | 62 - .../Xserver/hw/darwin/quartz/cr/crAppleWM.m | 157 - .../programs/Xserver/hw/darwin/quartz/cr/crFrame.m | 439 -- .../Xserver/hw/darwin/quartz/cr/crScreen.m | 381 -- .../Xserver/hw/darwin/quartz/fullscreen/Imakefile | 19 - .../hw/darwin/quartz/fullscreen/fullscreen.c | 569 -- .../hw/darwin/quartz/fullscreen/quartzCursor.c | 653 --- .../hw/darwin/quartz/fullscreen/quartzCursor.h | 44 - .../programs/Xserver/hw/darwin/quartz/keysym2ucs.c | 909 --- .../programs/Xserver/hw/darwin/quartz/keysym2ucs.h | 37 - .../Xserver/hw/darwin/quartz/pseudoramiX.c | 430 -- .../Xserver/hw/darwin/quartz/pseudoramiX.h | 10 - nx-X11/programs/Xserver/hw/darwin/quartz/quartz.c | 426 -- nx-X11/programs/Xserver/hw/darwin/quartz/quartz.h | 131 - .../Xserver/hw/darwin/quartz/quartzAudio.c | 342 -- .../Xserver/hw/darwin/quartz/quartzAudio.h | 41 - .../Xserver/hw/darwin/quartz/quartzCocoa.m | 205 - .../Xserver/hw/darwin/quartz/quartzCommon.h | 108 - .../Xserver/hw/darwin/quartz/quartzCursor.c | 653 --- .../Xserver/hw/darwin/quartz/quartzCursor.h | 43 - .../Xserver/hw/darwin/quartz/quartzKeyboard.c | 388 -- .../Xserver/hw/darwin/quartz/quartzPasteboard.c | 150 - .../Xserver/hw/darwin/quartz/quartzPasteboard.h | 45 - .../Xserver/hw/darwin/quartz/quartzStartup.c | 291 - .../Xserver/hw/darwin/quartz/xpr/Imakefile | 35 - .../Xserver/hw/darwin/quartz/xpr/Xplugin.h | 591 -- .../Xserver/hw/darwin/quartz/xpr/appledri.c | 350 -- nx-X11/programs/Xserver/hw/darwin/quartz/xpr/dri.c | 757 --- nx-X11/programs/Xserver/hw/darwin/quartz/xpr/dri.h | 129 - .../Xserver/hw/darwin/quartz/xpr/dristruct.h | 82 - .../programs/Xserver/hw/darwin/quartz/xpr/x-hash.c | 341 -- .../programs/Xserver/hw/darwin/quartz/xpr/x-hash.h | 62 - .../programs/Xserver/hw/darwin/quartz/xpr/x-hook.c | 106 - .../programs/Xserver/hw/darwin/quartz/xpr/x-hook.h | 44 - .../programs/Xserver/hw/darwin/quartz/xpr/x-list.c | 335 -- .../programs/Xserver/hw/darwin/quartz/xpr/x-list.h | 79 - nx-X11/programs/Xserver/hw/darwin/quartz/xpr/xpr.h | 49 - .../Xserver/hw/darwin/quartz/xpr/xprAppleWM.c | 99 - .../Xserver/hw/darwin/quartz/xpr/xprCursor.c | 420 -- .../Xserver/hw/darwin/quartz/xpr/xprFrame.c | 495 -- .../Xserver/hw/darwin/quartz/xpr/xprScreen.c | 417 -- nx-X11/programs/Xserver/hw/darwin/utils/Imakefile | 10 - nx-X11/programs/Xserver/hw/darwin/utils/README.txt | 111 - .../programs/Xserver/hw/darwin/utils/dumpkeymap.c | 1454 ----- .../Xserver/hw/darwin/utils/dumpkeymap.man | 1004 ---- nx-X11/programs/Xserver/hw/dmx/Imakefile | 125 - nx-X11/programs/Xserver/hw/dmx/Xdmx.man | 741 --- nx-X11/programs/Xserver/hw/dmx/config/Canvas.c | 160 - nx-X11/programs/Xserver/hw/dmx/config/Canvas.h | 56 - nx-X11/programs/Xserver/hw/dmx/config/CanvasP.h | 66 - nx-X11/programs/Xserver/hw/dmx/config/Imakefile | 101 - nx-X11/programs/Xserver/hw/dmx/config/TODO | 7 - nx-X11/programs/Xserver/hw/dmx/config/dmxcompat.c | 237 - nx-X11/programs/Xserver/hw/dmx/config/dmxcompat.h | 45 - nx-X11/programs/Xserver/hw/dmx/config/dmxconfig.c | 499 -- nx-X11/programs/Xserver/hw/dmx/config/dmxconfig.h | 65 - nx-X11/programs/Xserver/hw/dmx/config/dmxparse.c | 611 --- nx-X11/programs/Xserver/hw/dmx/config/dmxparse.h | 298 - nx-X11/programs/Xserver/hw/dmx/config/dmxprint.c | 456 -- nx-X11/programs/Xserver/hw/dmx/config/dmxprint.h | 44 - nx-X11/programs/Xserver/hw/dmx/config/dmxtodmx.c | 50 - nx-X11/programs/Xserver/hw/dmx/config/dmxtodmx.man | 41 - nx-X11/programs/Xserver/hw/dmx/config/parser.y | 226 - nx-X11/programs/Xserver/hw/dmx/config/scanner.l | 183 - nx-X11/programs/Xserver/hw/dmx/config/test-a.in | 1 - nx-X11/programs/Xserver/hw/dmx/config/test-a.out | 2 - nx-X11/programs/Xserver/hw/dmx/config/test-b.in | 1 - nx-X11/programs/Xserver/hw/dmx/config/test-b.out | 1 - nx-X11/programs/Xserver/hw/dmx/config/test-c.in | 1 - nx-X11/programs/Xserver/hw/dmx/config/test-c.out | 2 - nx-X11/programs/Xserver/hw/dmx/config/test-d.in | 1 - nx-X11/programs/Xserver/hw/dmx/config/test-d.out | 2 - nx-X11/programs/Xserver/hw/dmx/config/test-e.in | 1 - nx-X11/programs/Xserver/hw/dmx/config/test-e.out | 2 - nx-X11/programs/Xserver/hw/dmx/config/test-f.in | 2 - nx-X11/programs/Xserver/hw/dmx/config/test-f.out | Bin 69 -> 0 bytes nx-X11/programs/Xserver/hw/dmx/config/test-g.in | 4 - nx-X11/programs/Xserver/hw/dmx/config/test-g.out | 4 - nx-X11/programs/Xserver/hw/dmx/config/test-h.in | 7 - nx-X11/programs/Xserver/hw/dmx/config/test-h.out | 7 - nx-X11/programs/Xserver/hw/dmx/config/test-i.in | 3 - nx-X11/programs/Xserver/hw/dmx/config/test-i.out | 3 - nx-X11/programs/Xserver/hw/dmx/config/test-j.in | 13 - nx-X11/programs/Xserver/hw/dmx/config/test-j.out | 11 - nx-X11/programs/Xserver/hw/dmx/config/test-k.in | 3 - nx-X11/programs/Xserver/hw/dmx/config/test-k.out | 3 - nx-X11/programs/Xserver/hw/dmx/config/test-l.in | 12 - nx-X11/programs/Xserver/hw/dmx/config/test-l.out | 12 - nx-X11/programs/Xserver/hw/dmx/config/vdltodmx.c | 58 - nx-X11/programs/Xserver/hw/dmx/config/vdltodmx.man | 95 - nx-X11/programs/Xserver/hw/dmx/config/xdmxconfig.c | 1192 ---- .../programs/Xserver/hw/dmx/config/xdmxconfig.man | 63 - nx-X11/programs/Xserver/hw/dmx/dmx.h | 374 -- nx-X11/programs/Xserver/hw/dmx/dmx_glxvisuals.c | 606 -- nx-X11/programs/Xserver/hw/dmx/dmx_glxvisuals.h | 64 - nx-X11/programs/Xserver/hw/dmx/dmxcb.c | 224 - nx-X11/programs/Xserver/hw/dmx/dmxcb.h | 54 - nx-X11/programs/Xserver/hw/dmx/dmxclient.h | 152 - nx-X11/programs/Xserver/hw/dmx/dmxcmap.c | 220 - nx-X11/programs/Xserver/hw/dmx/dmxcmap.h | 71 - nx-X11/programs/Xserver/hw/dmx/dmxcursor.c | 926 ---- nx-X11/programs/Xserver/hw/dmx/dmxcursor.h | 70 - nx-X11/programs/Xserver/hw/dmx/dmxdpms.c | 213 - nx-X11/programs/Xserver/hw/dmx/dmxdpms.h | 43 - nx-X11/programs/Xserver/hw/dmx/dmxextension.c | 1497 ----- nx-X11/programs/Xserver/hw/dmx/dmxextension.h | 119 - nx-X11/programs/Xserver/hw/dmx/dmxfont.c | 559 -- nx-X11/programs/Xserver/hw/dmx/dmxfont.h | 60 - nx-X11/programs/Xserver/hw/dmx/dmxgc.c | 424 -- nx-X11/programs/Xserver/hw/dmx/dmxgc.h | 90 - nx-X11/programs/Xserver/hw/dmx/dmxgcops.c | 602 -- nx-X11/programs/Xserver/hw/dmx/dmxgcops.h | 96 - nx-X11/programs/Xserver/hw/dmx/dmxinit.c | 1062 ---- nx-X11/programs/Xserver/hw/dmx/dmxinit.h | 51 - nx-X11/programs/Xserver/hw/dmx/dmxinput.c | 105 - nx-X11/programs/Xserver/hw/dmx/dmxinput.h | 163 - nx-X11/programs/Xserver/hw/dmx/dmxlog.c | 351 -- nx-X11/programs/Xserver/hw/dmx/dmxlog.h | 79 - nx-X11/programs/Xserver/hw/dmx/dmxpict.c | 1298 ----- nx-X11/programs/Xserver/hw/dmx/dmxpict.h | 133 - nx-X11/programs/Xserver/hw/dmx/dmxpixmap.c | 252 - nx-X11/programs/Xserver/hw/dmx/dmxpixmap.h | 67 - nx-X11/programs/Xserver/hw/dmx/dmxprop.c | 348 -- nx-X11/programs/Xserver/hw/dmx/dmxprop.h | 47 - nx-X11/programs/Xserver/hw/dmx/dmxscrinit.c | 566 -- nx-X11/programs/Xserver/hw/dmx/dmxscrinit.h | 52 - nx-X11/programs/Xserver/hw/dmx/dmxshadow.c | 72 - nx-X11/programs/Xserver/hw/dmx/dmxshadow.h | 47 - nx-X11/programs/Xserver/hw/dmx/dmxstat.c | 223 - nx-X11/programs/Xserver/hw/dmx/dmxstat.h | 56 - nx-X11/programs/Xserver/hw/dmx/dmxsync.c | 194 - nx-X11/programs/Xserver/hw/dmx/dmxsync.h | 44 - nx-X11/programs/Xserver/hw/dmx/dmxvisual.c | 141 - nx-X11/programs/Xserver/hw/dmx/dmxvisual.h | 48 - nx-X11/programs/Xserver/hw/dmx/dmxwindow.c | 1085 ---- nx-X11/programs/Xserver/hw/dmx/dmxwindow.h | 149 - nx-X11/programs/Xserver/hw/dmx/doc/DMXSpec-v1.txt | 458 -- nx-X11/programs/Xserver/hw/dmx/doc/DMXSpec.txt | 875 --- nx-X11/programs/Xserver/hw/dmx/doc/Imakefile | 10 - nx-X11/programs/Xserver/hw/dmx/doc/Makefile.linux | 42 - nx-X11/programs/Xserver/hw/dmx/doc/dmx.sgml | 2778 ---------- nx-X11/programs/Xserver/hw/dmx/doc/dmx.txt | 2989 ---------- nx-X11/programs/Xserver/hw/dmx/doc/doxygen.conf | 1090 ---- nx-X11/programs/Xserver/hw/dmx/doc/doxygen.css | 49 - nx-X11/programs/Xserver/hw/dmx/doc/doxygen.foot | 12 - nx-X11/programs/Xserver/hw/dmx/doc/doxygen.head | 8 - .../Xserver/hw/dmx/doc/html/ChkNotMaskEv_8c.html | 76 - .../hw/dmx/doc/html/ChkNotMaskEv_8h-source.html | 60 - .../Xserver/hw/dmx/doc/html/ChkNotMaskEv_8h.html | 77 - .../Xserver/hw/dmx/doc/html/annotated.html | 98 - .../programs/Xserver/hw/dmx/doc/html/classes.html | 26 - .../Xserver/hw/dmx/doc/html/dmx_8h-source.html | 276 - .../programs/Xserver/hw/dmx/doc/html/dmx_8h.html | 532 -- .../hw/dmx/doc/html/dmx__glxvisuals_8h-source.html | 85 - .../Xserver/hw/dmx/doc/html/dmxarg_8c.html | 239 - .../Xserver/hw/dmx/doc/html/dmxarg_8h-source.html | 69 - .../Xserver/hw/dmx/doc/html/dmxarg_8h.html | 235 - .../Xserver/hw/dmx/doc/html/dmxbackend_8c.html | 427 -- .../hw/dmx/doc/html/dmxbackend_8h-source.html | 75 - .../Xserver/hw/dmx/doc/html/dmxbackend_8h.html | 411 -- .../programs/Xserver/hw/dmx/doc/html/dmxcb_8c.html | 184 - .../Xserver/hw/dmx/doc/html/dmxcb_8h-source.html | 70 - .../programs/Xserver/hw/dmx/doc/html/dmxcb_8h.html | 209 - .../hw/dmx/doc/html/dmxclient_8h-source.html | 168 - .../Xserver/hw/dmx/doc/html/dmxclient_8h.html | 48 - .../Xserver/hw/dmx/doc/html/dmxcmap_8c.html | 265 - .../Xserver/hw/dmx/doc/html/dmxcmap_8h-source.html | 86 - .../Xserver/hw/dmx/doc/html/dmxcmap_8h.html | 408 -- .../Xserver/hw/dmx/doc/html/dmxcommon_8c.html | 701 --- .../hw/dmx/doc/html/dmxcommon_8h-source.html | 151 - .../Xserver/hw/dmx/doc/html/dmxcommon_8h.html | 665 --- .../Xserver/hw/dmx/doc/html/dmxcompat_8c.html | 68 - .../hw/dmx/doc/html/dmxcompat_8h-source.html | 61 - .../Xserver/hw/dmx/doc/html/dmxcompat_8h.html | 62 - .../Xserver/hw/dmx/doc/html/dmxconfig_8c.html | 402 -- .../hw/dmx/doc/html/dmxconfig_8h-source.html | 84 - .../Xserver/hw/dmx/doc/html/dmxconfig_8h.html | 248 - .../Xserver/hw/dmx/doc/html/dmxconsole_8c.html | 498 -- .../hw/dmx/doc/html/dmxconsole_8h-source.html | 79 - .../Xserver/hw/dmx/doc/html/dmxconsole_8h.html | 488 -- .../Xserver/hw/dmx/doc/html/dmxcursor_8c.html | 471 -- .../hw/dmx/doc/html/dmxcursor_8h-source.html | 86 - .../Xserver/hw/dmx/doc/html/dmxcursor_8h.html | 498 -- .../Xserver/hw/dmx/doc/html/dmxdetach_8c.html | 70 - .../Xserver/hw/dmx/doc/html/dmxdpms_8c.html | 128 - .../Xserver/hw/dmx/doc/html/dmxdpms_8h-source.html | 62 - .../Xserver/hw/dmx/doc/html/dmxdpms_8h.html | 124 - .../Xserver/hw/dmx/doc/html/dmxdummy_8c.html | 111 - .../hw/dmx/doc/html/dmxdummy_8h-source.html | 63 - .../Xserver/hw/dmx/doc/html/dmxdummy_8h.html | 111 - .../programs/Xserver/hw/dmx/doc/html/dmxeq_8c.html | 269 - .../Xserver/hw/dmx/doc/html/dmxeq_8h-source.html | 61 - .../programs/Xserver/hw/dmx/doc/html/dmxeq_8h.html | 63 - .../Xserver/hw/dmx/doc/html/dmxevents_8c.html | 284 - .../hw/dmx/doc/html/dmxevents_8h-source.html | 66 - .../Xserver/hw/dmx/doc/html/dmxevents_8h.html | 233 - .../Xserver/hw/dmx/doc/html/dmxext_8h-source.html | 197 - .../Xserver/hw/dmx/doc/html/dmxext_8h.html | 926 ---- .../Xserver/hw/dmx/doc/html/dmxextension_8c.html | 433 -- .../hw/dmx/doc/html/dmxextension_8h-source.html | 131 - .../Xserver/hw/dmx/doc/html/dmxextension_8h.html | 426 -- .../Xserver/hw/dmx/doc/html/dmxfont_8c.html | 257 - .../Xserver/hw/dmx/doc/html/dmxfont_8h-source.html | 78 - .../Xserver/hw/dmx/doc/html/dmxfont_8h.html | 333 -- .../programs/Xserver/hw/dmx/doc/html/dmxgc_8c.html | 456 -- .../Xserver/hw/dmx/doc/html/dmxgc_8h-source.html | 106 - .../programs/Xserver/hw/dmx/doc/html/dmxgc_8h.html | 561 -- .../Xserver/hw/dmx/doc/html/dmxgcops_8c.html | 1476 ----- .../hw/dmx/doc/html/dmxgcops_8h-source.html | 115 - .../Xserver/hw/dmx/doc/html/dmxgcops_8h.html | 1469 ----- .../Xserver/hw/dmx/doc/html/dmxinit_8c.html | 709 --- .../Xserver/hw/dmx/doc/html/dmxinit_8h-source.html | 70 - .../Xserver/hw/dmx/doc/html/dmxinit_8h.html | 30 - .../Xserver/hw/dmx/doc/html/dmxinput_8c.html | 185 - .../hw/dmx/doc/html/dmxinput_8h-source.html | 146 - .../Xserver/hw/dmx/doc/html/dmxinput_8h.html | 534 -- .../Xserver/hw/dmx/doc/html/dmxinputinit_8c.html | 477 -- .../hw/dmx/doc/html/dmxinputinit_8h-source.html | 259 - .../Xserver/hw/dmx/doc/html/dmxinputinit_8h.html | 406 -- .../Xserver/hw/dmx/doc/html/dmxlog_8c.html | 602 -- .../Xserver/hw/dmx/doc/html/dmxlog_8h-source.html | 91 - .../Xserver/hw/dmx/doc/html/dmxlog_8h.html | 616 --- .../Xserver/hw/dmx/doc/html/dmxmap_8c.html | 150 - .../Xserver/hw/dmx/doc/html/dmxmap_8h-source.html | 62 - .../Xserver/hw/dmx/doc/html/dmxmap_8h.html | 148 - .../Xserver/hw/dmx/doc/html/dmxmotion_8c.html | 181 - .../hw/dmx/doc/html/dmxmotion_8h-source.html | 69 - .../Xserver/hw/dmx/doc/html/dmxmotion_8h.html | 180 - .../Xserver/hw/dmx/doc/html/dmxparse_8c.html | 74 - .../hw/dmx/doc/html/dmxparse_8h-source.html | 303 - .../Xserver/hw/dmx/doc/html/dmxparse_8h.html | 775 --- .../Xserver/hw/dmx/doc/html/dmxpict_8c.html | 1184 ---- .../Xserver/hw/dmx/doc/html/dmxpict_8h-source.html | 141 - .../Xserver/hw/dmx/doc/html/dmxpict_8h.html | 1418 ----- .../Xserver/hw/dmx/doc/html/dmxpixmap_8c.html | 240 - .../hw/dmx/doc/html/dmxpixmap_8h-source.html | 83 - .../Xserver/hw/dmx/doc/html/dmxpixmap_8h.html | 351 -- .../Xserver/hw/dmx/doc/html/dmxprint_8c.html | 119 - .../hw/dmx/doc/html/dmxprint_8h-source.html | 63 - .../Xserver/hw/dmx/doc/html/dmxprint_8h.html | 111 - .../Xserver/hw/dmx/doc/html/dmxprop_8c.html | 235 - .../Xserver/hw/dmx/doc/html/dmxprop_8h-source.html | 66 - .../Xserver/hw/dmx/doc/html/dmxprop_8h.html | 136 - .../hw/dmx/doc/html/dmxproto_8h-source.html | 431 -- .../Xserver/hw/dmx/doc/html/dmxproto_8h.html | 89 - .../Xserver/hw/dmx/doc/html/dmxscrinit_8c.html | 378 -- .../hw/dmx/doc/html/dmxscrinit_8h-source.html | 70 - .../Xserver/hw/dmx/doc/html/dmxscrinit_8h.html | 181 - .../Xserver/hw/dmx/doc/html/dmxshadow_8c.html | 71 - .../hw/dmx/doc/html/dmxshadow_8h-source.html | 66 - .../Xserver/hw/dmx/doc/html/dmxshadow_8h.html | 73 - .../Xserver/hw/dmx/doc/html/dmxsigio_8c.html | 230 - .../hw/dmx/doc/html/dmxsigio_8h-source.html | 65 - .../Xserver/hw/dmx/doc/html/dmxsigio_8h.html | 226 - .../Xserver/hw/dmx/doc/html/dmxstat_8c.html | 274 - .../Xserver/hw/dmx/doc/html/dmxstat_8h-source.html | 74 - .../Xserver/hw/dmx/doc/html/dmxstat_8h.html | 364 -- .../Xserver/hw/dmx/doc/html/dmxsync_8c.html | 139 - .../Xserver/hw/dmx/doc/html/dmxsync_8h-source.html | 63 - .../Xserver/hw/dmx/doc/html/dmxsync_8h.html | 136 - .../Xserver/hw/dmx/doc/html/dmxvisual_8c.html | 151 - .../hw/dmx/doc/html/dmxvisual_8h-source.html | 67 - .../Xserver/hw/dmx/doc/html/dmxvisual_8h.html | 152 - .../Xserver/hw/dmx/doc/html/dmxwindow_8c.html | 865 --- .../hw/dmx/doc/html/dmxwindow_8h-source.html | 165 - .../Xserver/hw/dmx/doc/html/dmxwindow_8h.html | 969 ---- .../Xserver/hw/dmx/doc/html/dmxxinput_8c.html | 396 -- .../programs/Xserver/hw/dmx/doc/html/doxygen.css | 49 - .../programs/Xserver/hw/dmx/doc/html/doxygen.png | Bin 2352 -> 0 bytes nx-X11/programs/Xserver/hw/dmx/doc/html/files.html | 120 - .../programs/Xserver/hw/dmx/doc/html/ftv2blank.png | Bin 174 -> 0 bytes .../programs/Xserver/hw/dmx/doc/html/ftv2doc.png | Bin 255 -> 0 bytes .../Xserver/hw/dmx/doc/html/ftv2folderclosed.png | Bin 259 -> 0 bytes .../Xserver/hw/dmx/doc/html/ftv2folderopen.png | Bin 261 -> 0 bytes .../Xserver/hw/dmx/doc/html/ftv2lastnode.png | Bin 233 -> 0 bytes .../programs/Xserver/hw/dmx/doc/html/ftv2link.png | Bin 358 -> 0 bytes .../Xserver/hw/dmx/doc/html/ftv2mlastnode.png | Bin 160 -> 0 bytes .../programs/Xserver/hw/dmx/doc/html/ftv2mnode.png | Bin 194 -> 0 bytes .../programs/Xserver/hw/dmx/doc/html/ftv2node.png | Bin 235 -> 0 bytes .../Xserver/hw/dmx/doc/html/ftv2plastnode.png | Bin 165 -> 0 bytes .../programs/Xserver/hw/dmx/doc/html/ftv2pnode.png | Bin 200 -> 0 bytes .../Xserver/hw/dmx/doc/html/ftv2vertline.png | Bin 229 -> 0 bytes .../Xserver/hw/dmx/doc/html/functions.html | 237 - .../Xserver/hw/dmx/doc/html/functions_vars.html | 237 - .../programs/Xserver/hw/dmx/doc/html/globals.html | 522 -- .../Xserver/hw/dmx/doc/html/globals_defs.html | 47 - .../Xserver/hw/dmx/doc/html/globals_enum.html | 32 - .../Xserver/hw/dmx/doc/html/globals_eval.html | 41 - .../Xserver/hw/dmx/doc/html/globals_func.html | 388 -- .../Xserver/hw/dmx/doc/html/globals_type.html | 96 - .../Xserver/hw/dmx/doc/html/globals_vars.html | 56 - nx-X11/programs/Xserver/hw/dmx/doc/html/index.html | 8 - .../Xserver/hw/dmx/doc/html/lib_2dmx_2dmx_8c.html | 894 --- .../Xserver/hw/dmx/doc/html/lnx-keyboard_8c.html | 511 -- .../hw/dmx/doc/html/lnx-keyboard_8h-source.html | 83 - .../Xserver/hw/dmx/doc/html/lnx-keyboard_8h.html | 388 -- .../Xserver/hw/dmx/doc/html/lnx-ms_8c.html | 352 -- .../Xserver/hw/dmx/doc/html/lnx-ms_8h-source.html | 75 - .../Xserver/hw/dmx/doc/html/lnx-ms_8h.html | 288 - .../Xserver/hw/dmx/doc/html/lnx-ps2_8c.html | 352 -- .../Xserver/hw/dmx/doc/html/lnx-ps2_8h-source.html | 75 - .../Xserver/hw/dmx/doc/html/lnx-ps2_8h.html | 288 - nx-X11/programs/Xserver/hw/dmx/doc/html/main.html | 26 - .../doc/html/programs_2Xserver_2Xext_2dmx_8c.html | 71 - .../hw/dmx/doc/html/structDMXConfigCmdStruct.html | 30 - .../hw/dmx/doc/html/structDMXConfigListStruct.html | 30 - .../dmx/doc/html/structDMXDesktopAttributes.html | 32 - .../doc/html/structDMXDesktopAttributesRec.html | 32 - .../hw/dmx/doc/html/structDMXInputAttributes.html | 32 - .../dmx/doc/html/structDMXInputAttributesRec.html | 32 - .../hw/dmx/doc/html/structDMXScreenAttributes.html | 32 - .../dmx/doc/html/structDMXScreenAttributesRec.html | 32 - .../hw/dmx/doc/html/structDMXWindowAttributes.html | 32 - .../dmx/doc/html/structDMXWindowAttributesRec.html | 32 - .../hw/dmx/doc/html/struct__DMXConfigComment.html | 32 - .../hw/dmx/doc/html/struct__DMXConfigDisplay.html | 32 - .../hw/dmx/doc/html/struct__DMXConfigEntry.html | 32 - .../hw/dmx/doc/html/struct__DMXConfigFullDim.html | 32 - .../hw/dmx/doc/html/struct__DMXConfigNumber.html | 32 - .../hw/dmx/doc/html/struct__DMXConfigOption.html | 32 - .../hw/dmx/doc/html/struct__DMXConfigPair.html | 32 - .../hw/dmx/doc/html/struct__DMXConfigParam.html | 32 - .../hw/dmx/doc/html/struct__DMXConfigPartDim.html | 32 - .../hw/dmx/doc/html/struct__DMXConfigString.html | 32 - .../hw/dmx/doc/html/struct__DMXConfigSub.html | 32 - .../hw/dmx/doc/html/struct__DMXConfigToken.html | 32 - .../hw/dmx/doc/html/struct__DMXConfigVirtual.html | 32 - .../hw/dmx/doc/html/struct__DMXConfigWall.html | 32 - .../hw/dmx/doc/html/struct__DMXEventMap.html | 82 - .../hw/dmx/doc/html/struct__DMXInputInfo.html | 490 -- .../hw/dmx/doc/html/struct__DMXLocalInitInfo.html | 778 --- .../hw/dmx/doc/html/struct__DMXLocalInputInfo.html | 996 ---- .../hw/dmx/doc/html/struct__DMXScreenInfo.html | 1330 ----- .../hw/dmx/doc/html/struct__DMXStatAvg.html | 30 - .../hw/dmx/doc/html/struct__DMXStatInfo.html | 30 - .../Xserver/hw/dmx/doc/html/struct__Event.html | 104 - .../hw/dmx/doc/html/struct__EventQueue.html | 224 - .../Xserver/hw/dmx/doc/html/struct__dmxArg.html | 104 - .../hw/dmx/doc/html/struct__dmxColormapPriv.html | 32 - .../hw/dmx/doc/html/struct__dmxCursorPriv.html | 32 - .../hw/dmx/doc/html/struct__dmxFontPriv.html | 32 - .../Xserver/hw/dmx/doc/html/struct__dmxGCPriv.html | 32 - .../hw/dmx/doc/html/struct__dmxGlyphPriv.html | 58 - .../hw/dmx/doc/html/struct__dmxPictPriv.html | 82 - .../hw/dmx/doc/html/struct__dmxPixPriv.html | 32 - .../hw/dmx/doc/html/struct__dmxWinPriv.html | 32 - .../Xserver/hw/dmx/doc/html/struct__myPrivate.html | 272 - .../hw/dmx/doc/html/structdmxGlxVisualPrivate.html | 32 - .../hw/dmx/doc/html/structxDMXAddInputReply.html | 32 - .../hw/dmx/doc/html/structxDMXAddInputReq.html | 32 - .../hw/dmx/doc/html/structxDMXAddScreenReply.html | 32 - .../hw/dmx/doc/html/structxDMXAddScreenReq.html | 32 - .../structxDMXChangeDesktopAttributesReply.html | 32 - .../html/structxDMXChangeDesktopAttributesReq.html | 32 - .../structxDMXChangeScreensAttributesReply.html | 32 - .../html/structxDMXChangeScreensAttributesReq.html | 32 - .../html/structxDMXForceWindowCreationReply.html | 32 - .../doc/html/structxDMXForceWindowCreationReq.html | 32 - .../html/structxDMXGetDesktopAttributesReply.html | 32 - .../html/structxDMXGetDesktopAttributesReq.html | 32 - .../html/structxDMXGetInputAttributesReply.html | 32 - .../doc/html/structxDMXGetInputAttributesReq.html | 32 - .../dmx/doc/html/structxDMXGetInputCountReply.html | 32 - .../dmx/doc/html/structxDMXGetInputCountReq.html | 32 - .../html/structxDMXGetScreenAttributesReply.html | 32 - .../doc/html/structxDMXGetScreenAttributesReq.html | 32 - .../doc/html/structxDMXGetScreenCountReply.html | 32 - .../dmx/doc/html/structxDMXGetScreenCountReq.html | 32 - .../html/structxDMXGetWindowAttributesReply.html | 32 - .../doc/html/structxDMXGetWindowAttributesReq.html | 32 - .../dmx/doc/html/structxDMXQueryVersionReply.html | 32 - .../hw/dmx/doc/html/structxDMXQueryVersionReq.html | 32 - .../dmx/doc/html/structxDMXRemoveInputReply.html | 32 - .../hw/dmx/doc/html/structxDMXRemoveInputReq.html | 32 - .../dmx/doc/html/structxDMXRemoveScreenReply.html | 32 - .../hw/dmx/doc/html/structxDMXRemoveScreenReq.html | 32 - .../hw/dmx/doc/html/structxDMXSyncReply.html | 32 - .../Xserver/hw/dmx/doc/html/structxDMXSyncReq.html | 32 - nx-X11/programs/Xserver/hw/dmx/doc/html/tree.html | 295 - .../Xserver/hw/dmx/doc/html/usb-common_8c.html | 222 - .../hw/dmx/doc/html/usb-common_8h-source.html | 74 - .../Xserver/hw/dmx/doc/html/usb-common_8h.html | 167 - .../Xserver/hw/dmx/doc/html/usb-keyboard_8c.html | 231 - .../hw/dmx/doc/html/usb-keyboard_8h-source.html | 68 - .../Xserver/hw/dmx/doc/html/usb-keyboard_8h.html | 174 - .../Xserver/hw/dmx/doc/html/usb-mouse_8c.html | 190 - .../hw/dmx/doc/html/usb-mouse_8h-source.html | 68 - .../Xserver/hw/dmx/doc/html/usb-mouse_8h.html | 134 - .../Xserver/hw/dmx/doc/html/usb-other_8c.html | 191 - .../hw/dmx/doc/html/usb-other_8h-source.html | 68 - .../Xserver/hw/dmx/doc/html/usb-other_8h.html | 134 - .../hw/dmx/doc/html/usb-private_8h-source.html | 131 - .../Xserver/hw/dmx/doc/html/usb-private_8h.html | 41 - nx-X11/programs/Xserver/hw/dmx/doc/scaled.sgml | 707 --- nx-X11/programs/Xserver/hw/dmx/doc/scaled.txt | 579 -- nx-X11/programs/Xserver/hw/dmx/examples/Imakefile | 56 - .../programs/Xserver/hw/dmx/examples/dmxaddinput.c | 84 - .../Xserver/hw/dmx/examples/dmxaddscreen.c | 106 - .../programs/Xserver/hw/dmx/examples/dmxreconfig.c | 163 - .../programs/Xserver/hw/dmx/examples/dmxresize.c | 105 - .../programs/Xserver/hw/dmx/examples/dmxrminput.c | 79 - .../programs/Xserver/hw/dmx/examples/dmxrmscreen.c | 81 - .../programs/Xserver/hw/dmx/examples/dmxwininfo.c | 497 -- nx-X11/programs/Xserver/hw/dmx/examples/ev.c | 183 - nx-X11/programs/Xserver/hw/dmx/examples/evi.c | 87 - nx-X11/programs/Xserver/hw/dmx/examples/res.c | 100 - nx-X11/programs/Xserver/hw/dmx/examples/xbell.c | 102 - nx-X11/programs/Xserver/hw/dmx/examples/xdmx.c | 240 - nx-X11/programs/Xserver/hw/dmx/examples/xinput.c | 319 -- nx-X11/programs/Xserver/hw/dmx/examples/xled.c | 125 - nx-X11/programs/Xserver/hw/dmx/examples/xtest.c | 76 - nx-X11/programs/Xserver/hw/dmx/glxProxy/Imakefile | 52 - nx-X11/programs/Xserver/hw/dmx/glxProxy/compsize.c | 564 -- .../programs/Xserver/hw/dmx/glxProxy/g_disptab.c | 612 --- .../programs/Xserver/hw/dmx/glxProxy/g_disptab.h | 676 --- .../Xserver/hw/dmx/glxProxy/g_renderswap.c | 2360 -------- nx-X11/programs/Xserver/hw/dmx/glxProxy/global.c | 77 - nx-X11/programs/Xserver/hw/dmx/glxProxy/glxcmds.c | 3636 ------------ .../programs/Xserver/hw/dmx/glxProxy/glxcmdsswap.c | 1059 ---- .../programs/Xserver/hw/dmx/glxProxy/glxcontext.h | 117 - .../programs/Xserver/hw/dmx/glxProxy/glxdrawable.h | 124 - nx-X11/programs/Xserver/hw/dmx/glxProxy/glxerror.h | 58 - nx-X11/programs/Xserver/hw/dmx/glxProxy/glxext.c | 512 -- nx-X11/programs/Xserver/hw/dmx/glxProxy/glxext.h | 98 - .../programs/Xserver/hw/dmx/glxProxy/glxfbconfig.c | 111 - .../programs/Xserver/hw/dmx/glxProxy/glxfbconfig.h | 43 - .../programs/Xserver/hw/dmx/glxProxy/glxscreens.c | 390 -- .../programs/Xserver/hw/dmx/glxProxy/glxscreens.h | 63 - .../programs/Xserver/hw/dmx/glxProxy/glxserver.h | 327 -- .../programs/Xserver/hw/dmx/glxProxy/glxsingle.c | 1013 ---- .../programs/Xserver/hw/dmx/glxProxy/glxsingle.h | 59 - nx-X11/programs/Xserver/hw/dmx/glxProxy/glxswap.c | 539 -- nx-X11/programs/Xserver/hw/dmx/glxProxy/glxswap.h | 47 - nx-X11/programs/Xserver/hw/dmx/glxProxy/glxutil.c | 121 - nx-X11/programs/Xserver/hw/dmx/glxProxy/glxutil.h | 54 - .../programs/Xserver/hw/dmx/glxProxy/glxvendor.c | 583 -- .../programs/Xserver/hw/dmx/glxProxy/glxvendor.h | 55 - .../programs/Xserver/hw/dmx/glxProxy/glxvisuals.c | 542 -- .../programs/Xserver/hw/dmx/glxProxy/glxvisuals.h | 55 - .../programs/Xserver/hw/dmx/glxProxy/render2swap.c | 348 -- .../Xserver/hw/dmx/glxProxy/renderpixswap.c | 390 -- nx-X11/programs/Xserver/hw/dmx/glxProxy/unpack.h | 234 - .../programs/Xserver/hw/dmx/input/ChkNotMaskEv.c | 108 - .../programs/Xserver/hw/dmx/input/ChkNotMaskEv.h | 41 - nx-X11/programs/Xserver/hw/dmx/input/Imakefile | 46 - nx-X11/programs/Xserver/hw/dmx/input/dmxarg.c | 176 - nx-X11/programs/Xserver/hw/dmx/input/dmxarg.h | 50 - nx-X11/programs/Xserver/hw/dmx/input/dmxbackend.c | 608 -- nx-X11/programs/Xserver/hw/dmx/input/dmxbackend.h | 57 - nx-X11/programs/Xserver/hw/dmx/input/dmxcommon.c | 674 --- nx-X11/programs/Xserver/hw/dmx/input/dmxcommon.h | 133 - nx-X11/programs/Xserver/hw/dmx/input/dmxconsole.c | 1023 ---- nx-X11/programs/Xserver/hw/dmx/input/dmxconsole.h | 60 - nx-X11/programs/Xserver/hw/dmx/input/dmxdetach.c | 59 - nx-X11/programs/Xserver/hw/dmx/input/dmxdummy.c | 87 - nx-X11/programs/Xserver/hw/dmx/input/dmxdummy.h | 44 - nx-X11/programs/Xserver/hw/dmx/input/dmxeq.c | 309 -- nx-X11/programs/Xserver/hw/dmx/input/dmxeq.h | 44 - nx-X11/programs/Xserver/hw/dmx/input/dmxevents.c | 716 --- nx-X11/programs/Xserver/hw/dmx/input/dmxevents.h | 47 - .../programs/Xserver/hw/dmx/input/dmxinputinit.c | 1298 ----- .../programs/Xserver/hw/dmx/input/dmxinputinit.h | 294 - nx-X11/programs/Xserver/hw/dmx/input/dmxmap.c | 122 - nx-X11/programs/Xserver/hw/dmx/input/dmxmap.h | 43 - nx-X11/programs/Xserver/hw/dmx/input/dmxmotion.c | 144 - nx-X11/programs/Xserver/hw/dmx/input/dmxmotion.h | 50 - nx-X11/programs/Xserver/hw/dmx/input/dmxsigio.c | 234 - nx-X11/programs/Xserver/hw/dmx/input/dmxsigio.h | 46 - nx-X11/programs/Xserver/hw/dmx/input/dmxxinput.c | 156 - .../programs/Xserver/hw/dmx/input/lnx-keyboard.c | 975 ---- .../programs/Xserver/hw/dmx/input/lnx-keyboard.h | 64 - nx-X11/programs/Xserver/hw/dmx/input/lnx-ms.c | 323 -- nx-X11/programs/Xserver/hw/dmx/input/lnx-ms.h | 56 - nx-X11/programs/Xserver/hw/dmx/input/lnx-ps2.c | 291 - nx-X11/programs/Xserver/hw/dmx/input/lnx-ps2.h | 56 - nx-X11/programs/Xserver/hw/dmx/input/usb-common.c | 383 -- nx-X11/programs/Xserver/hw/dmx/input/usb-common.h | 56 - .../programs/Xserver/hw/dmx/input/usb-keyboard.c | 442 -- .../programs/Xserver/hw/dmx/input/usb-keyboard.h | 49 - nx-X11/programs/Xserver/hw/dmx/input/usb-mouse.c | 127 - nx-X11/programs/Xserver/hw/dmx/input/usb-mouse.h | 49 - nx-X11/programs/Xserver/hw/dmx/input/usb-other.c | 162 - nx-X11/programs/Xserver/hw/dmx/input/usb-other.h | 49 - nx-X11/programs/Xserver/hw/dmx/input/usb-private.h | 118 - nx-X11/programs/Xserver/hw/kdrive/README | 7 - nx-X11/programs/Xserver/hw/sun/Imakefile | 90 - nx-X11/programs/Xserver/hw/sun/README | 118 - nx-X11/programs/Xserver/hw/sun/Xsun.man | 176 - nx-X11/programs/Xserver/hw/sun/circleset.h | 136 - nx-X11/programs/Xserver/hw/sun/constype.c | 216 - nx-X11/programs/Xserver/hw/sun/constype.man | 80 - nx-X11/programs/Xserver/hw/sun/kbd_mode.c | 155 - nx-X11/programs/Xserver/hw/sun/kbd_mode.man | 53 - nx-X11/programs/Xserver/hw/sun/sun.h | 446 -- nx-X11/programs/Xserver/hw/sun/sunCfb.c | 517 -- nx-X11/programs/Xserver/hw/sun/sunCfb24.c | 139 - nx-X11/programs/Xserver/hw/sun/sunCursor.c | 281 - nx-X11/programs/Xserver/hw/sun/sunFbs.c | 259 - nx-X11/programs/Xserver/hw/sun/sunGX.c | 2906 ---------- nx-X11/programs/Xserver/hw/sun/sunGX.h | 238 - nx-X11/programs/Xserver/hw/sun/sunInit.c | 960 ---- nx-X11/programs/Xserver/hw/sun/sunIo.c | 305 - nx-X11/programs/Xserver/hw/sun/sunKbd.c | 1071 ---- nx-X11/programs/Xserver/hw/sun/sunKeyMap.c | 5797 -------------------- nx-X11/programs/Xserver/hw/sun/sunMfb.c | 108 - nx-X11/programs/Xserver/hw/sun/sunMouse.c | 399 -- nx-X11/programs/Xserver/hw/sun/sunMultiDepth.c | 277 - nx-X11/programs/Xserver/hw/sunLynx/Imakefile | 78 - nx-X11/programs/Xserver/hw/sunLynx/btreg.h | 81 - nx-X11/programs/Xserver/hw/sunLynx/btvar.h | 74 - nx-X11/programs/Xserver/hw/sunLynx/cgsixreg.h | 206 - nx-X11/programs/Xserver/hw/sunLynx/fbio.h | 186 - nx-X11/programs/Xserver/hw/sunLynx/patch.Console | 428 -- .../Xserver/hw/sunLynx/patch.Console-2.4.0 | 493 -- nx-X11/programs/Xserver/hw/sunLynx/sun.h | 486 -- nx-X11/programs/Xserver/hw/sunLynx/sunLyCfb.c | 372 -- nx-X11/programs/Xserver/hw/sunLynx/sunLyFbs.c | 292 - nx-X11/programs/Xserver/hw/sunLynx/sunLyInit.c | 648 --- nx-X11/programs/Xserver/hw/sunLynx/sunLyIo.c | 389 -- nx-X11/programs/Xserver/hw/sunLynx/sunLyKbd.c | 1080 ---- nx-X11/programs/Xserver/hw/sunLynx/sunLyMouse.c | 649 --- nx-X11/programs/Xserver/hw/sunLynx/sunLyUtil.c | 509 -- nx-X11/programs/Xserver/hw/sunLynx/vuid_event.h | 88 - nx-X11/programs/Xserver/hw/vfb/Imakefile | 71 - nx-X11/programs/Xserver/hw/vfb/InitInput.c | 344 -- nx-X11/programs/Xserver/hw/vfb/InitOutput.c | 1046 ---- nx-X11/programs/Xserver/hw/vfb/Xvfb.man | 132 - nx-X11/programs/Xserver/hw/vfb/lk201kbd.h | 159 - .../programs/Xserver/hw/xfree86/common/Imakefile | 275 - .../Xserver/hw/xfree86/common/atKeynames.h | 298 - nx-X11/programs/Xserver/hw/xfree86/common/fourcc.h | 161 - .../Xserver/hw/xfree86/common/modeline2c.pl | 110 - nx-X11/programs/Xserver/hw/xfree86/common/scoasm.h | 143 - nx-X11/programs/Xserver/hw/xfree86/common/xf86.h | 447 -- .../Xserver/hw/xfree86/common/xf86AutoConfig.c | 368 -- .../programs/Xserver/hw/xfree86/common/xf86Bus.c | 3317 ----------- .../programs/Xserver/hw/xfree86/common/xf86Bus.h | 162 - .../Xserver/hw/xfree86/common/xf86Config.c | 2740 --------- .../Xserver/hw/xfree86/common/xf86Config.h | 63 - .../Xserver/hw/xfree86/common/xf86Configure.c | 1049 ---- .../Xserver/hw/xfree86/common/xf86Cursor.c | 788 --- .../programs/Xserver/hw/xfree86/common/xf86DGA.c | 1267 ----- .../programs/Xserver/hw/xfree86/common/xf86DPMS.c | 222 - .../programs/Xserver/hw/xfree86/common/xf86Debug.c | 197 - .../Xserver/hw/xfree86/common/xf86DefModes.c | 160 - .../Xserver/hw/xfree86/common/xf86DoProbe.c | 129 - .../Xserver/hw/xfree86/common/xf86DoScanPci.c | 130 - .../Xserver/hw/xfree86/common/xf86Events.c | 1865 ------- .../Xserver/hw/xfree86/common/xf86Globals.c | 254 - .../Xserver/hw/xfree86/common/xf86Helper.c | 2983 ---------- .../Xserver/hw/xfree86/common/xf86InPriv.h | 48 - .../programs/Xserver/hw/xfree86/common/xf86Init.c | 2035 ------- nx-X11/programs/Xserver/hw/xfree86/common/xf86Io.c | 507 -- .../programs/Xserver/hw/xfree86/common/xf86Kbd.c | 395 -- .../Xserver/hw/xfree86/common/xf86KbdBSD.c | 1266 ----- .../Xserver/hw/xfree86/common/xf86KbdLnx.c | 651 --- .../Xserver/hw/xfree86/common/xf86KbdMach.c | 317 -- .../Xserver/hw/xfree86/common/xf86Keymap.h | 455 -- .../Xserver/hw/xfree86/common/xf86MiscExt.c | 660 --- .../programs/Xserver/hw/xfree86/common/xf86Mode.c | 2185 -------- .../Xserver/hw/xfree86/common/xf86Module.h | 226 - .../programs/Xserver/hw/xfree86/common/xf86Opt.h | 114 - .../Xserver/hw/xfree86/common/xf86Option.c | 884 --- nx-X11/programs/Xserver/hw/xfree86/common/xf86PM.c | 225 - .../Xserver/hw/xfree86/common/xf86PciInfo.h | 726 --- .../programs/Xserver/hw/xfree86/common/xf86Priv.h | 228 - .../Xserver/hw/xfree86/common/xf86Privstr.h | 234 - .../programs/Xserver/hw/xfree86/common/xf86RandR.c | 438 -- .../Xserver/hw/xfree86/common/xf86Resources.h | 140 - .../Xserver/hw/xfree86/common/xf86Versions.c | 81 - .../Xserver/hw/xfree86/common/xf86VidMode.c | 722 --- .../programs/Xserver/hw/xfree86/common/xf86XKB.c | 82 - .../Xserver/hw/xfree86/common/xf86Xinput.c | 1513 ----- .../Xserver/hw/xfree86/common/xf86Xinput.h | 220 - .../programs/Xserver/hw/xfree86/common/xf86cmap.c | 1123 ---- .../programs/Xserver/hw/xfree86/common/xf86cmap.h | 76 - .../programs/Xserver/hw/xfree86/common/xf86fbBus.c | 97 - .../programs/Xserver/hw/xfree86/common/xf86fbman.c | 1445 ----- .../programs/Xserver/hw/xfree86/common/xf86fbman.h | 227 - .../Xserver/hw/xfree86/common/xf86isaBus.c | 142 - .../programs/Xserver/hw/xfree86/common/xf86noBus.c | 75 - .../Xserver/hw/xfree86/common/xf86pciBus.c | 3506 ------------ .../Xserver/hw/xfree86/common/xf86pciBus.h | 99 - .../Xserver/hw/xfree86/common/xf86sbusBus.c | 709 --- .../Xserver/hw/xfree86/common/xf86sbusBus.h | 98 - .../programs/Xserver/hw/xfree86/common/xf86str.h | 1140 ---- nx-X11/programs/Xserver/hw/xfree86/common/xf86xv.c | 2050 ------- nx-X11/programs/Xserver/hw/xfree86/common/xf86xv.h | 271 - .../programs/Xserver/hw/xfree86/common/xf86xvmc.c | 243 - .../programs/Xserver/hw/xfree86/common/xf86xvmc.h | 164 - .../Xserver/hw/xfree86/common/xf86xvpriv.h | 86 - nx-X11/programs/Xserver/hw/xfree86/common/xisb.c | 180 - nx-X11/programs/Xserver/hw/xfree86/common/xisb.h | 64 - .../Xserver/hw/xfree86/common/xorgHelper.c | 24 - .../Xserver/hw/xfree86/os-support/Imakefile | 130 - .../Xserver/hw/xfree86/os-support/README.OS-lib | 506 -- .../Xserver/hw/xfree86/os-support/assyntax.h | 753 --- .../Xserver/hw/xfree86/os-support/bsd/Imakefile | 242 - .../hw/xfree86/os-support/bsd/alpha_video.c | 735 --- .../Xserver/hw/xfree86/os-support/bsd/arm_video.c | 690 --- .../hw/xfree86/os-support/bsd/bsdResource.c | 194 - .../Xserver/hw/xfree86/os-support/bsd/bsd_KbdMap.c | 1087 ---- .../Xserver/hw/xfree86/os-support/bsd/bsd_VTsw.c | 96 - .../Xserver/hw/xfree86/os-support/bsd/bsd_apm.c | 141 - .../Xserver/hw/xfree86/os-support/bsd/bsd_axp.c | 73 - .../Xserver/hw/xfree86/os-support/bsd/bsd_ev56.c | 91 - .../Xserver/hw/xfree86/os-support/bsd/bsd_init.c | 738 --- .../Xserver/hw/xfree86/os-support/bsd/bsd_io.c | 294 - .../Xserver/hw/xfree86/os-support/bsd/bsd_jstk.c | 189 - .../Xserver/hw/xfree86/os-support/bsd/bsd_kbd.c | 573 -- .../Xserver/hw/xfree86/os-support/bsd/bsd_kbd.h | 5 - .../Xserver/hw/xfree86/os-support/bsd/bsd_kmod.c | 31 - .../hw/xfree86/os-support/bsd/bsd_kqueue_apm.c | 203 - .../Xserver/hw/xfree86/os-support/bsd/bsd_mouse.c | 792 --- .../hw/xfree86/os-support/bsd/drm/Imakefile | 63 - .../Xserver/hw/xfree86/os-support/bsd/i386_video.c | 999 ---- .../hw/xfree86/os-support/bsd/libusb/Imakefile | 10 - .../hw/xfree86/os-support/bsd/libusb/data.c | 95 - .../hw/xfree86/os-support/bsd/libusb/descr.c | 76 - .../hw/xfree86/os-support/bsd/libusb/parse.c | 404 -- .../hw/xfree86/os-support/bsd/libusb/usage.c | 199 - .../Xserver/hw/xfree86/os-support/bsd/libusb/usb.3 | 191 - .../Xserver/hw/xfree86/os-support/bsd/libusb/usb.h | 95 - .../xfree86/os-support/bsd/libusb/usb_hid_usages | 1079 ---- .../hw/xfree86/os-support/bsd/libusb/usbvar.h | 34 - .../Xserver/hw/xfree86/os-support/bsd/memrange.h | 72 - .../Xserver/hw/xfree86/os-support/bsd/ppc_video.c | 141 - .../hw/xfree86/os-support/bsd/sparc64_video.c | 113 - .../Xserver/hw/xfree86/os-support/bsdi/Imakefile | 46 - .../Xserver/hw/xfree86/os-support/bsdi/bsdi_init.c | 156 - .../Xserver/hw/xfree86/os-support/bsdi/bsdi_io.c | 110 - .../hw/xfree86/os-support/bsdi/bsdi_mouse.c | 34 - .../hw/xfree86/os-support/bsdi/bsdi_video.c | 182 - .../Xserver/hw/xfree86/os-support/bus/460gxPCI.c | 470 -- .../Xserver/hw/xfree86/os-support/bus/460gxPCI.h | 42 - .../Xserver/hw/xfree86/os-support/bus/Imakefile | 165 - .../Xserver/hw/xfree86/os-support/bus/Pci.c | 1453 ----- .../Xserver/hw/xfree86/os-support/bus/Pci.h | 449 -- .../Xserver/hw/xfree86/os-support/bus/Sbus.c | 637 --- .../Xserver/hw/xfree86/os-support/bus/altixPCI.c | 120 - .../Xserver/hw/xfree86/os-support/bus/altixPCI.h | 20 - .../Xserver/hw/xfree86/os-support/bus/axpPci.c | 478 -- .../Xserver/hw/xfree86/os-support/bus/e8870PCI.c | 64 - .../Xserver/hw/xfree86/os-support/bus/e8870PCI.h | 42 - .../Xserver/hw/xfree86/os-support/bus/freebsdPci.c | 171 - .../Xserver/hw/xfree86/os-support/bus/ix86Pci.c | 704 --- .../Xserver/hw/xfree86/os-support/bus/linuxPci.c | 894 --- .../Xserver/hw/xfree86/os-support/bus/netbsdPci.c | 132 - .../Xserver/hw/xfree86/os-support/bus/ppcPci.c | 311 -- .../Xserver/hw/xfree86/os-support/bus/sparcPci.c | 1052 ---- .../Xserver/hw/xfree86/os-support/bus/xf86Pci.h | 807 --- .../Xserver/hw/xfree86/os-support/bus/xf86Sbus.h | 70 - .../Xserver/hw/xfree86/os-support/bus/zx1PCI.c | 1133 ---- .../Xserver/hw/xfree86/os-support/bus/zx1PCI.h | 40 - .../Xserver/hw/xfree86/os-support/dgux/Imakefile | 35 - .../hw/xfree86/os-support/dgux/bios_DGmmap.c | 70 - .../Xserver/hw/xfree86/os-support/dgux/dgux_init.c | 182 - .../Xserver/hw/xfree86/os-support/dgux/dgux_io.c | 96 - .../Xserver/hw/xfree86/os-support/dgux/dgux_kbd.c | 120 - .../hw/xfree86/os-support/dgux/dgux_kbdEv.c | 47 - .../Xserver/hw/xfree86/os-support/dgux/dgux_tty.c | 175 - .../hw/xfree86/os-support/dgux/dgux_video.c | 441 -- .../Xserver/hw/xfree86/os-support/hurd/Imakefile | 40 - .../Xserver/hw/xfree86/os-support/hurd/bios_mmap.c | 95 - .../Xserver/hw/xfree86/os-support/hurd/hurd_init.c | 90 - .../Xserver/hw/xfree86/os-support/hurd/hurd_io.c | 139 - .../hw/xfree86/os-support/hurd/hurd_mouse.c | 300 - .../hw/xfree86/os-support/hurd/hurd_video.c | 181 - .../Xserver/hw/xfree86/os-support/int10Defines.h | 90 - .../Xserver/hw/xfree86/os-support/linux/Imakefile | 142 - .../hw/xfree86/os-support/linux/drm/Imakefile | 64 - .../hw/xfree86/os-support/linux/drm/drmmodule.c | 60 - .../hw/xfree86/os-support/linux/int10/Imakefile | 77 - .../hw/xfree86/os-support/linux/int10/linux.c | 649 --- .../xfree86/os-support/linux/int10/vm86/Imakefile | 55 - .../os-support/linux/int10/vm86/linux_vm86.c | 302 - .../os-support/linux/int10/x86emu/Imakefile | 86 - .../Xserver/hw/xfree86/os-support/linux/lnx.h | 55 - .../hw/xfree86/os-support/linux/lnxResource.c | 291 - .../hw/xfree86/os-support/linux/lnx_KbdMap.c | 606 -- .../Xserver/hw/xfree86/os-support/linux/lnx_acpi.c | 170 - .../Xserver/hw/xfree86/os-support/linux/lnx_agp.c | 371 -- .../Xserver/hw/xfree86/os-support/linux/lnx_apm.c | 192 - .../Xserver/hw/xfree86/os-support/linux/lnx_axp.c | 200 - .../Xserver/hw/xfree86/os-support/linux/lnx_ev56.c | 151 - .../Xserver/hw/xfree86/os-support/linux/lnx_font.c | 291 - .../Xserver/hw/xfree86/os-support/linux/lnx_ia64.c | 74 - .../Xserver/hw/xfree86/os-support/linux/lnx_init.c | 415 -- .../Xserver/hw/xfree86/os-support/linux/lnx_io.c | 275 - .../Xserver/hw/xfree86/os-support/linux/lnx_jstk.c | 188 - .../Xserver/hw/xfree86/os-support/linux/lnx_kbd.c | 559 -- .../Xserver/hw/xfree86/os-support/linux/lnx_kbd.h | 5 - .../Xserver/hw/xfree86/os-support/linux/lnx_kmod.c | 113 - .../hw/xfree86/os-support/linux/lnx_mouse.c | 206 - .../Xserver/hw/xfree86/os-support/linux/lnx_pci.c | 230 - .../hw/xfree86/os-support/linux/lnx_video.c | 1169 ---- .../Xserver/hw/xfree86/os-support/lynxos/Imakefile | 62 - .../hw/xfree86/os-support/lynxos/lynx_init.c | 193 - .../Xserver/hw/xfree86/os-support/lynxos/lynx_io.c | 166 - .../hw/xfree86/os-support/lynxos/lynx_mmap.c | 73 - .../hw/xfree86/os-support/lynxos/lynx_mouse.c | 34 - .../hw/xfree86/os-support/lynxos/lynx_noinline.c | 178 - .../hw/xfree86/os-support/lynxos/lynx_ppc.S | 70 - .../hw/xfree86/os-support/lynxos/lynx_ppc.c | 52 - .../hw/xfree86/os-support/lynxos/lynx_video.c | 711 --- .../Xserver/hw/xfree86/os-support/misc/BUSmemcpy.S | 153 - .../Xserver/hw/xfree86/os-support/misc/BUSmemcpy.c | 413 -- .../Xserver/hw/xfree86/os-support/misc/Delay.c | 44 - .../Xserver/hw/xfree86/os-support/misc/IODelay.S | 53 - .../Xserver/hw/xfree86/os-support/misc/IODelay.c | 28 - .../Xserver/hw/xfree86/os-support/misc/Imakefile | 54 - .../Xserver/hw/xfree86/os-support/misc/PortIO.S | 57 - .../Xserver/hw/xfree86/os-support/misc/SlowBcopy.S | 108 - .../Xserver/hw/xfree86/os-support/misc/SlowBcopy.c | 114 - .../hw/xfree86/os-support/misc/xf86_IlHack.c | 19 - .../Xserver/hw/xfree86/os-support/misc/xf86_Util.c | 96 - .../Xserver/hw/xfree86/os-support/nto/Imakefile | 37 - .../Xserver/hw/xfree86/os-support/nto/README | 29 - .../Xserver/hw/xfree86/os-support/nto/nto_init.c | 104 - .../Xserver/hw/xfree86/os-support/nto/nto_io.c | 118 - .../Xserver/hw/xfree86/os-support/nto/nto_ioperm.c | 48 - .../Xserver/hw/xfree86/os-support/nto/nto_kbdEv.c | 53 - .../Xserver/hw/xfree86/os-support/nto/nto_mouse.c | 210 - .../Xserver/hw/xfree86/os-support/nto/nto_video.c | 170 - .../Xserver/hw/xfree86/os-support/os2/Imakefile | 45 - .../Xserver/hw/xfree86/os-support/os2/README | 78 - .../hw/xfree86/os-support/os2/int10/Imakefile | 110 - .../Xserver/hw/xfree86/os-support/os2/int10/os2.c | 452 -- .../Xserver/hw/xfree86/os-support/os2/os2_VTsw.c | 340 -- .../Xserver/hw/xfree86/os-support/os2/os2_bios.c | 143 - .../Xserver/hw/xfree86/os-support/os2/os2_diag.c | 263 - .../Xserver/hw/xfree86/os-support/os2/os2_init.c | 244 - .../Xserver/hw/xfree86/os-support/os2/os2_io.c | 257 - .../Xserver/hw/xfree86/os-support/os2/os2_ioperm.c | 140 - .../Xserver/hw/xfree86/os-support/os2/os2_kbd.c | 158 - .../Xserver/hw/xfree86/os-support/os2/os2_kbdEv.c | 511 -- .../Xserver/hw/xfree86/os-support/os2/os2_mouse.c | 653 --- .../Xserver/hw/xfree86/os-support/os2/os2_select.c | 497 -- .../Xserver/hw/xfree86/os-support/os2/os2_select.h | 62 - .../Xserver/hw/xfree86/os-support/os2/os2_serial.c | 517 -- .../Xserver/hw/xfree86/os-support/os2/os2_stubs.c | 403 -- .../Xserver/hw/xfree86/os-support/os2/os2_video.c | 241 - .../Xserver/hw/xfree86/os-support/pmax/Imakefile | 48 - .../Xserver/hw/xfree86/os-support/pmax/pmax_devs.c | 126 - .../Xserver/hw/xfree86/os-support/pmax/pmax_init.c | 473 -- .../Xserver/hw/xfree86/os-support/pmax/pmax_map.c | 239 - .../hw/xfree86/os-support/pmax/pmax_mouse.c | 60 - .../Xserver/hw/xfree86/os-support/pmax/pmax_pci.c | 1072 ---- .../Xserver/hw/xfree86/os-support/pmax/pmax_ppc.c | 251 - .../Xserver/hw/xfree86/os-support/qnx4/Imakefile | 37 - .../Xserver/hw/xfree86/os-support/qnx4/qnx_VTsw.c | 116 - .../Xserver/hw/xfree86/os-support/qnx4/qnx_init.c | 175 - .../Xserver/hw/xfree86/os-support/qnx4/qnx_io.c | 110 - .../Xserver/hw/xfree86/os-support/qnx4/qnx_kbd.c | 104 - .../Xserver/hw/xfree86/os-support/qnx4/qnx_mouse.c | 267 - .../hw/xfree86/os-support/qnx4/qnx_select.c | 75 - .../Xserver/hw/xfree86/os-support/qnx4/qnx_utils.c | 30 - .../Xserver/hw/xfree86/os-support/qnx4/qnx_video.c | 183 - .../Xserver/hw/xfree86/os-support/sco/Imakefile | 56 - .../Xserver/hw/xfree86/os-support/sco/VTsw_sco.c | 119 - .../Xserver/hw/xfree86/os-support/sco/sco_KbdMap.c | 304 - .../Xserver/hw/xfree86/os-support/sco/sco_init.c | 296 - .../Xserver/hw/xfree86/os-support/sco/sco_io.c | 269 - .../Xserver/hw/xfree86/os-support/sco/sco_iop.c | 136 - .../Xserver/hw/xfree86/os-support/sco/sco_kbd.c | 530 -- .../Xserver/hw/xfree86/os-support/sco/sco_kbd.h | 20 - .../Xserver/hw/xfree86/os-support/sco/sco_mouse.c | 261 - .../Xserver/hw/xfree86/os-support/sco/sco_video.c | 296 - .../hw/xfree86/os-support/shared/VTsw_noop.c | 56 - .../hw/xfree86/os-support/shared/VTsw_usl.c | 92 - .../hw/xfree86/os-support/shared/agp_noop.c | 107 - .../hw/xfree86/os-support/shared/at_scancode.c | 132 - .../hw/xfree86/os-support/shared/bios_devmem.c | 77 - .../hw/xfree86/os-support/shared/bios_mmap.c | 164 - .../Xserver/hw/xfree86/os-support/shared/ia64Pci.c | 244 - .../Xserver/hw/xfree86/os-support/shared/ia64Pci.h | 46 - .../Xserver/hw/xfree86/os-support/shared/inout.S | 111 - .../hw/xfree86/os-support/shared/ioperm_noop.c | 51 - .../Xserver/hw/xfree86/os-support/shared/kbd.c | 39 - .../hw/xfree86/os-support/shared/kmod_noop.c | 39 - .../hw/xfree86/os-support/shared/libc_wrapper.c | 2153 -------- .../Xserver/hw/xfree86/os-support/shared/pm_noop.c | 48 - .../hw/xfree86/os-support/shared/posix_tty.c | 689 --- .../Xserver/hw/xfree86/os-support/shared/sigio.c | 312 -- .../hw/xfree86/os-support/shared/sigiostubs.c | 86 - .../Xserver/hw/xfree86/os-support/shared/stdPci.c | 52 - .../hw/xfree86/os-support/shared/stdResource.c | 182 - .../hw/xfree86/os-support/shared/std_kbdEv.c | 50 - .../hw/xfree86/os-support/shared/sysv_kbd.c | 106 - .../Xserver/hw/xfree86/os-support/shared/vidmem.c | 300 - .../Xserver/hw/xfree86/os-support/shared/xf86Axp.c | 50 - .../Xserver/hw/xfree86/os-support/shared/xf86Axp.h | 36 - .../Xserver/hw/xfree86/os-support/sunos/Imakefile | 119 - .../Xserver/hw/xfree86/os-support/sunos/agpgart.h | 109 - .../hw/xfree86/os-support/sunos/find_deps.pl | 150 - .../hw/xfree86/os-support/sunos/solaris-amd64.S | 73 - .../hw/xfree86/os-support/sunos/solaris-ia32.S | 73 - .../xfree86/os-support/sunos/solaris-sparcv8plus.S | 144 - .../Xserver/hw/xfree86/os-support/sunos/sun_agp.c | 339 -- .../Xserver/hw/xfree86/os-support/sunos/sun_bios.c | 104 - .../Xserver/hw/xfree86/os-support/sunos/sun_init.c | 393 -- .../hw/xfree86/os-support/sunos/sun_inout.s | 124 - .../Xserver/hw/xfree86/os-support/sunos/sun_io.c | 160 - .../Xserver/hw/xfree86/os-support/sunos/sun_kbd.c | 662 --- .../Xserver/hw/xfree86/os-support/sunos/sun_kbd.h | 72 - .../hw/xfree86/os-support/sunos/sun_kbdEv.c | 892 --- .../hw/xfree86/os-support/sunos/sun_mouse.c | 719 --- .../Xserver/hw/xfree86/os-support/sunos/sun_vid.c | 237 - .../Xserver/hw/xfree86/os-support/sysv/Imakefile | 58 - .../Xserver/hw/xfree86/os-support/sysv/sysv_init.c | 254 - .../Xserver/hw/xfree86/os-support/sysv/sysv_io.c | 78 - .../hw/xfree86/os-support/sysv/sysv_mouse.c | 64 - .../hw/xfree86/os-support/sysv/sysv_video.c | 369 -- .../Xserver/hw/xfree86/os-support/sysv/xqueue.c | 543 -- .../Xserver/hw/xfree86/os-support/sysv/xqueue.h | 12 - .../Xserver/hw/xfree86/os-support/usl/Imakefile | 40 - .../Xserver/hw/xfree86/os-support/usl/usl_KbdMap.c | 304 - .../Xserver/hw/xfree86/os-support/usl/usl_init.c | 359 -- .../Xserver/hw/xfree86/os-support/usl/usl_io.c | 172 - .../Xserver/hw/xfree86/os-support/usl/usl_iop.c | 108 - .../Xserver/hw/xfree86/os-support/usl/usl_kbd.c | 456 -- .../Xserver/hw/xfree86/os-support/usl/usl_kbd.h | 14 - .../Xserver/hw/xfree86/os-support/usl/usl_mouse.c | 181 - .../Xserver/hw/xfree86/os-support/usl/usl_video.c | 111 - .../Xserver/hw/xfree86/os-support/usl/usl_vtsw.c | 97 - .../Xserver/hw/xfree86/os-support/usl/usl_xqueue.c | 360 -- .../Xserver/hw/xfree86/os-support/usl/usl_xqueue.h | 9 - .../Xserver/hw/xfree86/os-support/xf86OSKbd.h | 133 - .../Xserver/hw/xfree86/os-support/xf86OSmouse.h | 295 - .../Xserver/hw/xfree86/os-support/xf86OSpriv.h | 57 - .../Xserver/hw/xfree86/os-support/xf86_OSlib.h | 759 --- .../Xserver/hw/xfree86/os-support/xf86_OSproc.h | 277 - .../programs/Xserver/hw/xfree86/parser/Configint.h | 226 - nx-X11/programs/Xserver/hw/xfree86/parser/DRI.c | 187 - nx-X11/programs/Xserver/hw/xfree86/parser/Device.c | 403 -- .../Xserver/hw/xfree86/parser/Extensions.c | 111 - nx-X11/programs/Xserver/hw/xfree86/parser/Files.c | 295 - nx-X11/programs/Xserver/hw/xfree86/parser/Flags.c | 525 -- .../programs/Xserver/hw/xfree86/parser/Imakefile | 51 - nx-X11/programs/Xserver/hw/xfree86/parser/Input.c | 215 - .../programs/Xserver/hw/xfree86/parser/Keyboard.c | 306 -- nx-X11/programs/Xserver/hw/xfree86/parser/Layout.c | 513 -- nx-X11/programs/Xserver/hw/xfree86/parser/Module.c | 261 - .../programs/Xserver/hw/xfree86/parser/Monitor.c | 907 --- .../programs/Xserver/hw/xfree86/parser/Pointer.c | 236 - nx-X11/programs/Xserver/hw/xfree86/parser/Screen.c | 578 -- nx-X11/programs/Xserver/hw/xfree86/parser/Vendor.c | 258 - nx-X11/programs/Xserver/hw/xfree86/parser/Video.c | 297 - .../Xserver/hw/xfree86/parser/configProcs.h | 132 - .../programs/Xserver/hw/xfree86/parser/cpconfig.c | 123 - nx-X11/programs/Xserver/hw/xfree86/parser/read.c | 321 -- nx-X11/programs/Xserver/hw/xfree86/parser/scan.c | 949 ---- nx-X11/programs/Xserver/hw/xfree86/parser/write.c | 220 - .../Xserver/hw/xfree86/parser/xf86Optrec.h | 113 - .../Xserver/hw/xfree86/parser/xf86Parser.h | 483 -- .../Xserver/hw/xfree86/parser/xf86tokens.h | 280 - nx-X11/programs/Xserver/hw/xfree86/xf86Date.h | 38 - nx-X11/programs/Xserver/hw/xnest/Args.c | 197 - nx-X11/programs/Xserver/hw/xnest/Args.h | 40 - nx-X11/programs/Xserver/hw/xnest/Color.c | 497 -- nx-X11/programs/Xserver/hw/xnest/Color.h | 58 - nx-X11/programs/Xserver/hw/xnest/Cursor.c | 159 - nx-X11/programs/Xserver/hw/xnest/Display.c | 195 - nx-X11/programs/Xserver/hw/xnest/Display.h | 46 - nx-X11/programs/Xserver/hw/xnest/Drawable.h | 28 - nx-X11/programs/Xserver/hw/xnest/Events.c | 226 - nx-X11/programs/Xserver/hw/xnest/Events.h | 31 - nx-X11/programs/Xserver/hw/xnest/Font.c | 91 - nx-X11/programs/Xserver/hw/xnest/GC.c | 340 -- nx-X11/programs/Xserver/hw/xnest/GCOps.c | 329 -- nx-X11/programs/Xserver/hw/xnest/GCOps.h | 70 - nx-X11/programs/Xserver/hw/xnest/GetTime.c | 51 - nx-X11/programs/Xserver/hw/xnest/Handlers.c | 47 - nx-X11/programs/Xserver/hw/xnest/Handlers.h | 24 - nx-X11/programs/Xserver/hw/xnest/Imakefile | 90 - nx-X11/programs/Xserver/hw/xnest/Init.c | 164 - nx-X11/programs/Xserver/hw/xnest/Init.h | 21 - nx-X11/programs/Xserver/hw/xnest/Keyboard.c | 339 -- nx-X11/programs/Xserver/hw/xnest/Keyboard.h | 30 - nx-X11/programs/Xserver/hw/xnest/Pixmap.c | 141 - nx-X11/programs/Xserver/hw/xnest/Pointer.c | 79 - nx-X11/programs/Xserver/hw/xnest/Pointer.h | 31 - nx-X11/programs/Xserver/hw/xnest/Screen.c | 458 -- nx-X11/programs/Xserver/hw/xnest/Screen.h | 27 - nx-X11/programs/Xserver/hw/xnest/TestExt.c | 69 - nx-X11/programs/Xserver/hw/xnest/Visual.c | 72 - nx-X11/programs/Xserver/hw/xnest/Visual.h | 27 - nx-X11/programs/Xserver/hw/xnest/Window.c | 558 -- nx-X11/programs/Xserver/hw/xnest/XNCursor.h | 35 - nx-X11/programs/Xserver/hw/xnest/XNFont.h | 37 - nx-X11/programs/Xserver/hw/xnest/XNGC.h | 44 - nx-X11/programs/Xserver/hw/xnest/XNPixmap.h | 45 - nx-X11/programs/Xserver/hw/xnest/XNWindow.h | 80 - nx-X11/programs/Xserver/hw/xnest/Xnest.h | 96 - nx-X11/programs/Xserver/hw/xnest/Xnest.man | 264 - nx-X11/programs/Xserver/hw/xnest/icon | 14 - nx-X11/programs/Xserver/hw/xnest/os2Stub.c | 388 -- nx-X11/programs/Xserver/hw/xnest/screensaver | 686 --- nx-X11/programs/Xserver/hw/xwin/ChangeLog | 663 --- nx-X11/programs/Xserver/hw/xwin/Imakefile | 310 -- nx-X11/programs/Xserver/hw/xwin/InitInput.c | 204 - nx-X11/programs/Xserver/hw/xwin/InitOutput.c | 1172 ---- nx-X11/programs/Xserver/hw/xwin/README | 141 - nx-X11/programs/Xserver/hw/xwin/X-boxed.ico | Bin 12902 -> 0 bytes nx-X11/programs/Xserver/hw/xwin/X.ico | Bin 20870 -> 0 bytes nx-X11/programs/Xserver/hw/xwin/XWin.man | 287 - nx-X11/programs/Xserver/hw/xwin/XWin.rc | 110 - nx-X11/programs/Xserver/hw/xwin/XWinrc.man | 180 - .../hw/xwin/_usr_X11R6_lib_X11_system.XWinrc | 125 - nx-X11/programs/Xserver/hw/xwin/ddraw.h | 2108 ------- nx-X11/programs/Xserver/hw/xwin/win.h | 1466 ----- nx-X11/programs/Xserver/hw/xwin/winallpriv.c | 185 - nx-X11/programs/Xserver/hw/xwin/winauth.c | 132 - nx-X11/programs/Xserver/hw/xwin/winblock.c | 106 - nx-X11/programs/Xserver/hw/xwin/winclip.c | 42 - nx-X11/programs/Xserver/hw/xwin/winclipboard.h | 164 - nx-X11/programs/Xserver/hw/xwin/winclipboardinit.c | 143 - .../Xserver/hw/xwin/winclipboardtextconv.c | 159 - .../programs/Xserver/hw/xwin/winclipboardthread.c | 477 -- .../programs/Xserver/hw/xwin/winclipboardunicode.c | 69 - .../programs/Xserver/hw/xwin/winclipboardwndproc.c | 585 -- .../Xserver/hw/xwin/winclipboardwrappers.c | 544 -- .../programs/Xserver/hw/xwin/winclipboardxevents.c | 796 --- nx-X11/programs/Xserver/hw/xwin/wincmap.c | 675 --- nx-X11/programs/Xserver/hw/xwin/winconfig.c | 1185 ---- nx-X11/programs/Xserver/hw/xwin/winconfig.h | 345 -- nx-X11/programs/Xserver/hw/xwin/wincreatewnd.c | 642 --- nx-X11/programs/Xserver/hw/xwin/wincursor.c | 615 --- nx-X11/programs/Xserver/hw/xwin/windialogs.c | 788 --- nx-X11/programs/Xserver/hw/xwin/winengine.c | 336 -- nx-X11/programs/Xserver/hw/xwin/winerror.c | 143 - nx-X11/programs/Xserver/hw/xwin/winfillsp.c | 876 --- nx-X11/programs/Xserver/hw/xwin/winfont.c | 80 - nx-X11/programs/Xserver/hw/xwin/wingc.c | 259 - nx-X11/programs/Xserver/hw/xwin/wingetsp.c | 193 - nx-X11/programs/Xserver/hw/xwin/winglobals.c | 138 - nx-X11/programs/Xserver/hw/xwin/winkeybd.c | 650 --- nx-X11/programs/Xserver/hw/xwin/winkeybd.h | 310 -- nx-X11/programs/Xserver/hw/xwin/winkeyhook.c | 194 - nx-X11/programs/Xserver/hw/xwin/winkeymap.h | 138 - nx-X11/programs/Xserver/hw/xwin/winkeynames.h | 204 - nx-X11/programs/Xserver/hw/xwin/winlayouts.h | 257 - nx-X11/programs/Xserver/hw/xwin/winmessages.h | 1030 ---- nx-X11/programs/Xserver/hw/xwin/winmisc.c | 152 - nx-X11/programs/Xserver/hw/xwin/winmouse.c | 341 -- nx-X11/programs/Xserver/hw/xwin/winms.h | 46 - nx-X11/programs/Xserver/hw/xwin/winmsg.c | 180 - nx-X11/programs/Xserver/hw/xwin/winmsg.h | 52 - .../programs/Xserver/hw/xwin/winmultiwindowclass.c | 326 -- .../programs/Xserver/hw/xwin/winmultiwindowclass.h | 116 - .../programs/Xserver/hw/xwin/winmultiwindowicons.c | 478 -- .../programs/Xserver/hw/xwin/winmultiwindowshape.c | 212 - .../Xserver/hw/xwin/winmultiwindowwindow.c | 1056 ---- nx-X11/programs/Xserver/hw/xwin/winmultiwindowwm.c | 1444 ----- .../Xserver/hw/xwin/winmultiwindowwndproc.c | 1035 ---- nx-X11/programs/Xserver/hw/xwin/winnativegdi.c | 547 -- nx-X11/programs/Xserver/hw/xwin/winpfbdd.c | 685 --- nx-X11/programs/Xserver/hw/xwin/winpixmap.c | 242 - nx-X11/programs/Xserver/hw/xwin/winpntwin.c | 47 - nx-X11/programs/Xserver/hw/xwin/winpolyline.c | 57 - nx-X11/programs/Xserver/hw/xwin/winprefs.c | 799 --- nx-X11/programs/Xserver/hw/xwin/winprefs.h | 163 - nx-X11/programs/Xserver/hw/xwin/winprefslex.l | 116 - nx-X11/programs/Xserver/hw/xwin/winprefsyacc.y | 353 -- nx-X11/programs/Xserver/hw/xwin/winpriv.c | 134 - nx-X11/programs/Xserver/hw/xwin/winpriv.h | 15 - nx-X11/programs/Xserver/hw/xwin/winprocarg.c | 1561 ------ nx-X11/programs/Xserver/hw/xwin/winpushpxl.c | 226 - nx-X11/programs/Xserver/hw/xwin/winrandr.c | 141 - nx-X11/programs/Xserver/hw/xwin/winregistry.c | 71 - nx-X11/programs/Xserver/hw/xwin/winresource.h | 56 - nx-X11/programs/Xserver/hw/xwin/winrop.c | 145 - nx-X11/programs/Xserver/hw/xwin/winscrinit.c | 794 --- nx-X11/programs/Xserver/hw/xwin/winsetsp.c | 196 - nx-X11/programs/Xserver/hw/xwin/winshaddd.c | 1443 ----- nx-X11/programs/Xserver/hw/xwin/winshadddnl.c | 1455 ----- nx-X11/programs/Xserver/hw/xwin/winshadgdi.c | 1323 ----- nx-X11/programs/Xserver/hw/xwin/wintrayicon.c | 211 - nx-X11/programs/Xserver/hw/xwin/winvalargs.c | 188 - nx-X11/programs/Xserver/hw/xwin/winvideo.c | 210 - nx-X11/programs/Xserver/hw/xwin/winwakeup.c | 72 - nx-X11/programs/Xserver/hw/xwin/winwin32rootless.c | 1092 ---- .../Xserver/hw/xwin/winwin32rootlesswindow.c | 476 -- .../Xserver/hw/xwin/winwin32rootlesswndproc.c | 1324 ----- nx-X11/programs/Xserver/hw/xwin/winwindow.c | 650 --- nx-X11/programs/Xserver/hw/xwin/winwindow.h | 151 - nx-X11/programs/Xserver/hw/xwin/winwindowswm.c | 666 --- nx-X11/programs/Xserver/hw/xwin/winwndproc.c | 1273 ----- nx-X11/programs/Xserver/hw/xwin/xlaunch/COPYING | 25 - nx-X11/programs/Xserver/hw/xwin/xlaunch/config.cc | 282 - nx-X11/programs/Xserver/hw/xwin/xlaunch/config.h | 60 - nx-X11/programs/Xserver/hw/xwin/xlaunch/main.cc | 700 --- .../Xserver/hw/xwin/xlaunch/resources/dialog.rc | 118 - .../hw/xwin/xlaunch/resources/fullscreen.bmp | Bin 22554 -> 0 bytes .../Xserver/hw/xwin/xlaunch/resources/images.rc | 29 - .../hw/xwin/xlaunch/resources/multiwindow.bmp | Bin 22554 -> 0 bytes .../hw/xwin/xlaunch/resources/nodecoration.bmp | Bin 22554 -> 0 bytes .../Xserver/hw/xwin/xlaunch/resources/resources.h | 99 - .../Xserver/hw/xwin/xlaunch/resources/resources.rc | 30 - .../Xserver/hw/xwin/xlaunch/resources/strings.rc | 108 - .../Xserver/hw/xwin/xlaunch/resources/windowed.bmp | Bin 22554 -> 0 bytes .../Xserver/hw/xwin/xlaunch/window/dialog.cc | 86 - .../Xserver/hw/xwin/xlaunch/window/dialog.h | 54 - .../Xserver/hw/xwin/xlaunch/window/util.cc | 1112 ---- .../programs/Xserver/hw/xwin/xlaunch/window/util.h | 53 - .../Xserver/hw/xwin/xlaunch/window/window.cc | 284 - .../Xserver/hw/xwin/xlaunch/window/window.h | 114 - .../Xserver/hw/xwin/xlaunch/window/wizard.cc | 244 - .../Xserver/hw/xwin/xlaunch/window/wizard.h | 59 - nx-X11/programs/Xserver/ilbm/Imakefile | 63 - nx-X11/programs/Xserver/ilbm/README | 17 - nx-X11/programs/Xserver/ilbm/ilbm.h | 1051 ---- nx-X11/programs/Xserver/ilbm/ilbmbitblt.c | 483 -- nx-X11/programs/Xserver/ilbm/ilbmblt.c | 573 -- nx-X11/programs/Xserver/ilbm/ilbmbres.c | 328 -- nx-X11/programs/Xserver/ilbm/ilbmbresd.c | 219 - nx-X11/programs/Xserver/ilbm/ilbmbstore.c | 159 - nx-X11/programs/Xserver/ilbm/ilbmclip.c | 246 - nx-X11/programs/Xserver/ilbm/ilbmcmap.c | 128 - nx-X11/programs/Xserver/ilbm/ilbmfillarc.c | 377 -- nx-X11/programs/Xserver/ilbm/ilbmfillrct.c | 299 - nx-X11/programs/Xserver/ilbm/ilbmfillsp.c | 1149 ---- nx-X11/programs/Xserver/ilbm/ilbmfont.c | 82 - nx-X11/programs/Xserver/ilbm/ilbmgc.c | 715 --- nx-X11/programs/Xserver/ilbm/ilbmgetsp.c | 170 - nx-X11/programs/Xserver/ilbm/ilbmhrzvert.c | 213 - nx-X11/programs/Xserver/ilbm/ilbmimage.c | 441 -- nx-X11/programs/Xserver/ilbm/ilbmimggblt.c | 474 -- nx-X11/programs/Xserver/ilbm/ilbmline.c | 705 --- nx-X11/programs/Xserver/ilbm/ilbmmisc.c | 99 - nx-X11/programs/Xserver/ilbm/ilbmpixmap.c | 295 - nx-X11/programs/Xserver/ilbm/ilbmply1rct.c | 303 - nx-X11/programs/Xserver/ilbm/ilbmplygblt.c | 469 -- nx-X11/programs/Xserver/ilbm/ilbmpntarea.c | 656 --- nx-X11/programs/Xserver/ilbm/ilbmpntwin.c | 131 - nx-X11/programs/Xserver/ilbm/ilbmpolypnt.c | 152 - nx-X11/programs/Xserver/ilbm/ilbmpushpxl.c | 263 - nx-X11/programs/Xserver/ilbm/ilbmscrinit.c | 251 - nx-X11/programs/Xserver/ilbm/ilbmsetsp.c | 269 - nx-X11/programs/Xserver/ilbm/ilbmtegblt.c | 599 -- nx-X11/programs/Xserver/ilbm/ilbmtile.c | 857 --- nx-X11/programs/Xserver/ilbm/ilbmwindow.c | 323 -- nx-X11/programs/Xserver/ilbm/ilbmzerarc.c | 214 - nx-X11/programs/Xserver/iplan2p2/Imakefile | 6 - nx-X11/programs/Xserver/iplan2p4/Imakefile | 119 - nx-X11/programs/Xserver/iplan2p4/ipl.h | 1254 ----- nx-X11/programs/Xserver/iplan2p4/iplallpriv.c | 93 - nx-X11/programs/Xserver/iplan2p4/iplbitblt.c | 388 -- nx-X11/programs/Xserver/iplan2p4/iplblt.c | 431 -- nx-X11/programs/Xserver/iplan2p4/iplbres.c | 186 - nx-X11/programs/Xserver/iplan2p4/iplbresd.c | 212 - nx-X11/programs/Xserver/iplan2p4/iplbstore.c | 159 - nx-X11/programs/Xserver/iplan2p4/iplcmap.c | 126 - nx-X11/programs/Xserver/iplan2p4/iplfillarc.c | 271 - nx-X11/programs/Xserver/iplan2p4/iplfillrct.c | 281 - nx-X11/programs/Xserver/iplan2p4/iplfillsp.c | 384 -- nx-X11/programs/Xserver/iplan2p4/iplgc.c | 786 --- nx-X11/programs/Xserver/iplan2p4/iplgetsp.c | 166 - nx-X11/programs/Xserver/iplan2p4/iplhrzvert.c | 128 - nx-X11/programs/Xserver/iplan2p4/iplimage.c | 87 - nx-X11/programs/Xserver/iplan2p4/iplline.c | 758 --- nx-X11/programs/Xserver/iplan2p4/iplmap.h | 176 - nx-X11/programs/Xserver/iplan2p4/iplmergerop.h | 146 - nx-X11/programs/Xserver/iplan2p4/iplmskbits.c | 108 - nx-X11/programs/Xserver/iplan2p4/iplmskbits.h | 500 -- nx-X11/programs/Xserver/iplan2p4/iplpack.c | 316 -- nx-X11/programs/Xserver/iplan2p4/iplpack.h | 10 - nx-X11/programs/Xserver/iplan2p4/iplpixmap.c | 386 -- nx-X11/programs/Xserver/iplan2p4/iplply1rct.c | 310 -- nx-X11/programs/Xserver/iplan2p4/iplpntwin.c | 341 -- nx-X11/programs/Xserver/iplan2p4/iplpolypnt.c | 123 - nx-X11/programs/Xserver/iplan2p4/iplrrop.c | 219 - nx-X11/programs/Xserver/iplan2p4/iplrrop.h | 80 - nx-X11/programs/Xserver/iplan2p4/iplscrinit.c | 233 - nx-X11/programs/Xserver/iplan2p4/iplsetsp.c | 304 - nx-X11/programs/Xserver/iplan2p4/iplsolid.c | 221 - nx-X11/programs/Xserver/iplan2p4/ipltegblt.c | 221 - nx-X11/programs/Xserver/iplan2p4/ipltile32.c | 272 - nx-X11/programs/Xserver/iplan2p4/ipltileodd.c | 869 --- nx-X11/programs/Xserver/iplan2p4/iplwindow.c | 343 -- nx-X11/programs/Xserver/iplan2p8/Imakefile | 6 - nx-X11/programs/Xserver/lbx/Imakefile | 56 - nx-X11/programs/Xserver/lbx/lbxcmap.c | 1156 ---- nx-X11/programs/Xserver/lbx/lbxdata.h | 48 - nx-X11/programs/Xserver/lbx/lbxdix.c | 869 --- nx-X11/programs/Xserver/lbx/lbxexts.c | 275 - nx-X11/programs/Xserver/lbx/lbxgfx.c | 854 --- nx-X11/programs/Xserver/lbx/lbxmain.c | 1760 ------ nx-X11/programs/Xserver/lbx/lbxopts.c | 806 --- nx-X11/programs/Xserver/lbx/lbxprop.c | 549 -- nx-X11/programs/Xserver/lbx/lbxserve.h | 289 - nx-X11/programs/Xserver/lbx/lbxsquish.c | 158 - nx-X11/programs/Xserver/lbx/lbxsrvopts.h | 67 - nx-X11/programs/Xserver/lbx/lbxswap.c | 828 --- nx-X11/programs/Xserver/lbx/lbxtables.c | 39 - nx-X11/programs/Xserver/lbx/lbxtags.c | 237 - nx-X11/programs/Xserver/lbx/lbxtags.h | 86 - nx-X11/programs/Xserver/lbx/lbxzerorep.c | 420 -- nx-X11/programs/Xserver/mfb/Imakefile | 168 - nx-X11/programs/Xserver/mfb/fastblt.h | 98 - nx-X11/programs/Xserver/mfb/maskbits.c | 1061 ---- nx-X11/programs/Xserver/mfb/mergerop.h | 400 -- nx-X11/programs/Xserver/mfb/mfb.h | 1158 ---- nx-X11/programs/Xserver/mfb/mfbbitblt.c | 510 -- nx-X11/programs/Xserver/mfb/mfbblt.c | 589 -- nx-X11/programs/Xserver/mfb/mfbbres.c | 370 -- nx-X11/programs/Xserver/mfb/mfbbresd.c | 209 - nx-X11/programs/Xserver/mfb/mfbbstore.c | 155 - nx-X11/programs/Xserver/mfb/mfbclip.c | 280 - nx-X11/programs/Xserver/mfb/mfbcmap.c | 164 - nx-X11/programs/Xserver/mfb/mfbfillarc.c | 333 -- nx-X11/programs/Xserver/mfb/mfbfillrct.c | 228 - nx-X11/programs/Xserver/mfb/mfbfillsp.c | 1028 ---- nx-X11/programs/Xserver/mfb/mfbfont.c | 88 - nx-X11/programs/Xserver/mfb/mfbgc.c | 1151 ---- nx-X11/programs/Xserver/mfb/mfbgetsp.c | 159 - nx-X11/programs/Xserver/mfb/mfbhrzvert.c | 179 - nx-X11/programs/Xserver/mfb/mfbimage.c | 177 - nx-X11/programs/Xserver/mfb/mfbimggblt.c | 445 -- nx-X11/programs/Xserver/mfb/mfbline.c | 757 --- nx-X11/programs/Xserver/mfb/mfbmisc.c | 100 - nx-X11/programs/Xserver/mfb/mfbmodule.c | 52 - nx-X11/programs/Xserver/mfb/mfbpixmap.c | 298 - nx-X11/programs/Xserver/mfb/mfbply1rct.c | 261 - nx-X11/programs/Xserver/mfb/mfbplygblt.c | 399 -- nx-X11/programs/Xserver/mfb/mfbpntarea.c | 300 - nx-X11/programs/Xserver/mfb/mfbpntwin.c | 127 - nx-X11/programs/Xserver/mfb/mfbpolypnt.c | 145 - nx-X11/programs/Xserver/mfb/mfbpushpxl.c | 287 - nx-X11/programs/Xserver/mfb/mfbscrclse.c | 66 - nx-X11/programs/Xserver/mfb/mfbscrinit.c | 210 - nx-X11/programs/Xserver/mfb/mfbsetsp.c | 283 - nx-X11/programs/Xserver/mfb/mfbtegblt.c | 368 -- nx-X11/programs/Xserver/mfb/mfbtile.c | 240 - nx-X11/programs/Xserver/mfb/mfbwindow.c | 341 -- nx-X11/programs/Xserver/mfb/mfbzerarc.c | 258 - nx-X11/programs/Xserver/mfb/module/Imakefile | 6 - nx-X11/programs/Xserver/miext/layer/Imakefile | 49 - nx-X11/programs/Xserver/miext/layer/layer.h | 149 - nx-X11/programs/Xserver/miext/layer/layergc.c | 194 - nx-X11/programs/Xserver/miext/layer/layerinit.c | 363 -- nx-X11/programs/Xserver/miext/layer/layerpict.c | 149 - nx-X11/programs/Xserver/miext/layer/layerstr.h | 425 -- nx-X11/programs/Xserver/miext/layer/layerwin.c | 487 -- nx-X11/programs/Xserver/miext/layer/laymodule.c | 60 - nx-X11/programs/Xserver/miext/rootless/Imakefile | 54 - .../Xserver/miext/rootless/Imakefile.NX.original | 54 - .../Xserver/miext/rootless/Imakefile.X.original | 54 - nx-X11/programs/Xserver/miext/rootless/README.txt | 403 -- .../Xserver/miext/rootless/accel/Imakefile | 30 - .../Xserver/miext/rootless/accel/rlAccel.c | 155 - .../Xserver/miext/rootless/accel/rlAccel.h | 141 - .../programs/Xserver/miext/rootless/accel/rlBlt.c | 370 -- .../programs/Xserver/miext/rootless/accel/rlCopy.c | 107 - .../programs/Xserver/miext/rootless/accel/rlFill.c | 221 - .../Xserver/miext/rootless/accel/rlFillRect.c | 118 - .../Xserver/miext/rootless/accel/rlFillSpans.c | 106 - .../Xserver/miext/rootless/accel/rlGlyph.c | 170 - .../Xserver/miext/rootless/accel/rlSolid.c | 112 - nx-X11/programs/Xserver/miext/rootless/rootless.h | 436 -- .../Xserver/miext/rootless/rootlessCommon.c | 405 -- .../Xserver/miext/rootless/rootlessCommon.h | 261 - .../Xserver/miext/rootless/rootlessConfig.h | 68 - .../programs/Xserver/miext/rootless/rootlessGC.c | 1508 ----- .../Xserver/miext/rootless/rootlessScreen.c | 670 --- .../Xserver/miext/rootless/rootlessValTree.c | 648 --- .../Xserver/miext/rootless/rootlessWindow.c | 1468 ----- .../Xserver/miext/rootless/rootlessWindow.h | 64 - .../Xserver/miext/rootless/safeAlpha/Imakefile | 18 - .../Xserver/miext/rootless/safeAlpha/safeAlpha.h | 45 - .../miext/rootless/safeAlpha/safeAlphaPicture.c | 643 --- .../miext/rootless/safeAlpha/safeAlphaWindow.c | 175 - nx-X11/programs/Xserver/miext/shadow/Imakefile | 66 - nx-X11/programs/Xserver/miext/shadow/shadow.c | 1544 ------ nx-X11/programs/Xserver/miext/shadow/shadow.h | 179 - nx-X11/programs/Xserver/miext/shadow/shalloc.c | 52 - nx-X11/programs/Xserver/miext/shadow/shmodule.c | 60 - nx-X11/programs/Xserver/miext/shadow/shpacked.c | 114 - nx-X11/programs/Xserver/miext/shadow/shplanar.c | 179 - nx-X11/programs/Xserver/miext/shadow/shplanar8.c | 174 - nx-X11/programs/Xserver/miext/shadow/shrot16pack.c | 32 - .../Xserver/miext/shadow/shrot16pack_180.c | 33 - .../Xserver/miext/shadow/shrot16pack_270.c | 33 - .../programs/Xserver/miext/shadow/shrot16pack_90.c | 33 - nx-X11/programs/Xserver/miext/shadow/shrot32pack.c | 32 - .../Xserver/miext/shadow/shrot32pack_180.c | 33 - .../Xserver/miext/shadow/shrot32pack_270.c | 33 - .../programs/Xserver/miext/shadow/shrot32pack_90.c | 33 - nx-X11/programs/Xserver/miext/shadow/shrot8pack.c | 32 - .../programs/Xserver/miext/shadow/shrot8pack_180.c | 33 - .../programs/Xserver/miext/shadow/shrot8pack_270.c | 33 - .../programs/Xserver/miext/shadow/shrot8pack_90.c | 33 - nx-X11/programs/Xserver/miext/shadow/shrotate.c | 314 -- nx-X11/programs/Xserver/miext/shadow/shrotpack.h | 186 - 1664 files changed, 461759 deletions(-) delete mode 100644 nx-X11/programs/Xserver/GL/apple/Imakefile delete mode 100644 nx-X11/programs/Xserver/GL/apple/aglGlx.c delete mode 100644 nx-X11/programs/Xserver/GL/apple/indirect.c delete mode 100644 nx-X11/programs/Xserver/GL/dri/Imakefile delete mode 100644 nx-X11/programs/Xserver/GL/dri/Imakefile.NX.reference delete mode 100644 nx-X11/programs/Xserver/GL/dri/Imakefile.XF86.reference delete mode 100644 nx-X11/programs/Xserver/GL/dri/dri-def.cpp delete mode 100644 nx-X11/programs/Xserver/GL/dri/dri.c delete mode 100644 nx-X11/programs/Xserver/GL/dri/dri.h delete mode 100644 nx-X11/programs/Xserver/GL/dri/drimodule.c delete mode 100644 nx-X11/programs/Xserver/GL/dri/dristruct.h delete mode 100644 nx-X11/programs/Xserver/GL/dri/sarea.h delete mode 100644 nx-X11/programs/Xserver/GL/dri/xf86dri.c delete mode 100644 nx-X11/programs/Xserver/GL/windows/ChangeLog delete mode 100755 nx-X11/programs/Xserver/GL/windows/Imakefile delete mode 100644 nx-X11/programs/Xserver/GL/windows/glwindows.h delete mode 100755 nx-X11/programs/Xserver/GL/windows/glwrap.c delete mode 100755 nx-X11/programs/Xserver/GL/windows/indirect.c delete mode 100644 nx-X11/programs/Xserver/XFree86.def delete mode 100644 nx-X11/programs/Xserver/Xnest.def delete mode 100644 nx-X11/programs/Xserver/Xorg.def delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/Imakefile delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/Imakefile delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/Xprinters delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/attributes/Imakefile delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/attributes/document delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/attributes/job delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/attributes/printer delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/ddx-config/Imakefile delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/ddx-config/raster/Imakefile delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/ddx-config/raster/pcl delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/ddx-config/raster/postscript delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/CANONBJ10E-GS/Imakefile delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/CANONBJ10E-GS/model-config delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/CANONC3200-PS/Imakefile delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/CANONC3200-PS/fonts/Imakefile delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/CANONC3200-PS/model-config delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/GSdefault/Imakefile delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/GSdefault/model-config delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/Imakefile delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00051.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00052.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00053.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00054.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00055.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00056.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00057.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00058.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00059.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00060.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00061.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00062.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00063.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00064.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00065.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00066.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00067.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00068.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00069.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00070.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00071.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00072.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00073.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00074.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00075.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00076.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00077.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00079.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00080.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00081.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00082.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00083.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00084.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00085.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00086.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00087.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00088.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00089.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00090.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00091.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00092.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00093.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00094.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/Imakefile delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/README delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/fonts.alias delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/fonts.dir delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/lpr0ye1a.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/model-config delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4050-PS/Imakefile delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4050-PS/fonts/Imakefile delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4050-PS/model-config delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/Imakefile delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00051.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00052.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00053.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00054.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00055.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00056.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00057.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00058.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00059.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00060.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00061.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00062.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00063.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00064.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00065.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00066.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00067.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00068.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00069.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00070.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00071.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00072.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00073.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00074.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00075.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00076.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00077.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00079.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00080.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00081.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00082.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00083.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00084.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00085.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00086.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00087.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00088.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00089.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00090.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00091.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00092.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00093.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00094.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/Imakefile delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/README delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/fonts.alias delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/fonts.dir delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/lpr0ye1a.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/model-config delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/Imakefile delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/PS2PDFspooldir-GS/Imakefile delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/PS2PDFspooldir-GS/model-config delete mode 100755 nx-X11/programs/Xserver/XpConfig/C/print/models/PS2PDFspooldir-GS/ps2pdf_spooltodir.sh delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/Imakefile delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/AvantGarde-Book.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/AvantGarde-BookOblique.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/AvantGarde-Demi.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/AvantGarde-DemiOblique.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Courier-Bold.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Courier-BoldOblique.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Courier-Oblique.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Courier.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Helvetica-Bold.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Helvetica-BoldOblique.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Helvetica-Oblique.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Helvetica.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Imakefile delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/LubalinGraph-Book.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/LubalinGraph-BookOblique.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/LubalinGraph-Demi.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/LubalinGraph-DemiOblique.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/NewCenturySchlbk-Bold.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/NewCenturySchlbk-BoldItalic.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/NewCenturySchlbk-Italic.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/NewCenturySchlbk-Roman.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Souvenir-Demi.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Souvenir-DemiItalic.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Souvenir-Light.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Souvenir-LightItalic.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Symbol.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Times-Bold.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Times-BoldItalic.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Times-Italic.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Times-Roman.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/ZapfDingbats.pmf delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/model-config delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/PSspooldir/Imakefile delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/PSspooldir/model-config delete mode 100755 nx-X11/programs/Xserver/XpConfig/C/print/models/PSspooldir/spooltodir.sh delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/SPSPARC2/Imakefile delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/SPSPARC2/fonts/Imakefile delete mode 100644 nx-X11/programs/Xserver/XpConfig/C/print/models/SPSPARC2/model-config delete mode 100644 nx-X11/programs/Xserver/XpConfig/Imakefile delete mode 100644 nx-X11/programs/Xserver/XpConfig/README delete mode 100644 nx-X11/programs/Xserver/XpConfig/en_US/Imakefile delete mode 100644 nx-X11/programs/Xserver/XpConfig/en_US/print/Imakefile delete mode 100644 nx-X11/programs/Xserver/XpConfig/en_US/print/attributes/Imakefile delete mode 100644 nx-X11/programs/Xserver/XpConfig/en_US/print/attributes/document delete mode 100644 nx-X11/programs/Xserver/Xprint/AttrValid.c delete mode 100644 nx-X11/programs/Xserver/Xprint/AttrValid.h delete mode 100644 nx-X11/programs/Xserver/Xprint/DiPrint.h delete mode 100644 nx-X11/programs/Xserver/Xprint/Imakefile delete mode 100644 nx-X11/programs/Xserver/Xprint/Init.c delete mode 100644 nx-X11/programs/Xserver/Xprint/Oid.c delete mode 100644 nx-X11/programs/Xserver/Xprint/Oid.h delete mode 100644 nx-X11/programs/Xserver/Xprint/OidDefs.h delete mode 100644 nx-X11/programs/Xserver/Xprint/OidStrs.h delete mode 100644 nx-X11/programs/Xserver/Xprint/Util.c delete mode 100644 nx-X11/programs/Xserver/Xprint/ValTree.c delete mode 100644 nx-X11/programs/Xserver/Xprint/Xprt.html delete mode 100644 nx-X11/programs/Xserver/Xprint/Xprt.man delete mode 100644 nx-X11/programs/Xserver/Xprint/Xprt.sgml delete mode 100644 nx-X11/programs/Xserver/Xprint/attributes.c delete mode 100644 nx-X11/programs/Xserver/Xprint/attributes.h delete mode 100644 nx-X11/programs/Xserver/Xprint/ddxInit.c delete mode 100644 nx-X11/programs/Xserver/Xprint/etc/Imakefile delete mode 100644 nx-X11/programs/Xserver/Xprint/etc/Xsession.d/Imakefile delete mode 100644 nx-X11/programs/Xserver/Xprint/etc/Xsession.d/cde_xsessiond_xprint.sh delete mode 100644 nx-X11/programs/Xserver/Xprint/etc/init.d/Imakefile delete mode 100644 nx-X11/programs/Xserver/Xprint/etc/init.d/xprint.cpp delete mode 100644 nx-X11/programs/Xserver/Xprint/etc/profile.d/Imakefile delete mode 100644 nx-X11/programs/Xserver/Xprint/etc/profile.d/xprint.csh delete mode 100644 nx-X11/programs/Xserver/Xprint/etc/profile.d/xprint.sh delete mode 100644 nx-X11/programs/Xserver/Xprint/mediaSizes.c delete mode 100644 nx-X11/programs/Xserver/Xprint/pcl-mono/Imakefile delete mode 100644 nx-X11/programs/Xserver/Xprint/pcl/Imakefile delete mode 100644 nx-X11/programs/Xserver/Xprint/pcl/Pcl.h delete mode 100644 nx-X11/programs/Xserver/Xprint/pcl/PclArc.c delete mode 100644 nx-X11/programs/Xserver/Xprint/pcl/PclArea.c delete mode 100644 nx-X11/programs/Xserver/Xprint/pcl/PclAttVal.c delete mode 100644 nx-X11/programs/Xserver/Xprint/pcl/PclAttr.c delete mode 100644 nx-X11/programs/Xserver/Xprint/pcl/PclColor.c delete mode 100644 nx-X11/programs/Xserver/Xprint/pcl/PclCursor.c delete mode 100644 nx-X11/programs/Xserver/Xprint/pcl/PclDef.h delete mode 100644 nx-X11/programs/Xserver/Xprint/pcl/PclFonts.c delete mode 100644 nx-X11/programs/Xserver/Xprint/pcl/PclGC.c delete mode 100644 nx-X11/programs/Xserver/Xprint/pcl/PclInit.c delete mode 100644 nx-X11/programs/Xserver/Xprint/pcl/PclLine.c delete mode 100644 nx-X11/programs/Xserver/Xprint/pcl/PclMisc.c delete mode 100644 nx-X11/programs/Xserver/Xprint/pcl/PclPixel.c delete mode 100644 nx-X11/programs/Xserver/Xprint/pcl/PclPixmap.c delete mode 100644 nx-X11/programs/Xserver/Xprint/pcl/PclPolygon.c delete mode 100644 nx-X11/programs/Xserver/Xprint/pcl/PclPrint.c delete mode 100644 nx-X11/programs/Xserver/Xprint/pcl/PclSFonts.c delete mode 100644 nx-X11/programs/Xserver/Xprint/pcl/PclSFonts.h delete mode 100644 nx-X11/programs/Xserver/Xprint/pcl/PclSpans.c delete mode 100644 nx-X11/programs/Xserver/Xprint/pcl/PclText.c delete mode 100644 nx-X11/programs/Xserver/Xprint/pcl/PclWindow.c delete mode 100644 nx-X11/programs/Xserver/Xprint/pcl/Pclmap.h delete mode 100644 nx-X11/programs/Xserver/Xprint/pdf/README delete mode 100644 nx-X11/programs/Xserver/Xprint/ps/Imakefile delete mode 100644 nx-X11/programs/Xserver/Xprint/ps/Ps.h delete mode 100644 nx-X11/programs/Xserver/Xprint/ps/PsArc.c delete mode 100644 nx-X11/programs/Xserver/Xprint/ps/PsArea.c delete mode 100644 nx-X11/programs/Xserver/Xprint/ps/PsAttVal.c delete mode 100644 nx-X11/programs/Xserver/Xprint/ps/PsAttr.c delete mode 100644 nx-X11/programs/Xserver/Xprint/ps/PsCache.c delete mode 100644 nx-X11/programs/Xserver/Xprint/ps/PsColor.c delete mode 100644 nx-X11/programs/Xserver/Xprint/ps/PsDef.h delete mode 100644 nx-X11/programs/Xserver/Xprint/ps/PsFTFonts.c delete mode 100644 nx-X11/programs/Xserver/Xprint/ps/PsFonts.c delete mode 100644 nx-X11/programs/Xserver/Xprint/ps/PsGC.c delete mode 100644 nx-X11/programs/Xserver/Xprint/ps/PsImageUtil.c delete mode 100644 nx-X11/programs/Xserver/Xprint/ps/PsInit.c delete mode 100644 nx-X11/programs/Xserver/Xprint/ps/PsLine.c delete mode 100644 nx-X11/programs/Xserver/Xprint/ps/PsMisc.c delete mode 100644 nx-X11/programs/Xserver/Xprint/ps/PsPixel.c delete mode 100644 nx-X11/programs/Xserver/Xprint/ps/PsPixmap.c delete mode 100644 nx-X11/programs/Xserver/Xprint/ps/PsPolygon.c delete mode 100644 nx-X11/programs/Xserver/Xprint/ps/PsPrint.c delete mode 100644 nx-X11/programs/Xserver/Xprint/ps/PsSpans.c delete mode 100644 nx-X11/programs/Xserver/Xprint/ps/PsText.c delete mode 100644 nx-X11/programs/Xserver/Xprint/ps/PsWindow.c delete mode 100644 nx-X11/programs/Xserver/Xprint/ps/psout.c delete mode 100644 nx-X11/programs/Xserver/Xprint/ps/psout.h delete mode 100644 nx-X11/programs/Xserver/Xprint/ps/psout_ft.c delete mode 100644 nx-X11/programs/Xserver/Xprint/ps/psout_ftpstype1.c delete mode 100644 nx-X11/programs/Xserver/Xprint/ps/psout_ftpstype3.c delete mode 100644 nx-X11/programs/Xserver/Xprint/ps/ttf2pt1wrap.c delete mode 100644 nx-X11/programs/Xserver/Xprint/raster/Imakefile delete mode 100644 nx-X11/programs/Xserver/Xprint/raster/Raster.c delete mode 100644 nx-X11/programs/Xserver/Xprint/raster/Raster.h delete mode 100644 nx-X11/programs/Xserver/Xprint/raster/RasterAttVal.c delete mode 100644 nx-X11/programs/Xserver/Xprint/spooler.c delete mode 100644 nx-X11/programs/Xserver/Xprint/spooler.h delete mode 100644 nx-X11/programs/Xserver/Xprint/svg/README delete mode 100644 nx-X11/programs/Xserver/Xprint/windows/README delete mode 100644 nx-X11/programs/Xserver/Xvfb.def delete mode 100644 nx-X11/programs/Xserver/afb/Imakefile delete mode 100644 nx-X11/programs/Xserver/afb/README delete mode 100644 nx-X11/programs/Xserver/afb/Xdaniver.doc delete mode 100644 nx-X11/programs/Xserver/afb/afb.h delete mode 100644 nx-X11/programs/Xserver/afb/afbbitblt.c delete mode 100644 nx-X11/programs/Xserver/afb/afbblt.c delete mode 100644 nx-X11/programs/Xserver/afb/afbbres.c delete mode 100644 nx-X11/programs/Xserver/afb/afbbresd.c delete mode 100644 nx-X11/programs/Xserver/afb/afbbstore.c delete mode 100644 nx-X11/programs/Xserver/afb/afbclip.c delete mode 100644 nx-X11/programs/Xserver/afb/afbcmap.c delete mode 100644 nx-X11/programs/Xserver/afb/afbfillarc.c delete mode 100644 nx-X11/programs/Xserver/afb/afbfillrct.c delete mode 100644 nx-X11/programs/Xserver/afb/afbfillsp.c delete mode 100644 nx-X11/programs/Xserver/afb/afbfont.c delete mode 100644 nx-X11/programs/Xserver/afb/afbgc.c delete mode 100644 nx-X11/programs/Xserver/afb/afbgetsp.c delete mode 100644 nx-X11/programs/Xserver/afb/afbhrzvert.c delete mode 100644 nx-X11/programs/Xserver/afb/afbimage.c delete mode 100644 nx-X11/programs/Xserver/afb/afbimggblt.c delete mode 100644 nx-X11/programs/Xserver/afb/afbline.c delete mode 100644 nx-X11/programs/Xserver/afb/afbmisc.c delete mode 100644 nx-X11/programs/Xserver/afb/afbmodule.c delete mode 100644 nx-X11/programs/Xserver/afb/afbpixmap.c delete mode 100644 nx-X11/programs/Xserver/afb/afbply1rct.c delete mode 100644 nx-X11/programs/Xserver/afb/afbplygblt.c delete mode 100644 nx-X11/programs/Xserver/afb/afbpntarea.c delete mode 100644 nx-X11/programs/Xserver/afb/afbpntwin.c delete mode 100644 nx-X11/programs/Xserver/afb/afbpolypnt.c delete mode 100644 nx-X11/programs/Xserver/afb/afbpushpxl.c delete mode 100644 nx-X11/programs/Xserver/afb/afbscrinit.c delete mode 100644 nx-X11/programs/Xserver/afb/afbsetsp.c delete mode 100644 nx-X11/programs/Xserver/afb/afbtegblt.c delete mode 100644 nx-X11/programs/Xserver/afb/afbtile.c delete mode 100644 nx-X11/programs/Xserver/afb/afbwindow.c delete mode 100644 nx-X11/programs/Xserver/afb/afbzerarc.c delete mode 100644 nx-X11/programs/Xserver/cfb/Imakefile delete mode 100644 nx-X11/programs/Xserver/cfb/Imakefile.inc delete mode 100644 nx-X11/programs/Xserver/cfb/cfb.h delete mode 100644 nx-X11/programs/Xserver/cfb/cfb16.h delete mode 100644 nx-X11/programs/Xserver/cfb/cfb24.h delete mode 100644 nx-X11/programs/Xserver/cfb/cfb32.h delete mode 100644 nx-X11/programs/Xserver/cfb/cfb8bit.c delete mode 100644 nx-X11/programs/Xserver/cfb/cfb8bit.h delete mode 100644 nx-X11/programs/Xserver/cfb/cfb8line.c delete mode 100644 nx-X11/programs/Xserver/cfb/cfballpriv.c delete mode 100644 nx-X11/programs/Xserver/cfb/cfbbitblt.c delete mode 100644 nx-X11/programs/Xserver/cfb/cfbblt.c delete mode 100644 nx-X11/programs/Xserver/cfb/cfbbres.c delete mode 100644 nx-X11/programs/Xserver/cfb/cfbbresd.c delete mode 100644 nx-X11/programs/Xserver/cfb/cfbbstore.c delete mode 100644 nx-X11/programs/Xserver/cfb/cfbcmap.c delete mode 100644 nx-X11/programs/Xserver/cfb/cfbcppl.c delete mode 100644 nx-X11/programs/Xserver/cfb/cfbfillarc.c delete mode 100644 nx-X11/programs/Xserver/cfb/cfbfillrct.c delete mode 100644 nx-X11/programs/Xserver/cfb/cfbfillsp.c delete mode 100644 nx-X11/programs/Xserver/cfb/cfbgc.c delete mode 100644 nx-X11/programs/Xserver/cfb/cfbgetsp.c delete mode 100644 nx-X11/programs/Xserver/cfb/cfbglblt8.c delete mode 100644 nx-X11/programs/Xserver/cfb/cfbhrzvert.c delete mode 100644 nx-X11/programs/Xserver/cfb/cfbigblt8.c delete mode 100644 nx-X11/programs/Xserver/cfb/cfbimage.c delete mode 100644 nx-X11/programs/Xserver/cfb/cfbline.c delete mode 100644 nx-X11/programs/Xserver/cfb/cfbmap.h delete mode 100644 nx-X11/programs/Xserver/cfb/cfbmodule.c delete mode 100644 nx-X11/programs/Xserver/cfb/cfbmskbits.c delete mode 100644 nx-X11/programs/Xserver/cfb/cfbmskbits.h delete mode 100644 nx-X11/programs/Xserver/cfb/cfbpixmap.c delete mode 100644 nx-X11/programs/Xserver/cfb/cfbply1rct.c delete mode 100644 nx-X11/programs/Xserver/cfb/cfbpntwin.c delete mode 100644 nx-X11/programs/Xserver/cfb/cfbpolypnt.c delete mode 100644 nx-X11/programs/Xserver/cfb/cfbpush8.c delete mode 100644 nx-X11/programs/Xserver/cfb/cfbrctstp8.c delete mode 100644 nx-X11/programs/Xserver/cfb/cfbrrop.c delete mode 100644 nx-X11/programs/Xserver/cfb/cfbrrop.h delete mode 100644 nx-X11/programs/Xserver/cfb/cfbscrinit.c delete mode 100644 nx-X11/programs/Xserver/cfb/cfbsetsp.c delete mode 100644 nx-X11/programs/Xserver/cfb/cfbsolid.c delete mode 100644 nx-X11/programs/Xserver/cfb/cfbtab.h delete mode 100644 nx-X11/programs/Xserver/cfb/cfbteblt8.c delete mode 100644 nx-X11/programs/Xserver/cfb/cfbtegblt.c delete mode 100644 nx-X11/programs/Xserver/cfb/cfbtile32.c delete mode 100644 nx-X11/programs/Xserver/cfb/cfbtileodd.c delete mode 100644 nx-X11/programs/Xserver/cfb/cfbunmap.h delete mode 100644 nx-X11/programs/Xserver/cfb/cfbwindow.c delete mode 100644 nx-X11/programs/Xserver/cfb/cfbzerarc.c delete mode 100644 nx-X11/programs/Xserver/cfb/module/Imakefile delete mode 100644 nx-X11/programs/Xserver/cfb/stip68kgnu.h delete mode 100644 nx-X11/programs/Xserver/cfb/stipmips.s delete mode 100644 nx-X11/programs/Xserver/cfb/stipple68k.s delete mode 100644 nx-X11/programs/Xserver/cfb/stipsparc.s delete mode 100644 nx-X11/programs/Xserver/cfb/stipsprc32.s delete mode 100644 nx-X11/programs/Xserver/cfb16/Imakefile delete mode 100644 nx-X11/programs/Xserver/cfb16/cfbmodule.c delete mode 100644 nx-X11/programs/Xserver/cfb16/module/Imakefile delete mode 100644 nx-X11/programs/Xserver/cfb24/Imakefile delete mode 100644 nx-X11/programs/Xserver/cfb24/cfbmodule.c delete mode 100644 nx-X11/programs/Xserver/cfb24/cfbrrop24.h delete mode 100644 nx-X11/programs/Xserver/cfb24/module/Imakefile delete mode 100644 nx-X11/programs/Xserver/cfb32/Imakefile delete mode 100644 nx-X11/programs/Xserver/cfb32/cfbmodule.c delete mode 100644 nx-X11/programs/Xserver/cfb32/module/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/darwin/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/darwin/XDarwin.man delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/Dutch.lproj/Credits.rtf delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/Dutch.lproj/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/Dutch.lproj/Localizable.strings delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/Dutch.lproj/MainMenu.nib/classes.nib delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/Dutch.lproj/MainMenu.nib/objects.nib delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/Dutch.lproj/XDarwinHelp.html.cpp delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/English.lproj/Credits.rtf delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/English.lproj/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/English.lproj/Localizable.strings delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/English.lproj/MainMenu.nib/objects.nib delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/French.lproj/Credits.rtf delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/French.lproj/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/French.lproj/Localizable.strings delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/French.lproj/MainMenu.nib/classes.nib delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/French.lproj/MainMenu.nib/objects.nib delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/French.lproj/XDarwinHelp.html.cpp delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/German.lproj/Credits.rtf delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/German.lproj/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/German.lproj/Localizable.strings delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/German.lproj/MainMenu.nib/classes.nib delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/German.lproj/MainMenu.nib/objects.nib delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/German.lproj/XDarwinHelp.html.cpp delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/Japanese.lproj/Credits.rtf delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/Japanese.lproj/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/Japanese.lproj/Localizable.strings delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/classes.nib delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/objects.nib delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/Japanese.lproj/XDarwinHelp.html.cpp delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/Portuguese.lproj/Credits.rtf delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/Portuguese.lproj/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/Portuguese.lproj/Localizable.strings delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/classes.nib delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/objects.nib delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/Portuguese.lproj/XDarwinHelp.html.cpp delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/Spanish.lproj/Credits.rtf delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/Spanish.lproj/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/Spanish.lproj/Localizable.strings delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/Spanish.lproj/MainMenu.nib/classes.nib delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/Spanish.lproj/MainMenu.nib/objects.nib delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/Spanish.lproj/XDarwinHelp.html.cpp delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/Swedish.lproj/Credits.rtf delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/Swedish.lproj/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/Swedish.lproj/Localizable.strings delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/Swedish.lproj/MainMenu.nib/classes.nib delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/Swedish.lproj/MainMenu.nib/objects.nib delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/Swedish.lproj/XDarwinHelp.html.cpp delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/XDarwin.icns delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/ko.lproj/Credits.rtf delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/ko.lproj/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/ko.lproj/Localizable.strings delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/ko.lproj/MainMenu.nib/classes.nib delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/ko.lproj/MainMenu.nib/objects.nib delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/ko.lproj/XDarwinHelp.html.cpp delete mode 100644 nx-X11/programs/Xserver/hw/darwin/bundle/startXClients.cpp delete mode 100644 nx-X11/programs/Xserver/hw/darwin/darwin.c delete mode 100644 nx-X11/programs/Xserver/hw/darwin/darwin.h delete mode 100644 nx-X11/programs/Xserver/hw/darwin/darwinClut8.h delete mode 100644 nx-X11/programs/Xserver/hw/darwin/darwinEvents.c delete mode 100644 nx-X11/programs/Xserver/hw/darwin/darwinKeyboard.c delete mode 100644 nx-X11/programs/Xserver/hw/darwin/darwinKeyboard.h delete mode 100644 nx-X11/programs/Xserver/hw/darwin/darwinXinput.c delete mode 100644 nx-X11/programs/Xserver/hw/darwin/iokit/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/darwin/iokit/xfIOKit.c delete mode 100644 nx-X11/programs/Xserver/hw/darwin/iokit/xfIOKit.h delete mode 100644 nx-X11/programs/Xserver/hw/darwin/iokit/xfIOKitCursor.c delete mode 100644 nx-X11/programs/Xserver/hw/darwin/iokit/xfIOKitStartup.c delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/Preferences.h delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/Preferences.m delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/XApplication.h delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/XApplication.m delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/XDarwin.pbproj/project.pbxproj delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/XDarwinStartup.c delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/XDarwinStartup.man delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/XServer.h delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/XServer.m delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/applewm.c delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/applewmExt.h delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/cr/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/cr/XView.h delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/cr/XView.m delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/cr/cr.h delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/cr/crAppleWM.m delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/cr/crFrame.m delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/cr/crScreen.m delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/fullscreen/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/fullscreen/fullscreen.c delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/fullscreen/quartzCursor.c delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/fullscreen/quartzCursor.h delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/keysym2ucs.c delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/keysym2ucs.h delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/pseudoramiX.c delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/pseudoramiX.h delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/quartz.c delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/quartz.h delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/quartzAudio.c delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/quartzAudio.h delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/quartzCocoa.m delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/quartzCommon.h delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/quartzCursor.c delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/quartzCursor.h delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/quartzKeyboard.c delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/quartzPasteboard.c delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/quartzPasteboard.h delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/quartzStartup.c delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/xpr/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/xpr/Xplugin.h delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/xpr/appledri.c delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/xpr/dri.c delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/xpr/dri.h delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/xpr/dristruct.h delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/xpr/x-hash.c delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/xpr/x-hash.h delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/xpr/x-hook.c delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/xpr/x-hook.h delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/xpr/x-list.c delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/xpr/x-list.h delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/xpr/xpr.h delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/xpr/xprAppleWM.c delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/xpr/xprCursor.c delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/xpr/xprFrame.c delete mode 100644 nx-X11/programs/Xserver/hw/darwin/quartz/xpr/xprScreen.c delete mode 100644 nx-X11/programs/Xserver/hw/darwin/utils/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/darwin/utils/README.txt delete mode 100644 nx-X11/programs/Xserver/hw/darwin/utils/dumpkeymap.c delete mode 100644 nx-X11/programs/Xserver/hw/darwin/utils/dumpkeymap.man delete mode 100644 nx-X11/programs/Xserver/hw/dmx/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/dmx/Xdmx.man delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/Canvas.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/Canvas.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/CanvasP.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/TODO delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/dmxcompat.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/dmxcompat.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/dmxconfig.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/dmxconfig.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/dmxparse.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/dmxparse.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/dmxprint.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/dmxprint.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/dmxtodmx.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/dmxtodmx.man delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/parser.y delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/scanner.l delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/test-a.in delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/test-a.out delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/test-b.in delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/test-b.out delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/test-c.in delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/test-c.out delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/test-d.in delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/test-d.out delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/test-e.in delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/test-e.out delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/test-f.in delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/test-f.out delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/test-g.in delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/test-g.out delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/test-h.in delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/test-h.out delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/test-i.in delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/test-i.out delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/test-j.in delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/test-j.out delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/test-k.in delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/test-k.out delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/test-l.in delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/test-l.out delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/vdltodmx.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/vdltodmx.man delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/xdmxconfig.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/config/xdmxconfig.man delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmx.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmx_glxvisuals.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmx_glxvisuals.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxcb.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxcb.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxclient.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxcmap.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxcmap.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxcursor.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxcursor.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxdpms.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxdpms.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxextension.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxextension.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxfont.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxfont.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxgc.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxgc.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxgcops.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxgcops.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxinit.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxinit.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxinput.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxinput.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxlog.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxlog.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxpict.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxpict.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxpixmap.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxpixmap.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxprop.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxprop.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxscrinit.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxscrinit.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxshadow.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxshadow.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxstat.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxstat.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxsync.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxsync.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxvisual.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxvisual.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxwindow.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/dmxwindow.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/DMXSpec-v1.txt delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/DMXSpec.txt delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/Makefile.linux delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/dmx.sgml delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/dmx.txt delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/doxygen.conf delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/doxygen.css delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/doxygen.foot delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/doxygen.head delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/ChkNotMaskEv_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/ChkNotMaskEv_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/ChkNotMaskEv_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/annotated.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/classes.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmx_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmx_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmx__glxvisuals_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxarg_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxarg_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxarg_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxbackend_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxbackend_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxbackend_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxcb_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxcb_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxcb_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxclient_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxclient_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxcmap_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxcmap_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxcmap_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxcommon_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxcommon_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxcommon_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxcompat_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxcompat_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxcompat_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxconfig_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxconfig_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxconfig_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxconsole_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxconsole_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxconsole_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxcursor_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxcursor_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxcursor_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxdetach_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxdpms_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxdpms_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxdpms_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxdummy_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxdummy_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxdummy_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxeq_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxeq_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxeq_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxevents_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxevents_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxevents_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxext_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxext_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxextension_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxextension_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxextension_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxfont_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxfont_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxfont_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxgc_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxgc_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxgc_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxgcops_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxgcops_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxgcops_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxinit_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxinit_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxinit_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxinput_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxinput_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxinput_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxinputinit_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxinputinit_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxinputinit_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxlog_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxlog_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxlog_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxmap_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxmap_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxmap_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxmotion_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxmotion_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxmotion_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxparse_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxparse_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxparse_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxpict_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxpict_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxpict_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxpixmap_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxpixmap_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxpixmap_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxprint_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxprint_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxprint_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxprop_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxprop_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxprop_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxproto_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxproto_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxscrinit_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxscrinit_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxscrinit_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxshadow_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxshadow_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxshadow_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxsigio_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxsigio_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxsigio_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxstat_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxstat_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxstat_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxsync_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxsync_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxsync_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxvisual_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxvisual_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxvisual_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxwindow_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxwindow_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxwindow_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/dmxxinput_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/doxygen.css delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/doxygen.png delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/files.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/ftv2blank.png delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/ftv2doc.png delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/ftv2folderclosed.png delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/ftv2folderopen.png delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/ftv2lastnode.png delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/ftv2link.png delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/ftv2mlastnode.png delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/ftv2mnode.png delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/ftv2node.png delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/ftv2plastnode.png delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/ftv2pnode.png delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/ftv2vertline.png delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/functions.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/functions_vars.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/globals.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/globals_defs.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/globals_enum.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/globals_eval.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/globals_func.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/globals_type.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/globals_vars.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/index.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/lib_2dmx_2dmx_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/lnx-keyboard_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/lnx-keyboard_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/lnx-keyboard_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/lnx-ms_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/lnx-ms_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/lnx-ms_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/lnx-ps2_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/lnx-ps2_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/lnx-ps2_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/main.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/programs_2Xserver_2Xext_2dmx_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structDMXConfigCmdStruct.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structDMXConfigListStruct.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structDMXDesktopAttributes.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structDMXDesktopAttributesRec.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structDMXInputAttributes.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structDMXInputAttributesRec.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structDMXScreenAttributes.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structDMXScreenAttributesRec.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structDMXWindowAttributes.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structDMXWindowAttributesRec.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/struct__DMXConfigComment.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/struct__DMXConfigDisplay.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/struct__DMXConfigEntry.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/struct__DMXConfigFullDim.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/struct__DMXConfigNumber.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/struct__DMXConfigOption.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/struct__DMXConfigPair.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/struct__DMXConfigParam.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/struct__DMXConfigPartDim.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/struct__DMXConfigString.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/struct__DMXConfigSub.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/struct__DMXConfigToken.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/struct__DMXConfigVirtual.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/struct__DMXConfigWall.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/struct__DMXEventMap.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/struct__DMXInputInfo.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/struct__DMXLocalInitInfo.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/struct__DMXLocalInputInfo.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/struct__DMXScreenInfo.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/struct__DMXStatAvg.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/struct__DMXStatInfo.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/struct__Event.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/struct__EventQueue.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/struct__dmxArg.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/struct__dmxColormapPriv.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/struct__dmxCursorPriv.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/struct__dmxFontPriv.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/struct__dmxGCPriv.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/struct__dmxGlyphPriv.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/struct__dmxPictPriv.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/struct__dmxPixPriv.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/struct__dmxWinPriv.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/struct__myPrivate.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structdmxGlxVisualPrivate.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structxDMXAddInputReply.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structxDMXAddInputReq.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structxDMXAddScreenReply.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structxDMXAddScreenReq.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structxDMXChangeDesktopAttributesReply.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structxDMXChangeDesktopAttributesReq.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structxDMXChangeScreensAttributesReply.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structxDMXChangeScreensAttributesReq.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structxDMXForceWindowCreationReply.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structxDMXForceWindowCreationReq.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structxDMXGetDesktopAttributesReply.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structxDMXGetDesktopAttributesReq.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structxDMXGetInputAttributesReply.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structxDMXGetInputAttributesReq.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structxDMXGetInputCountReply.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structxDMXGetInputCountReq.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structxDMXGetScreenAttributesReply.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structxDMXGetScreenAttributesReq.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structxDMXGetScreenCountReply.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structxDMXGetScreenCountReq.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structxDMXGetWindowAttributesReply.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structxDMXGetWindowAttributesReq.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structxDMXQueryVersionReply.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structxDMXQueryVersionReq.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structxDMXRemoveInputReply.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structxDMXRemoveInputReq.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structxDMXRemoveScreenReply.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structxDMXRemoveScreenReq.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structxDMXSyncReply.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/structxDMXSyncReq.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/tree.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/usb-common_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/usb-common_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/usb-common_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/usb-keyboard_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/usb-keyboard_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/usb-keyboard_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/usb-mouse_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/usb-mouse_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/usb-mouse_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/usb-other_8c.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/usb-other_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/usb-other_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/usb-private_8h-source.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/html/usb-private_8h.html delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/scaled.sgml delete mode 100644 nx-X11/programs/Xserver/hw/dmx/doc/scaled.txt delete mode 100644 nx-X11/programs/Xserver/hw/dmx/examples/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/dmx/examples/dmxaddinput.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/examples/dmxaddscreen.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/examples/dmxreconfig.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/examples/dmxresize.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/examples/dmxrminput.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/examples/dmxrmscreen.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/examples/dmxwininfo.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/examples/ev.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/examples/evi.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/examples/res.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/examples/xbell.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/examples/xdmx.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/examples/xinput.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/examples/xled.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/examples/xtest.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/glxProxy/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/dmx/glxProxy/compsize.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/glxProxy/g_disptab.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/glxProxy/g_disptab.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/glxProxy/g_renderswap.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/glxProxy/global.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/glxProxy/glxcmds.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/glxProxy/glxcmdsswap.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/glxProxy/glxcontext.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/glxProxy/glxdrawable.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/glxProxy/glxerror.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/glxProxy/glxext.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/glxProxy/glxext.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/glxProxy/glxfbconfig.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/glxProxy/glxfbconfig.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/glxProxy/glxscreens.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/glxProxy/glxscreens.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/glxProxy/glxserver.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/glxProxy/glxsingle.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/glxProxy/glxsingle.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/glxProxy/glxswap.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/glxProxy/glxswap.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/glxProxy/glxutil.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/glxProxy/glxutil.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/glxProxy/glxvendor.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/glxProxy/glxvendor.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/glxProxy/glxvisuals.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/glxProxy/glxvisuals.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/glxProxy/render2swap.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/glxProxy/renderpixswap.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/glxProxy/unpack.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/ChkNotMaskEv.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/ChkNotMaskEv.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/dmxarg.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/dmxarg.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/dmxbackend.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/dmxbackend.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/dmxcommon.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/dmxcommon.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/dmxconsole.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/dmxconsole.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/dmxdetach.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/dmxdummy.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/dmxdummy.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/dmxeq.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/dmxeq.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/dmxevents.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/dmxevents.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/dmxinputinit.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/dmxinputinit.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/dmxmap.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/dmxmap.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/dmxmotion.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/dmxmotion.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/dmxsigio.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/dmxsigio.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/dmxxinput.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/lnx-keyboard.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/lnx-keyboard.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/lnx-ms.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/lnx-ms.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/lnx-ps2.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/lnx-ps2.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/usb-common.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/usb-common.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/usb-keyboard.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/usb-keyboard.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/usb-mouse.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/usb-mouse.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/usb-other.c delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/usb-other.h delete mode 100644 nx-X11/programs/Xserver/hw/dmx/input/usb-private.h delete mode 100644 nx-X11/programs/Xserver/hw/kdrive/README delete mode 100644 nx-X11/programs/Xserver/hw/sun/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/sun/README delete mode 100644 nx-X11/programs/Xserver/hw/sun/Xsun.man delete mode 100644 nx-X11/programs/Xserver/hw/sun/circleset.h delete mode 100644 nx-X11/programs/Xserver/hw/sun/constype.c delete mode 100644 nx-X11/programs/Xserver/hw/sun/constype.man delete mode 100644 nx-X11/programs/Xserver/hw/sun/kbd_mode.c delete mode 100644 nx-X11/programs/Xserver/hw/sun/kbd_mode.man delete mode 100644 nx-X11/programs/Xserver/hw/sun/sun.h delete mode 100644 nx-X11/programs/Xserver/hw/sun/sunCfb.c delete mode 100644 nx-X11/programs/Xserver/hw/sun/sunCfb24.c delete mode 100644 nx-X11/programs/Xserver/hw/sun/sunCursor.c delete mode 100644 nx-X11/programs/Xserver/hw/sun/sunFbs.c delete mode 100644 nx-X11/programs/Xserver/hw/sun/sunGX.c delete mode 100644 nx-X11/programs/Xserver/hw/sun/sunGX.h delete mode 100644 nx-X11/programs/Xserver/hw/sun/sunInit.c delete mode 100644 nx-X11/programs/Xserver/hw/sun/sunIo.c delete mode 100644 nx-X11/programs/Xserver/hw/sun/sunKbd.c delete mode 100644 nx-X11/programs/Xserver/hw/sun/sunKeyMap.c delete mode 100644 nx-X11/programs/Xserver/hw/sun/sunMfb.c delete mode 100644 nx-X11/programs/Xserver/hw/sun/sunMouse.c delete mode 100644 nx-X11/programs/Xserver/hw/sun/sunMultiDepth.c delete mode 100644 nx-X11/programs/Xserver/hw/sunLynx/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/sunLynx/btreg.h delete mode 100644 nx-X11/programs/Xserver/hw/sunLynx/btvar.h delete mode 100644 nx-X11/programs/Xserver/hw/sunLynx/cgsixreg.h delete mode 100644 nx-X11/programs/Xserver/hw/sunLynx/fbio.h delete mode 100644 nx-X11/programs/Xserver/hw/sunLynx/patch.Console delete mode 100644 nx-X11/programs/Xserver/hw/sunLynx/patch.Console-2.4.0 delete mode 100644 nx-X11/programs/Xserver/hw/sunLynx/sun.h delete mode 100644 nx-X11/programs/Xserver/hw/sunLynx/sunLyCfb.c delete mode 100644 nx-X11/programs/Xserver/hw/sunLynx/sunLyFbs.c delete mode 100644 nx-X11/programs/Xserver/hw/sunLynx/sunLyInit.c delete mode 100644 nx-X11/programs/Xserver/hw/sunLynx/sunLyIo.c delete mode 100644 nx-X11/programs/Xserver/hw/sunLynx/sunLyKbd.c delete mode 100644 nx-X11/programs/Xserver/hw/sunLynx/sunLyMouse.c delete mode 100644 nx-X11/programs/Xserver/hw/sunLynx/sunLyUtil.c delete mode 100644 nx-X11/programs/Xserver/hw/sunLynx/vuid_event.h delete mode 100644 nx-X11/programs/Xserver/hw/vfb/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/vfb/InitInput.c delete mode 100644 nx-X11/programs/Xserver/hw/vfb/InitOutput.c delete mode 100644 nx-X11/programs/Xserver/hw/vfb/Xvfb.man delete mode 100644 nx-X11/programs/Xserver/hw/vfb/lk201kbd.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/atKeynames.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/fourcc.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/modeline2c.pl delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/scoasm.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86AutoConfig.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86Bus.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86Bus.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86Config.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86Config.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86Configure.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86Cursor.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86DGA.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86DPMS.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86Debug.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86DefModes.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86DoProbe.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86DoScanPci.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86Events.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86Globals.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86Helper.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86InPriv.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86Init.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86Io.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86Kbd.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86KbdBSD.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86KbdLnx.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86KbdMach.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86Keymap.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86MiscExt.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86Mode.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86Module.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86Opt.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86Option.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86PM.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86PciInfo.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86Priv.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86Privstr.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86RandR.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86Resources.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86Versions.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86VidMode.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86XKB.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86Xinput.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86Xinput.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86cmap.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86cmap.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86fbBus.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86fbman.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86fbman.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86isaBus.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86noBus.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86pciBus.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86pciBus.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86sbusBus.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86sbusBus.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86str.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86xv.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86xv.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86xvmc.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86xvmc.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xf86xvpriv.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xisb.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xisb.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/common/xorgHelper.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/README.OS-lib delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/assyntax.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bsd/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bsd/alpha_video.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bsd/arm_video.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bsd/bsdResource.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bsd/bsd_KbdMap.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bsd/bsd_VTsw.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bsd/bsd_apm.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bsd/bsd_axp.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bsd/bsd_ev56.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bsd/bsd_init.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bsd/bsd_io.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bsd/bsd_jstk.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bsd/bsd_kbd.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bsd/bsd_kbd.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bsd/bsd_kmod.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bsd/bsd_mouse.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bsd/drm/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bsd/i386_video.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bsd/libusb/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bsd/libusb/data.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bsd/libusb/descr.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bsd/libusb/parse.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bsd/libusb/usage.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bsd/libusb/usb.3 delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bsd/libusb/usb.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bsd/libusb/usb_hid_usages delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bsd/libusb/usbvar.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bsd/memrange.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bsd/ppc_video.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bsd/sparc64_video.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bsdi/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bsdi/bsdi_init.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bsdi/bsdi_io.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bsdi/bsdi_mouse.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bsdi/bsdi_video.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bus/460gxPCI.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bus/460gxPCI.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bus/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bus/Pci.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bus/Pci.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bus/Sbus.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bus/altixPCI.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bus/altixPCI.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bus/axpPci.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bus/e8870PCI.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bus/e8870PCI.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bus/freebsdPci.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bus/ix86Pci.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bus/linuxPci.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bus/netbsdPci.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bus/ppcPci.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bus/sparcPci.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bus/xf86Pci.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bus/xf86Sbus.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bus/zx1PCI.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/bus/zx1PCI.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/dgux/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/dgux/bios_DGmmap.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/dgux/dgux_init.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/dgux/dgux_io.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/dgux/dgux_kbd.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/dgux/dgux_kbdEv.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/dgux/dgux_tty.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/dgux/dgux_video.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/hurd/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/hurd/bios_mmap.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/hurd/hurd_init.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/hurd/hurd_io.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/hurd/hurd_mouse.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/hurd/hurd_video.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/int10Defines.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/linux/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/linux/drm/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/linux/drm/drmmodule.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/linux/int10/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/linux/int10/linux.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/linux/int10/vm86/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/linux/int10/x86emu/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/linux/lnx.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/linux/lnxResource.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/linux/lnx_KbdMap.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/linux/lnx_acpi.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/linux/lnx_apm.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/linux/lnx_axp.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/linux/lnx_ev56.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/linux/lnx_font.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/linux/lnx_ia64.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/linux/lnx_init.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/linux/lnx_io.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/linux/lnx_jstk.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/linux/lnx_kbd.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/linux/lnx_kbd.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/linux/lnx_kmod.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/linux/lnx_mouse.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/linux/lnx_pci.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/linux/lnx_video.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/lynxos/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/lynxos/lynx_init.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/lynxos/lynx_io.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/lynxos/lynx_mmap.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/lynxos/lynx_mouse.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/lynxos/lynx_noinline.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/lynxos/lynx_ppc.S delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/lynxos/lynx_ppc.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/lynxos/lynx_video.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/misc/BUSmemcpy.S delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/misc/BUSmemcpy.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/misc/Delay.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/misc/IODelay.S delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/misc/IODelay.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/misc/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/misc/PortIO.S delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/misc/SlowBcopy.S delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/misc/SlowBcopy.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/misc/xf86_IlHack.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/misc/xf86_Util.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/nto/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/nto/README delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/nto/nto_init.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/nto/nto_io.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/nto/nto_ioperm.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/nto/nto_kbdEv.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/nto/nto_mouse.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/nto/nto_video.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/os2/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/os2/README delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/os2/int10/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/os2/int10/os2.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/os2/os2_VTsw.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/os2/os2_bios.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/os2/os2_diag.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/os2/os2_init.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/os2/os2_io.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/os2/os2_ioperm.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/os2/os2_kbd.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/os2/os2_kbdEv.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/os2/os2_mouse.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/os2/os2_select.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/os2/os2_select.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/os2/os2_serial.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/os2/os2_stubs.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/os2/os2_video.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/pmax/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/pmax/pmax_devs.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/pmax/pmax_init.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/pmax/pmax_map.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/pmax/pmax_mouse.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/pmax/pmax_pci.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/pmax/pmax_ppc.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/qnx4/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/qnx4/qnx_VTsw.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/qnx4/qnx_init.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/qnx4/qnx_io.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/qnx4/qnx_kbd.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/qnx4/qnx_mouse.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/qnx4/qnx_select.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/qnx4/qnx_utils.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/qnx4/qnx_video.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/sco/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/sco/VTsw_sco.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/sco/sco_KbdMap.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/sco/sco_init.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/sco/sco_io.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/sco/sco_iop.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/sco/sco_kbd.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/sco/sco_kbd.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/sco/sco_mouse.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/sco/sco_video.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/shared/VTsw_noop.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/shared/VTsw_usl.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/shared/agp_noop.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/shared/at_scancode.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/shared/bios_devmem.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/shared/bios_mmap.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/shared/ia64Pci.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/shared/ia64Pci.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/shared/inout.S delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/shared/ioperm_noop.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/shared/kbd.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/shared/kmod_noop.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/shared/libc_wrapper.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/shared/pm_noop.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/shared/posix_tty.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/shared/sigio.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/shared/sigiostubs.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/shared/stdPci.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/shared/stdResource.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/shared/std_kbdEv.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/shared/sysv_kbd.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/shared/vidmem.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/shared/xf86Axp.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/shared/xf86Axp.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/sunos/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/sunos/agpgart.h delete mode 100755 nx-X11/programs/Xserver/hw/xfree86/os-support/sunos/find_deps.pl delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/sunos/solaris-amd64.S delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/sunos/solaris-ia32.S delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/sunos/solaris-sparcv8plus.S delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/sunos/sun_agp.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/sunos/sun_bios.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/sunos/sun_init.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/sunos/sun_inout.s delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/sunos/sun_io.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/sunos/sun_kbd.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/sunos/sun_kbd.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/sunos/sun_kbdEv.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/sunos/sun_mouse.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/sunos/sun_vid.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/sysv/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/sysv/sysv_init.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/sysv/sysv_io.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/sysv/sysv_mouse.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/sysv/sysv_video.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/sysv/xqueue.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/sysv/xqueue.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/usl/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/usl/usl_KbdMap.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/usl/usl_init.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/usl/usl_io.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/usl/usl_iop.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/usl/usl_kbd.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/usl/usl_kbd.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/usl/usl_mouse.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/usl/usl_video.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/usl/usl_vtsw.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/usl/usl_xqueue.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/usl/usl_xqueue.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/xf86OSKbd.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/xf86OSmouse.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/xf86OSpriv.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/xf86_OSlib.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/parser/Configint.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/parser/DRI.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/parser/Device.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/parser/Extensions.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/parser/Files.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/parser/Flags.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/parser/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/parser/Input.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/parser/Keyboard.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/parser/Layout.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/parser/Module.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/parser/Monitor.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/parser/Pointer.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/parser/Screen.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/parser/Vendor.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/parser/Video.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/parser/configProcs.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/parser/cpconfig.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/parser/read.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/parser/scan.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/parser/write.c delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/parser/xf86Optrec.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/parser/xf86Parser.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/parser/xf86tokens.h delete mode 100644 nx-X11/programs/Xserver/hw/xfree86/xf86Date.h delete mode 100644 nx-X11/programs/Xserver/hw/xnest/Args.c delete mode 100644 nx-X11/programs/Xserver/hw/xnest/Args.h delete mode 100644 nx-X11/programs/Xserver/hw/xnest/Color.c delete mode 100644 nx-X11/programs/Xserver/hw/xnest/Color.h delete mode 100644 nx-X11/programs/Xserver/hw/xnest/Cursor.c delete mode 100644 nx-X11/programs/Xserver/hw/xnest/Display.c delete mode 100644 nx-X11/programs/Xserver/hw/xnest/Display.h delete mode 100644 nx-X11/programs/Xserver/hw/xnest/Drawable.h delete mode 100644 nx-X11/programs/Xserver/hw/xnest/Events.c delete mode 100644 nx-X11/programs/Xserver/hw/xnest/Events.h delete mode 100644 nx-X11/programs/Xserver/hw/xnest/Font.c delete mode 100644 nx-X11/programs/Xserver/hw/xnest/GC.c delete mode 100644 nx-X11/programs/Xserver/hw/xnest/GCOps.c delete mode 100644 nx-X11/programs/Xserver/hw/xnest/GCOps.h delete mode 100644 nx-X11/programs/Xserver/hw/xnest/GetTime.c delete mode 100644 nx-X11/programs/Xserver/hw/xnest/Handlers.c delete mode 100644 nx-X11/programs/Xserver/hw/xnest/Handlers.h delete mode 100644 nx-X11/programs/Xserver/hw/xnest/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/xnest/Init.c delete mode 100644 nx-X11/programs/Xserver/hw/xnest/Init.h delete mode 100644 nx-X11/programs/Xserver/hw/xnest/Keyboard.c delete mode 100644 nx-X11/programs/Xserver/hw/xnest/Keyboard.h delete mode 100644 nx-X11/programs/Xserver/hw/xnest/Pixmap.c delete mode 100644 nx-X11/programs/Xserver/hw/xnest/Pointer.c delete mode 100644 nx-X11/programs/Xserver/hw/xnest/Pointer.h delete mode 100644 nx-X11/programs/Xserver/hw/xnest/Screen.c delete mode 100644 nx-X11/programs/Xserver/hw/xnest/Screen.h delete mode 100644 nx-X11/programs/Xserver/hw/xnest/TestExt.c delete mode 100644 nx-X11/programs/Xserver/hw/xnest/Visual.c delete mode 100644 nx-X11/programs/Xserver/hw/xnest/Visual.h delete mode 100644 nx-X11/programs/Xserver/hw/xnest/Window.c delete mode 100644 nx-X11/programs/Xserver/hw/xnest/XNCursor.h delete mode 100644 nx-X11/programs/Xserver/hw/xnest/XNFont.h delete mode 100644 nx-X11/programs/Xserver/hw/xnest/XNGC.h delete mode 100644 nx-X11/programs/Xserver/hw/xnest/XNPixmap.h delete mode 100644 nx-X11/programs/Xserver/hw/xnest/XNWindow.h delete mode 100644 nx-X11/programs/Xserver/hw/xnest/Xnest.h delete mode 100644 nx-X11/programs/Xserver/hw/xnest/Xnest.man delete mode 100644 nx-X11/programs/Xserver/hw/xnest/icon delete mode 100644 nx-X11/programs/Xserver/hw/xnest/os2Stub.c delete mode 100644 nx-X11/programs/Xserver/hw/xnest/screensaver delete mode 100644 nx-X11/programs/Xserver/hw/xwin/ChangeLog delete mode 100644 nx-X11/programs/Xserver/hw/xwin/Imakefile delete mode 100644 nx-X11/programs/Xserver/hw/xwin/InitInput.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/InitOutput.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/README delete mode 100755 nx-X11/programs/Xserver/hw/xwin/X-boxed.ico delete mode 100644 nx-X11/programs/Xserver/hw/xwin/X.ico delete mode 100644 nx-X11/programs/Xserver/hw/xwin/XWin.man delete mode 100644 nx-X11/programs/Xserver/hw/xwin/XWin.rc delete mode 100755 nx-X11/programs/Xserver/hw/xwin/XWinrc.man delete mode 100644 nx-X11/programs/Xserver/hw/xwin/_usr_X11R6_lib_X11_system.XWinrc delete mode 100644 nx-X11/programs/Xserver/hw/xwin/ddraw.h delete mode 100644 nx-X11/programs/Xserver/hw/xwin/win.h delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winallpriv.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winauth.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winblock.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winclip.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winclipboard.h delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winclipboardinit.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winclipboardtextconv.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winclipboardthread.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winclipboardunicode.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winclipboardwndproc.c delete mode 100755 nx-X11/programs/Xserver/hw/xwin/winclipboardwrappers.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winclipboardxevents.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/wincmap.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winconfig.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winconfig.h delete mode 100644 nx-X11/programs/Xserver/hw/xwin/wincreatewnd.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/wincursor.c delete mode 100755 nx-X11/programs/Xserver/hw/xwin/windialogs.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winengine.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winerror.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winfillsp.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winfont.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/wingc.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/wingetsp.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winglobals.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winkeybd.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winkeybd.h delete mode 100755 nx-X11/programs/Xserver/hw/xwin/winkeyhook.c delete mode 100755 nx-X11/programs/Xserver/hw/xwin/winkeymap.h delete mode 100755 nx-X11/programs/Xserver/hw/xwin/winkeynames.h delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winlayouts.h delete mode 100755 nx-X11/programs/Xserver/hw/xwin/winmessages.h delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winmisc.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winmouse.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winms.h delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winmsg.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winmsg.h delete mode 100755 nx-X11/programs/Xserver/hw/xwin/winmultiwindowclass.c delete mode 100755 nx-X11/programs/Xserver/hw/xwin/winmultiwindowclass.h delete mode 100755 nx-X11/programs/Xserver/hw/xwin/winmultiwindowicons.c delete mode 100755 nx-X11/programs/Xserver/hw/xwin/winmultiwindowshape.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winmultiwindowwindow.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winmultiwindowwm.c delete mode 100755 nx-X11/programs/Xserver/hw/xwin/winmultiwindowwndproc.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winnativegdi.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winpfbdd.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winpixmap.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winpntwin.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winpolyline.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winprefs.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winprefs.h delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winprefslex.l delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winprefsyacc.y delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winpriv.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winpriv.h delete mode 100755 nx-X11/programs/Xserver/hw/xwin/winprocarg.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winpushpxl.c delete mode 100755 nx-X11/programs/Xserver/hw/xwin/winrandr.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winregistry.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winresource.h delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winrop.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winscrinit.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winsetsp.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winshaddd.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winshadddnl.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winshadgdi.c delete mode 100755 nx-X11/programs/Xserver/hw/xwin/wintrayicon.c delete mode 100755 nx-X11/programs/Xserver/hw/xwin/winvalargs.c delete mode 100755 nx-X11/programs/Xserver/hw/xwin/winvideo.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winwakeup.c delete mode 100755 nx-X11/programs/Xserver/hw/xwin/winwin32rootless.c delete mode 100755 nx-X11/programs/Xserver/hw/xwin/winwin32rootlesswindow.c delete mode 100755 nx-X11/programs/Xserver/hw/xwin/winwin32rootlesswndproc.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winwindow.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winwindow.h delete mode 100755 nx-X11/programs/Xserver/hw/xwin/winwindowswm.c delete mode 100644 nx-X11/programs/Xserver/hw/xwin/winwndproc.c delete mode 100755 nx-X11/programs/Xserver/hw/xwin/xlaunch/COPYING delete mode 100644 nx-X11/programs/Xserver/hw/xwin/xlaunch/config.cc delete mode 100644 nx-X11/programs/Xserver/hw/xwin/xlaunch/config.h delete mode 100755 nx-X11/programs/Xserver/hw/xwin/xlaunch/main.cc delete mode 100755 nx-X11/programs/Xserver/hw/xwin/xlaunch/resources/dialog.rc delete mode 100755 nx-X11/programs/Xserver/hw/xwin/xlaunch/resources/fullscreen.bmp delete mode 100755 nx-X11/programs/Xserver/hw/xwin/xlaunch/resources/images.rc delete mode 100755 nx-X11/programs/Xserver/hw/xwin/xlaunch/resources/multiwindow.bmp delete mode 100755 nx-X11/programs/Xserver/hw/xwin/xlaunch/resources/nodecoration.bmp delete mode 100755 nx-X11/programs/Xserver/hw/xwin/xlaunch/resources/resources.h delete mode 100755 nx-X11/programs/Xserver/hw/xwin/xlaunch/resources/resources.rc delete mode 100644 nx-X11/programs/Xserver/hw/xwin/xlaunch/resources/strings.rc delete mode 100755 nx-X11/programs/Xserver/hw/xwin/xlaunch/resources/windowed.bmp delete mode 100755 nx-X11/programs/Xserver/hw/xwin/xlaunch/window/dialog.cc delete mode 100755 nx-X11/programs/Xserver/hw/xwin/xlaunch/window/dialog.h delete mode 100644 nx-X11/programs/Xserver/hw/xwin/xlaunch/window/util.cc delete mode 100644 nx-X11/programs/Xserver/hw/xwin/xlaunch/window/util.h delete mode 100755 nx-X11/programs/Xserver/hw/xwin/xlaunch/window/window.cc delete mode 100755 nx-X11/programs/Xserver/hw/xwin/xlaunch/window/window.h delete mode 100755 nx-X11/programs/Xserver/hw/xwin/xlaunch/window/wizard.cc delete mode 100755 nx-X11/programs/Xserver/hw/xwin/xlaunch/window/wizard.h delete mode 100644 nx-X11/programs/Xserver/ilbm/Imakefile delete mode 100644 nx-X11/programs/Xserver/ilbm/README delete mode 100644 nx-X11/programs/Xserver/ilbm/ilbm.h delete mode 100644 nx-X11/programs/Xserver/ilbm/ilbmbitblt.c delete mode 100644 nx-X11/programs/Xserver/ilbm/ilbmblt.c delete mode 100644 nx-X11/programs/Xserver/ilbm/ilbmbres.c delete mode 100644 nx-X11/programs/Xserver/ilbm/ilbmbresd.c delete mode 100644 nx-X11/programs/Xserver/ilbm/ilbmbstore.c delete mode 100644 nx-X11/programs/Xserver/ilbm/ilbmclip.c delete mode 100644 nx-X11/programs/Xserver/ilbm/ilbmcmap.c delete mode 100644 nx-X11/programs/Xserver/ilbm/ilbmfillarc.c delete mode 100644 nx-X11/programs/Xserver/ilbm/ilbmfillrct.c delete mode 100644 nx-X11/programs/Xserver/ilbm/ilbmfillsp.c delete mode 100644 nx-X11/programs/Xserver/ilbm/ilbmfont.c delete mode 100644 nx-X11/programs/Xserver/ilbm/ilbmgc.c delete mode 100644 nx-X11/programs/Xserver/ilbm/ilbmgetsp.c delete mode 100644 nx-X11/programs/Xserver/ilbm/ilbmhrzvert.c delete mode 100644 nx-X11/programs/Xserver/ilbm/ilbmimage.c delete mode 100644 nx-X11/programs/Xserver/ilbm/ilbmimggblt.c delete mode 100644 nx-X11/programs/Xserver/ilbm/ilbmline.c delete mode 100644 nx-X11/programs/Xserver/ilbm/ilbmmisc.c delete mode 100644 nx-X11/programs/Xserver/ilbm/ilbmpixmap.c delete mode 100644 nx-X11/programs/Xserver/ilbm/ilbmply1rct.c delete mode 100644 nx-X11/programs/Xserver/ilbm/ilbmplygblt.c delete mode 100644 nx-X11/programs/Xserver/ilbm/ilbmpntarea.c delete mode 100644 nx-X11/programs/Xserver/ilbm/ilbmpntwin.c delete mode 100644 nx-X11/programs/Xserver/ilbm/ilbmpolypnt.c delete mode 100644 nx-X11/programs/Xserver/ilbm/ilbmpushpxl.c delete mode 100644 nx-X11/programs/Xserver/ilbm/ilbmscrinit.c delete mode 100644 nx-X11/programs/Xserver/ilbm/ilbmsetsp.c delete mode 100644 nx-X11/programs/Xserver/ilbm/ilbmtegblt.c delete mode 100644 nx-X11/programs/Xserver/ilbm/ilbmtile.c delete mode 100644 nx-X11/programs/Xserver/ilbm/ilbmwindow.c delete mode 100644 nx-X11/programs/Xserver/ilbm/ilbmzerarc.c delete mode 100644 nx-X11/programs/Xserver/iplan2p2/Imakefile delete mode 100644 nx-X11/programs/Xserver/iplan2p4/Imakefile delete mode 100644 nx-X11/programs/Xserver/iplan2p4/ipl.h delete mode 100644 nx-X11/programs/Xserver/iplan2p4/iplallpriv.c delete mode 100644 nx-X11/programs/Xserver/iplan2p4/iplbitblt.c delete mode 100644 nx-X11/programs/Xserver/iplan2p4/iplblt.c delete mode 100644 nx-X11/programs/Xserver/iplan2p4/iplbres.c delete mode 100644 nx-X11/programs/Xserver/iplan2p4/iplbresd.c delete mode 100644 nx-X11/programs/Xserver/iplan2p4/iplbstore.c delete mode 100644 nx-X11/programs/Xserver/iplan2p4/iplcmap.c delete mode 100644 nx-X11/programs/Xserver/iplan2p4/iplfillarc.c delete mode 100644 nx-X11/programs/Xserver/iplan2p4/iplfillrct.c delete mode 100644 nx-X11/programs/Xserver/iplan2p4/iplfillsp.c delete mode 100644 nx-X11/programs/Xserver/iplan2p4/iplgc.c delete mode 100644 nx-X11/programs/Xserver/iplan2p4/iplgetsp.c delete mode 100644 nx-X11/programs/Xserver/iplan2p4/iplhrzvert.c delete mode 100644 nx-X11/programs/Xserver/iplan2p4/iplimage.c delete mode 100644 nx-X11/programs/Xserver/iplan2p4/iplline.c delete mode 100644 nx-X11/programs/Xserver/iplan2p4/iplmap.h delete mode 100644 nx-X11/programs/Xserver/iplan2p4/iplmergerop.h delete mode 100644 nx-X11/programs/Xserver/iplan2p4/iplmskbits.c delete mode 100644 nx-X11/programs/Xserver/iplan2p4/iplmskbits.h delete mode 100644 nx-X11/programs/Xserver/iplan2p4/iplpack.c delete mode 100644 nx-X11/programs/Xserver/iplan2p4/iplpack.h delete mode 100644 nx-X11/programs/Xserver/iplan2p4/iplpixmap.c delete mode 100644 nx-X11/programs/Xserver/iplan2p4/iplply1rct.c delete mode 100644 nx-X11/programs/Xserver/iplan2p4/iplpntwin.c delete mode 100644 nx-X11/programs/Xserver/iplan2p4/iplpolypnt.c delete mode 100644 nx-X11/programs/Xserver/iplan2p4/iplrrop.c delete mode 100644 nx-X11/programs/Xserver/iplan2p4/iplrrop.h delete mode 100644 nx-X11/programs/Xserver/iplan2p4/iplscrinit.c delete mode 100644 nx-X11/programs/Xserver/iplan2p4/iplsetsp.c delete mode 100644 nx-X11/programs/Xserver/iplan2p4/iplsolid.c delete mode 100644 nx-X11/programs/Xserver/iplan2p4/ipltegblt.c delete mode 100644 nx-X11/programs/Xserver/iplan2p4/ipltile32.c delete mode 100644 nx-X11/programs/Xserver/iplan2p4/ipltileodd.c delete mode 100644 nx-X11/programs/Xserver/iplan2p4/iplwindow.c delete mode 100644 nx-X11/programs/Xserver/iplan2p8/Imakefile delete mode 100644 nx-X11/programs/Xserver/lbx/Imakefile delete mode 100644 nx-X11/programs/Xserver/lbx/lbxcmap.c delete mode 100644 nx-X11/programs/Xserver/lbx/lbxdata.h delete mode 100644 nx-X11/programs/Xserver/lbx/lbxdix.c delete mode 100644 nx-X11/programs/Xserver/lbx/lbxexts.c delete mode 100644 nx-X11/programs/Xserver/lbx/lbxgfx.c delete mode 100644 nx-X11/programs/Xserver/lbx/lbxmain.c delete mode 100644 nx-X11/programs/Xserver/lbx/lbxopts.c delete mode 100644 nx-X11/programs/Xserver/lbx/lbxprop.c delete mode 100644 nx-X11/programs/Xserver/lbx/lbxserve.h delete mode 100644 nx-X11/programs/Xserver/lbx/lbxsquish.c delete mode 100644 nx-X11/programs/Xserver/lbx/lbxsrvopts.h delete mode 100644 nx-X11/programs/Xserver/lbx/lbxswap.c delete mode 100644 nx-X11/programs/Xserver/lbx/lbxtables.c delete mode 100644 nx-X11/programs/Xserver/lbx/lbxtags.c delete mode 100644 nx-X11/programs/Xserver/lbx/lbxtags.h delete mode 100644 nx-X11/programs/Xserver/lbx/lbxzerorep.c delete mode 100644 nx-X11/programs/Xserver/mfb/Imakefile delete mode 100644 nx-X11/programs/Xserver/mfb/fastblt.h delete mode 100644 nx-X11/programs/Xserver/mfb/maskbits.c delete mode 100644 nx-X11/programs/Xserver/mfb/mergerop.h delete mode 100644 nx-X11/programs/Xserver/mfb/mfb.h delete mode 100644 nx-X11/programs/Xserver/mfb/mfbbitblt.c delete mode 100644 nx-X11/programs/Xserver/mfb/mfbblt.c delete mode 100644 nx-X11/programs/Xserver/mfb/mfbbres.c delete mode 100644 nx-X11/programs/Xserver/mfb/mfbbresd.c delete mode 100644 nx-X11/programs/Xserver/mfb/mfbbstore.c delete mode 100644 nx-X11/programs/Xserver/mfb/mfbclip.c delete mode 100644 nx-X11/programs/Xserver/mfb/mfbcmap.c delete mode 100644 nx-X11/programs/Xserver/mfb/mfbfillarc.c delete mode 100644 nx-X11/programs/Xserver/mfb/mfbfillrct.c delete mode 100644 nx-X11/programs/Xserver/mfb/mfbfillsp.c delete mode 100644 nx-X11/programs/Xserver/mfb/mfbfont.c delete mode 100644 nx-X11/programs/Xserver/mfb/mfbgc.c delete mode 100644 nx-X11/programs/Xserver/mfb/mfbgetsp.c delete mode 100644 nx-X11/programs/Xserver/mfb/mfbhrzvert.c delete mode 100644 nx-X11/programs/Xserver/mfb/mfbimage.c delete mode 100644 nx-X11/programs/Xserver/mfb/mfbimggblt.c delete mode 100644 nx-X11/programs/Xserver/mfb/mfbline.c delete mode 100644 nx-X11/programs/Xserver/mfb/mfbmisc.c delete mode 100644 nx-X11/programs/Xserver/mfb/mfbmodule.c delete mode 100644 nx-X11/programs/Xserver/mfb/mfbpixmap.c delete mode 100644 nx-X11/programs/Xserver/mfb/mfbply1rct.c delete mode 100644 nx-X11/programs/Xserver/mfb/mfbplygblt.c delete mode 100644 nx-X11/programs/Xserver/mfb/mfbpntarea.c delete mode 100644 nx-X11/programs/Xserver/mfb/mfbpntwin.c delete mode 100644 nx-X11/programs/Xserver/mfb/mfbpolypnt.c delete mode 100644 nx-X11/programs/Xserver/mfb/mfbpushpxl.c delete mode 100644 nx-X11/programs/Xserver/mfb/mfbscrclse.c delete mode 100644 nx-X11/programs/Xserver/mfb/mfbscrinit.c delete mode 100644 nx-X11/programs/Xserver/mfb/mfbsetsp.c delete mode 100644 nx-X11/programs/Xserver/mfb/mfbtegblt.c delete mode 100644 nx-X11/programs/Xserver/mfb/mfbtile.c delete mode 100644 nx-X11/programs/Xserver/mfb/mfbwindow.c delete mode 100644 nx-X11/programs/Xserver/mfb/mfbzerarc.c delete mode 100644 nx-X11/programs/Xserver/mfb/module/Imakefile delete mode 100644 nx-X11/programs/Xserver/miext/layer/Imakefile delete mode 100644 nx-X11/programs/Xserver/miext/layer/layer.h delete mode 100644 nx-X11/programs/Xserver/miext/layer/layergc.c delete mode 100644 nx-X11/programs/Xserver/miext/layer/layerinit.c delete mode 100644 nx-X11/programs/Xserver/miext/layer/layerpict.c delete mode 100644 nx-X11/programs/Xserver/miext/layer/layerstr.h delete mode 100644 nx-X11/programs/Xserver/miext/layer/layerwin.c delete mode 100644 nx-X11/programs/Xserver/miext/layer/laymodule.c delete mode 100644 nx-X11/programs/Xserver/miext/rootless/Imakefile delete mode 100644 nx-X11/programs/Xserver/miext/rootless/Imakefile.NX.original delete mode 100644 nx-X11/programs/Xserver/miext/rootless/Imakefile.X.original delete mode 100644 nx-X11/programs/Xserver/miext/rootless/README.txt delete mode 100644 nx-X11/programs/Xserver/miext/rootless/accel/Imakefile delete mode 100644 nx-X11/programs/Xserver/miext/rootless/accel/rlAccel.c delete mode 100644 nx-X11/programs/Xserver/miext/rootless/accel/rlAccel.h delete mode 100644 nx-X11/programs/Xserver/miext/rootless/accel/rlBlt.c delete mode 100644 nx-X11/programs/Xserver/miext/rootless/accel/rlCopy.c delete mode 100644 nx-X11/programs/Xserver/miext/rootless/accel/rlFill.c delete mode 100644 nx-X11/programs/Xserver/miext/rootless/accel/rlFillRect.c delete mode 100644 nx-X11/programs/Xserver/miext/rootless/accel/rlFillSpans.c delete mode 100644 nx-X11/programs/Xserver/miext/rootless/accel/rlGlyph.c delete mode 100644 nx-X11/programs/Xserver/miext/rootless/accel/rlSolid.c delete mode 100644 nx-X11/programs/Xserver/miext/rootless/rootless.h delete mode 100644 nx-X11/programs/Xserver/miext/rootless/rootlessCommon.c delete mode 100644 nx-X11/programs/Xserver/miext/rootless/rootlessCommon.h delete mode 100644 nx-X11/programs/Xserver/miext/rootless/rootlessConfig.h delete mode 100644 nx-X11/programs/Xserver/miext/rootless/rootlessGC.c delete mode 100644 nx-X11/programs/Xserver/miext/rootless/rootlessScreen.c delete mode 100644 nx-X11/programs/Xserver/miext/rootless/rootlessValTree.c delete mode 100644 nx-X11/programs/Xserver/miext/rootless/rootlessWindow.c delete mode 100644 nx-X11/programs/Xserver/miext/rootless/rootlessWindow.h delete mode 100644 nx-X11/programs/Xserver/miext/rootless/safeAlpha/Imakefile delete mode 100644 nx-X11/programs/Xserver/miext/rootless/safeAlpha/safeAlpha.h delete mode 100644 nx-X11/programs/Xserver/miext/rootless/safeAlpha/safeAlphaPicture.c delete mode 100644 nx-X11/programs/Xserver/miext/rootless/safeAlpha/safeAlphaWindow.c delete mode 100644 nx-X11/programs/Xserver/miext/shadow/Imakefile delete mode 100644 nx-X11/programs/Xserver/miext/shadow/shadow.c delete mode 100644 nx-X11/programs/Xserver/miext/shadow/shadow.h delete mode 100644 nx-X11/programs/Xserver/miext/shadow/shalloc.c delete mode 100644 nx-X11/programs/Xserver/miext/shadow/shmodule.c delete mode 100644 nx-X11/programs/Xserver/miext/shadow/shpacked.c delete mode 100644 nx-X11/programs/Xserver/miext/shadow/shplanar.c delete mode 100644 nx-X11/programs/Xserver/miext/shadow/shplanar8.c delete mode 100644 nx-X11/programs/Xserver/miext/shadow/shrot16pack.c delete mode 100644 nx-X11/programs/Xserver/miext/shadow/shrot16pack_180.c delete mode 100644 nx-X11/programs/Xserver/miext/shadow/shrot16pack_270.c delete mode 100644 nx-X11/programs/Xserver/miext/shadow/shrot16pack_90.c delete mode 100644 nx-X11/programs/Xserver/miext/shadow/shrot32pack.c delete mode 100644 nx-X11/programs/Xserver/miext/shadow/shrot32pack_180.c delete mode 100644 nx-X11/programs/Xserver/miext/shadow/shrot32pack_270.c delete mode 100644 nx-X11/programs/Xserver/miext/shadow/shrot32pack_90.c delete mode 100644 nx-X11/programs/Xserver/miext/shadow/shrot8pack.c delete mode 100644 nx-X11/programs/Xserver/miext/shadow/shrot8pack_180.c delete mode 100644 nx-X11/programs/Xserver/miext/shadow/shrot8pack_270.c delete mode 100644 nx-X11/programs/Xserver/miext/shadow/shrot8pack_90.c delete mode 100644 nx-X11/programs/Xserver/miext/shadow/shrotate.c delete mode 100644 nx-X11/programs/Xserver/miext/shadow/shrotpack.h (limited to 'nx-X11/programs/Xserver') diff --git a/nx-X11/programs/Xserver/GL/apple/Imakefile b/nx-X11/programs/Xserver/GL/apple/Imakefile deleted file mode 100644 index 36b780c73..000000000 --- a/nx-X11/programs/Xserver/GL/apple/Imakefile +++ /dev/null @@ -1,49 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/GL/apple/Imakefile,v 1.2 2003/09/16 00:36:11 torrey Exp $ - -#include - - XPRDIR = $(SERVERSRC)/hw/darwin/quartz/xpr - -LinkSourceFile(x-list.c,$(XPRDIR)) -LinkSourceFile(x-list.h,$(XPRDIR)) -LinkSourceFile(x-hash.c,$(XPRDIR)) -LinkSourceFile(x-hash.h,$(XPRDIR)) -LinkSourceFile(compsize.c,$(MESASRCDIR)/src/glx/x11) - - BASE_SRCS = compsize.c - BASE_OBJS = compsize.o - - AGL_SRCS = aglGlx.c - AGL_OBJS = aglGlx.o - -#if HasXplugin - GL_SRCS = indirect.c x-hash.c x-list.c - GL_OBJS = indirect.o x-hash.o x-list.o - - AS = /System/Library/Frameworks/ApplicationServices.framework - - GL_INCLUDES = -I$(LIBSRC)/GL/apple -I$(XPRDIR) -I$(XPINCDIR) \ - -F$(AS)/Frameworks -#endif - - SRCS = $(BASE_SRCS) $(AGL_SRCS) $(GL_SRCS) - OBJS = $(BASE_OBJS) $(AGL_OBJS) $(GL_OBJS) - - INCLUDES = -I. -I$(INCLUDESRC) -I$(XINCLUDESRC) -I$(EXTINCSRC) \ - -I$(LIBSRC)/GL/glx -I$(LIBSRC)/GL/include \ - -I$(SERVERSRC)/mi -I$(SERVERSRC)/include -I$(FONTINCSRC) \ - -I$(SERVERSRC)/render -I$(SERVERSRC)/GL/include \ - -I$(SERVERSRC)/GL/glx -I$(SERVERSRC)/hw/darwin/quartz/cr \ - -I$(SERVERSRC)/hw/darwin/quartz $(GL_INCLUDES) \ - -I$(MESASRCDIR)/include -I$(MESASRCDIR)/src/mesa/glapi \ - -I$(XF86OSSRC) - - DEFINES = $(GLX_DEFINES) - -NormalLibraryTarget(AGLcore,$(AGL_OBJS) $(BASE_OBJS)) -#if HasXplugin -NormalLibraryTarget(CGLcore,$(GL_OBJS) $(BASE_OBJS)) -#endif -NormalLibraryObjectRule() - -DependTarget() diff --git a/nx-X11/programs/Xserver/GL/apple/aglGlx.c b/nx-X11/programs/Xserver/GL/apple/aglGlx.c deleted file mode 100644 index be846be83..000000000 --- a/nx-X11/programs/Xserver/GL/apple/aglGlx.c +++ /dev/null @@ -1,1355 +0,0 @@ -/* - * GLX implementation that uses Apple's AGL.framework for OpenGL - * - * FIXME: This file and indirect.c are very similar. The two should be - * merged by introducing suitable abstractions. - */ -/* - * Copyright (c) 2002 Greg Parker. All Rights Reserved. - * Copyright (c) 2004 Torrey T. Lyons. All Rights Reserved. - * - * Large portions of this file are copied from Mesa's xf86glx.c, - * which contains the following copyright: - * - * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ -/* $XFree86: xc/programs/Xserver/GL/apple/aglGlx.c,v 1.2 2003/09/16 00:36:11 torrey Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "quartzCommon.h" -#include -#include "cr.h" - -// X11 and X11's glx -#undef BOOL -#define BOOL xBOOL -#include "quartz.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#undef BOOL - -#include "glcontextmodes.h" - -// ggs: needed to call back to glx with visual configs -extern void GlxSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs, void **configprivs); - -// Write debugging output, or not -#ifdef GLAQUA_DEBUG -#define GLAQUA_DEBUG_MSG ErrorF -#else -#define GLAQUA_DEBUG_MSG(a, ...) -#endif - - -// The following GL functions don't have an EXT suffix in OpenGL.framework. -GLboolean glAreTexturesResidentEXT (GLsizei a, const GLuint *b, GLboolean *c) { - return glAreTexturesResident(a, b, c); -} -void glDeleteTexturesEXT (GLsizei d, const GLuint *e) { - glDeleteTextures(d, e); -} -void glGenTexturesEXT (GLsizei f, GLuint *g) { - glGenTextures(f, g); -} -GLboolean glIsTextureEXT (GLuint h) { - return glIsTexture(h); -} - - -// some prototypes -static Bool glAquaScreenProbe(int screen); -static Bool glAquaInitVisuals(VisualPtr *visualp, DepthPtr *depthp, - int *nvisualp, int *ndepthp, - int *rootDepthp, VisualID *defaultVisp, - unsigned long sizes, int bitsPerRGB); -static void glAquaSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs, - void **privates); -static __GLinterface *glAquaCreateContext(__GLimports *imports, - __GLcontextModes *mode, - __GLinterface *shareGC); -static void glAquaCreateBuffer(__GLXdrawablePrivate *glxPriv); -static void glAquaResetExtension(void); - - -/* - * This structure is statically allocated in the __glXScreens[] - * structure. This struct is not used anywhere other than in - * __glXScreenInit to initialize each of the active screens - * (__glXActiveScreens[]). Several of the fields must be initialized by - * the screenProbe routine before they are copied to the active screens - * struct. In particular, the contextCreate, modes, numVisuals, - * and numUsableVisuals fields must be initialized. - */ -static __GLXscreenInfo __glDDXScreenInfo = { - glAquaScreenProbe, /* Must be generic and handle all screens */ - glAquaCreateContext, /* Substitute screen's createContext routine */ - glAquaCreateBuffer, /* Substitute screen's createBuffer routine */ - NULL, /* Set up modes in probe */ - NULL, /* Set up pVisualPriv in probe */ - 0, /* Set up numVisuals in probe */ - 0, /* Set up numUsableVisuals in probe */ - "Vendor String", /* GLXvendor is overwritten by __glXScreenInit */ - "Version String", /* GLXversion is overwritten by __glXScreenInit */ - "Extensions String", /* GLXextensions is overwritten by __glXScreenInit */ - NULL /* WrappedPositionWindow is overwritten */ -}; - -void *__glXglDDXScreenInfo(void) { - return &__glDDXScreenInfo; -} - -static __GLXextensionInfo __glDDXExtensionInfo = { - GL_CORE_APPLE, - glAquaResetExtension, - glAquaInitVisuals, - glAquaSetVisualConfigs -}; - -void *__glXglDDXExtensionInfo(void) { - return &__glDDXExtensionInfo; -} - -// prototypes - -static GLboolean glAquaDestroyContext(__GLcontext *gc); -static GLboolean glAquaLoseCurrent(__GLcontext *gc); -static GLboolean glAquaMakeCurrent(__GLcontext *gc); -static GLboolean glAquaShareContext(__GLcontext *gc, __GLcontext *gcShare); -static GLboolean glAquaCopyContext(__GLcontext *dst, const __GLcontext *src, - GLuint mask); -static GLboolean glAquaForceCurrent(__GLcontext *gc); - -/* Drawing surface notification callbacks */ -static GLboolean glAquaNotifyResize(__GLcontext *gc); -static void glAquaNotifyDestroy(__GLcontext *gc); -static void glAquaNotifySwapBuffers(__GLcontext *gc); - -/* Dispatch table override control for external agents like libGLS */ -static struct __GLdispatchStateRec* glAquaDispatchExec(__GLcontext *gc); -static void glAquaBeginDispatchOverride(__GLcontext *gc); -static void glAquaEndDispatchOverride(__GLcontext *gc); - - -static __GLexports glAquaExports = { - glAquaDestroyContext, - glAquaLoseCurrent, - glAquaMakeCurrent, - glAquaShareContext, - glAquaCopyContext, - glAquaForceCurrent, - - glAquaNotifyResize, - glAquaNotifyDestroy, - glAquaNotifySwapBuffers, - - glAquaDispatchExec, - glAquaBeginDispatchOverride, - glAquaEndDispatchOverride -}; - - -typedef struct { - int num_vis; - __GLcontextModes *modes; - void **priv; - - // wrapped screen functions - RealizeWindowProcPtr RealizeWindow; - UnrealizeWindowProcPtr UnrealizeWindow; -} glAquaScreenRec; - -static glAquaScreenRec glAquaScreens[MAXSCREENS]; - - -// __GLdrawablePrivate->private -typedef struct { - GLboolean (*resize)(__GLdrawableBuffer *buf, GLint x, GLint y, - GLuint width, GLuint height, - __GLdrawablePrivate *glPriv, - GLuint bufferMask); -} GLAquaDrawableRec; - -struct __GLcontextRec { - struct __GLinterfaceRec interface; // required to be first - - AGLContext ctx; - AGLPixelFormat pixelFormat; - - Bool isAttached; // TRUE if ctx is really attached to a window -}; - - -// Context manipulation; return GL_FALSE on failure -static GLboolean glAquaDestroyContext(__GLcontext *gc) -{ - GLAQUA_DEBUG_MSG("glAquaDestroyContext (ctx 0x%x)\n", gc->ctx); - - if (gc) { - if (gc->ctx) aglDestroyContext(gc->ctx); - if (gc->pixelFormat) aglDestroyPixelFormat(gc->pixelFormat); - free(gc); - } - - return GL_TRUE; -} - - -static GLboolean glAquaLoseCurrent(__GLcontext *gc) -{ - GLAQUA_DEBUG_MSG("glAquaLoseCurrent (ctx 0x%x)\n", gc->ctx); - - aglSetCurrentContext(NULL); - __glXLastContext = NULL; // Mesa does this; why? - gc->isAttached = FALSE; - - return GL_TRUE; -} - - -/* - * Attach a GL context to a GL drawable - * If glPriv is NULL, the context is detached. - */ -static void attach(__GLcontext *gc, __GLdrawablePrivate *glPriv) -{ - __GLXdrawablePrivate *glxPriv; - - if (glPriv == NULL) { - // attaching to nothing - GLAQUA_DEBUG_MSG("unattaching\n"); - aglSetDrawable(gc->ctx, NULL); - gc->isAttached = FALSE; - return; - } - - // Note that when resizing, the X11 WindowPtr already has its - // new size and position, but the Aqua window does not. - - glxPriv = (__GLXdrawablePrivate *)glPriv->other; - - if (glxPriv->type == DRAWABLE_WINDOW) { - WindowPtr pWin = (WindowPtr) glxPriv->pDraw; - WindowPtr topWin = quartzProcs->TopLevelParent(pWin); - CRWindowPtr crWinPtr; - AGLDrawable newPort; - - if (glPriv->width <= 0 || glPriv->height <= 0) { - // attach to zero size drawable - will really attach later - GLAQUA_DEBUG_MSG("couldn't attach to zero size drawable\n"); - aglSetDrawable(gc->ctx, NULL); - gc->isAttached = FALSE; - return; - } - - crWinPtr = (CRWindowPtr) quartzProcs->FrameForWindow(pWin, FALSE); - - if (crWinPtr) { - newPort = (AGLDrawable) crWinPtr->port; - } else { - newPort = NULL; - } - - if (newPort) { - // FIXME: won't be a CGrafPtr if currently offscreen or fullscreen - AGLDrawable oldPort = aglGetDrawable(gc->ctx); - // AGLDrawable newPort = GetWindowPort(window); - - // Frame is GLdrawable in X11 global coordinates - // FIXME: Does this work for multiple screens? - GLint frame[4] = {glPriv->xOrigin, glPriv->yOrigin, glPriv->width, glPriv->height}; - GLAQUA_DEBUG_MSG("global size %d %d %d %d\n", - frame[0], frame[1], frame[2], frame[3]); - - // Convert to window-local coordinates - frame[0] -= topWin->drawable.x - topWin->borderWidth; - frame[1] -= topWin->drawable.y - topWin->borderWidth; - - // AGL uses flipped coordinates - frame[1] = topWin->drawable.height + 2*topWin->borderWidth - - frame[1] - frame[3]; - - GLAQUA_DEBUG_MSG("local size %d %d %d %d\n", - frame[0], frame[1], frame[2], frame[3]); - - if (oldPort != newPort) { - // FIXME: retain/release windows - if (!aglSetDrawable(gc->ctx, newPort)) return; - } - if (!aglSetInteger(gc->ctx, AGL_BUFFER_RECT, frame)) return; - if (!aglEnable(gc->ctx, AGL_BUFFER_RECT)) return; - if (!aglSetInteger(gc->ctx, AGL_SWAP_RECT, frame)) return; - if (!aglEnable(gc->ctx, AGL_SWAP_RECT)) return; - if (!aglUpdateContext(gc->ctx)) return; - - gc->isAttached = TRUE; - GLAQUA_DEBUG_MSG("attached context 0x%x to window 0x%x\n", gc->ctx, - pWin->drawable.id); - } else { - // attach to not-yet-realized window - will really attach later - GLAQUA_DEBUG_MSG("couldn't attach to unrealized window\n"); - aglSetDrawable(gc->ctx, NULL); - gc->isAttached = FALSE; - } - } else { - GLAQUA_DEBUG_MSG("attach: attach to non-window unimplemented\n"); - aglSetDrawable(gc->ctx, NULL); - gc->isAttached = FALSE; - } -} - -static GLboolean glAquaMakeCurrent(__GLcontext *gc) -{ - __GLdrawablePrivate *glPriv = gc->interface.imports.getDrawablePrivate(gc); - - GLAQUA_DEBUG_MSG("glAquaMakeCurrent (ctx 0x%x)\n", gc->ctx); - - if (!gc->isAttached) { - attach(gc, glPriv); - } - - return aglSetCurrentContext(gc->ctx); -} - -static GLboolean glAquaShareContext(__GLcontext *gc, __GLcontext *gcShare) -{ - GLAQUA_DEBUG_MSG("glAquaShareContext unimplemented\n"); - - return GL_TRUE; -} - - -static GLboolean glAquaCopyContext(__GLcontext *dst, const __GLcontext *src, - GLuint mask) -{ - GLAQUA_DEBUG_MSG("glAquaCopyContext\n"); - - return aglCopyContext(src->ctx, dst->ctx, mask); -} - -static GLboolean glAquaForceCurrent(__GLcontext *gc) -{ - // GLAQUA_DEBUG_MSG("glAquaForceCurrent (ctx 0x%x)\n", gc->ctx); - return aglSetCurrentContext(gc->ctx); -} - -/* Drawing surface notification callbacks */ - -static GLboolean glAquaNotifyResize(__GLcontext *gc) -{ - GLAQUA_DEBUG_MSG("unimplemented glAquaNotifyResize"); - return GL_TRUE; -} - -static void glAquaNotifyDestroy(__GLcontext *gc) -{ - GLAQUA_DEBUG_MSG("unimplemented glAquaNotifyDestroy"); -} - -static void glAquaNotifySwapBuffers(__GLcontext *gc) -{ - GLAQUA_DEBUG_MSG("unimplemented glAquaNotifySwapBuffers"); -} - -/* Dispatch table override control for external agents like libGLS */ -static struct __GLdispatchStateRec* glAquaDispatchExec(__GLcontext *gc) -{ - GLAQUA_DEBUG_MSG("unimplemented glAquaDispatchExec"); - return NULL; -} - -static void glAquaBeginDispatchOverride(__GLcontext *gc) -{ - GLAQUA_DEBUG_MSG("unimplemented glAquaBeginDispatchOverride"); -} - -static void glAquaEndDispatchOverride(__GLcontext *gc) -{ - GLAQUA_DEBUG_MSG("unimplemented glAquaEndDispatchOverride"); -} - - -static AGLPixelFormat makeFormat(__GLcontextModes *mode) -{ - int i; - GLint attr[64]; // currently uses max of 30 - AGLPixelFormat result; - - GLAQUA_DEBUG_MSG("makeFormat\n"); - - i = 0; - - // attr [i++] = AGL_ACCELERATED; // require hwaccel - BAD for multiscreen - // attr [i++] = AGL_NO_RECOVERY; // disable fallback renderers - BAD - - if (mode->stereoMode) { - attr[i++] = AGL_STEREO; - } - if (mode->doubleBufferMode) { - attr[i++] = AGL_DOUBLEBUFFER; - } - - if (mode->colorIndexMode) { - attr[i++] = AGL_BUFFER_SIZE; - attr[i++] = mode->indexBits; - } - - if (mode->rgbMode) { - attr[i++] = AGL_RGBA; - attr[i++] = AGL_RED_SIZE; - attr[i++] = mode->redBits; - attr[i++] = AGL_GREEN_SIZE; - attr[i++] = mode->greenBits; - attr[i++] = AGL_BLUE_SIZE; - attr[i++] = mode->blueBits; - attr[i++] = AGL_ALPHA_SIZE; - attr[i++] = mode->alphaBits; - } - - if (mode->haveAccumBuffer) { - attr[i++] = AGL_ACCUM_RED_SIZE; - attr[i++] = mode->accumRedBits; - attr[i++] = AGL_ACCUM_GREEN_SIZE; - attr[i++] = mode->accumGreenBits; - attr[i++] = AGL_ACCUM_BLUE_SIZE; - attr[i++] = mode->accumBlueBits; - attr[i++] = AGL_ACCUM_ALPHA_SIZE; - attr[i++] = mode->accumAlphaBits; - } - if (mode->haveDepthBuffer) { - attr[i++] = AGL_DEPTH_SIZE; - attr[i++] = mode->depthBits; - } - if (mode->haveStencilBuffer) { - attr[i++] = AGL_STENCIL_SIZE; - attr[i++] = mode->stencilBits; - } - - attr[i++] = AGL_AUX_BUFFERS; - attr[i++] = mode->numAuxBuffers; - - attr[i++] = AGL_LEVEL; - attr[i++] = mode->level; - - // mode->pixmapMode ? - - attr[i++] = AGL_NONE; // end of option list - - GLAQUA_DEBUG_MSG("makeFormat almost done\n"); - result = aglChoosePixelFormat(NULL, 0, attr); - GLAQUA_DEBUG_MSG("makeFormat done (0x%x)\n", result); - return result; -} - -static __GLinterface *glAquaCreateContext(__GLimports *imports, - __GLcontextModes *mode, - __GLinterface *shareGC) -{ - __GLcontext *result; - __GLcontext *sharectx = (__GLcontext *)shareGC; - - GLAQUA_DEBUG_MSG("glAquaCreateContext\n"); - - result = (__GLcontext *)calloc(1, sizeof(__GLcontext)); - if (!result) return NULL; - - result->interface.imports = *imports; - result->interface.exports = glAquaExports; - - result->pixelFormat = makeFormat(mode); - if (!result->pixelFormat) { - free(result); - return NULL; - } - - result->ctx = aglCreateContext(result->pixelFormat, - (sharectx && sharectx->ctx) ? sharectx->ctx : NULL); - - if (!result->ctx) { - aglDestroyPixelFormat(result->pixelFormat); - free(result); - return NULL; - } - - result->isAttached = FALSE; - - GLAQUA_DEBUG_MSG("glAquaCreateContext done\n"); - return (__GLinterface *)result; -} - - -Bool -glAquaRealizeWindow(WindowPtr pWin) -{ - // If this window has GL contexts, tell them to reattach - Bool result; - ScreenPtr pScreen = pWin->drawable.pScreen; - glAquaScreenRec *screenPriv = &glAquaScreens[pScreen->myNum]; - __GLXdrawablePrivate *glxPriv; - - GLAQUA_DEBUG_MSG("glAquaRealizeWindow\n"); - - // Allow the window to be created (RootlessRealizeWindow is inside our wrap) - pScreen->RealizeWindow = screenPriv->RealizeWindow; - result = pScreen->RealizeWindow(pWin); - pScreen->RealizeWindow = glAquaRealizeWindow; - - // The Aqua window will already have been created (windows are - // realized from top down) - - // Re-attach this window's GL contexts, if any. - glxPriv = __glXFindDrawablePrivate(pWin->drawable.id); - if (glxPriv) { - __GLXcontext *gx; - __GLcontext *gc; - __GLdrawablePrivate *glPriv = &glxPriv->glPriv; - GLAQUA_DEBUG_MSG("glAquaRealizeWindow is GL drawable!\n"); - - // GL contexts bound to this window for drawing - for (gx = glxPriv->drawGlxc; gx != NULL; gx = gx->nextDrawPriv) { - gc = (__GLcontext *)gx->gc; - attach(gc, glPriv); - } - - // GL contexts bound to this window for reading - for (gx = glxPriv->readGlxc; gx != NULL; gx = gx->nextReadPriv) { - gc = (__GLcontext *)gx->gc; - attach(gc, glPriv); - } - } - - return result; -} - -Bool -glAquaUnrealizeWindow(WindowPtr pWin) -{ - // If this window has GL contexts, tell them to unattach - Bool result; - ScreenPtr pScreen = pWin->drawable.pScreen; - glAquaScreenRec *screenPriv = &glAquaScreens[pScreen->myNum]; - __GLXdrawablePrivate *glxPriv; - - GLAQUA_DEBUG_MSG("glAquaUnrealizeWindow\n"); - - // The Aqua window may have already been destroyed (windows - // are unrealized from top down) - - // Unattach this window's GL contexts, if any. - glxPriv = __glXFindDrawablePrivate(pWin->drawable.id); - if (glxPriv) { - __GLXcontext *gx; - __GLcontext *gc; - GLAQUA_DEBUG_MSG("glAquaUnealizeWindow is GL drawable!\n"); - - // GL contexts bound to this window for drawing - for (gx = glxPriv->drawGlxc; gx != NULL; gx = gx->nextDrawPriv) { - gc = (__GLcontext *)gx->gc; - attach(gc, NULL); - } - - // GL contexts bound to this window for reading - for (gx = glxPriv->readGlxc; gx != NULL; gx = gx->nextReadPriv) { - gc = (__GLcontext *)gx->gc; - attach(gc, NULL); - } - } - - pScreen->UnrealizeWindow = screenPriv->UnrealizeWindow; - result = pScreen->UnrealizeWindow(pWin); - pScreen->UnrealizeWindow = glAquaUnrealizeWindow; - - return result; -} - - -// Originally copied from Mesa - -static int numConfigs = 0; -static __GLXvisualConfig *visualConfigs = NULL; -static void **visualPrivates = NULL; - -/* - * In the case the driver defines no GLX visuals we'll use these. - * Note that for TrueColor and DirectColor visuals, bufferSize is the - * sum of redSize, greenSize, blueSize and alphaSize, which may be larger - * than the nplanes/rootDepth of the server's X11 visuals - */ -#define NUM_FALLBACK_CONFIGS 5 -static __GLXvisualConfig FallbackConfigs[NUM_FALLBACK_CONFIGS] = { - /* [0] = RGB, double buffered, Z */ - { - -1, /* vid */ - -1, /* class */ - True, /* rgba */ - -1, -1, -1, 0, /* rgba sizes */ - -1, -1, -1, 0, /* rgba masks */ - 0, 0, 0, 0, /* rgba accum sizes */ - True, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 0, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE, /* visualRating */ - GLX_NONE, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ - }, - /* [1] = RGB, double buffered, Z, stencil, accum */ - { - -1, /* vid */ - -1, /* class */ - True, /* rgba */ - -1, -1, -1, 0, /* rgba sizes */ - -1, -1, -1, 0, /* rgba masks */ - 16, 16, 16, 0, /* rgba accum sizes */ - True, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 8, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE, /* visualRating */ - GLX_NONE, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ - }, - /* [2] = RGB+Alpha, double buffered, Z, stencil, accum */ - { - -1, /* vid */ - -1, /* class */ - True, /* rgba */ - -1, -1, -1, 8, /* rgba sizes */ - -1, -1, -1, -1, /* rgba masks */ - 16, 16, 16, 16, /* rgba accum sizes */ - True, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 8, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE, /* visualRating */ - GLX_NONE, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ - }, - /* [3] = RGB+Alpha, single buffered, Z, stencil, accum */ - { - -1, /* vid */ - -1, /* class */ - True, /* rgba */ - -1, -1, -1, 8, /* rgba sizes */ - -1, -1, -1, -1, /* rgba masks */ - 16, 16, 16, 16, /* rgba accum sizes */ - False, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 8, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE, /* visualRating */ - GLX_NONE, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ - }, - /* [4] = CI, double buffered, Z */ - { - -1, /* vid */ - -1, /* class */ - False, /* rgba? (false = color index) */ - -1, -1, -1, 0, /* rgba sizes */ - -1, -1, -1, 0, /* rgba masks */ - 0, 0, 0, 0, /* rgba accum sizes */ - True, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 0, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE, /* visualRating */ - GLX_NONE, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ - }, -}; - -static __GLXvisualConfig NullConfig = { - -1, /* vid */ - -1, /* class */ - False, /* rgba */ - -1, -1, -1, 0, /* rgba sizes */ - -1, -1, -1, 0, /* rgba masks */ - 0, 0, 0, 0, /* rgba accum sizes */ - False, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 0, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE_EXT, /* visualRating */ - 0, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ -}; - - -static int count_bits(unsigned int n) -{ - int bits = 0; - - while (n > 0) { - if (n & 1) bits++; - n >>= 1; - } - return bits; -} - - -static Bool init_visuals(int *nvisualp, VisualPtr *visualp, - VisualID *defaultVisp, - int ndepth, DepthPtr pdepth, - int rootDepth) -{ - int numRGBconfigs; - int numCIconfigs; - int numVisuals = *nvisualp; - int numNewVisuals; - int numNewConfigs; - VisualPtr pVisual = *visualp; - VisualPtr pVisualNew = NULL; - VisualID *orig_vid = NULL; - __GLcontextModes *modes; - __GLXvisualConfig *pNewVisualConfigs = NULL; - void **glXVisualPriv; - void **pNewVisualPriv; - int found_default; - int i, j, k; - - GLAQUA_DEBUG_MSG("init_visuals\n"); - - if (numConfigs > 0) - numNewConfigs = numConfigs; - else - numNewConfigs = NUM_FALLBACK_CONFIGS; - - /* Alloc space for the list of new GLX visuals */ - pNewVisualConfigs = (__GLXvisualConfig *) - __glXMalloc(numNewConfigs * sizeof(__GLXvisualConfig)); - if (!pNewVisualConfigs) { - return FALSE; - } - - /* Alloc space for the list of new GLX visual privates */ - pNewVisualPriv = (void **) __glXMalloc(numNewConfigs * sizeof(void *)); - if (!pNewVisualPriv) { - __glXFree(pNewVisualConfigs); - return FALSE; - } - - /* - ** If SetVisualConfigs was not called, then use default GLX - ** visual configs. - */ - if (numConfigs == 0) { - memcpy(pNewVisualConfigs, FallbackConfigs, - NUM_FALLBACK_CONFIGS * sizeof(__GLXvisualConfig)); - memset(pNewVisualPriv, 0, NUM_FALLBACK_CONFIGS * sizeof(void *)); - } - else { - /* copy driver's visual config info */ - for (i = 0; i < numConfigs; i++) { - pNewVisualConfigs[i] = visualConfigs[i]; - pNewVisualPriv[i] = visualPrivates[i]; - } - } - - /* Count the number of RGB and CI visual configs */ - numRGBconfigs = 0; - numCIconfigs = 0; - for (i = 0; i < numNewConfigs; i++) { - if (pNewVisualConfigs[i].rgba) - numRGBconfigs++; - else - numCIconfigs++; - } - - /* Count the total number of visuals to compute */ - numNewVisuals = 0; - for (i = 0; i < numVisuals; i++) { - int count; - - count = ((pVisual[i].class == TrueColor || - pVisual[i].class == DirectColor) - ? numRGBconfigs : numCIconfigs); - if (count == 0) - count = 1; /* preserve the existing visual */ - - numNewVisuals += count; - } - - /* Reset variables for use with the next screen/driver's visual configs */ - visualConfigs = NULL; - numConfigs = 0; - - /* Alloc temp space for the list of orig VisualIDs for each new visual */ - orig_vid = (VisualID *)__glXMalloc(numNewVisuals * sizeof(VisualID)); - if (!orig_vid) { - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); - return FALSE; - } - - /* Alloc space for the list of glXVisuals */ - modes = _gl_context_modes_create(numNewVisuals, sizeof(__GLcontextModes)); - if (modes == NULL) { - __glXFree(orig_vid); - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); - return FALSE; - } - - /* Alloc space for the list of glXVisualPrivates */ - glXVisualPriv = (void **)__glXMalloc(numNewVisuals * sizeof(void *)); - if (!glXVisualPriv) { - _gl_context_modes_destroy( modes ); - __glXFree(orig_vid); - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); - return FALSE; - } - - /* Alloc space for the new list of the X server's visuals */ - pVisualNew = (VisualPtr)__glXMalloc(numNewVisuals * sizeof(VisualRec)); - if (!pVisualNew) { - __glXFree(glXVisualPriv); - _gl_context_modes_destroy( modes ); - __glXFree(orig_vid); - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); - return FALSE; - } - - /* Initialize the new visuals */ - found_default = FALSE; - glAquaScreens[screenInfo.numScreens-1].modes = modes; - for (i = j = 0; i < numVisuals; i++) { - int is_rgb = (pVisual[i].class == TrueColor || - pVisual[i].class == DirectColor); - - if (!is_rgb) - { - /* We don't support non-rgb visuals for GL. But we don't - want to remove them either, so just pass them through - with null glX configs */ - - pVisualNew[j] = pVisual[i]; - pVisualNew[j].vid = FakeClientID(0); - - /* Check for the default visual */ - if (!found_default && pVisual[i].vid == *defaultVisp) { - *defaultVisp = pVisualNew[j].vid; - found_default = TRUE; - } - - /* Save the old VisualID */ - orig_vid[j] = pVisual[i].vid; - - /* Initialize the glXVisual */ - _gl_copy_visual_to_context_mode( modes, & NullConfig ); - modes->visualID = pVisualNew[j].vid; - - j++; - - continue; - } - - for (k = 0; k < numNewConfigs; k++) { - if (pNewVisualConfigs[k].rgba != is_rgb) - continue; - - assert( modes != NULL ); - - /* Initialize the new visual */ - pVisualNew[j] = pVisual[i]; - pVisualNew[j].vid = FakeClientID(0); - - /* Check for the default visual */ - if (!found_default && pVisual[i].vid == *defaultVisp) { - *defaultVisp = pVisualNew[j].vid; - found_default = TRUE; - } - - /* Save the old VisualID */ - orig_vid[j] = pVisual[i].vid; - - /* Initialize the glXVisual */ - _gl_copy_visual_to_context_mode( modes, & pNewVisualConfigs[k] ); - modes->visualID = pVisualNew[j].vid; - - /* - * If the class is -1, then assume the X visual information - * is identical to what GLX needs, and take them from the X - * visual. NOTE: if class != -1, then all other fields MUST - * be initialized. - */ - if (modes->visualType == GLX_NONE) { - modes->visualType = _gl_convert_from_x_visual_type( pVisual[i].class ); - modes->redBits = count_bits(pVisual[i].redMask); - modes->greenBits = count_bits(pVisual[i].greenMask); - modes->blueBits = count_bits(pVisual[i].blueMask); - modes->alphaBits = modes->alphaBits; - modes->redMask = pVisual[i].redMask; - modes->greenMask = pVisual[i].greenMask; - modes->blueMask = pVisual[i].blueMask; - modes->alphaMask = modes->alphaMask; - modes->rgbBits = (is_rgb) - ? (modes->redBits + modes->greenBits + - modes->blueBits + modes->alphaBits) - : rootDepth; - } - - /* Save the device-dependent private for this visual */ - glXVisualPriv[j] = pNewVisualPriv[k]; - - j++; - modes = modes->next; - } - } - - assert(j <= numNewVisuals); - - /* Save the GLX visuals in the screen structure */ - glAquaScreens[screenInfo.numScreens-1].num_vis = numNewVisuals; - glAquaScreens[screenInfo.numScreens-1].priv = glXVisualPriv; - - /* Set up depth's VisualIDs */ - for (i = 0; i < ndepth; i++) { - int numVids = 0; - VisualID *pVids = NULL; - int k, n = 0; - - /* Count the new number of VisualIDs at this depth */ - for (j = 0; j < pdepth[i].numVids; j++) - for (k = 0; k < numNewVisuals; k++) - if (pdepth[i].vids[j] == orig_vid[k]) - numVids++; - - /* Allocate a new list of VisualIDs for this depth */ - pVids = (VisualID *)__glXMalloc(numVids * sizeof(VisualID)); - - /* Initialize the new list of VisualIDs for this depth */ - for (j = 0; j < pdepth[i].numVids; j++) - for (k = 0; k < numNewVisuals; k++) - if (pdepth[i].vids[j] == orig_vid[k]) - pVids[n++] = pVisualNew[k].vid; - - /* Update this depth's list of VisualIDs */ - __glXFree(pdepth[i].vids); - pdepth[i].vids = pVids; - pdepth[i].numVids = numVids; - } - - /* Update the X server's visuals */ - *nvisualp = numNewVisuals; - *visualp = pVisualNew; - - /* Free the old list of the X server's visuals */ - __glXFree(pVisual); - - /* Clean up temporary allocations */ - __glXFree(orig_vid); - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); - - /* Free the private list created by DDX HW driver */ - if (visualPrivates) - xfree(visualPrivates); - visualPrivates = NULL; - - return TRUE; -} - -/* based on code in i830_dri.c - This ends calling glAquaSetVisualConfigs to set the static - numconfigs, etc. */ -static void -glAquaInitVisualConfigs(void) -{ - int lclNumConfigs = 0; - __GLXvisualConfig *lclVisualConfigs = NULL; - void **lclVisualPrivates = NULL; - - int depth, aux, buffers, stencil, accum; - int i = 0; - - GLAQUA_DEBUG_MSG("glAquaInitVisualConfigs "); - - /* count num configs: - 2 Z buffer (0, 24 bit) - 2 AUX buffer (0, 2) - 2 buffers (single, double) - 2 stencil (0, 8 bit) - 2 accum (0, 64 bit) - = 32 configs */ - - lclNumConfigs = 2 * 2 * 2 * 2 * 2; /* 32 */ - - /* alloc */ - lclVisualConfigs = xcalloc(sizeof(__GLXvisualConfig), lclNumConfigs); - lclVisualPrivates = xcalloc(sizeof(void *), lclNumConfigs); - - /* fill in configs */ - if (NULL != lclVisualConfigs) { - i = 0; /* current buffer */ - for (depth = 0; depth < 2; depth++) { - for (aux = 0; aux < 2; aux++) { - for (buffers = 0; buffers < 2; buffers++) { - for (stencil = 0; stencil < 2; stencil++) { - for (accum = 0; accum < 2; accum++) { - lclVisualConfigs[i].vid = -1; - lclVisualConfigs[i].class = -1; - lclVisualConfigs[i].rgba = TRUE; - lclVisualConfigs[i].redSize = -1; - lclVisualConfigs[i].greenSize = -1; - lclVisualConfigs[i].blueSize = -1; - lclVisualConfigs[i].redMask = -1; - lclVisualConfigs[i].greenMask = -1; - lclVisualConfigs[i].blueMask = -1; - lclVisualConfigs[i].alphaMask = 0; - if (accum) { - lclVisualConfigs[i].accumRedSize = 16; - lclVisualConfigs[i].accumGreenSize = 16; - lclVisualConfigs[i].accumBlueSize = 16; - lclVisualConfigs[i].accumAlphaSize = 16; - } - else { - lclVisualConfigs[i].accumRedSize = 0; - lclVisualConfigs[i].accumGreenSize = 0; - lclVisualConfigs[i].accumBlueSize = 0; - lclVisualConfigs[i].accumAlphaSize = 0; - } - lclVisualConfigs[i].doubleBuffer = buffers ? TRUE : FALSE; - lclVisualConfigs[i].stereo = FALSE; - lclVisualConfigs[i].bufferSize = -1; - - lclVisualConfigs[i].depthSize = depth? 24 : 0; - lclVisualConfigs[i].stencilSize = stencil ? 8 : 0; - lclVisualConfigs[i].auxBuffers = aux ? 2 : 0; - lclVisualConfigs[i].level = 0; - lclVisualConfigs[i].visualRating = GLX_NONE_EXT; - lclVisualConfigs[i].transparentPixel = 0; - lclVisualConfigs[i].transparentRed = 0; - lclVisualConfigs[i].transparentGreen = 0; - lclVisualConfigs[i].transparentBlue = 0; - lclVisualConfigs[i].transparentAlpha = 0; - lclVisualConfigs[i].transparentIndex = 0; - i++; - } - } - } - } - } - } - if (i != lclNumConfigs) - GLAQUA_DEBUG_MSG("glAquaInitVisualConfigs failed to alloc visual configs"); - - GlxSetVisualConfigs(lclNumConfigs, lclVisualConfigs, lclVisualPrivates); -} - - -static void glAquaSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs, - void **privates) -{ - GLAQUA_DEBUG_MSG("glAquaSetVisualConfigs\n"); - - numConfigs = nconfigs; - visualConfigs = configs; - visualPrivates = privates; -} - -static Bool glAquaInitVisuals(VisualPtr *visualp, DepthPtr *depthp, - int *nvisualp, int *ndepthp, - int *rootDepthp, VisualID *defaultVisp, - unsigned long sizes, int bitsPerRGB) -{ - GLAQUA_DEBUG_MSG("glAquaInitVisuals\n"); - - if (numConfigs == 0) /* if no configs */ - glAquaInitVisualConfigs(); /* ensure the visual configs are setup */ - - /* - * Setup the visuals supported by this particular screen. - */ - return init_visuals(nvisualp, visualp, defaultVisp, - *ndepthp, *depthp, *rootDepthp); -} - - -static void fixup_visuals(int screen) -{ - ScreenPtr pScreen = screenInfo.screens[screen]; - glAquaScreenRec *pScr = &glAquaScreens[screen]; - int j; - __GLcontextModes *modes; - - GLAQUA_DEBUG_MSG("fixup_visuals\n"); - - for ( modes = pScr->modes ; modes != NULL ; modes = modes->next ) { - const int vis_class = _gl_convert_to_x_visual_type( modes->visualType ); - const int nplanes = (modes->rgbBits - modes->alphaBits); - const VisualPtr pVis = pScreen->visuals; - - /* Find a visual that matches the GLX visual's class and size */ - for (j = 0; j < pScreen->numVisuals; j++) { - if (pVis[j].class == vis_class && - pVis[j].nplanes == nplanes) { - - /* Fixup the masks */ - modes->redMask = pVis[j].redMask; - modes->greenMask = pVis[j].greenMask; - modes->blueMask = pVis[j].blueMask; - - /* Recalc the sizes */ - modes->redBits = count_bits(modes->redMask); - modes->greenBits = count_bits(modes->greenMask); - modes->blueBits = count_bits(modes->blueMask); - } - } - } -} - -static void init_screen_visuals(int screen) -{ - ScreenPtr pScreen = screenInfo.screens[screen]; - __GLcontextModes *modes; - int *used; - int i, j; - - GLAQUA_DEBUG_MSG("init_screen_visuals\n"); - - /* FIXME: Change 'used' to be a array of bits (rather than of ints), - * FIXME: create a stack array of 8 or 16 bytes. If 'numVisuals' is less - * FIXME: than 64 or 128 the stack array can be used instead of calling - * FIXME: __glXMalloc / __glXFree. If nothing else, convert 'used' to - * FIXME: array of bytes instead of ints! - */ - used = (int *)__glXMalloc(pScreen->numVisuals * sizeof(int)); - __glXMemset(used, 0, pScreen->numVisuals * sizeof(int)); - - i = 0; - for ( modes = glAquaScreens[screen].modes - ; modes != NULL - ; modes = modes->next ) { - const int vis_class = _gl_convert_to_x_visual_type( modes->visualType ); - const int nplanes = (modes->rgbBits - modes->alphaBits); - const VisualPtr pVis = pScreen->visuals; - - for (j = 0; j < pScreen->numVisuals; j++) { - if (pVis[j].class == vis_class && - pVis[j].nplanes == nplanes && - pVis[j].redMask == modes->redMask && - pVis[j].greenMask == modes->greenMask && - pVis[j].blueMask == modes->blueMask && - !used[j]) { - - /* Set the VisualID */ - modes->visualID = pVis[j].vid; - - /* Mark this visual used */ - used[j] = 1; - break; - } - } - if ( j == pScreen->numVisuals ) { - ErrorF("No matching visual for __GLcontextMode with " - "visual class = %d (%d), nplanes = %u\n", - vis_class, - (int)modes->visualType, - (unsigned int)(modes->rgbBits - modes->alphaBits) ); - } - else if ( modes->visualID == -1 ) { - FatalError( "Matching visual found, but visualID still -1!\n" ); - } - - i++; - } - - __glXFree(used); -} - -static Bool glAquaScreenProbe(int screen) -{ - ScreenPtr pScreen; - glAquaScreenRec *screenPriv; - - GLAQUA_DEBUG_MSG("glAquaScreenProbe\n"); - - /* - * Set up the current screen's visuals. - */ - __glDDXScreenInfo.modes = glAquaScreens[screen].modes; - __glDDXScreenInfo.pVisualPriv = glAquaScreens[screen].priv; - __glDDXScreenInfo.numVisuals = - __glDDXScreenInfo.numUsableVisuals = glAquaScreens[screen].num_vis; - - /* - * Set the current screen's createContext routine. This could be - * wrapped by a DDX GLX context creation routine. - */ - __glDDXScreenInfo.createContext = glAquaCreateContext; - - /* - * The ordering of the rgb compenents might have been changed by the - * driver after mi initialized them. - */ - fixup_visuals(screen); - - /* - * Find the GLX visuals that are supported by this screen and create - * XMesa's visuals. - */ - init_screen_visuals(screen); - - /* - * Wrap RealizeWindow and UnrealizeWindow on this screen - */ - pScreen = screenInfo.screens[screen]; - screenPriv = &glAquaScreens[screen]; - screenPriv->RealizeWindow = pScreen->RealizeWindow; - pScreen->RealizeWindow = glAquaRealizeWindow; - screenPriv->UnrealizeWindow = pScreen->UnrealizeWindow; - pScreen->UnrealizeWindow = glAquaUnrealizeWindow; - - return TRUE; -} - - -static GLboolean glAquaResizeBuffers(__GLdrawableBuffer *buffer, - GLint x, GLint y, - GLuint width, GLuint height, - __GLdrawablePrivate *glPriv, - GLuint bufferMask) -{ - GLAquaDrawableRec *aquaPriv = (GLAquaDrawableRec *)glPriv->private; - __GLXdrawablePrivate *glxPriv = (__GLXdrawablePrivate *)glPriv->other; - __GLXcontext *gx; - __GLcontext *gc; - - GLAQUA_DEBUG_MSG("glAquaResizeBuffers to (%d %d %d %d)\n", x, y, width, height); - - // update all contexts that point at this drawable for drawing (hack?) - for (gx = glxPriv->drawGlxc; gx != NULL; gx = gx->nextDrawPriv) { - gc = (__GLcontext *)gx->gc; - attach(gc, glPriv); - } - - // update all contexts that point at this drawable for reading (hack?) - for (gx = glxPriv->readGlxc; gx != NULL; gx = gx->nextReadPriv) { - gc = (__GLcontext *)gx->gc; - attach(gc, glPriv); - } - - return aquaPriv->resize(buffer, x, y, width, height, glPriv, bufferMask); -} - - -static GLboolean glAquaSwapBuffers(__GLXdrawablePrivate *glxPriv) -{ - // fixme AGL software renderer will use properties of current QD port (bad) - - // swap buffers on only *one* of the contexts - // (e.g. the last one for drawing) - __GLcontext *gc = (__GLcontext *)glxPriv->drawGlxc->gc; - if (gc && gc->ctx) aglSwapBuffers(gc->ctx); - - return GL_TRUE; -} - -static void glAquaDestroyDrawablePrivate(__GLdrawablePrivate *glPriv) -{ - GLAQUA_DEBUG_MSG("glAquaDestroyDrawablePrivate\n"); - - free(glPriv->private); - glPriv->private = NULL; -} - -static void glAquaCreateBuffer(__GLXdrawablePrivate *glxPriv) -{ - GLAquaDrawableRec *aquaPriv = malloc(sizeof(GLAquaDrawableRec)); - __GLdrawablePrivate *glPriv = &glxPriv->glPriv; - - GLAQUA_DEBUG_MSG("glAquaCreateBuffer\n"); - - // replace swapBuffers (original is never called) - glxPriv->swapBuffers = glAquaSwapBuffers; - - // wrap front buffer resize - aquaPriv->resize = glPriv->frontBuffer.resize; - glPriv->frontBuffer.resize = glAquaResizeBuffers; - - // stash private data - glPriv->private = aquaPriv; - glPriv->freePrivate = glAquaDestroyDrawablePrivate; -} - - -static void glAquaResetExtension(void) -{ - GLAQUA_DEBUG_MSG("glAquaResetExtension\n"); - aglResetLibrary(); -} - - - -// Extra goodies for glx - -GLuint __glFloorLog2(GLuint val) -{ - int c = 0; - - while (val > 1) { - c++; - val >>= 1; - } - return c; -} diff --git a/nx-X11/programs/Xserver/GL/apple/indirect.c b/nx-X11/programs/Xserver/GL/apple/indirect.c deleted file mode 100644 index 448b1f76a..000000000 --- a/nx-X11/programs/Xserver/GL/apple/indirect.c +++ /dev/null @@ -1,1380 +0,0 @@ -/* - * GLX implementation that uses Apple's OpenGL.framework - * (Indirect rendering path) - */ -/* - * Copyright (c) 2002 Greg Parker. All Rights Reserved. - * Copyright (c) 2002 Apple Computer, Inc. - * Copyright (c) 2004 Torrey T. Lyons. All Rights Reserved. - * - * Portions of this file are copied from Mesa's xf86glx.c, - * which contains the following copyright: - * - * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ -/* $XFree86: xc/programs/Xserver/GL/apple/indirect.c,v 1.2 2003/09/16 00:36:11 torrey Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "dri.h" -#include "quartz.h" - -#include -#include -#include - -// X11 and X11's glx -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "x-hash.h" -#include "x-list.h" - -#include "glcontextmodes.h" - -// ggs: needed to call back to glx with visual configs -extern void GlxSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs, void **configprivs); - - -// Write debugging output, or not -#ifdef GLAQUA_DEBUG -#define GLAQUA_DEBUG_MSG ErrorF -#else -#define GLAQUA_DEBUG_MSG(a, ...) -#endif - - -// The following GL functions don't have an EXT suffix in OpenGL.framework. -GLboolean glAreTexturesResidentEXT(GLsizei a, const GLuint *b, GLboolean *c) { - return glAreTexturesResident(a, b, c); -} -void glDeleteTexturesEXT(GLsizei d, const GLuint *e) { - glDeleteTextures(d, e); -} -void glGenTexturesEXT(GLsizei f, GLuint *g) { - glGenTextures(f, g); -} -GLboolean glIsTextureEXT(GLuint h) { - return glIsTexture(h); -} - -// some prototypes -static Bool glAquaScreenProbe(int screen); -static Bool glAquaInitVisuals(VisualPtr *visualp, DepthPtr *depthp, - int *nvisualp, int *ndepthp, - int *rootDepthp, VisualID *defaultVisp, - unsigned long sizes, int bitsPerRGB); -static void glAquaSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs, - void **privates); -static __GLinterface *glAquaCreateContext(__GLimports *imports, - __GLcontextModes *mode, - __GLinterface *shareGC); -static void glAquaCreateBuffer(__GLXdrawablePrivate *glxPriv); -static void glAquaResetExtension(void); - -/* - * This structure is statically allocated in the __glXScreens[] - * structure. This struct is not used anywhere other than in - * __glXScreenInit to initialize each of the active screens - * (__glXActiveScreens[]). Several of the fields must be initialized by - * the screenProbe routine before they are copied to the active screens - * struct. In particular, the contextCreate, modes, numVisuals, - * and numUsableVisuals fields must be initialized. - */ -static __GLXscreenInfo __glDDXScreenInfo = { - glAquaScreenProbe, /* Must be generic and handle all screens */ - glAquaCreateContext, /* Substitute screen's createContext routine */ - glAquaCreateBuffer, /* Substitute screen's createBuffer routine */ - NULL, /* Set up modes in probe */ - NULL, /* Set up pVisualPriv in probe */ - 0, /* Set up numVisuals in probe */ - 0, /* Set up numUsableVisuals in probe */ - "Vendor String", /* GLXvendor is overwritten by __glXScreenInit */ - "Version String", /* GLXversion is overwritten by __glXScreenInit */ - "Extensions String", /* GLXextensions is overwritten by __glXScreenInit */ - NULL /* WrappedPositionWindow is overwritten */ -}; - -void *__glXglDDXScreenInfo(void) { - return &__glDDXScreenInfo; -} - -static __GLXextensionInfo __glDDXExtensionInfo = { - GL_CORE_APPLE, - glAquaResetExtension, - glAquaInitVisuals, - glAquaSetVisualConfigs -}; - -void *__glXglDDXExtensionInfo(void) { - return &__glDDXExtensionInfo; -} - -// prototypes - -static GLboolean glAquaDestroyContext(__GLcontext *gc); -static GLboolean glAquaLoseCurrent(__GLcontext *gc); -static GLboolean glAquaMakeCurrent(__GLcontext *gc); -static GLboolean glAquaShareContext(__GLcontext *gc, __GLcontext *gcShare); -static GLboolean glAquaCopyContext(__GLcontext *dst, const __GLcontext *src, - GLuint mask); -static GLboolean glAquaForceCurrent(__GLcontext *gc); - -/* Drawing surface notification callbacks */ -static GLboolean glAquaNotifyResize(__GLcontext *gc); -static void glAquaNotifyDestroy(__GLcontext *gc); -static void glAquaNotifySwapBuffers(__GLcontext *gc); - -/* Dispatch table override control for external agents like libGLS */ -static struct __GLdispatchStateRec* glAquaDispatchExec(__GLcontext *gc); -static void glAquaBeginDispatchOverride(__GLcontext *gc); -static void glAquaEndDispatchOverride(__GLcontext *gc); - -static __GLexports glAquaExports = { - glAquaDestroyContext, - glAquaLoseCurrent, - glAquaMakeCurrent, - glAquaShareContext, - glAquaCopyContext, - glAquaForceCurrent, - - glAquaNotifyResize, - glAquaNotifyDestroy, - glAquaNotifySwapBuffers, - - glAquaDispatchExec, - glAquaBeginDispatchOverride, - glAquaEndDispatchOverride -}; - -typedef struct { - int num_vis; - __GLcontextModes *modes; - void **priv; - - // wrapped screen functions - RealizeWindowProcPtr RealizeWindow; - UnrealizeWindowProcPtr UnrealizeWindow; -} glAquaScreenRec; - -static glAquaScreenRec glAquaScreens[MAXSCREENS]; - -// __GLdrawablePrivate->private -typedef struct { - DrawablePtr pDraw; - xp_surface_id sid; -} GLAquaDrawableRec; - -struct __GLcontextRec { - struct __GLinterfaceRec interface; // required to be first - - CGLContextObj ctx; - CGLPixelFormatObj pixelFormat; - - /* set when attached */ - xp_surface_id sid; - - unsigned isAttached :1; -}; - -/* maps from surface id -> list of __GLcontext */ -static x_hash_table *surface_hash; - - -// Context manipulation; return GL_FALSE on failure -static GLboolean glAquaDestroyContext(__GLcontext *gc) -{ - x_list *lst; - - GLAQUA_DEBUG_MSG("glAquaDestroyContext (ctx 0x%x)\n", - (unsigned int) gc->ctx); - - if (gc != NULL) - { - if (gc->sid != 0 && surface_hash != NULL) - { - lst = x_hash_table_lookup(surface_hash, (void *) gc->sid, NULL); - lst = x_list_remove(lst, gc); - x_hash_table_insert(surface_hash, (void *) gc->sid, lst); - } - - if (gc->ctx != NULL) - CGLDestroyContext(gc->ctx); - - if (gc->pixelFormat != NULL) - CGLDestroyPixelFormat(gc->pixelFormat); - - free(gc); - } - - return GL_TRUE; -} - -static GLboolean glAquaLoseCurrent(__GLcontext *gc) -{ - CGLError gl_err; - - GLAQUA_DEBUG_MSG("glAquaLoseCurrent (ctx 0x%x)\n", (unsigned int) gc->ctx); - - gl_err = CGLSetCurrentContext(NULL); - if (gl_err != 0) - ErrorF("CGLSetCurrentContext error: %s\n", CGLErrorString(gl_err)); - - __glXLastContext = NULL; // Mesa does this; why? - - return GL_TRUE; -} - -/* Called when a surface is destroyed as a side effect of destroying - the window it's attached to. */ -static void surface_notify(void *_arg, void *data) -{ - DRISurfaceNotifyArg *arg = _arg; - GLAquaDrawableRec *aquaPriv = data; - __GLcontext *gc; - x_list *lst; - - switch (arg->kind) - { - case AppleDRISurfaceNotifyDestroyed: - if (surface_hash != NULL) - x_hash_table_remove(surface_hash, (void *) arg->id); - - aquaPriv->pDraw = NULL; - aquaPriv->sid = 0; - break; - - case AppleDRISurfaceNotifyChanged: - if (surface_hash != NULL) - { - lst = x_hash_table_lookup(surface_hash, (void *) arg->id, NULL); - for (; lst != NULL; lst = lst->next) - { - gc = lst->data; - xp_update_gl_context(gc->ctx); - } - } - break; - } -} - -static void unattach(__GLcontext *gc) -{ - x_list *lst; - - if (gc->isAttached) - { - GLAQUA_DEBUG_MSG("unattaching\n"); - - if (surface_hash != NULL) - { - lst = x_hash_table_lookup(surface_hash, (void *) gc->sid, NULL); - lst = x_list_remove(lst, gc); - x_hash_table_insert(surface_hash, (void *) gc->sid, lst); - } - - CGLClearDrawable(gc->ctx); - gc->isAttached = FALSE; - gc->sid = 0; - } -} - -static void attach(__GLcontext *gc, __GLdrawablePrivate *glPriv) -{ - __GLXdrawablePrivate *glxPriv; - GLAquaDrawableRec *aquaPriv; - DrawablePtr pDraw; - - glxPriv = (__GLXdrawablePrivate *)glPriv->other; - aquaPriv = (GLAquaDrawableRec *)glPriv->private; - pDraw = glxPriv->pDraw; - - if (aquaPriv->sid == 0) - { - if (!quartzProcs->CreateSurface(pDraw->pScreen, pDraw->id, pDraw, - 0, &aquaPriv->sid, NULL, - surface_notify, aquaPriv)) - { - return; - } - aquaPriv->pDraw = pDraw; - } - - if (!gc->isAttached || gc->sid != aquaPriv->sid) - { - x_list *lst; - - if (xp_attach_gl_context(gc->ctx, aquaPriv->sid) != Success) - { - quartzProcs->DestroySurface(pDraw->pScreen, pDraw->id, pDraw, - surface_notify, aquaPriv); - if (surface_hash != NULL) - x_hash_table_remove(surface_hash, (void *) aquaPriv->sid); - - aquaPriv->sid = 0; - return; - } - - gc->isAttached = TRUE; - gc->sid = aquaPriv->sid; - - if (surface_hash == NULL) - surface_hash = x_hash_table_new(NULL, NULL, NULL, NULL); - - lst = x_hash_table_lookup(surface_hash, (void *) gc->sid, NULL); - if (x_list_find(lst, gc) == NULL) - { - lst = x_list_prepend(lst, gc); - x_hash_table_insert(surface_hash, (void *) gc->sid, lst); - } - - GLAQUA_DEBUG_MSG("attached 0x%x to 0x%x\n", (unsigned int) pDraw->id, - (unsigned int) aquaPriv->sid); - } -} - -static GLboolean glAquaMakeCurrent(__GLcontext *gc) -{ - __GLdrawablePrivate *glPriv = gc->interface.imports.getDrawablePrivate(gc); - CGLError gl_err; - - GLAQUA_DEBUG_MSG("glAquaMakeCurrent (ctx 0x%x)\n", (unsigned int) gc->ctx); - - attach(gc, glPriv); - - gl_err = CGLSetCurrentContext(gc->ctx); - if (gl_err != 0) - ErrorF("CGLSetCurrentContext error: %s\n", CGLErrorString(gl_err)); - - return gl_err == 0; -} - -static GLboolean glAquaShareContext(__GLcontext *gc, __GLcontext *gcShare) -{ - GLAQUA_DEBUG_MSG("glAquaShareContext unimplemented\n"); - - return GL_TRUE; -} - -static GLboolean glAquaCopyContext(__GLcontext *dst, const __GLcontext *src, - GLuint mask) -{ - CGLError gl_err; - - GLAQUA_DEBUG_MSG("glAquaCopyContext\n"); - - gl_err = CGLCopyContext(src->ctx, dst->ctx, mask); - if (gl_err != 0) - ErrorF("CGLCopyContext error: %s\n", CGLErrorString(gl_err)); - - return gl_err == 0; -} - -static GLboolean glAquaForceCurrent(__GLcontext *gc) -{ - CGLError gl_err; - - GLAQUA_DEBUG_MSG("glAquaForceCurrent (ctx 0x%x)\n", - (unsigned int) gc->ctx); - - gl_err = CGLSetCurrentContext(gc->ctx); - if (gl_err != 0) - ErrorF("CGLSetCurrentContext error: %s\n", CGLErrorString(gl_err)); - - return gl_err == 0; -} - -/* Drawing surface notification callbacks */ - -static GLboolean glAquaNotifyResize(__GLcontext *gc) -{ - GLAQUA_DEBUG_MSG("unimplemented glAquaNotifyResize"); - return GL_TRUE; -} - -static void glAquaNotifyDestroy(__GLcontext *gc) -{ - GLAQUA_DEBUG_MSG("unimplemented glAquaNotifyDestroy"); -} - -static void glAquaNotifySwapBuffers(__GLcontext *gc) -{ - GLAQUA_DEBUG_MSG("unimplemented glAquaNotifySwapBuffers"); -} - -/* Dispatch table override control for external agents like libGLS */ -static struct __GLdispatchStateRec* glAquaDispatchExec(__GLcontext *gc) -{ - GLAQUA_DEBUG_MSG("unimplemented glAquaDispatchExec"); - return NULL; -} - -static void glAquaBeginDispatchOverride(__GLcontext *gc) -{ - GLAQUA_DEBUG_MSG("unimplemented glAquaBeginDispatchOverride"); -} - -static void glAquaEndDispatchOverride(__GLcontext *gc) -{ - GLAQUA_DEBUG_MSG("unimplemented glAquaEndDispatchOverride"); -} - -static CGLPixelFormatObj makeFormat(__GLcontextModes *mode) -{ - int i; - CGLPixelFormatAttribute attr[64]; // currently uses max of 30 - CGLPixelFormatObj result; - long n_formats; - CGLError gl_err; - - GLAQUA_DEBUG_MSG("makeFormat\n"); - - if (!mode->rgbMode) - return NULL; - - i = 0; - - // attr [i++] = kCGLPFAAcelerated; // require hwaccel - BAD for multiscreen - // attr [i++] = kCGLPFANoRecovery; // disable fallback renderers - BAD - - if (mode->stereoMode) { - attr[i++] = kCGLPFAStereo; - } - if (mode->doubleBufferMode) { - attr[i++] = kCGLPFADoubleBuffer; - } - - if (mode->colorIndexMode) { - /* ignored */ - } - - if (mode->rgbMode) { - attr[i++] = kCGLPFAColorSize; - attr[i++] = mode->redBits + mode->greenBits + mode->blueBits; - attr[i++] = kCGLPFAAlphaSize; - attr[i++] = 1; /* FIXME: ignoring mode->alphaBits which is always 0 */ - } - - if (mode->haveAccumBuffer) { - attr[i++] = kCGLPFAAccumSize; - attr[i++] = mode->accumRedBits + mode->accumGreenBits - + mode->accumBlueBits + mode->accumAlphaBits; - } - if (mode->haveDepthBuffer) { - attr[i++] = kCGLPFADepthSize; - attr[i++] = mode->depthBits; - } - if (mode->haveStencilBuffer) { - attr[i++] = kCGLPFAStencilSize; - attr[i++] = mode->stencilBits; - } - - attr[i++] = kCGLPFAAuxBuffers; - attr[i++] = mode->numAuxBuffers; - - /* mode->level ignored */ - - /* mode->pixmapMode ? */ - - attr[i++] = 0; - - GLAQUA_DEBUG_MSG("makeFormat almost done\n"); - - result = NULL; - gl_err = CGLChoosePixelFormat(attr, &result, &n_formats); - if (gl_err != 0) - ErrorF("CGLChoosePixelFormat error: %s\n", CGLErrorString(gl_err)); - - GLAQUA_DEBUG_MSG("makeFormat done (0x%x)\n", (unsigned int) result); - - return result; -} - -static __GLinterface *glAquaCreateContext(__GLimports *imports, - __GLcontextModes *mode, - __GLinterface *shareGC) -{ - __GLcontext *result; - __GLcontext *sharectx = (__GLcontext *)shareGC; - CGLError gl_err; - - GLAQUA_DEBUG_MSG("glAquaCreateContext\n"); - - result = (__GLcontext *)calloc(1, sizeof(__GLcontext)); - if (!result) return NULL; - - result->interface.imports = *imports; - result->interface.exports = glAquaExports; - - result->pixelFormat = makeFormat(mode); - if (!result->pixelFormat) { - free(result); - return NULL; - } - - result->ctx = NULL; - gl_err = CGLCreateContext(result->pixelFormat, - sharectx ? sharectx->ctx : NULL, - &result->ctx); - - if (gl_err != 0) { - ErrorF("CGLCreateContext error: %s\n", CGLErrorString(gl_err)); - CGLDestroyPixelFormat(result->pixelFormat); - free(result); - return NULL; - } - - GLAQUA_DEBUG_MSG("glAquaCreateContext done\n"); - return (__GLinterface *)result; -} - -Bool -glAquaRealizeWindow(WindowPtr pWin) -{ - // If this window has GL contexts, tell them to reattach - Bool result; - ScreenPtr pScreen = pWin->drawable.pScreen; - glAquaScreenRec *screenPriv = &glAquaScreens[pScreen->myNum]; - __GLXdrawablePrivate *glxPriv; - - GLAQUA_DEBUG_MSG("glAquaRealizeWindow\n"); - - // Allow the window to be created (RootlessRealizeWindow is inside our wrap) - pScreen->RealizeWindow = screenPriv->RealizeWindow; - result = pScreen->RealizeWindow(pWin); - pScreen->RealizeWindow = glAquaRealizeWindow; - - // The Aqua window will already have been created (windows are - // realized from top down) - - // Re-attach this window's GL contexts, if any. - glxPriv = __glXFindDrawablePrivate(pWin->drawable.id); - if (glxPriv) { - __GLXcontext *gx; - __GLcontext *gc; - __GLdrawablePrivate *glPriv = &glxPriv->glPriv; - GLAQUA_DEBUG_MSG("glAquaRealizeWindow is GL drawable!\n"); - - // GL contexts bound to this window for drawing - for (gx = glxPriv->drawGlxc; gx != NULL; gx = gx->next) { - gc = (__GLcontext *)gx->gc; - attach(gc, glPriv); - } - - // GL contexts bound to this window for reading - for (gx = glxPriv->readGlxc; gx != NULL; gx = gx->next) { - gc = (__GLcontext *)gx->gc; - attach(gc, glPriv); - } - } - - return result; -} - -Bool -glAquaUnrealizeWindow(WindowPtr pWin) -{ - // If this window has GL contexts, tell them to unattach - Bool result; - ScreenPtr pScreen = pWin->drawable.pScreen; - glAquaScreenRec *screenPriv = &glAquaScreens[pScreen->myNum]; - __GLXdrawablePrivate *glxPriv; - - GLAQUA_DEBUG_MSG("glAquaUnrealizeWindow\n"); - - // The Aqua window may have already been destroyed (windows - // are unrealized from top down) - - // Unattach this window's GL contexts, if any. - glxPriv = __glXFindDrawablePrivate(pWin->drawable.id); - if (glxPriv) { - __GLXcontext *gx; - __GLcontext *gc; - GLAQUA_DEBUG_MSG("glAquaUnealizeWindow is GL drawable!\n"); - - // GL contexts bound to this window for drawing - for (gx = glxPriv->drawGlxc; gx != NULL; gx = gx->next) { - gc = (__GLcontext *)gx->gc; - unattach(gc); - } - - // GL contexts bound to this window for reading - for (gx = glxPriv->readGlxc; gx != NULL; gx = gx->next) { - gc = (__GLcontext *)gx->gc; - unattach(gc); - } - } - - pScreen->UnrealizeWindow = screenPriv->UnrealizeWindow; - result = pScreen->UnrealizeWindow(pWin); - pScreen->UnrealizeWindow = glAquaUnrealizeWindow; - - return result; -} - - -// Originally copied from Mesa - -static int numConfigs = 0; -static __GLXvisualConfig *visualConfigs = NULL; -static void **visualPrivates = NULL; - -/* - * In the case the driver defines no GLX visuals we'll use these. - * Note that for TrueColor and DirectColor visuals, bufferSize is the - * sum of redSize, greenSize, blueSize and alphaSize, which may be larger - * than the nplanes/rootDepth of the server's X11 visuals - */ -#define NUM_FALLBACK_CONFIGS 5 -static __GLXvisualConfig FallbackConfigs[NUM_FALLBACK_CONFIGS] = { - /* [0] = RGB, double buffered, Z */ - { - -1, /* vid */ - -1, /* class */ - True, /* rgba */ - -1, -1, -1, 0, /* rgba sizes */ - -1, -1, -1, 0, /* rgba masks */ - 0, 0, 0, 0, /* rgba accum sizes */ - True, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 0, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE, /* visualRating */ - GLX_NONE, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ - }, - /* [1] = RGB, double buffered, Z, stencil, accum */ - { - -1, /* vid */ - -1, /* class */ - True, /* rgba */ - -1, -1, -1, 0, /* rgba sizes */ - -1, -1, -1, 0, /* rgba masks */ - 16, 16, 16, 0, /* rgba accum sizes */ - True, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 8, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE, /* visualRating */ - GLX_NONE, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ - }, - /* [2] = RGB+Alpha, double buffered, Z, stencil, accum */ - { - -1, /* vid */ - -1, /* class */ - True, /* rgba */ - -1, -1, -1, 8, /* rgba sizes */ - -1, -1, -1, -1, /* rgba masks */ - 16, 16, 16, 16, /* rgba accum sizes */ - True, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 8, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE, /* visualRating */ - GLX_NONE, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ - }, - /* [3] = RGB+Alpha, single buffered, Z, stencil, accum */ - { - -1, /* vid */ - -1, /* class */ - True, /* rgba */ - -1, -1, -1, 8, /* rgba sizes */ - -1, -1, -1, -1, /* rgba masks */ - 16, 16, 16, 16, /* rgba accum sizes */ - False, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 8, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE, /* visualRating */ - GLX_NONE, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ - }, - /* [4] = CI, double buffered, Z */ - { - -1, /* vid */ - -1, /* class */ - False, /* rgba? (false = color index) */ - -1, -1, -1, 0, /* rgba sizes */ - -1, -1, -1, 0, /* rgba masks */ - 0, 0, 0, 0, /* rgba accum sizes */ - True, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 0, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE, /* visualRating */ - GLX_NONE, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ - }, -}; - -static __GLXvisualConfig NullConfig = { - -1, /* vid */ - -1, /* class */ - False, /* rgba */ - -1, -1, -1, 0, /* rgba sizes */ - -1, -1, -1, 0, /* rgba masks */ - 0, 0, 0, 0, /* rgba accum sizes */ - False, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 0, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE_EXT, /* visualRating */ - 0, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ -}; - - -static inline int count_bits(uint32_t x) -{ - x = x - ((x >> 1) & 0x55555555); - x = (x & 0x33333333) + ((x >> 2) & 0x33333333); - x = (x + (x >> 4)) & 0x0f0f0f0f; - x = x + (x >> 8); - x = x + (x >> 16); - return x & 63; -} - - -static Bool init_visuals(int *nvisualp, VisualPtr *visualp, - VisualID *defaultVisp, - int ndepth, DepthPtr pdepth, - int rootDepth) -{ - int numRGBconfigs; - int numCIconfigs; - int numVisuals = *nvisualp; - int numNewVisuals; - int numNewConfigs; - VisualPtr pVisual = *visualp; - VisualPtr pVisualNew = NULL; - VisualID *orig_vid = NULL; - __GLcontextModes *modes; - __GLXvisualConfig *pNewVisualConfigs = NULL; - void **glXVisualPriv; - void **pNewVisualPriv; - int found_default; - int i, j, k; - - GLAQUA_DEBUG_MSG("init_visuals\n"); - - if (numConfigs > 0) - numNewConfigs = numConfigs; - else - numNewConfigs = NUM_FALLBACK_CONFIGS; - - /* Alloc space for the list of new GLX visuals */ - pNewVisualConfigs = (__GLXvisualConfig *) - __glXMalloc(numNewConfigs * sizeof(__GLXvisualConfig)); - if (!pNewVisualConfigs) { - return FALSE; - } - - /* Alloc space for the list of new GLX visual privates */ - pNewVisualPriv = (void **) __glXMalloc(numNewConfigs * sizeof(void *)); - if (!pNewVisualPriv) { - __glXFree(pNewVisualConfigs); - return FALSE; - } - - /* - ** If SetVisualConfigs was not called, then use default GLX - ** visual configs. - */ - if (numConfigs == 0) { - memcpy(pNewVisualConfigs, FallbackConfigs, - NUM_FALLBACK_CONFIGS * sizeof(__GLXvisualConfig)); - memset(pNewVisualPriv, 0, NUM_FALLBACK_CONFIGS * sizeof(void *)); - } - else { - /* copy driver's visual config info */ - for (i = 0; i < numConfigs; i++) { - pNewVisualConfigs[i] = visualConfigs[i]; - pNewVisualPriv[i] = visualPrivates[i]; - } - } - - /* Count the number of RGB and CI visual configs */ - numRGBconfigs = 0; - numCIconfigs = 0; - for (i = 0; i < numNewConfigs; i++) { - if (pNewVisualConfigs[i].rgba) - numRGBconfigs++; - else - numCIconfigs++; - } - - /* Count the total number of visuals to compute */ - numNewVisuals = 0; - for (i = 0; i < numVisuals; i++) { - int count; - - count = ((pVisual[i].class == TrueColor || - pVisual[i].class == DirectColor) - ? numRGBconfigs : numCIconfigs); - if (count == 0) - count = 1; /* preserve the existing visual */ - - numNewVisuals += count; - } - - /* Reset variables for use with the next screen/driver's visual configs */ - visualConfigs = NULL; - numConfigs = 0; - - /* Alloc temp space for the list of orig VisualIDs for each new visual */ - orig_vid = (VisualID *)__glXMalloc(numNewVisuals * sizeof(VisualID)); - if (!orig_vid) { - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); - return FALSE; - } - - /* Alloc space for the list of glXVisuals */ - modes = _gl_context_modes_create(numNewVisuals, sizeof(__GLcontextModes)); - if (modes == NULL) { - __glXFree(orig_vid); - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); - return FALSE; - } - - /* Alloc space for the list of glXVisualPrivates */ - glXVisualPriv = (void **)__glXMalloc(numNewVisuals * sizeof(void *)); - if (!glXVisualPriv) { - _gl_context_modes_destroy( modes ); - __glXFree(orig_vid); - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); - return FALSE; - } - - /* Alloc space for the new list of the X server's visuals */ - pVisualNew = (VisualPtr)__glXMalloc(numNewVisuals * sizeof(VisualRec)); - if (!pVisualNew) { - __glXFree(glXVisualPriv); - _gl_context_modes_destroy( modes ); - __glXFree(orig_vid); - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); - return FALSE; - } - - /* Initialize the new visuals */ - found_default = FALSE; - glAquaScreens[screenInfo.numScreens-1].modes = modes; - for (i = j = 0; i < numVisuals; i++) { - int is_rgb = (pVisual[i].class == TrueColor || - pVisual[i].class == DirectColor); - - if (!is_rgb) - { - /* We don't support non-rgb visuals for GL. But we don't - want to remove them either, so just pass them through - with null glX configs */ - - pVisualNew[j] = pVisual[i]; - pVisualNew[j].vid = FakeClientID(0); - - /* Check for the default visual */ - if (!found_default && pVisual[i].vid == *defaultVisp) { - *defaultVisp = pVisualNew[j].vid; - found_default = TRUE; - } - - /* Save the old VisualID */ - orig_vid[j] = pVisual[i].vid; - - /* Initialize the glXVisual */ - _gl_copy_visual_to_context_mode( modes, & NullConfig ); - modes->visualID = pVisualNew[j].vid; - - j++; - - continue; - } - - for (k = 0; k < numNewConfigs; k++) { - if (pNewVisualConfigs[k].rgba != is_rgb) - continue; - - assert( modes != NULL ); - - /* Initialize the new visual */ - pVisualNew[j] = pVisual[i]; - pVisualNew[j].vid = FakeClientID(0); - - /* Check for the default visual */ - if (!found_default && pVisual[i].vid == *defaultVisp) { - *defaultVisp = pVisualNew[j].vid; - found_default = TRUE; - } - - /* Save the old VisualID */ - orig_vid[j] = pVisual[i].vid; - - /* Initialize the glXVisual */ - _gl_copy_visual_to_context_mode( modes, & pNewVisualConfigs[k] ); - modes->visualID = pVisualNew[j].vid; - - /* - * If the class is -1, then assume the X visual information - * is identical to what GLX needs, and take them from the X - * visual. NOTE: if class != -1, then all other fields MUST - * be initialized. - */ - if (modes->visualType == GLX_NONE) { - modes->visualType = _gl_convert_from_x_visual_type( pVisual[i].class ); - modes->redBits = count_bits(pVisual[i].redMask); - modes->greenBits = count_bits(pVisual[i].greenMask); - modes->blueBits = count_bits(pVisual[i].blueMask); - modes->alphaBits = modes->alphaBits; - modes->redMask = pVisual[i].redMask; - modes->greenMask = pVisual[i].greenMask; - modes->blueMask = pVisual[i].blueMask; - modes->alphaMask = modes->alphaMask; - modes->rgbBits = (is_rgb) - ? (modes->redBits + modes->greenBits + - modes->blueBits + modes->alphaBits) - : rootDepth; - } - - /* Save the device-dependent private for this visual */ - glXVisualPriv[j] = pNewVisualPriv[k]; - - j++; - modes = modes->next; - } - } - - assert(j <= numNewVisuals); - - /* Save the GLX visuals in the screen structure */ - glAquaScreens[screenInfo.numScreens-1].num_vis = numNewVisuals; - glAquaScreens[screenInfo.numScreens-1].priv = glXVisualPriv; - - /* Set up depth's VisualIDs */ - for (i = 0; i < ndepth; i++) { - int numVids = 0; - VisualID *pVids = NULL; - int k, n = 0; - - /* Count the new number of VisualIDs at this depth */ - for (j = 0; j < pdepth[i].numVids; j++) - for (k = 0; k < numNewVisuals; k++) - if (pdepth[i].vids[j] == orig_vid[k]) - numVids++; - - /* Allocate a new list of VisualIDs for this depth */ - pVids = (VisualID *)__glXMalloc(numVids * sizeof(VisualID)); - - /* Initialize the new list of VisualIDs for this depth */ - for (j = 0; j < pdepth[i].numVids; j++) - for (k = 0; k < numNewVisuals; k++) - if (pdepth[i].vids[j] == orig_vid[k]) - pVids[n++] = pVisualNew[k].vid; - - /* Update this depth's list of VisualIDs */ - __glXFree(pdepth[i].vids); - pdepth[i].vids = pVids; - pdepth[i].numVids = numVids; - } - - /* Update the X server's visuals */ - *nvisualp = numNewVisuals; - *visualp = pVisualNew; - - /* Free the old list of the X server's visuals */ - __glXFree(pVisual); - - /* Clean up temporary allocations */ - __glXFree(orig_vid); - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); - - /* Free the private list created by DDX HW driver */ - if (visualPrivates) - xfree(visualPrivates); - visualPrivates = NULL; - - return TRUE; -} - -/* based on code in i830_dri.c - This ends calling glAquaSetVisualConfigs to set the static - numconfigs, etc. */ -static void -glAquaInitVisualConfigs(void) -{ - int lclNumConfigs = 0; - __GLXvisualConfig *lclVisualConfigs = NULL; - void **lclVisualPrivates = NULL; - - int depth, aux, buffers, stencil, accum; - int i = 0; - - GLAQUA_DEBUG_MSG("glAquaInitVisualConfigs "); - - /* count num configs: - 2 Z buffer (0, 24 bit) - 2 AUX buffer (0, 2) - 2 buffers (single, double) - 2 stencil (0, 8 bit) - 2 accum (0, 64 bit) - = 32 configs */ - - lclNumConfigs = 2 * 2 * 2 * 2 * 2; /* 32 */ - - /* alloc */ - lclVisualConfigs = xcalloc(sizeof(__GLXvisualConfig), lclNumConfigs); - lclVisualPrivates = xcalloc(sizeof(void *), lclNumConfigs); - - /* fill in configs */ - if (NULL != lclVisualConfigs) { - i = 0; /* current buffer */ - for (depth = 0; depth < 2; depth++) { - for (aux = 0; aux < 2; aux++) { - for (buffers = 0; buffers < 2; buffers++) { - for (stencil = 0; stencil < 2; stencil++) { - for (accum = 0; accum < 2; accum++) { - lclVisualConfigs[i].vid = -1; - lclVisualConfigs[i].class = -1; - lclVisualConfigs[i].rgba = TRUE; - lclVisualConfigs[i].redSize = -1; - lclVisualConfigs[i].greenSize = -1; - lclVisualConfigs[i].blueSize = -1; - lclVisualConfigs[i].redMask = -1; - lclVisualConfigs[i].greenMask = -1; - lclVisualConfigs[i].blueMask = -1; - lclVisualConfigs[i].alphaMask = 0; - if (accum) { - lclVisualConfigs[i].accumRedSize = 16; - lclVisualConfigs[i].accumGreenSize = 16; - lclVisualConfigs[i].accumBlueSize = 16; - lclVisualConfigs[i].accumAlphaSize = 16; - } - else { - lclVisualConfigs[i].accumRedSize = 0; - lclVisualConfigs[i].accumGreenSize = 0; - lclVisualConfigs[i].accumBlueSize = 0; - lclVisualConfigs[i].accumAlphaSize = 0; - } - lclVisualConfigs[i].doubleBuffer = buffers ? TRUE : FALSE; - lclVisualConfigs[i].stereo = FALSE; - lclVisualConfigs[i].bufferSize = -1; - - lclVisualConfigs[i].depthSize = depth? 24 : 0; - lclVisualConfigs[i].stencilSize = stencil ? 8 : 0; - lclVisualConfigs[i].auxBuffers = aux ? 2 : 0; - lclVisualConfigs[i].level = 0; - lclVisualConfigs[i].visualRating = GLX_NONE_EXT; - lclVisualConfigs[i].transparentPixel = 0; - lclVisualConfigs[i].transparentRed = 0; - lclVisualConfigs[i].transparentGreen = 0; - lclVisualConfigs[i].transparentBlue = 0; - lclVisualConfigs[i].transparentAlpha = 0; - lclVisualConfigs[i].transparentIndex = 0; - i++; - } - } - } - } - } - } - if (i != lclNumConfigs) - GLAQUA_DEBUG_MSG("glAquaInitVisualConfigs failed to alloc visual configs"); - - GlxSetVisualConfigs(lclNumConfigs, lclVisualConfigs, lclVisualPrivates); -} - - -static void glAquaSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs, - void **privates) -{ - GLAQUA_DEBUG_MSG("glAquaSetVisualConfigs\n"); - - numConfigs = nconfigs; - visualConfigs = configs; - visualPrivates = privates; -} - -static Bool glAquaInitVisuals(VisualPtr *visualp, DepthPtr *depthp, - int *nvisualp, int *ndepthp, - int *rootDepthp, VisualID *defaultVisp, - unsigned long sizes, int bitsPerRGB) -{ - GLAQUA_DEBUG_MSG("glAquaInitVisuals\n"); - - if (numConfigs == 0) /* if no configs */ - glAquaInitVisualConfigs(); /* ensure the visual configs are setup */ - - /* - * Setup the visuals supported by this particular screen. - */ - return init_visuals(nvisualp, visualp, defaultVisp, - *ndepthp, *depthp, *rootDepthp); -} - - -static void fixup_visuals(int screen) -{ - ScreenPtr pScreen = screenInfo.screens[screen]; - glAquaScreenRec *pScr = &glAquaScreens[screen]; - int j; - __GLcontextModes *modes; - - GLAQUA_DEBUG_MSG("fixup_visuals\n"); - - for ( modes = pScr->modes ; modes != NULL ; modes = modes->next ) { - const int vis_class = _gl_convert_to_x_visual_type( modes->visualType ); - const int nplanes = (modes->rgbBits - modes->alphaBits); - const VisualPtr pVis = pScreen->visuals; - - /* Find a visual that matches the GLX visual's class and size */ - for (j = 0; j < pScreen->numVisuals; j++) { - if (pVis[j].class == vis_class && - pVis[j].nplanes == nplanes) { - - /* Fixup the masks */ - modes->redMask = pVis[j].redMask; - modes->greenMask = pVis[j].greenMask; - modes->blueMask = pVis[j].blueMask; - - /* Recalc the sizes */ - modes->redBits = count_bits(modes->redMask); - modes->greenBits = count_bits(modes->greenMask); - modes->blueBits = count_bits(modes->blueMask); - } - } - } -} - -static void init_screen_visuals(int screen) -{ - ScreenPtr pScreen = screenInfo.screens[screen]; - __GLcontextModes *modes; - int *used; - int i, j; - - GLAQUA_DEBUG_MSG("init_screen_visuals\n"); - - /* FIXME: Change 'used' to be a array of bits (rather than of ints), - * FIXME: create a stack array of 8 or 16 bytes. If 'numVisuals' is less - * FIXME: than 64 or 128 the stack array can be used instead of calling - * FIXME: __glXMalloc / __glXFree. If nothing else, convert 'used' to - * FIXME: array of bytes instead of ints! - */ - used = (int *)__glXMalloc(pScreen->numVisuals * sizeof(int)); - __glXMemset(used, 0, pScreen->numVisuals * sizeof(int)); - - i = 0; - for ( modes = glAquaScreens[screen].modes - ; modes != NULL - ; modes = modes->next ) { - const int vis_class = _gl_convert_to_x_visual_type( modes->visualType ); - const int nplanes = (modes->rgbBits - modes->alphaBits); - const VisualPtr pVis = pScreen->visuals; - - for (j = 0; j < pScreen->numVisuals; j++) { - if (pVis[j].class == vis_class && - pVis[j].nplanes == nplanes && - pVis[j].redMask == modes->redMask && - pVis[j].greenMask == modes->greenMask && - pVis[j].blueMask == modes->blueMask && - !used[j]) { - - /* Set the VisualID */ - modes->visualID = pVis[j].vid; - - /* Mark this visual used */ - used[j] = 1; - break; - } - } - if ( j == pScreen->numVisuals ) { - ErrorF("No matching visual for __GLcontextMode with " - "visual class = %d (%d), nplanes = %u\n", - vis_class, - (int)modes->visualType, - (unsigned int)(modes->rgbBits - modes->alphaBits) ); - } - else if ( modes->visualID == -1 ) { - FatalError( "Matching visual found, but visualID still -1!\n" ); - } - - i++; - } - - __glXFree(used); -} - -static Bool glAquaScreenProbe(int screen) -{ - ScreenPtr pScreen; - glAquaScreenRec *screenPriv; - - GLAQUA_DEBUG_MSG("glAquaScreenProbe\n"); - - /* - * Set up the current screen's visuals. - */ - __glDDXScreenInfo.modes = glAquaScreens[screen].modes; - __glDDXScreenInfo.pVisualPriv = glAquaScreens[screen].priv; - __glDDXScreenInfo.numVisuals = - __glDDXScreenInfo.numUsableVisuals = glAquaScreens[screen].num_vis; - - /* - * Set the current screen's createContext routine. This could be - * wrapped by a DDX GLX context creation routine. - */ - __glDDXScreenInfo.createContext = glAquaCreateContext; - - /* - * The ordering of the rgb compenents might have been changed by the - * driver after mi initialized them. - */ - fixup_visuals(screen); - - /* - * Find the GLX visuals that are supported by this screen and create - * XMesa's visuals. - */ - init_screen_visuals(screen); - - /* - * Wrap RealizeWindow and UnrealizeWindow on this screen - */ - pScreen = screenInfo.screens[screen]; - screenPriv = &glAquaScreens[screen]; - screenPriv->RealizeWindow = pScreen->RealizeWindow; - pScreen->RealizeWindow = glAquaRealizeWindow; - screenPriv->UnrealizeWindow = pScreen->UnrealizeWindow; - pScreen->UnrealizeWindow = glAquaUnrealizeWindow; - - return TRUE; -} - -static GLboolean glAquaSwapBuffers(__GLXdrawablePrivate *glxPriv) -{ - // swap buffers on only *one* of the contexts - // (e.g. the last one for drawing) - __GLcontext *gc = (__GLcontext *)glxPriv->drawGlxc->gc; - CGLError gl_err; - - GLAQUA_DEBUG_MSG("glAquaSwapBuffers\n"); - - if (gc != NULL && gc->ctx != NULL) - { - gl_err = CGLFlushDrawable(gc->ctx); - if (gl_err != 0) - ErrorF("CGLFlushDrawable error: %s\n", CGLErrorString(gl_err)); - } - - return GL_TRUE; -} - -static void glAquaDestroyDrawablePrivate(__GLdrawablePrivate *glPriv) -{ - GLAQUA_DEBUG_MSG("glAquaDestroyDrawablePrivate\n"); - - /* It doesn't work to call DRIDestroySurface here, the drawable's - already gone.. But dri.c notices the window destruction and - frees the surface itself. */ - - free(glPriv->private); - glPriv->private = NULL; -} - -static void glAquaCreateBuffer(__GLXdrawablePrivate *glxPriv) -{ - GLAquaDrawableRec *aquaPriv = malloc(sizeof(GLAquaDrawableRec)); - __GLdrawablePrivate *glPriv = &glxPriv->glPriv; - - aquaPriv->sid = 0; - aquaPriv->pDraw = NULL; - - GLAQUA_DEBUG_MSG("glAquaCreateBuffer\n"); - - // replace swapBuffers (original is never called) - glxPriv->swapBuffers = glAquaSwapBuffers; - - // stash private data - glPriv->private = aquaPriv; - glPriv->freePrivate = glAquaDestroyDrawablePrivate; -} - -static void glAquaResetExtension(void) -{ - GLAQUA_DEBUG_MSG("glAquaResetExtension\n"); - CGLSetOption(kCGLGOResetLibrary, GL_TRUE); -} - -// Extra goodies for glx - -GLuint __glFloorLog2(GLuint val) -{ - int c = 0; - - while (val > 1) { - c++; - val >>= 1; - } - return c; -} diff --git a/nx-X11/programs/Xserver/GL/dri/Imakefile b/nx-X11/programs/Xserver/GL/dri/Imakefile deleted file mode 100644 index 8ea938f8c..000000000 --- a/nx-X11/programs/Xserver/GL/dri/Imakefile +++ /dev/null @@ -1,35 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/GL/dri/Imakefile,v 1.6 2001/04/28 13:55:36 dawes Exp $ - -#define IHaveModules -#include - -#if DoLoadableServer -MSRC = drimodule.c -MOBJ = drimodule.o -#endif - - SRCS = xf86dri.c dri.c $(MSRC) - OBJS = xf86dri.o dri.o $(MOBJ) - - INCLUDES = -I$(SERVERSRC)/include -I$(INCLUDESRC) -I$(XINCLUDESRC) \ - -I$(EXTINCSRC) -I$(MESASRCDIR)/include \ - -I$(XF86OSSRC) -I$(XF86COMSRC) \ - -I../include -I../glx -I$(LIBSRC)/GL/include \ - -I$(DRMSRCDIR)/shared-core \ - -I$(SERVERSRC)/mi -I$(FONTINCSRC) - DEFINES = $(GLX_DEFINES) - -LinkSourceFile(xf86dri.h,$(MESASRCDIR)/src/glx/x11) -LinkSourceFile(xf86dristr.h,$(MESASRCDIR)/src/glx/x11) - -ModuleObjectRule() -LibraryModuleTarget(dri,$(OBJS)) -InstallLibraryModule(dri,$(MODULEDIR),extensions) - -DependTarget() - -InstallDriverSDKLibraryModule(dri,$(DRIVERSDKMODULEDIR),extensions) - -InstallDriverSDKNonExecFile(dri.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(sarea.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(xf86dri.h,$(DRIVERSDKINCLUDEDIR)) diff --git a/nx-X11/programs/Xserver/GL/dri/Imakefile.NX.reference b/nx-X11/programs/Xserver/GL/dri/Imakefile.NX.reference deleted file mode 100644 index 59fb0af84..000000000 --- a/nx-X11/programs/Xserver/GL/dri/Imakefile.NX.reference +++ /dev/null @@ -1,35 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/GL/dri/Imakefile,v 1.7 2003/02/11 21:34:04 tsi Exp $ - -#define IHaveModules -#include - -#if DoLoadableServer -MSRC = drimodule.c -MOBJ = drimodule.o -#endif - - SRCS = xf86dri.c dri.c $(MSRC) - OBJS = xf86dri.o dri.o $(MOBJ) - - INCLUDES = -I$(SERVERSRC)/include -I$(INCLUDESRC) -I$(XINCLUDESRC) \ - -I$(EXTINCSRC) \ - -I$(XF86OSSRC) -I$(XF86COMSRC) \ - -I../include -I../glx -I$(LIBSRC)/GL/include \ - -I$(SERVERSRC)/mi -I$(FONTINCSRC) \ - -I../../hw/xfree86/os-support/bus - DEFINES = $(GLX_DEFINES) - -LinkSourceFile(xf86dri.h,$(LIBSRC)/GL/dri) -LinkSourceFile(xf86dristr.h,$(LIBSRC)/GL/dri) - -ModuleObjectRule() -LibraryModuleTarget(dri,$(OBJS)) -InstallLibraryModule(dri,$(MODULEDIR),extensions) - -DependTarget() - -InstallDriverSDKLibraryModule(dri,$(DRIVERSDKMODULEDIR),extensions) - -InstallDriverSDKNonExecFile(dri.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(sarea.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(xf86dri.h,$(DRIVERSDKINCLUDEDIR)) diff --git a/nx-X11/programs/Xserver/GL/dri/Imakefile.XF86.reference b/nx-X11/programs/Xserver/GL/dri/Imakefile.XF86.reference deleted file mode 100644 index c8770f6d8..000000000 --- a/nx-X11/programs/Xserver/GL/dri/Imakefile.XF86.reference +++ /dev/null @@ -1,34 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/GL/dri/Imakefile,v 1.7 2003/02/11 21:34:04 tsi Exp $ - -#define IHaveModules -#include - -#if DoLoadableServer -MSRC = drimodule.c -MOBJ = drimodule.o -#endif - - SRCS = xf86dri.c dri.c $(MSRC) - OBJS = xf86dri.o dri.o $(MOBJ) - - INCLUDES = -I$(SERVERSRC)/include -I$(INCLUDESRC) -I$(XINCLUDESRC) \ - -I$(EXTINCSRC) \ - -I$(XF86OSSRC) -I$(XF86COMSRC) \ - -I../include -I../glx -I$(LIBSRC)/GL/include \ - -I$(SERVERSRC)/mi -I$(FONTINCSRC) - DEFINES = $(GLX_DEFINES) - -LinkSourceFile(xf86dri.h,$(LIBSRC)/GL/dri) -LinkSourceFile(xf86dristr.h,$(LIBSRC)/GL/dri) - -ModuleObjectRule() -LibraryModuleTarget(dri,$(OBJS)) -InstallLibraryModule(dri,$(MODULEDIR),extensions) - -DependTarget() - -InstallDriverSDKLibraryModule(dri,$(DRIVERSDKMODULEDIR),extensions) - -InstallDriverSDKNonExecFile(dri.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(sarea.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(xf86dri.h,$(DRIVERSDKINCLUDEDIR)) diff --git a/nx-X11/programs/Xserver/GL/dri/dri-def.cpp b/nx-X11/programs/Xserver/GL/dri/dri-def.cpp deleted file mode 100644 index 0d1ab6872..000000000 --- a/nx-X11/programs/Xserver/GL/dri/dri-def.cpp +++ /dev/null @@ -1,50 +0,0 @@ -LIBRARY DRI -VERSION LIBRARY_VERSION -EXPORTS - -XFree86DRIExtensionInit -DRIAuthConnection -DRIBlockHandler -DRIClipNotify -DRICloseConnection -DRICloseScreen -DRIContextPrivDelete -DRICopyWindow -DRICreateContext -DRICreateContextPriv -DRICreateContextPrivFromHandle -DRICreateDrawable -DRICreateInfoRec -DRIDestroyContext -DRIDestroyContextPriv -DRIDestroyDrawable -DRIDestroyInfoRec -DRIDoBlockHandler -DRIDoWakeupHandler -DRIDrawablePrivDelete -DRIExtensionInit -DRIFinishScreenInit -DRIGetClientDriverName -DRIGetContext -DRIGetContextStore -DRIGetDeviceInfo -DRIGetDrawableIndex -DRIGetDrawableInfo -DRIGetDrawableStamp -DRIGetSAREAPrivate -DRIGetWrappedFuncs -DRILock -DRIOpenConnection -DRIPaintWindow -DRIPostValidateTree -DRIPrintDrawableLock -DRIQueryDirectRenderingCapable -DRIQueryVersion -DRIReset -DRIScreenInit -DRISwapContext -DRIUnlock -DRIValidateTree -DRIWakeupHandler - -/* $XFree86$ */ diff --git a/nx-X11/programs/Xserver/GL/dri/dri.c b/nx-X11/programs/Xserver/GL/dri/dri.c deleted file mode 100644 index 424a21c68..000000000 --- a/nx-X11/programs/Xserver/GL/dri/dri.c +++ /dev/null @@ -1,2109 +0,0 @@ -/* $XFree86: xc/programs/Xserver/GL/dri/dri.c,v 1.39 2003/11/10 18:21:41 tsi Exp $ */ -/************************************************************************** - -Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -Copyright 2000 VA Linux Systems, Inc. -All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sub license, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice (including the -next paragraph) shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -**************************************************************************/ - -/* - * Authors: - * Jens Owen - * Rickard E. (Rik) Faith - * - */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "xf86.h" -#ifdef XFree86LOADER -#include "xf86_ansic.h" -#else -#include -#include -#endif - -#define NEED_REPLIES -#define NEED_EVENTS -#include -#include -#include "misc.h" -#include "dixstruct.h" -#include "extnsionst.h" -#include "colormapst.h" -#include "cursorstr.h" -#include "scrnintstr.h" -#include "windowstr.h" -#include "servermd.h" -#define _XF86DRI_SERVER_ -#include "xf86dristr.h" -#include "swaprep.h" -#include "xf86str.h" -#include "dri.h" -#include "sarea.h" -#include "dristruct.h" -#include "xf86.h" -#include "xf86drm.h" -#include "glxserver.h" -#include "mi.h" -#include "mipointer.h" - -#if defined(XFree86LOADER) && !defined(PANORAMIX) -extern Bool noPanoramiXExtension; -#endif - -static int DRIScreenPrivIndex = -1; -static int DRIWindowPrivIndex = -1; -static unsigned long DRIGeneration = 0; -static unsigned int DRIDrawableValidationStamp = 0; - -static RESTYPE DRIDrawablePrivResType; -static RESTYPE DRIContextPrivResType; -static void DRIDestroyDummyContext(ScreenPtr pScreen, Bool hasCtxPriv); - - /* Wrapper just like xf86DrvMsg, but - without the verbosity level checking. - This will make it easy to turn off some - messages later, based on verbosity - level. */ - -/* - * Since we're already referencing things from the XFree86 common layer in - * this file, we'd might as well just call xf86VDrvMsgVerb, and have - * consistent message formatting. The verbosity of these messages can be - * easily changed here. - */ -#define DRI_MSG_VERBOSITY 1 -static void -DRIDrvMsg(int scrnIndex, MessageType type, const char *format, ...) -{ - va_list ap; - - va_start(ap, format); - xf86VDrvMsgVerb(scrnIndex, type, DRI_MSG_VERBOSITY, format, ap); - va_end(ap); -} - -Bool -DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD) -{ - DRIScreenPrivPtr pDRIPriv; - drm_context_t * reserved; - int reserved_count; - int i, fd, drmWasAvailable; - Bool xineramaInCore = FALSE; - int err = 0; - char *openbusid; - drmVersionPtr drmlibv; - int drmlibmajor, drmlibminor, drmdimajor, drmdiminor; - - if (DRIGeneration != serverGeneration) { - if ((DRIScreenPrivIndex = AllocateScreenPrivateIndex()) < 0) - return FALSE; - DRIGeneration = serverGeneration; - } - - /* If the DRI extension is disabled, do not initialize the DRI */ - if (noXFree86DRIExtension) { - DRIDrvMsg(pScreen->myNum, X_WARNING, - "Direct rendering has been disabled.\n"); - return FALSE; - } - - /* - * If Xinerama is on, don't allow DRI to initialise. It won't be usable - * anyway. - */ -#if defined(PANORAMIX) && !defined(XFree86LOADER) - xineramaInCore = TRUE; -#elif defined(XFree86LOADER) - if (xf86LoaderCheckSymbol("noPanoramiXExtension")) - xineramaInCore = TRUE; -#endif - -#if defined(PANORAMIX) || defined(XFree86LOADER) - if (xineramaInCore) { - if (!noPanoramiXExtension) { - DRIDrvMsg(pScreen->myNum, X_WARNING, - "Direct rendering is not supported when Xinerama is enabled\n"); - return FALSE; - } - } -#endif - - drmWasAvailable = drmAvailable(); - - /* Check the DRM lib version. - * drmGetLibVersion was not supported in version 1.0, so check for - * symbol first to avoid possible crash or hang. - */ - drmlibmajor = 1; - drmlibminor = 0; - if (xf86LoaderCheckSymbol("drmGetLibVersion")) { - drmlibv = drmGetLibVersion(-1); - if (drmlibv != NULL) { - drmlibmajor = drmlibv->version_major; - drmlibminor = drmlibv->version_minor; - drmFreeVersion(drmlibv); - } - } - - /* Check if the libdrm can handle falling back to loading based on name - * if a busid string is passed. - */ - if (drmlibmajor == 1 && drmlibminor >= 2) - openbusid = pDRIInfo->busIdString; - else - openbusid = NULL; - - /* Note that drmOpen will try to load the kernel module, if needed. */ - fd = drmOpen(pDRIInfo->drmDriverName, openbusid); - if (fd < 0) { - /* failed to open DRM */ - pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL; - DRIDrvMsg(pScreen->myNum, X_INFO, - "[drm] drmOpen failed\n"); - return FALSE; - } - - if (!drmWasAvailable) { - /* drmOpen loaded the kernel module, print a message to say so */ - DRIDrvMsg(pScreen->myNum, X_INFO, - "[drm] loaded kernel module for \"%s\" driver\n", - pDRIInfo->drmDriverName); - } - - pDRIPriv = (DRIScreenPrivPtr) xcalloc(1, sizeof(DRIScreenPrivRec)); - if (!pDRIPriv) { - pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL; - return FALSE; - } - - pScreen->devPrivates[DRIScreenPrivIndex].ptr = (pointer) pDRIPriv; - pDRIPriv->drmFD = fd; - pDRIPriv->directRenderingSupport = TRUE; - pDRIPriv->pDriverInfo = pDRIInfo; - pDRIPriv->nrWindows = 0; - pDRIPriv->fullscreen = NULL; - - pDRIPriv->createDummyCtx = pDRIInfo->createDummyCtx; - pDRIPriv->createDummyCtxPriv = pDRIInfo->createDummyCtxPriv; - - pDRIPriv->grabbedDRILock = FALSE; - pDRIPriv->drmSIGIOHandlerInstalled = FALSE; - - if (drmlibmajor == 1 && drmlibminor >= 2) { - drmSetVersion sv; - - /* Get the interface version, asking for 1.1. */ - sv.drm_di_major = 1; - sv.drm_di_minor = 1; - sv.drm_dd_major = -1; - err = drmSetInterfaceVersion(pDRIPriv->drmFD, &sv); - if (err == 0) { - drmdimajor = sv.drm_di_major; - drmdiminor = sv.drm_di_minor; - } else { - /* failure, so set it to 1.0.0. */ - drmdimajor = 1; - drmdiminor = 0; - } - } - else { - /* We can't check the DI DRM interface version, so set it to 1.0.0. */ - drmdimajor = 1; - drmdiminor = 0; - } - DRIDrvMsg(pScreen->myNum, X_INFO, - "[drm] DRM interface version %d.%d\n", drmdimajor, drmdiminor); - - /* If the interface minor number is 1.1, then we've opened a DRM device - * that already had the busid set through drmOpen. - */ - if (drmdimajor == 1 && drmdiminor >= 1) - err = 0; - else - err = drmSetBusid(pDRIPriv->drmFD, pDRIPriv->pDriverInfo->busIdString); - - if (err < 0) { - pDRIPriv->directRenderingSupport = FALSE; - pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL; - drmClose(pDRIPriv->drmFD); - DRIDrvMsg(pScreen->myNum, X_INFO, - "[drm] drmSetBusid failed (%d, %s), %s\n", - pDRIPriv->drmFD, pDRIPriv->pDriverInfo->busIdString, strerror(-err)); - return FALSE; - } - - *pDRMFD = pDRIPriv->drmFD; - DRIDrvMsg(pScreen->myNum, X_INFO, - "[drm] created \"%s\" driver at busid \"%s\"\n", - pDRIPriv->pDriverInfo->drmDriverName, - pDRIPriv->pDriverInfo->busIdString); - - if (drmAddMap( pDRIPriv->drmFD, - 0, - pDRIPriv->pDriverInfo->SAREASize, - DRM_SHM, - DRM_CONTAINS_LOCK, - &pDRIPriv->hSAREA) < 0) - { - pDRIPriv->directRenderingSupport = FALSE; - pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL; - drmClose(pDRIPriv->drmFD); - DRIDrvMsg(pScreen->myNum, X_INFO, - "[drm] drmAddMap failed\n"); - return FALSE; - } - DRIDrvMsg(pScreen->myNum, X_INFO, - "[drm] added %d byte SAREA at %p\n", - pDRIPriv->pDriverInfo->SAREASize, pDRIPriv->hSAREA); - - if (drmMap( pDRIPriv->drmFD, - pDRIPriv->hSAREA, - pDRIPriv->pDriverInfo->SAREASize, - (drmAddressPtr)(&pDRIPriv->pSAREA)) < 0) - { - pDRIPriv->directRenderingSupport = FALSE; - pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL; - drmClose(pDRIPriv->drmFD); - DRIDrvMsg(pScreen->myNum, X_INFO, - "[drm] drmMap failed\n"); - return FALSE; - } - memset(pDRIPriv->pSAREA, 0, pDRIPriv->pDriverInfo->SAREASize); - DRIDrvMsg(pScreen->myNum, X_INFO, "[drm] mapped SAREA %p to %p\n", - pDRIPriv->hSAREA, pDRIPriv->pSAREA); - - if (drmAddMap( pDRIPriv->drmFD, - (drm_handle_t)pDRIPriv->pDriverInfo->frameBufferPhysicalAddress, - pDRIPriv->pDriverInfo->frameBufferSize, - DRM_FRAME_BUFFER, - 0, - &pDRIPriv->hFrameBuffer) < 0) - { - pDRIPriv->directRenderingSupport = FALSE; - pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL; - drmUnmap(pDRIPriv->pSAREA, pDRIPriv->pDriverInfo->SAREASize); - drmClose(pDRIPriv->drmFD); - DRIDrvMsg(pScreen->myNum, X_INFO, - "[drm] drmAddMap failed\n"); - return FALSE; - } - DRIDrvMsg(pScreen->myNum, X_INFO, "[drm] framebuffer handle = %p\n", - pDRIPriv->hFrameBuffer); - - /* Add tags for reserved contexts */ - if ((reserved = drmGetReservedContextList(pDRIPriv->drmFD, - &reserved_count))) { - int i; - void *tag; - - for (i = 0; i < reserved_count; i++) { - tag = DRICreateContextPrivFromHandle(pScreen, - reserved[i], - DRI_CONTEXT_RESERVED); - drmAddContextTag(pDRIPriv->drmFD, reserved[i], tag); - } - drmFreeReservedContextList(reserved); - DRIDrvMsg(pScreen->myNum, X_INFO, - "[drm] added %d reserved context%s for kernel\n", - reserved_count, reserved_count > 1 ? "s" : ""); - } - - /* validate max drawable table entry set by driver */ - if ((pDRIPriv->pDriverInfo->maxDrawableTableEntry <= 0) || - (pDRIPriv->pDriverInfo->maxDrawableTableEntry > SAREA_MAX_DRAWABLES)) { - DRIDrvMsg(pScreen->myNum, X_ERROR, - "Invalid max drawable table size set by driver: %d\n", - pDRIPriv->pDriverInfo->maxDrawableTableEntry); - } - - /* Initialize drawable tables (screen private and SAREA) */ - for( i=0; i < pDRIPriv->pDriverInfo->maxDrawableTableEntry; i++) { - pDRIPriv->DRIDrawables[i] = NULL; - pDRIPriv->pSAREA->drawableTable[i].stamp = 0; - pDRIPriv->pSAREA->drawableTable[i].flags = 0; - } - - return TRUE; -} - -Bool -DRIFinishScreenInit(ScreenPtr pScreen) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo; - DRIContextFlags flags = 0; - DRIContextPrivPtr pDRIContextPriv; - - /* Set up flags for DRICreateContextPriv */ - switch (pDRIInfo->driverSwapMethod) { - case DRI_KERNEL_SWAP: flags = DRI_CONTEXT_2DONLY; break; - case DRI_HIDE_X_CONTEXT: flags = DRI_CONTEXT_PRESERVED; break; - } - - if (!(pDRIContextPriv = DRICreateContextPriv(pScreen, - &pDRIPriv->myContext, - flags))) { - DRIDrvMsg(pScreen->myNum, X_ERROR, - "failed to create server context\n"); - return FALSE; - } - pDRIPriv->myContextPriv = pDRIContextPriv; - - DRIDrvMsg(pScreen->myNum, X_INFO, - "X context handle = %p\n", pDRIPriv->myContext); - - /* Now that we have created the X server's context, we can grab the - * hardware lock for the X server. - */ - DRILock(pScreen, 0); - pDRIPriv->grabbedDRILock = TRUE; - - /* pointers so that we can prevent memory leaks later */ - pDRIPriv->hiddenContextStore = NULL; - pDRIPriv->partial3DContextStore = NULL; - - switch(pDRIInfo->driverSwapMethod) { - case DRI_HIDE_X_CONTEXT: - /* Server will handle 3D swaps, and hide 2D swaps from kernel. - * Register server context as a preserved context. - */ - - /* allocate memory for hidden context store */ - pDRIPriv->hiddenContextStore - = (void *)xcalloc(1, pDRIInfo->contextSize); - if (!pDRIPriv->hiddenContextStore) { - DRIDrvMsg(pScreen->myNum, X_ERROR, - "failed to allocate hidden context\n"); - DRIDestroyContextPriv(pDRIContextPriv); - return FALSE; - } - - /* allocate memory for partial 3D context store */ - pDRIPriv->partial3DContextStore - = (void *)xcalloc(1, pDRIInfo->contextSize); - if (!pDRIPriv->partial3DContextStore) { - DRIDrvMsg(pScreen->myNum, X_ERROR, - "[DRI] failed to allocate partial 3D context\n"); - xfree(pDRIPriv->hiddenContextStore); - DRIDestroyContextPriv(pDRIContextPriv); - return FALSE; - } - - /* save initial context store */ - if (pDRIInfo->SwapContext) { - (*pDRIInfo->SwapContext)( - pScreen, - DRI_NO_SYNC, - DRI_2D_CONTEXT, - pDRIPriv->hiddenContextStore, - DRI_NO_CONTEXT, - NULL); - } - /* fall through */ - - case DRI_SERVER_SWAP: - /* For swap methods of DRI_SERVER_SWAP and DRI_HIDE_X_CONTEXT - * setup signal handler for receiving swap requests from kernel - */ - if (!(pDRIPriv->drmSIGIOHandlerInstalled = - drmInstallSIGIOHandler(pDRIPriv->drmFD, DRISwapContext))) { - DRIDrvMsg(pScreen->myNum, X_ERROR, - "[drm] failed to setup DRM signal handler\n"); - if (pDRIPriv->hiddenContextStore) - xfree(pDRIPriv->hiddenContextStore); - if (pDRIPriv->partial3DContextStore) - xfree(pDRIPriv->partial3DContextStore); - DRIDestroyContextPriv(pDRIContextPriv); - return FALSE; - } else { - DRIDrvMsg(pScreen->myNum, X_INFO, - "[drm] installed DRM signal handler\n"); - } - - default: - break; - } - - /* Wrap DRI support */ - if (pDRIInfo->wrap.ValidateTree) { - pDRIPriv->wrap.ValidateTree = pScreen->ValidateTree; - pScreen->ValidateTree = pDRIInfo->wrap.ValidateTree; - } - if (pDRIInfo->wrap.PostValidateTree) { - pDRIPriv->wrap.PostValidateTree = pScreen->PostValidateTree; - pScreen->PostValidateTree = pDRIInfo->wrap.PostValidateTree; - } - if (pDRIInfo->wrap.WindowExposures) { - pDRIPriv->wrap.WindowExposures = pScreen->WindowExposures; - pScreen->WindowExposures = pDRIInfo->wrap.WindowExposures; - } - if (pDRIInfo->wrap.CopyWindow) { - pDRIPriv->wrap.CopyWindow = pScreen->CopyWindow; - pScreen->CopyWindow = pDRIInfo->wrap.CopyWindow; - } - if (pDRIInfo->wrap.ClipNotify) { - pDRIPriv->wrap.ClipNotify = pScreen->ClipNotify; - pScreen->ClipNotify = pDRIInfo->wrap.ClipNotify; - } - if (pDRIInfo->wrap.AdjustFrame) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - pDRIPriv->wrap.AdjustFrame = pScrn->AdjustFrame; - pScrn->AdjustFrame = pDRIInfo->wrap.AdjustFrame; - } - pDRIPriv->wrapped = TRUE; - - DRIDrvMsg(pScreen->myNum, X_INFO, "[DRI] installation complete\n"); - - return TRUE; -} - -void -DRICloseScreen(ScreenPtr pScreen) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - DRIInfoPtr pDRIInfo; - drm_context_t * reserved; - int reserved_count; - - if (pDRIPriv && pDRIPriv->directRenderingSupport) { - - pDRIInfo = pDRIPriv->pDriverInfo; - - if (pDRIPriv->wrapped) { - /* Unwrap DRI Functions */ - if (pDRIInfo->wrap.ValidateTree) { - pScreen->ValidateTree = pDRIPriv->wrap.ValidateTree; - pDRIPriv->wrap.ValidateTree = NULL; - } - if (pDRIInfo->wrap.PostValidateTree) { - pScreen->PostValidateTree = pDRIPriv->wrap.PostValidateTree; - pDRIPriv->wrap.PostValidateTree = NULL; - } - if (pDRIInfo->wrap.WindowExposures) { - pScreen->WindowExposures = pDRIPriv->wrap.WindowExposures; - pDRIPriv->wrap.WindowExposures = NULL; - } - if (pDRIInfo->wrap.CopyWindow) { - pScreen->CopyWindow = pDRIPriv->wrap.CopyWindow; - pDRIPriv->wrap.CopyWindow = NULL; - } - if (pDRIInfo->wrap.ClipNotify) { - pScreen->ClipNotify = pDRIPriv->wrap.ClipNotify; - pDRIPriv->wrap.ClipNotify = NULL; - } - if (pDRIInfo->wrap.AdjustFrame) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - pScrn->AdjustFrame = pDRIPriv->wrap.AdjustFrame; - pDRIPriv->wrap.AdjustFrame = NULL; - } - pDRIPriv->wrapped = FALSE; - } - - if (pDRIPriv->drmSIGIOHandlerInstalled) { - if (!drmRemoveSIGIOHandler(pDRIPriv->drmFD)) { - DRIDrvMsg(pScreen->myNum, X_ERROR, - "[drm] failed to remove DRM signal handler\n"); - } - } - - if (pDRIPriv->dummyCtxPriv && pDRIPriv->createDummyCtx) { - DRIDestroyDummyContext(pScreen, pDRIPriv->createDummyCtxPriv); - } - - if (!DRIDestroyContextPriv(pDRIPriv->myContextPriv)) { - DRIDrvMsg(pScreen->myNum, X_ERROR, - "failed to destroy server context\n"); - } - - /* Remove tags for reserved contexts */ - if ((reserved = drmGetReservedContextList(pDRIPriv->drmFD, - &reserved_count))) { - int i; - - for (i = 0; i < reserved_count; i++) { - DRIDestroyContextPriv(drmGetContextTag(pDRIPriv->drmFD, - reserved[i])); - } - drmFreeReservedContextList(reserved); - DRIDrvMsg(pScreen->myNum, X_INFO, - "[drm] removed %d reserved context%s for kernel\n", - reserved_count, reserved_count > 1 ? "s" : ""); - } - - /* Make sure signals get unblocked etc. */ - drmUnlock(pDRIPriv->drmFD, pDRIPriv->myContext); - pDRIPriv->lockRefCount = 0; - DRIDrvMsg(pScreen->myNum, X_INFO, - "[drm] unmapping %d bytes of SAREA %p at %p\n", - pDRIInfo->SAREASize, - pDRIPriv->hSAREA, - pDRIPriv->pSAREA); - if (drmUnmap(pDRIPriv->pSAREA, pDRIInfo->SAREASize)) { - DRIDrvMsg(pScreen->myNum, X_ERROR, - "[drm] unable to unmap %d bytes" - " of SAREA %p at %p\n", - pDRIInfo->SAREASize, - pDRIPriv->hSAREA, - pDRIPriv->pSAREA); - } - - drmClose(pDRIPriv->drmFD); - - xfree(pDRIPriv); - pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL; - } -} - -Bool -DRIExtensionInit(void) -{ - int i; - ScreenPtr pScreen; - - if (DRIScreenPrivIndex < 0) { - return FALSE; - } - - /* Allocate a window private index with a zero sized private area for - * each window, then should a window become a DRI window, we'll hang - * a DRIWindowPrivateRec off of this private index. - */ - if ((DRIWindowPrivIndex = AllocateWindowPrivateIndex()) < 0) - return FALSE; - - DRIDrawablePrivResType = CreateNewResourceType(DRIDrawablePrivDelete); - DRIContextPrivResType = CreateNewResourceType(DRIContextPrivDelete); - - for (i = 0; i < screenInfo.numScreens; i++) - { - pScreen = screenInfo.screens[i]; - if (!AllocateWindowPrivate(pScreen, DRIWindowPrivIndex, 0)) - return FALSE; - } - - RegisterBlockAndWakeupHandlers(DRIBlockHandler, DRIWakeupHandler, NULL); - - return TRUE; -} - -void -DRIReset(void) -{ - /* - * This stub routine is called when the X Server recycles, resources - * allocated by DRIExtensionInit need to be managed here. - * - * Currently this routine is a stub because all the interesting resources - * are managed via the screen init process. - */ -} - -Bool -DRIQueryDirectRenderingCapable(ScreenPtr pScreen, Bool* isCapable) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - - if (pDRIPriv) - *isCapable = pDRIPriv->directRenderingSupport; - else - *isCapable = FALSE; - - return TRUE; -} - -Bool -DRIOpenConnection(ScreenPtr pScreen, drm_handle_t * hSAREA, char **busIdString) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - - *hSAREA = pDRIPriv->hSAREA; - *busIdString = pDRIPriv->pDriverInfo->busIdString; - - return TRUE; -} - -Bool -DRIAuthConnection(ScreenPtr pScreen, drm_magic_t magic) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - - if (drmAuthMagic(pDRIPriv->drmFD, magic)) return FALSE; - return TRUE; -} - -Bool -DRICloseConnection(ScreenPtr pScreen) -{ - return TRUE; -} - -Bool -DRIGetClientDriverName(ScreenPtr pScreen, - int *ddxDriverMajorVersion, - int *ddxDriverMinorVersion, - int *ddxDriverPatchVersion, - char **clientDriverName) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - - *ddxDriverMajorVersion = pDRIPriv->pDriverInfo->ddxDriverMajorVersion; - *ddxDriverMinorVersion = pDRIPriv->pDriverInfo->ddxDriverMinorVersion; - *ddxDriverPatchVersion = pDRIPriv->pDriverInfo->ddxDriverPatchVersion; - *clientDriverName = pDRIPriv->pDriverInfo->clientDriverName; - - return TRUE; -} - -/* DRICreateContextPriv and DRICreateContextPrivFromHandle are helper - functions that layer on drmCreateContext and drmAddContextTag. - - DRICreateContextPriv always creates a kernel drm_context_t and then calls - DRICreateContextPrivFromHandle to create a DRIContextPriv structure for - DRI tracking. For the SIGIO handler, the drm_context_t is associated with - DRIContextPrivPtr. Any special flags are stored in the DRIContextPriv - area and are passed to the kernel (if necessary). - - DRICreateContextPriv returns a pointer to newly allocated - DRIContextPriv, and returns the kernel drm_context_t in pHWContext. */ - -DRIContextPrivPtr -DRICreateContextPriv(ScreenPtr pScreen, - drm_context_t * pHWContext, - DRIContextFlags flags) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - - if (drmCreateContext(pDRIPriv->drmFD, pHWContext)) { - return NULL; - } - - return DRICreateContextPrivFromHandle(pScreen, *pHWContext, flags); -} - -DRIContextPrivPtr -DRICreateContextPrivFromHandle(ScreenPtr pScreen, - drm_context_t hHWContext, - DRIContextFlags flags) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - DRIContextPrivPtr pDRIContextPriv; - int contextPrivSize; - - contextPrivSize = sizeof(DRIContextPrivRec) + - pDRIPriv->pDriverInfo->contextSize; - if (!(pDRIContextPriv = xcalloc(1, contextPrivSize))) { - return NULL; - } - pDRIContextPriv->pContextStore = (void *)(pDRIContextPriv + 1); - - drmAddContextTag(pDRIPriv->drmFD, hHWContext, pDRIContextPriv); - - pDRIContextPriv->hwContext = hHWContext; - pDRIContextPriv->pScreen = pScreen; - pDRIContextPriv->flags = flags; - pDRIContextPriv->valid3D = FALSE; - - if (flags & DRI_CONTEXT_2DONLY) { - if (drmSetContextFlags(pDRIPriv->drmFD, - hHWContext, - DRM_CONTEXT_2DONLY)) { - DRIDrvMsg(pScreen->myNum, X_ERROR, - "[drm] failed to set 2D context flag\n"); - DRIDestroyContextPriv(pDRIContextPriv); - return NULL; - } - } - if (flags & DRI_CONTEXT_PRESERVED) { - if (drmSetContextFlags(pDRIPriv->drmFD, - hHWContext, - DRM_CONTEXT_PRESERVED)) { - DRIDrvMsg(pScreen->myNum, X_ERROR, - "[drm] failed to set preserved flag\n"); - DRIDestroyContextPriv(pDRIContextPriv); - return NULL; - } - } - return pDRIContextPriv; -} - -Bool -DRIDestroyContextPriv(DRIContextPrivPtr pDRIContextPriv) -{ - DRIScreenPrivPtr pDRIPriv; - - if (!pDRIContextPriv) return TRUE; - - pDRIPriv = DRI_SCREEN_PRIV(pDRIContextPriv->pScreen); - - if (!(pDRIContextPriv->flags & DRI_CONTEXT_RESERVED)) { - /* Don't delete reserved contexts from - kernel area -- the kernel manages its - reserved contexts itself. */ - if (drmDestroyContext(pDRIPriv->drmFD, pDRIContextPriv->hwContext)) - return FALSE; - } - - /* Remove the tag last to prevent a race - condition where the context has pending - buffers. The context can't be re-used - while in this thread, but buffers can be - dispatched asynchronously. */ - drmDelContextTag(pDRIPriv->drmFD, pDRIContextPriv->hwContext); - xfree(pDRIContextPriv); - return TRUE; -} - -static Bool -DRICreateDummyContext(ScreenPtr pScreen, Bool needCtxPriv) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - __GLXscreenInfo *pGLXScreen = __glXgetActiveScreen(pScreen->myNum); - __GLcontextModes *modes = pGLXScreen->modes; - void **pVisualConfigPriv = pGLXScreen->pVisualPriv; - DRIContextPrivPtr pDRIContextPriv; - void *contextStore; - VisualPtr visual; - int visNum; - - visual = pScreen->visuals; - - /* Find the X visual that corresponds the the first GLX visual */ - for (visNum = 0; - visNum < pScreen->numVisuals; - visNum++, visual++) { - if (modes->visualID == visual->vid) - break; - } - if (visNum == pScreen->numVisuals) return FALSE; - - if (!(pDRIContextPriv = - DRICreateContextPriv(pScreen, - &pDRIPriv->pSAREA->dummy_context, 0))) { - return FALSE; - } - - contextStore = DRIGetContextStore(pDRIContextPriv); - if (pDRIPriv->pDriverInfo->CreateContext && needCtxPriv) { - if (!pDRIPriv->pDriverInfo->CreateContext(pScreen, visual, - pDRIPriv->pSAREA->dummy_context, - *pVisualConfigPriv, - (DRIContextType)(long)contextStore)) { - DRIDestroyContextPriv(pDRIContextPriv); - return FALSE; - } - } - - pDRIPriv->dummyCtxPriv = pDRIContextPriv; - return TRUE; -} - -static void -DRIDestroyDummyContext(ScreenPtr pScreen, Bool hasCtxPriv) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - DRIContextPrivPtr pDRIContextPriv = pDRIPriv->dummyCtxPriv; - void *contextStore; - - if (!pDRIContextPriv) return; - if (pDRIPriv->pDriverInfo->DestroyContext && hasCtxPriv) { - contextStore = DRIGetContextStore(pDRIContextPriv); - pDRIPriv->pDriverInfo->DestroyContext(pDRIContextPriv->pScreen, - pDRIContextPriv->hwContext, - (DRIContextType)(long)contextStore); - } - - DRIDestroyContextPriv(pDRIPriv->dummyCtxPriv); - pDRIPriv->dummyCtxPriv = NULL; -} - -Bool -DRICreateContext(ScreenPtr pScreen, VisualPtr visual, - XID context, drm_context_t * pHWContext) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - __GLXscreenInfo *pGLXScreen = __glXgetActiveScreen(pScreen->myNum); - __GLcontextModes *modes = pGLXScreen->modes; - void **pVisualConfigPriv = pGLXScreen->pVisualPriv; - DRIContextPrivPtr pDRIContextPriv; - void *contextStore; - - if (pDRIPriv->createDummyCtx && !pDRIPriv->dummyCtxPriv) { - if (!DRICreateDummyContext(pScreen, pDRIPriv->createDummyCtxPriv)) { - DRIDrvMsg(pScreen->myNum, X_INFO, - "[drm] Could not create dummy context\n"); - return FALSE; - } - } - - /* Find the GLX visual associated with the one requested */ - for (modes = pGLXScreen->modes; modes != NULL; modes = modes->next) { - if (modes->visualID == visual->vid) - break; - pVisualConfigPriv++; - } - - if (modes == NULL) { - /* No matching GLX visual found */ - return FALSE; - } - - if (!(pDRIContextPriv = DRICreateContextPriv(pScreen, pHWContext, 0))) { - return FALSE; - } - - contextStore = DRIGetContextStore(pDRIContextPriv); - if (pDRIPriv->pDriverInfo->CreateContext) { - if (!((*pDRIPriv->pDriverInfo->CreateContext)(pScreen, visual, - *pHWContext, *pVisualConfigPriv, - (DRIContextType)(long)contextStore))) { - DRIDestroyContextPriv(pDRIContextPriv); - return FALSE; - } - } - - /* track this in case the client dies before cleanup */ - AddResource(context, DRIContextPrivResType, (pointer)pDRIContextPriv); - - return TRUE; -} - -Bool -DRIDestroyContext(ScreenPtr pScreen, XID context) -{ - FreeResourceByType(context, DRIContextPrivResType, FALSE); - - return TRUE; -} - -/* DRIContextPrivDelete is called by the resource manager. */ -Bool -DRIContextPrivDelete(pointer pResource, XID id) -{ - DRIContextPrivPtr pDRIContextPriv = (DRIContextPrivPtr)pResource; - DRIScreenPrivPtr pDRIPriv; - void *contextStore; - - pDRIPriv = DRI_SCREEN_PRIV(pDRIContextPriv->pScreen); - if (pDRIPriv->pDriverInfo->DestroyContext) { - contextStore = DRIGetContextStore(pDRIContextPriv); - pDRIPriv->pDriverInfo->DestroyContext(pDRIContextPriv->pScreen, - pDRIContextPriv->hwContext, - (DRIContextType)(long)contextStore); - } - return DRIDestroyContextPriv(pDRIContextPriv); -} - - -/* This walks the drawable timestamp array and invalidates all of them - * in the case of transition from private to shared backbuffers. It's - * not necessary for correctness, because DRIClipNotify gets called in - * time to prevent any conflict, but the transition from - * shared->private is sometimes missed if we don't do this. - */ -static void -DRIClipNotifyAllDrawables(ScreenPtr pScreen) -{ - int i; - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - - for( i=0; i < pDRIPriv->pDriverInfo->maxDrawableTableEntry; i++) { - pDRIPriv->pSAREA->drawableTable[i].stamp = DRIDrawableValidationStamp++; - } -} - - -static void -DRITransitionToSharedBuffers(ScreenPtr pScreen) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo; - - DRIClipNotifyAllDrawables( pScreen ); - - if (pDRIInfo->TransitionSingleToMulti3D) - pDRIInfo->TransitionSingleToMulti3D( pScreen ); -} - - -static void -DRITransitionToPrivateBuffers(ScreenPtr pScreen) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo; - - DRIClipNotifyAllDrawables( pScreen ); - - if (pDRIInfo->TransitionMultiToSingle3D) - pDRIInfo->TransitionMultiToSingle3D( pScreen ); -} - - -static void -DRITransitionTo3d(ScreenPtr pScreen) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo; - - DRIClipNotifyAllDrawables( pScreen ); - - if (pDRIInfo->TransitionTo3d) - pDRIInfo->TransitionTo3d( pScreen ); -} - -static void -DRITransitionTo2d(ScreenPtr pScreen) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo; - - DRIClipNotifyAllDrawables( pScreen ); - - if (pDRIInfo->TransitionTo2d) - pDRIInfo->TransitionTo2d( pScreen ); -} - - -Bool -DRICreateDrawable(ScreenPtr pScreen, Drawable id, - DrawablePtr pDrawable, drm_drawable_t * hHWDrawable) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - DRIDrawablePrivPtr pDRIDrawablePriv; - WindowPtr pWin; - - if (pDrawable->type == DRAWABLE_WINDOW) { - pWin = (WindowPtr)pDrawable; - if ((pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin))) { - pDRIDrawablePriv->refCount++; - } - else { - /* allocate a DRI Window Private record */ - if (!(pDRIDrawablePriv = xalloc(sizeof(DRIDrawablePrivRec)))) { - return FALSE; - } - - /* Only create a drm_drawable_t once */ - if (drmCreateDrawable(pDRIPriv->drmFD, hHWDrawable)) { - xfree(pDRIDrawablePriv); - return FALSE; - } - - /* add it to the list of DRI drawables for this screen */ - pDRIDrawablePriv->hwDrawable = *hHWDrawable; - pDRIDrawablePriv->pScreen = pScreen; - pDRIDrawablePriv->refCount = 1; - pDRIDrawablePriv->drawableIndex = -1; - - /* save private off of preallocated index */ - pWin->devPrivates[DRIWindowPrivIndex].ptr = - (pointer)pDRIDrawablePriv; - - switch (++pDRIPriv->nrWindows) { - case 1: - DRITransitionTo3d( pScreen ); - break; - case 2: - DRITransitionToSharedBuffers( pScreen ); - break; - default: - break; - } - - /* track this in case this window is destroyed */ - AddResource(id, DRIDrawablePrivResType, (pointer)pWin); - } - } - else { /* pixmap (or for GLX 1.3, a PBuffer) */ - /* NOT_DONE */ - return FALSE; - } - - return TRUE; -} - -Bool -DRIDestroyDrawable(ScreenPtr pScreen, Drawable id, DrawablePtr pDrawable) -{ - DRIDrawablePrivPtr pDRIDrawablePriv; - WindowPtr pWin; - - - if (pDrawable->type == DRAWABLE_WINDOW) { - pWin = (WindowPtr)pDrawable; - pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin); - pDRIDrawablePriv->refCount--; - if (pDRIDrawablePriv->refCount <= 0) { - /* This calls back DRIDrawablePrivDelete which frees private area */ - FreeResourceByType(id, DRIDrawablePrivResType, FALSE); - } - } - else { /* pixmap (or for GLX 1.3, a PBuffer) */ - /* NOT_DONE */ - return FALSE; - } - - return TRUE; -} - -Bool -DRIDrawablePrivDelete(pointer pResource, XID id) -{ - DrawablePtr pDrawable = (DrawablePtr)pResource; - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pDrawable->pScreen); - DRIDrawablePrivPtr pDRIDrawablePriv; - WindowPtr pWin; - - if (pDrawable->type == DRAWABLE_WINDOW) { - pWin = (WindowPtr)pDrawable; - pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin); - - if (pDRIDrawablePriv->drawableIndex != -1) { - /* bump stamp to force outstanding 3D requests to resync */ - pDRIPriv->pSAREA->drawableTable[pDRIDrawablePriv->drawableIndex].stamp - = DRIDrawableValidationStamp++; - - /* release drawable table entry */ - pDRIPriv->DRIDrawables[pDRIDrawablePriv->drawableIndex] = NULL; - } - - if (drmDestroyDrawable(pDRIPriv->drmFD, - pDRIDrawablePriv->hwDrawable)) { - return FALSE; - } - xfree(pDRIDrawablePriv); - pWin->devPrivates[DRIWindowPrivIndex].ptr = NULL; - - switch (--pDRIPriv->nrWindows) { - case 0: - DRITransitionTo2d( pDrawable->pScreen ); - break; - case 1: - DRITransitionToPrivateBuffers( pDrawable->pScreen ); - break; - default: - break; - } - } - else { /* pixmap (or for GLX 1.3, a PBuffer) */ - /* NOT_DONE */ - return FALSE; - } - - return TRUE; -} - -Bool -DRIGetDrawableInfo(ScreenPtr pScreen, - DrawablePtr pDrawable, - unsigned int* index, - unsigned int* stamp, - int* X, - int* Y, - int* W, - int* H, - int* numClipRects, - drm_clip_rect_t ** pClipRects, - int* backX, - int* backY, - int* numBackClipRects, - drm_clip_rect_t ** pBackClipRects) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - DRIDrawablePrivPtr pDRIDrawablePriv, pOldDrawPriv; - WindowPtr pWin, pOldWin; - int i; - - printf("maxDrawableTableEntry = %d\n", pDRIPriv->pDriverInfo->maxDrawableTableEntry); - - if (pDrawable->type == DRAWABLE_WINDOW) { - pWin = (WindowPtr)pDrawable; - if ((pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin))) { - - /* Manage drawable table */ - if (pDRIDrawablePriv->drawableIndex == -1) { /* load SAREA table */ - - /* Search table for empty entry */ - i = 0; - while (i < pDRIPriv->pDriverInfo->maxDrawableTableEntry) { - if (!(pDRIPriv->DRIDrawables[i])) { - pDRIPriv->DRIDrawables[i] = pDrawable; - pDRIDrawablePriv->drawableIndex = i; - pDRIPriv->pSAREA->drawableTable[i].stamp = - DRIDrawableValidationStamp++; - break; - } - i++; - } - - /* Search table for oldest entry */ - if (i == pDRIPriv->pDriverInfo->maxDrawableTableEntry) { - unsigned int oldestStamp = ~0; - int oldestIndex = 0; - i = pDRIPriv->pDriverInfo->maxDrawableTableEntry; - while (i--) { - if (pDRIPriv->pSAREA->drawableTable[i].stamp < - oldestStamp) { - oldestIndex = i; - oldestStamp = - pDRIPriv->pSAREA->drawableTable[i].stamp; - } - } - pDRIDrawablePriv->drawableIndex = oldestIndex; - - /* release oldest drawable table entry */ - pOldWin = (WindowPtr)pDRIPriv->DRIDrawables[oldestIndex]; - pOldDrawPriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pOldWin); - pOldDrawPriv->drawableIndex = -1; - - /* claim drawable table entry */ - pDRIPriv->DRIDrawables[oldestIndex] = pDrawable; - - /* validate SAREA entry */ - pDRIPriv->pSAREA->drawableTable[oldestIndex].stamp = - DRIDrawableValidationStamp++; - - /* check for stamp wrap around */ - if (oldestStamp > DRIDrawableValidationStamp) { - - /* walk SAREA table and invalidate all drawables */ - for( i=0; - i < pDRIPriv->pDriverInfo->maxDrawableTableEntry; - i++) { - pDRIPriv->pSAREA->drawableTable[i].stamp = - DRIDrawableValidationStamp++; - } - } - } - - /* If the driver wants to be notified when the index is - * set for a drawable, let it know now. - */ - if (pDRIPriv->pDriverInfo->SetDrawableIndex) - pDRIPriv->pDriverInfo->SetDrawableIndex(pWin, - pDRIDrawablePriv->drawableIndex); - - /* reinit drawable ID if window is visible */ - if ((pWin->viewable) && - (pDRIPriv->pDriverInfo->bufferRequests != DRI_NO_WINDOWS)) - { - (*pDRIPriv->pDriverInfo->InitBuffers)(pWin, - &pWin->clipList, pDRIDrawablePriv->drawableIndex); - } - } - - *index = pDRIDrawablePriv->drawableIndex; - *stamp = pDRIPriv->pSAREA->drawableTable[*index].stamp; - *X = (int)(pWin->drawable.x); - *Y = (int)(pWin->drawable.y); -#if 0 - *W = (int)(pWin->winSize.extents.x2 - pWin->winSize.extents.x1); - *H = (int)(pWin->winSize.extents.y2 - pWin->winSize.extents.y1); -#endif - *W = (int)(pWin->drawable.width); - *H = (int)(pWin->drawable.height); - *numClipRects = REGION_NUM_RECTS(&pWin->clipList); - *pClipRects = (drm_clip_rect_t *)REGION_RECTS(&pWin->clipList); - - if (!*numClipRects && pDRIPriv->fullscreen) { - /* use fake full-screen clip rect */ - pDRIPriv->fullscreen_rect.x1 = *X; - pDRIPriv->fullscreen_rect.y1 = *Y; - pDRIPriv->fullscreen_rect.x2 = *X + *W; - pDRIPriv->fullscreen_rect.y2 = *Y + *H; - - *numClipRects = 1; - *pClipRects = &pDRIPriv->fullscreen_rect; - } - - *backX = *X; - *backY = *Y; - - if (pDRIPriv->nrWindows == 1 && *numClipRects) { - /* Use a single cliprect. */ - - int x0 = *X; - int y0 = *Y; - int x1 = x0 + *W; - int y1 = y0 + *H; - - if (x0 < 0) x0 = 0; - if (y0 < 0) y0 = 0; - if (x1 > pScreen->width) x1 = pScreen->width; - if (y1 > pScreen->height) y1 = pScreen->height; - - pDRIPriv->private_buffer_rect.x1 = x0; - pDRIPriv->private_buffer_rect.y1 = y0; - pDRIPriv->private_buffer_rect.x2 = x1; - pDRIPriv->private_buffer_rect.y2 = y1; - - *numBackClipRects = 1; - *pBackClipRects = &(pDRIPriv->private_buffer_rect); - } else { - /* Use the frontbuffer cliprects for back buffers. */ - *numBackClipRects = 0; - *pBackClipRects = 0; - } - } - else { - /* Not a DRIDrawable */ - return FALSE; - } - } - else { /* pixmap (or for GLX 1.3, a PBuffer) */ - /* NOT_DONE */ - return FALSE; - } - - return TRUE; -} - -Bool -DRIGetDeviceInfo(ScreenPtr pScreen, - drm_handle_t * hFrameBuffer, - int* fbOrigin, - int* fbSize, - int* fbStride, - int* devPrivateSize, - void** pDevPrivate) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - - *hFrameBuffer = pDRIPriv->hFrameBuffer; - *fbOrigin = 0; - *fbSize = pDRIPriv->pDriverInfo->frameBufferSize; - *fbStride = pDRIPriv->pDriverInfo->frameBufferStride; - *devPrivateSize = pDRIPriv->pDriverInfo->devPrivateSize; - *pDevPrivate = pDRIPriv->pDriverInfo->devPrivate; - - return TRUE; -} - -DRIInfoPtr -DRICreateInfoRec(void) -{ - DRIInfoPtr inforec = (DRIInfoPtr)xcalloc(1, sizeof(DRIInfoRec)); - if (!inforec) return NULL; - - /* Initialize defaults */ - inforec->busIdString = NULL; - - /* Wrapped function defaults */ - inforec->wrap.WakeupHandler = DRIDoWakeupHandler; - inforec->wrap.BlockHandler = DRIDoBlockHandler; - inforec->wrap.WindowExposures = DRIWindowExposures; - inforec->wrap.CopyWindow = DRICopyWindow; - inforec->wrap.ValidateTree = DRIValidateTree; - inforec->wrap.PostValidateTree = DRIPostValidateTree; - inforec->wrap.ClipNotify = DRIClipNotify; - inforec->wrap.AdjustFrame = DRIAdjustFrame; - - inforec->TransitionTo2d = 0; - inforec->TransitionTo3d = 0; - inforec->SetDrawableIndex = 0; - - return inforec; -} - -void -DRIDestroyInfoRec(DRIInfoPtr DRIInfo) -{ - if (DRIInfo->busIdString) xfree(DRIInfo->busIdString); - xfree((char*)DRIInfo); -} - - -void -DRIWakeupHandler(pointer wakeupData, int result, pointer pReadmask) -{ - int i; - - for (i = 0; i < screenInfo.numScreens; i++) { - ScreenPtr pScreen = screenInfo.screens[i]; - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - - if (pDRIPriv && - pDRIPriv->pDriverInfo->wrap.WakeupHandler) - (*pDRIPriv->pDriverInfo->wrap.WakeupHandler)(i, wakeupData, - result, pReadmask); - } -} - -void -DRIBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadmask) -{ - int i; - - for (i = 0; i < screenInfo.numScreens; i++) { - ScreenPtr pScreen = screenInfo.screens[i]; - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - - if (pDRIPriv && - pDRIPriv->pDriverInfo->wrap.BlockHandler) - (*pDRIPriv->pDriverInfo->wrap.BlockHandler)(i, blockData, - pTimeout, pReadmask); - } -} - -void -DRIDoWakeupHandler(int screenNum, pointer wakeupData, - unsigned long result, pointer pReadmask) -{ - ScreenPtr pScreen = screenInfo.screens[screenNum]; - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - - DRILock(pScreen, 0); - if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) { - /* hide X context by swapping 2D component here */ - (*pDRIPriv->pDriverInfo->SwapContext)(pScreen, - DRI_3D_SYNC, - DRI_2D_CONTEXT, - pDRIPriv->partial3DContextStore, - DRI_2D_CONTEXT, - pDRIPriv->hiddenContextStore); - } -} - -void -DRIDoBlockHandler(int screenNum, pointer blockData, - pointer pTimeout, pointer pReadmask) -{ - ScreenPtr pScreen = screenInfo.screens[screenNum]; - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - - if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) { - /* hide X context by swapping 2D component here */ - (*pDRIPriv->pDriverInfo->SwapContext)(pScreen, - DRI_2D_SYNC, - DRI_NO_CONTEXT, - NULL, - DRI_2D_CONTEXT, - pDRIPriv->partial3DContextStore); - } - DRIUnlock(pScreen); -} - -void -DRISwapContext(int drmFD, void *oldctx, void *newctx) -{ - DRIContextPrivPtr oldContext = (DRIContextPrivPtr)oldctx; - DRIContextPrivPtr newContext = (DRIContextPrivPtr)newctx; - ScreenPtr pScreen = newContext->pScreen; - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - void* oldContextStore = NULL; - DRIContextType oldContextType; - void* newContextStore = NULL; - DRIContextType newContextType; - DRISyncType syncType; -#ifdef DEBUG - static int count = 0; -#endif - - if (!newContext) { - DRIDrvMsg(pScreen->myNum, X_ERROR, - "[DRI] Context Switch Error: oldContext=%x, newContext=%x\n", - oldContext, newContext); - return; - } - -#ifdef DEBUG - /* usefull for debugging, just print out after n context switches */ - if (!count || !(count % 1)) { - DRIDrvMsg(pScreen->myNum, X_INFO, - "[DRI] Context switch %5d from %p/0x%08x (%d)\n", - count, - oldContext, - oldContext ? oldContext->flags : 0, - oldContext ? oldContext->hwContext : -1); - DRIDrvMsg(pScreen->myNum, X_INFO, - "[DRI] Context switch %5d to %p/0x%08x (%d)\n", - count, - newContext, - newContext ? newContext->flags : 0, - newContext ? newContext->hwContext : -1); - } - ++count; -#endif - - if (!pDRIPriv->pDriverInfo->SwapContext) { - DRIDrvMsg(pScreen->myNum, X_ERROR, - "[DRI] DDX driver missing context swap call back\n"); - return; - } - - if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) { - - /* only 3D contexts are swapped in this case */ - if (oldContext) { - oldContextStore = DRIGetContextStore(oldContext); - oldContext->valid3D = TRUE; - oldContextType = DRI_3D_CONTEXT; - } else { - oldContextType = DRI_NO_CONTEXT; - } - newContextStore = DRIGetContextStore(newContext); - if ((newContext->valid3D) && - (newContext->hwContext != pDRIPriv->myContext)) { - newContextType = DRI_3D_CONTEXT; - } - else { - newContextType = DRI_2D_CONTEXT; - } - syncType = DRI_3D_SYNC; - } - else /* default: driverSwapMethod == DRI_SERVER_SWAP */ { - - /* optimize 2D context swaps */ - - if (newContext->flags & DRI_CONTEXT_2DONLY) { - /* go from 3D context to 2D context and only save 2D - * subset of 3D state - */ - oldContextStore = DRIGetContextStore(oldContext); - oldContextType = DRI_2D_CONTEXT; - newContextStore = DRIGetContextStore(newContext); - newContextType = DRI_2D_CONTEXT; - syncType = DRI_3D_SYNC; - pDRIPriv->lastPartial3DContext = oldContext; - } - else if (oldContext->flags & DRI_CONTEXT_2DONLY) { - if (pDRIPriv->lastPartial3DContext == newContext) { - /* go from 2D context back to previous 3D context and - * only restore 2D subset of previous 3D state - */ - oldContextStore = DRIGetContextStore(oldContext); - oldContextType = DRI_2D_CONTEXT; - newContextStore = DRIGetContextStore(newContext); - newContextType = DRI_2D_CONTEXT; - syncType = DRI_2D_SYNC; - } - else { - /* go from 2D context to a different 3D context */ - - /* call DDX driver to do partial restore */ - oldContextStore = DRIGetContextStore(oldContext); - newContextStore = - DRIGetContextStore(pDRIPriv->lastPartial3DContext); - (*pDRIPriv->pDriverInfo->SwapContext)(pScreen, - DRI_2D_SYNC, - DRI_2D_CONTEXT, - oldContextStore, - DRI_2D_CONTEXT, - newContextStore); - - /* now setup for a complete 3D swap */ - oldContextStore = newContextStore; - oldContext->valid3D = TRUE; - oldContextType = DRI_3D_CONTEXT; - newContextStore = DRIGetContextStore(newContext); - if ((newContext->valid3D) && - (newContext->hwContext != pDRIPriv->myContext)) { - newContextType = DRI_3D_CONTEXT; - } - else { - newContextType = DRI_2D_CONTEXT; - } - syncType = DRI_NO_SYNC; - } - } - else { - /* now setup for a complete 3D swap */ - oldContextStore = newContextStore; - oldContext->valid3D = TRUE; - oldContextType = DRI_3D_CONTEXT; - newContextStore = DRIGetContextStore(newContext); - if ((newContext->valid3D) && - (newContext->hwContext != pDRIPriv->myContext)) { - newContextType = DRI_3D_CONTEXT; - } - else { - newContextType = DRI_2D_CONTEXT; - } - syncType = DRI_3D_SYNC; - } - } - - /* call DDX driver to perform the swap */ - (*pDRIPriv->pDriverInfo->SwapContext)(pScreen, - syncType, - oldContextType, - oldContextStore, - newContextType, - newContextStore); -} - -void* -DRIGetContextStore(DRIContextPrivPtr context) -{ - return((void *)context->pContextStore); -} - -void -DRIWindowExposures(WindowPtr pWin, RegionPtr prgn, RegionPtr bsreg) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - DRIDrawablePrivPtr pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin); - - if(pDRIDrawablePriv) { - (*pDRIPriv->pDriverInfo->InitBuffers)(pWin, prgn, - pDRIDrawablePriv->drawableIndex); - } - - /* call lower wrapped functions */ - if (pDRIPriv && pDRIPriv->wrap.WindowExposures) { - - /* unwrap */ - pScreen->WindowExposures = pDRIPriv->wrap.WindowExposures; - - /* call lower layers */ - (*pScreen->WindowExposures)(pWin, prgn, bsreg); - - /* rewrap */ - pDRIPriv->wrap.WindowExposures = pScreen->WindowExposures; - pScreen->WindowExposures = DRIWindowExposures; - } -} - - -static int -DRITreeTraversal(WindowPtr pWin, pointer data) -{ - DRIDrawablePrivPtr pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin); - - if(pDRIDrawablePriv) { - ScreenPtr pScreen = pWin->drawable.pScreen; - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - RegionPtr reg = (RegionPtr)data; - - REGION_UNION(pScreen, reg, reg, &(pWin->clipList)); - - if(pDRIPriv->nrWindows == 1) - return WT_STOPWALKING; - } - return WT_WALKCHILDREN; -} - -void -DRICopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - - if(!pDRIPriv) return; - - if(pDRIPriv->nrWindows > 0) { - RegionRec reg; - - REGION_NULL(pScreen, ®); - TraverseTree(pWin, DRITreeTraversal, (pointer)(®)); - - if(REGION_NOTEMPTY(pScreen, ®)) { - REGION_TRANSLATE(pScreen, ®, ptOldOrg.x - pWin->drawable.x, - ptOldOrg.y - pWin->drawable.y); - REGION_INTERSECT(pScreen, ®, ®, prgnSrc); - - /* The MoveBuffers interface is not ideal */ - (*pDRIPriv->pDriverInfo->MoveBuffers)(pWin, ptOldOrg, ®, - pDRIPriv->pDriverInfo->ddxDrawableTableEntry); - } - - REGION_UNINIT(pScreen, ®); - } - - /* call lower wrapped functions */ - if(pDRIPriv->wrap.CopyWindow) { - /* unwrap */ - pScreen->CopyWindow = pDRIPriv->wrap.CopyWindow; - - /* call lower layers */ - (*pScreen->CopyWindow)(pWin, ptOldOrg, prgnSrc); - - /* rewrap */ - pDRIPriv->wrap.CopyWindow = pScreen->CopyWindow; - pScreen->CopyWindow = DRICopyWindow; - } -} - -static void -DRIGetSecs(long *secs, long *usecs) -{ -#ifdef XFree86LOADER - getsecs(secs,usecs); -#else - struct timeval tv; - - gettimeofday(&tv, NULL); - - *secs = tv.tv_sec; - *usecs = tv.tv_usec; -#endif -} - -static unsigned long -DRIComputeMilliSeconds(unsigned long s_secs, unsigned long s_usecs, - unsigned long f_secs, unsigned long f_usecs) -{ - if (f_usecs < s_usecs) { - --f_secs; - f_usecs += 1000000; - } - return (f_secs - s_secs) * 1000 + (f_usecs - s_usecs) / 1000; -} - -static void -DRISpinLockTimeout(drmLock *lock, int val, unsigned long timeout /* in mS */) -{ - int count = 10000; -#if !defined(__alpha__) && !defined(__powerpc__) - char ret; -#else - int ret; -#endif - long s_secs, s_usecs; - long f_secs, f_usecs; - long msecs; - long prev = 0; - - DRIGetSecs(&s_secs, &s_usecs); - - do { - DRM_SPINLOCK_COUNT(lock, val, count, ret); - if (!ret) return; /* Got lock */ - DRIGetSecs(&f_secs, &f_usecs); - msecs = DRIComputeMilliSeconds(s_secs, s_usecs, f_secs, f_usecs); - if (msecs - prev < 250) count *= 2; /* Not more than 0.5S */ - } while (msecs < timeout); - - /* Didn't get lock, so take it. The worst - that can happen is that there is some - garbage written to the wrong part of the - framebuffer that a refresh will repair. - That's undesirable, but better than - locking the server. This should be a - very rare event. */ - DRM_SPINLOCK_TAKE(lock, val); -} - -static void -DRILockTree(ScreenPtr pScreen) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - - if(!pDRIPriv) return; - - /* Restore the last known 3D context if the X context is hidden */ - if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) { - (*pDRIPriv->pDriverInfo->SwapContext)(pScreen, - DRI_2D_SYNC, - DRI_NO_CONTEXT, - NULL, - DRI_2D_CONTEXT, - pDRIPriv->partial3DContextStore); - } - - /* Call kernel to release lock */ - DRIUnlock(pScreen); - - /* Grab drawable spin lock: a time out between 10 and 30 seconds is - appropriate, since this should never time out except in the case of - client death while the lock is being held. The timeout must be - greater than any reasonable rendering time. */ - DRISpinLockTimeout(&pDRIPriv->pSAREA->drawable_lock, 1, 10000); /*10 secs*/ - - /* Call kernel flush outstanding buffers and relock */ - DRILock(pScreen, DRM_LOCK_QUIESCENT|DRM_LOCK_FLUSH_ALL); - - /* Switch back to our 2D context if the X context is hidden */ - if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) { - /* hide X context by swapping 2D component here */ - (*pDRIPriv->pDriverInfo->SwapContext)(pScreen, - DRI_3D_SYNC, - DRI_2D_CONTEXT, - pDRIPriv->partial3DContextStore, - DRI_2D_CONTEXT, - pDRIPriv->hiddenContextStore); - } -} - -/* It appears that somebody is relying on the lock being set even - if we aren't touching 3D windows */ - -#define DRI_BROKEN - -static Bool DRIWindowsTouched = FALSE; - -int -DRIValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind) -{ - ScreenPtr pScreen = pParent->drawable.pScreen; - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - - int returnValue = 1; /* always return 1, not checked by dix/window.c */ - - if(!pDRIPriv) return returnValue; - - DRIWindowsTouched = FALSE; - -#ifdef DRI_BROKEN - if(!DRIWindowsTouched) { - DRILockTree(pScreen); - DRIWindowsTouched = TRUE; - } -#endif - - /* call lower wrapped functions */ - if(pDRIPriv->wrap.ValidateTree) { - /* unwrap */ - pScreen->ValidateTree = pDRIPriv->wrap.ValidateTree; - - /* call lower layers */ - returnValue = (*pScreen->ValidateTree)(pParent, pChild, kind); - - /* rewrap */ - pDRIPriv->wrap.ValidateTree = pScreen->ValidateTree; - pScreen->ValidateTree = DRIValidateTree; - } - - return returnValue; -} - -void -DRIPostValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind) -{ - ScreenPtr pScreen; - DRIScreenPrivPtr pDRIPriv; - - if (pParent) { - pScreen = pParent->drawable.pScreen; - } else { - pScreen = pChild->drawable.pScreen; - } - if(!(pDRIPriv = DRI_SCREEN_PRIV(pScreen))) return; - - if (pDRIPriv->wrap.PostValidateTree) { - /* unwrap */ - pScreen->PostValidateTree = pDRIPriv->wrap.PostValidateTree; - - /* call lower layers */ - (*pScreen->PostValidateTree)(pParent, pChild, kind); - - /* rewrap */ - pDRIPriv->wrap.PostValidateTree = pScreen->PostValidateTree; - pScreen->PostValidateTree = DRIPostValidateTree; - } - - if (DRIWindowsTouched) { - /* Release spin lock */ - DRM_SPINUNLOCK(&pDRIPriv->pSAREA->drawable_lock, 1); - DRIWindowsTouched = FALSE; - } -} - -void -DRIClipNotify(WindowPtr pWin, int dx, int dy) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - DRIDrawablePrivPtr pDRIDrawablePriv; - - if(!pDRIPriv) return; - - if ((pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin))) { - -#ifndef DRI_BROKEN - if(!DRIWindowsTouched) { - DRILockTree(pScreen); - DRIWindowsTouched = TRUE; - } -#endif - - pDRIPriv->pSAREA->drawableTable[pDRIDrawablePriv->drawableIndex].stamp - = DRIDrawableValidationStamp++; - } - - /* call lower wrapped functions */ - if(pDRIPriv->wrap.ClipNotify) { - - /* unwrap */ - pScreen->ClipNotify = pDRIPriv->wrap.ClipNotify; - - /* call lower layers */ - (*pScreen->ClipNotify)(pWin, dx, dy); - - /* rewrap */ - pDRIPriv->wrap.ClipNotify = pScreen->ClipNotify; - pScreen->ClipNotify = DRIClipNotify; - } -} - -CARD32 -DRIGetDrawableIndex(WindowPtr pWin) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - DRIDrawablePrivPtr pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin); - CARD32 index; - - if (pDRIDrawablePriv) { - index = pDRIDrawablePriv->drawableIndex; - } - else { - index = pDRIPriv->pDriverInfo->ddxDrawableTableEntry; - } - - return index; -} - -unsigned int -DRIGetDrawableStamp(ScreenPtr pScreen, CARD32 drawable_index) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - return pDRIPriv->pSAREA->drawableTable[drawable_index].stamp; -} - - -void -DRIPrintDrawableLock(ScreenPtr pScreen, char *msg) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - - ErrorF("%s: %d\n", msg, pDRIPriv->pSAREA->drawable_lock.lock); -} - -void -DRILock(ScreenPtr pScreen, int flags) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - if(!pDRIPriv) return; - - if (!pDRIPriv->lockRefCount) - DRM_LOCK(pDRIPriv->drmFD, pDRIPriv->pSAREA, pDRIPriv->myContext, flags); - pDRIPriv->lockRefCount++; -} - -void -DRIUnlock(ScreenPtr pScreen) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - if(!pDRIPriv) return; - - if (pDRIPriv->lockRefCount > 0) { - pDRIPriv->lockRefCount--; - } - else { - ErrorF("DRIUnlock called when not locked\n"); - return; - } - if (!pDRIPriv->lockRefCount) - DRM_UNLOCK(pDRIPriv->drmFD, pDRIPriv->pSAREA, pDRIPriv->myContext); -} - -void * -DRIGetSAREAPrivate(ScreenPtr pScreen) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - if (!pDRIPriv) return 0; - - return (void *)(((char*)pDRIPriv->pSAREA)+sizeof(XF86DRISAREARec)); -} - -drm_context_t -DRIGetContext(ScreenPtr pScreen) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - if (!pDRIPriv) return 0; - - return pDRIPriv->myContext; -} - -/* This lets get at the unwrapped functions so that they can correctly - * call the lowerlevel functions, and choose whether they will be - * called at every level of recursion (eg in validatetree). - */ -DRIWrappedFuncsRec * -DRIGetWrappedFuncs(ScreenPtr pScreen) -{ - return &(DRI_SCREEN_PRIV(pScreen)->wrap); -} - -/* note that this returns the library version, not the protocol version */ -void -DRIQueryVersion(int *majorVersion, - int *minorVersion, - int *patchVersion) -{ - *majorVersion = DRIINFO_MAJOR_VERSION; - *minorVersion = DRIINFO_MINOR_VERSION; - *patchVersion = DRIINFO_PATCH_VERSION; -} - -static void -_DRIAdjustFrame(ScrnInfoPtr pScrn, DRIScreenPrivPtr pDRIPriv, int x, int y) -{ - pDRIPriv->pSAREA->frame.x = x; - pDRIPriv->pSAREA->frame.y = y; - pDRIPriv->pSAREA->frame.width = pScrn->frameX1 - x + 1; - pDRIPriv->pSAREA->frame.height = pScrn->frameY1 - y + 1; -} - -void -DRIAdjustFrame(int scrnIndex, int x, int y, int flags) -{ - ScreenPtr pScreen = screenInfo.screens[scrnIndex]; - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - int px, py; - - if (!pDRIPriv || !pDRIPriv->pSAREA) { - DRIDrvMsg(scrnIndex, X_ERROR, "[DRI] No SAREA (%p %p)\n", - pDRIPriv, pDRIPriv ? pDRIPriv->pSAREA : NULL); - return; - } - - if (pDRIPriv->fullscreen) { - /* Fix up frame */ - pScrn->frameX0 = pDRIPriv->pSAREA->frame.x; - pScrn->frameY0 = pDRIPriv->pSAREA->frame.y; - pScrn->frameX1 = pScrn->frameX0 + pDRIPriv->pSAREA->frame.width - 1; - pScrn->frameY1 = pScrn->frameY0 + pDRIPriv->pSAREA->frame.height - 1; - - /* Fix up cursor */ - miPointerPosition(&px, &py); - if (px < pScrn->frameX0) px = pScrn->frameX0; - if (px > pScrn->frameX1) px = pScrn->frameX1; - if (py < pScrn->frameY0) py = pScrn->frameY0; - if (py > pScrn->frameY1) py = pScrn->frameY1; - pScreen->SetCursorPosition(pScreen, px, py, TRUE); - return; - } - - if (pDRIPriv->wrap.AdjustFrame) { - /* unwrap */ - pScrn->AdjustFrame = pDRIPriv->wrap.AdjustFrame; - /* call lower layers */ - (*pScrn->AdjustFrame)(scrnIndex, x, y, flags); - /* rewrap */ - pDRIPriv->wrap.AdjustFrame = pScrn->AdjustFrame; - pScrn->AdjustFrame = DRIAdjustFrame; - } - - _DRIAdjustFrame(pScrn, pDRIPriv, x, y); -} - -/* - * DRIMoveBuffersHelper swaps the regions rects in place leaving you - * a region with the rects in the order that you need to blit them, - * but it is possibly (likely) an invalid region afterwards. If you - * need to use the region again for anything you have to call - * REGION_VALIDATE on it, or better yet, save a copy first. - */ - -void -DRIMoveBuffersHelper( - ScreenPtr pScreen, - int dx, - int dy, - int *xdir, - int *ydir, - RegionPtr reg -) -{ - BoxPtr extents, pbox, firstBox, lastBox; - BoxRec tmpBox; - int y, nbox; - - extents = REGION_EXTENTS(pScreen, reg); - nbox = REGION_NUM_RECTS(reg); - pbox = REGION_RECTS(reg); - - if((dy > 0) && (dy < (extents->y2 - extents->y1))) { - *ydir = -1; - if(nbox > 1) { - firstBox = pbox; - lastBox = pbox + nbox - 1; - while((unsigned long)firstBox < (unsigned long)lastBox) { - tmpBox = *firstBox; - *firstBox = *lastBox; - *lastBox = tmpBox; - firstBox++; - lastBox--; - } - } - } else *ydir = 1; - - if((dx > 0) && (dx < (extents->x2 - extents->x1))) { - *xdir = -1; - if(nbox > 1) { - firstBox = lastBox = pbox; - y = pbox->y1; - while(--nbox) { - pbox++; - if(pbox->y1 == y) lastBox++; - else { - while((unsigned long)firstBox < (unsigned long)lastBox) { - tmpBox = *firstBox; - *firstBox = *lastBox; - *lastBox = tmpBox; - firstBox++; - lastBox--; - } - - firstBox = lastBox = pbox; - y = pbox->y1; - } - } - while((unsigned long)firstBox < (unsigned long)lastBox) { - tmpBox = *firstBox; - *firstBox = *lastBox; - *lastBox = tmpBox; - firstBox++; - lastBox--; - } - } - } else *xdir = 1; - -} - -char * -DRICreatePCIBusID(pciVideoPtr PciInfo) -{ - char *busID; - int domain; - PCITAG tag; - - busID = xalloc(20); - if (busID == NULL) - return NULL; - - tag = pciTag(PciInfo->bus, PciInfo->device, PciInfo->func); - domain = xf86GetPciDomain(tag); - snprintf(busID, 20, "pci:%04x:%02x:%02x.%d", domain, PciInfo->bus, - PciInfo->device, PciInfo->func); - return busID; -} diff --git a/nx-X11/programs/Xserver/GL/dri/dri.h b/nx-X11/programs/Xserver/GL/dri/dri.h deleted file mode 100644 index 312e8a8bb..000000000 --- a/nx-X11/programs/Xserver/GL/dri/dri.h +++ /dev/null @@ -1,345 +0,0 @@ -/* $XFree86: xc/programs/Xserver/GL/dri/dri.h,v 1.18 2001/03/21 16:21:40 dawes Exp $ */ -/************************************************************************** - -Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sub license, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice (including the -next paragraph) shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -**************************************************************************/ - -/* - * Authors: - * Jens Owen - * - */ - -/* Prototypes for DRI functions */ - -#ifndef _DRI_H_ - -#include "scrnintstr.h" -#include "xf86dri.h" - -typedef int DRISyncType; - -#define DRI_NO_SYNC 0 -#define DRI_2D_SYNC 1 -#define DRI_3D_SYNC 2 - -typedef int DRIContextType; - -typedef struct _DRIContextPrivRec DRIContextPrivRec, *DRIContextPrivPtr; - -typedef enum _DRIContextFlags -{ - DRI_CONTEXT_2DONLY = 0x01, - DRI_CONTEXT_PRESERVED = 0x02, - DRI_CONTEXT_RESERVED = 0x04 /* DRI Only -- no kernel equivalent */ -} DRIContextFlags; - -#define DRI_NO_CONTEXT 0 -#define DRI_2D_CONTEXT 1 -#define DRI_3D_CONTEXT 2 - -typedef int DRISwapMethod; - -#define DRI_HIDE_X_CONTEXT 0 -#define DRI_SERVER_SWAP 1 -#define DRI_KERNEL_SWAP 2 - -typedef int DRIWindowRequests; - -#define DRI_NO_WINDOWS 0 -#define DRI_3D_WINDOWS_ONLY 1 -#define DRI_ALL_WINDOWS 2 - - -typedef void (*ClipNotifyPtr)( WindowPtr, int, int ); -typedef void (*AdjustFramePtr)(int scrnIndex, int x, int y, int flags); - - -/* - * These functions can be wrapped by the DRI. Each of these have - * generic default funcs (initialized in DRICreateInfoRec) and can be - * overridden by the driver in its [driver]DRIScreenInit function. - */ -typedef struct { - ScreenWakeupHandlerProcPtr WakeupHandler; - ScreenBlockHandlerProcPtr BlockHandler; - WindowExposuresProcPtr WindowExposures; - CopyWindowProcPtr CopyWindow; - ValidateTreeProcPtr ValidateTree; - PostValidateTreeProcPtr PostValidateTree; - ClipNotifyProcPtr ClipNotify; - AdjustFramePtr AdjustFrame; -} DRIWrappedFuncsRec, *DRIWrappedFuncsPtr; - - -/* - * Prior to Xorg 6.8.99.8, the DRIInfoRec structure was implicitly versioned - * by the XF86DRI_*_VERSION defines in xf86dristr.h. These numbers were also - * being used to version the XFree86-DRI protocol. Bugs #3066 and #3163 - * showed that this was inadequate. The DRIInfoRec structure is now versioned - * by the DRIINFO_*_VERSION defines in this file. - ajax, 2005-05-18. - * - * Revision history: - * 4.1.0 and earlier: DRIQueryVersion returns XF86DRI_*_VERSION. - * 4.2.0: DRIQueryVersion begins returning DRIINFO_*_VERSION. - * 5.0.0: frameBufferPhysicalAddress changed from CARD32 to pointer. - */ - -#define DRIINFO_MAJOR_VERSION 5 -#define DRIINFO_MINOR_VERSION 0 -#define DRIINFO_PATCH_VERSION 0 - -typedef struct { - /* driver call back functions - * - * New fields should be added at the end for backwards compatibility. - * Bump the DRIINFO patch number to indicate bugfixes. - * Bump the DRIINFO minor number to indicate new fields. - * Bump the DRIINFO major number to indicate binary-incompatible changes. - */ - Bool (*CreateContext)(ScreenPtr pScreen, - VisualPtr visual, - drm_context_t hHWContext, - void* pVisualConfigPriv, - DRIContextType context); - void (*DestroyContext)(ScreenPtr pScreen, - drm_context_t hHWContext, - DRIContextType context); - void (*SwapContext)(ScreenPtr pScreen, - DRISyncType syncType, - DRIContextType readContextType, - void* readContextStore, - DRIContextType writeContextType, - void* writeContextStore); - void (*InitBuffers)(WindowPtr pWin, - RegionPtr prgn, - CARD32 indx); - void (*MoveBuffers)(WindowPtr pWin, - DDXPointRec ptOldOrg, - RegionPtr prgnSrc, - CARD32 indx); - void (*TransitionTo3d)(ScreenPtr pScreen); - void (*TransitionTo2d)(ScreenPtr pScreen); - - void (*SetDrawableIndex)(WindowPtr pWin, CARD32 indx); - Bool (*OpenFullScreen)(ScreenPtr pScreen); - Bool (*CloseFullScreen)(ScreenPtr pScreen); - - /* wrapped functions */ - DRIWrappedFuncsRec wrap; - - /* device info */ - char* drmDriverName; - char* clientDriverName; - char* busIdString; - int ddxDriverMajorVersion; - int ddxDriverMinorVersion; - int ddxDriverPatchVersion; - pointer frameBufferPhysicalAddress; - long frameBufferSize; - long frameBufferStride; - long SAREASize; - int maxDrawableTableEntry; - int ddxDrawableTableEntry; - long contextSize; - DRISwapMethod driverSwapMethod; - DRIWindowRequests bufferRequests; - int devPrivateSize; - void* devPrivate; - Bool createDummyCtx; - Bool createDummyCtxPriv; - - /* New with DRI version 4.1.0 */ - void (*TransitionSingleToMulti3D)(ScreenPtr pScreen); - void (*TransitionMultiToSingle3D)(ScreenPtr pScreen); -} DRIInfoRec, *DRIInfoPtr; - - -extern Bool DRIScreenInit(ScreenPtr pScreen, - DRIInfoPtr pDRIInfo, - int *pDRMFD); - -extern void DRICloseScreen(ScreenPtr pScreen); - -extern Bool DRIExtensionInit(void); - -extern void DRIReset(void); - -extern Bool DRIQueryDirectRenderingCapable(ScreenPtr pScreen, - Bool *isCapable); - -extern Bool DRIOpenConnection(ScreenPtr pScreen, - drm_handle_t * hSAREA, - char **busIdString); - -extern Bool DRIAuthConnection(ScreenPtr pScreen, drm_magic_t magic); - -extern Bool DRICloseConnection(ScreenPtr pScreen); - -extern Bool DRIGetClientDriverName(ScreenPtr pScreen, - int* ddxDriverMajorVersion, - int* ddxDriverMinorVersion, - int* ddxDriverPatchVersion, - char** clientDriverName); - -extern Bool DRICreateContext(ScreenPtr pScreen, - VisualPtr visual, - XID context, - drm_context_t * pHWContext); - -extern Bool DRIDestroyContext(ScreenPtr pScreen, XID context); - -extern Bool DRIContextPrivDelete(pointer pResource, XID id); - -extern Bool DRICreateDrawable(ScreenPtr pScreen, - Drawable id, - DrawablePtr pDrawable, - drm_drawable_t * hHWDrawable); - -extern Bool DRIDestroyDrawable(ScreenPtr pScreen, - Drawable id, - DrawablePtr pDrawable); - -extern Bool DRIDrawablePrivDelete(pointer pResource, - XID id); - -extern Bool DRIGetDrawableInfo(ScreenPtr pScreen, - DrawablePtr pDrawable, - unsigned int* indx, - unsigned int* stamp, - int* X, - int* Y, - int* W, - int* H, - int* numClipRects, - drm_clip_rect_t ** pClipRects, - int* backX, - int* backY, - int* numBackClipRects, - drm_clip_rect_t ** pBackClipRects); - -extern Bool DRIGetDeviceInfo(ScreenPtr pScreen, - drm_handle_t * hFrameBuffer, - int* fbOrigin, - int* fbSize, - int* fbStride, - int* devPrivateSize, - void** pDevPrivate); - -extern DRIInfoPtr DRICreateInfoRec(void); - -extern void DRIDestroyInfoRec(DRIInfoPtr DRIInfo); - -extern Bool DRIFinishScreenInit(ScreenPtr pScreen); - -extern void DRIWakeupHandler(pointer wakeupData, - int result, - pointer pReadmask); - -extern void DRIBlockHandler(pointer blockData, - OSTimePtr pTimeout, - pointer pReadmask); - -extern void DRIDoWakeupHandler(int screenNum, - pointer wakeupData, - unsigned long result, - pointer pReadmask); - -extern void DRIDoBlockHandler(int screenNum, - pointer blockData, - pointer pTimeout, - pointer pReadmask); - -extern void DRISwapContext(int drmFD, - void *oldctx, - void *newctx); - -extern void *DRIGetContextStore(DRIContextPrivPtr context); - -extern void DRIWindowExposures(WindowPtr pWin, - RegionPtr prgn, - RegionPtr bsreg); - -extern void DRICopyWindow(WindowPtr pWin, - DDXPointRec ptOldOrg, - RegionPtr prgnSrc); - -extern int DRIValidateTree(WindowPtr pParent, - WindowPtr pChild, - VTKind kind); - -extern void DRIPostValidateTree(WindowPtr pParent, - WindowPtr pChild, - VTKind kind); - -extern void DRIClipNotify(WindowPtr pWin, - int dx, - int dy); - -extern CARD32 DRIGetDrawableIndex(WindowPtr pWin); - -extern void DRIPrintDrawableLock(ScreenPtr pScreen, char *msg); - -extern void DRILock(ScreenPtr pScreen, int flags); - -extern void DRIUnlock(ScreenPtr pScreen); - -extern DRIWrappedFuncsRec *DRIGetWrappedFuncs(ScreenPtr pScreen); - -extern void *DRIGetSAREAPrivate(ScreenPtr pScreen); - -extern unsigned int DRIGetDrawableStamp(ScreenPtr pScreen, - CARD32 drawable_index); - -extern DRIContextPrivPtr DRICreateContextPriv(ScreenPtr pScreen, - drm_context_t * pHWContext, - DRIContextFlags flags); - -extern DRIContextPrivPtr DRICreateContextPrivFromHandle(ScreenPtr pScreen, - drm_context_t hHWContext, - DRIContextFlags flags); - -extern Bool DRIDestroyContextPriv(DRIContextPrivPtr pDRIContextPriv); - -extern drm_context_t DRIGetContext(ScreenPtr pScreen); - -extern void DRIQueryVersion(int *majorVersion, - int *minorVersion, - int *patchVersion); - -extern void DRIAdjustFrame(int scrnIndex, int x, int y, int flags); - -extern void DRIMoveBuffersHelper(ScreenPtr pScreen, - int dx, - int dy, - int *xdir, - int *ydir, - RegionPtr reg); - -extern char *DRICreatePCIBusID(pciVideoPtr PciInfo); - -#define _DRI_H_ - -#endif diff --git a/nx-X11/programs/Xserver/GL/dri/drimodule.c b/nx-X11/programs/Xserver/GL/dri/drimodule.c deleted file mode 100644 index 922c6f40e..000000000 --- a/nx-X11/programs/Xserver/GL/dri/drimodule.c +++ /dev/null @@ -1,127 +0,0 @@ -/* $XdotOrg: xc/programs/Xserver/GL/dri/drimodule.c,v 1.6 2005/11/02 15:53:57 kem Exp $ */ -/************************************************************************** - -Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. -All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sub license, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice (including the -next paragraph) shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -**************************************************************************/ -/* $XFree86: xc/programs/Xserver/GL/dri/drimodule.c,v 1.5 2001/06/15 21:22:39 dawes Exp $ */ - -/* - * Authors: - * Kevin E. Martin - * Rickard E. Faith - * - */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "xf86Module.h" -#include "globals.h" - -static MODULESETUPPROTO(driSetup); - -static XF86ModuleVersionInfo VersRec = -{ - "dri", - MODULEVENDORSTRING, - MODINFOSTRING1, - MODINFOSTRING2, - XORG_VERSION_CURRENT, - 1, 0, 0, - ABI_CLASS_EXTENSION, - ABI_EXTENSION_VERSION, - MOD_CLASS_NONE, - {0,0,0,0} -}; - -extern void XFree86DRIExtensionInit(INITARGS); -#define _XF86DRI_SERVER_ -#include "xf86dristr.h" - -ExtensionModule XF86DRIExt = -{ - XFree86DRIExtensionInit, - XF86DRINAME, - &noXFree86DRIExtension, - NULL, - NULL -}; - -static const char *drmSymbols[] = { - "drmAddContextTag", - "drmAddMap", - "drmAuthMagic", - "drmAvailable", - "drmClose", - "drmCreateContext", - "drmCreateDrawable", - "drmDelContextTag", - "drmDestroyContext", - "drmDestroyDrawable", - "drmFreeReservedContextList", - "drmGetContextTag", - "drmGetLock", - "drmGetReservedContextList", - "drmInstallSIGIOHandler", - "drmMap", - "drmOpen", - "drmRemoveSIGIOHandler", - "drmSetBusid", - "drmSetContextFlags", - "drmUnlock", - "drmUnmap", - NULL -}; - -XF86ModuleData driModuleData = { &VersRec, driSetup, NULL }; - -static pointer -driSetup(pointer module, pointer opts, int *errmaj, int *errmin) -{ - static Bool setupDone = FALSE; - pointer drm = NULL; - - if (!setupDone) { - setupDone = TRUE; - - drm = - LoadSubModule(module, "drm", NULL, NULL, NULL, NULL, errmaj, errmin); - - if (!drm) { - if (errmaj) *errmaj = LDR_NOSUBENT; - } - else { - LoaderReqSymLists(drmSymbols, NULL); - LoaderRefSymbols("noPanoramiXExtension", NULL); - LoadExtension(&XF86DRIExt, FALSE); - } - } else { - if (errmaj) *errmaj = LDR_ONCEONLY; - } - /* Need a non-NULL return value to indicate success */ - return drm; -} - diff --git a/nx-X11/programs/Xserver/GL/dri/dristruct.h b/nx-X11/programs/Xserver/GL/dri/dristruct.h deleted file mode 100644 index b47afba3a..000000000 --- a/nx-X11/programs/Xserver/GL/dri/dristruct.h +++ /dev/null @@ -1,105 +0,0 @@ -/* $XFree86: xc/programs/Xserver/GL/dri/dristruct.h,v 1.12 2002/10/30 12:52:03 alanh Exp $ */ -/************************************************************************** - -Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sub license, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice (including the -next paragraph) shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -**************************************************************************/ - -/* - * Authors: - * Jens Owen - * - */ - -#ifndef DRI_STRUCT_H -#define DRI_STRUCT_H - -#include "xf86drm.h" - - -#define DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin) \ - ((DRIWindowPrivIndex < 0) ? \ - NULL : \ - ((DRIDrawablePrivPtr)((pWin)->devPrivates[DRIWindowPrivIndex].ptr))) - -#define DRI_DRAWABLE_PRIV_FROM_PIXMAP(pPix) \ - ((DRIPixmapPrivIndex < 0) ? \ - NULL : \ - ((DRIDrawablePrivPtr)((pPix)->devPrivates[DRIWindowPrivIndex].ptr))) - -typedef struct _DRIDrawablePrivRec -{ - drm_drawable_t hwDrawable; - int drawableIndex; - ScreenPtr pScreen; - int refCount; -} DRIDrawablePrivRec, *DRIDrawablePrivPtr; - -struct _DRIContextPrivRec -{ - drm_context_t hwContext; - ScreenPtr pScreen; - Bool valid3D; - DRIContextFlags flags; - void** pContextStore; -}; - -#define DRI_SCREEN_PRIV(pScreen) \ - ((DRIScreenPrivIndex < 0) ? \ - NULL : \ - ((DRIScreenPrivPtr)((pScreen)->devPrivates[DRIScreenPrivIndex].ptr))) - -#define DRI_SCREEN_PRIV_FROM_INDEX(screenIndex) ((DRIScreenPrivPtr) \ - (screenInfo.screens[screenIndex]->devPrivates[DRIScreenPrivIndex].ptr)) - - -typedef struct _DRIScreenPrivRec -{ - Bool directRenderingSupport; - int drmFD; /* File descriptor for /dev/video/? */ - drm_handle_t hSAREA; /* Handle to SAREA, for mapping */ - XF86DRISAREAPtr pSAREA; /* Mapped pointer to SAREA */ - drm_handle_t hFrameBuffer; /* Handle to framebuffer, for mapping */ - drm_context_t myContext; /* DDX Driver's context */ - DRIContextPrivPtr myContextPriv;/* Pointer to server's private area */ - DRIContextPrivPtr lastPartial3DContext; /* last one partially saved */ - void** hiddenContextStore; /* hidden X context */ - void** partial3DContextStore; /* parital 3D context */ - DRIInfoPtr pDriverInfo; - int nrWindows; - drm_clip_rect_t private_buffer_rect; /* management of private buffers */ - DrawablePtr fullscreen; /* pointer to fullscreen drawable */ - drm_clip_rect_t fullscreen_rect; /* fake rect for fullscreen mode */ - DRIWrappedFuncsRec wrap; - DrawablePtr DRIDrawables[SAREA_MAX_DRAWABLES]; - DRIContextPrivPtr dummyCtxPriv; /* Pointer to dummy context */ - Bool createDummyCtx; - Bool createDummyCtxPriv; - Bool grabbedDRILock; - Bool drmSIGIOHandlerInstalled; - Bool wrapped; - int lockRefCount; -} DRIScreenPrivRec, *DRIScreenPrivPtr; - -#endif /* DRI_STRUCT_H */ diff --git a/nx-X11/programs/Xserver/GL/dri/sarea.h b/nx-X11/programs/Xserver/GL/dri/sarea.h deleted file mode 100644 index 77c16e0ef..000000000 --- a/nx-X11/programs/Xserver/GL/dri/sarea.h +++ /dev/null @@ -1,94 +0,0 @@ -/* $XFree86: xc/programs/Xserver/GL/dri/sarea.h,v 1.11 2002/10/30 12:52:03 alanh Exp $ */ -/** - * \file sarea.h - * SAREA definitions. - * - * \author Kevin E. Martin - * \author Jens Owen - * \author Rickard E. (Rik) Faith - */ - -/* - * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. - * Copyright 2000 VA Linux Systems, Inc. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. - * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* $XFree86: xc/programs/Xserver/GL/dri/sarea.h,v 1.11 2002/10/30 12:52:03 alanh Exp $ */ - -#ifndef _SAREA_H_ -#define _SAREA_H_ - -#include "xf86drm.h" - -/* SAREA area needs to be at least a page */ -#if defined(__alpha__) -#define SAREA_MAX 0x2000 -#elif defined(__ia64__) -#define SAREA_MAX 0x10000 /* 64kB */ -#else -/* Intel 830M driver needs at least 8k SAREA */ -#define SAREA_MAX 0x2000 -#endif - -#define SAREA_MAX_DRAWABLES 256 - -#define SAREA_DRAWABLE_CLAIMED_ENTRY 0x80000000 - -/** - * SAREA per drawable information. - * - * \sa _XF86DRISAREA. - */ -typedef struct _XF86DRISAREADrawable { - unsigned int stamp; - unsigned int flags; -} XF86DRISAREADrawableRec, *XF86DRISAREADrawablePtr; - -/** - * SAREA frame information. - * - * \sa _XF86DRISAREA. - */ -typedef struct _XF86DRISAREAFrame { - unsigned int x; - unsigned int y; - unsigned int width; - unsigned int height; - unsigned int fullscreen; -} XF86DRISAREAFrameRec, *XF86DRISAREAFramePtr; - -/** - * SAREA definition. - */ -typedef struct _XF86DRISAREA { - /** first thing is always the DRM locking structure */ - drmLock lock; - /** \todo Use readers/writer lock for drawable_lock */ - drmLock drawable_lock; - XF86DRISAREADrawableRec drawableTable[SAREA_MAX_DRAWABLES]; - XF86DRISAREAFrameRec frame; - drm_context_t dummy_context; -} XF86DRISAREARec, *XF86DRISAREAPtr; - -#endif diff --git a/nx-X11/programs/Xserver/GL/dri/xf86dri.c b/nx-X11/programs/Xserver/GL/dri/xf86dri.c deleted file mode 100644 index 273ccda1b..000000000 --- a/nx-X11/programs/Xserver/GL/dri/xf86dri.c +++ /dev/null @@ -1,649 +0,0 @@ -/* $XFree86: xc/programs/Xserver/GL/dri/xf86dri.c,v 1.12 2002/12/14 01:36:08 dawes Exp $ */ -/************************************************************************** - -Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -Copyright 2000 VA Linux Systems, Inc. -All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sub license, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice (including the -next paragraph) shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -**************************************************************************/ - -/* - * Authors: - * Kevin E. Martin - * Jens Owen - * Rickard E. (Rik) Faith - * - */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "xf86.h" -#ifdef XFree86LOADER -#include "xf86_ansic.h" -#endif - -#define NEED_REPLIES -#define NEED_EVENTS -#include -#include -#include "misc.h" -#include "dixstruct.h" -#include "extnsionst.h" -#include "colormapst.h" -#include "cursorstr.h" -#include "scrnintstr.h" -#include "servermd.h" -#define _XF86DRI_SERVER_ -#include "xf86dristr.h" -#include "swaprep.h" -#include "xf86str.h" -#include "dri.h" -#include "sarea.h" -#include "dristruct.h" -#include "xf86.h" -#include "xf86drm.h" - -static int DRIErrorBase; - -static DISPATCH_PROC(ProcXF86DRIQueryVersion); -static DISPATCH_PROC(ProcXF86DRIQueryDirectRenderingCapable); -static DISPATCH_PROC(ProcXF86DRIOpenConnection); -static DISPATCH_PROC(ProcXF86DRICloseConnection); -static DISPATCH_PROC(ProcXF86DRIGetClientDriverName); -static DISPATCH_PROC(ProcXF86DRICreateContext); -static DISPATCH_PROC(ProcXF86DRIDestroyContext); -static DISPATCH_PROC(ProcXF86DRICreateDrawable); -static DISPATCH_PROC(ProcXF86DRIDestroyDrawable); -static DISPATCH_PROC(ProcXF86DRIGetDrawableInfo); -static DISPATCH_PROC(ProcXF86DRIGetDeviceInfo); -static DISPATCH_PROC(ProcXF86DRIDispatch); -static DISPATCH_PROC(ProcXF86DRIAuthConnection); - -static DISPATCH_PROC(SProcXF86DRIQueryVersion); -static DISPATCH_PROC(SProcXF86DRIDispatch); - -static void XF86DRIResetProc(ExtensionEntry* extEntry); - -static unsigned char DRIReqCode = 0; - -extern void XFree86DRIExtensionInit(void); - -void -XFree86DRIExtensionInit(void) -{ - ExtensionEntry* extEntry; - -#ifdef XF86DRI_EVENTS - EventType = CreateNewResourceType(XF86DRIFreeEvents); -#endif - - if ( - DRIExtensionInit() && -#ifdef XF86DRI_EVENTS - EventType && ScreenPrivateIndex != -1 && -#endif - (extEntry = AddExtension(XF86DRINAME, - XF86DRINumberEvents, - XF86DRINumberErrors, - ProcXF86DRIDispatch, - SProcXF86DRIDispatch, - XF86DRIResetProc, - StandardMinorOpcode))) { - DRIReqCode = (unsigned char)extEntry->base; - DRIErrorBase = extEntry->errorBase; - } -} - -/*ARGSUSED*/ -static void -XF86DRIResetProc ( - ExtensionEntry* extEntry -) -{ - DRIReset(); -} - -static int -ProcXF86DRIQueryVersion( - register ClientPtr client -) -{ - xXF86DRIQueryVersionReply rep; - register int n; - - REQUEST_SIZE_MATCH(xXF86DRIQueryVersionReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.majorVersion = XF86DRI_MAJOR_VERSION; - rep.minorVersion = XF86DRI_MINOR_VERSION; - rep.patchVersion = XF86DRI_PATCH_VERSION; - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - } - WriteToClient(client, sizeof(xXF86DRIQueryVersionReply), (char *)&rep); - return (client->noClientException); -} - -static int -ProcXF86DRIQueryDirectRenderingCapable( - register ClientPtr client -) -{ - xXF86DRIQueryDirectRenderingCapableReply rep; - Bool isCapable; - - REQUEST(xXF86DRIQueryDirectRenderingCapableReq); - REQUEST_SIZE_MATCH(xXF86DRIQueryDirectRenderingCapableReq); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - - if (!DRIQueryDirectRenderingCapable( screenInfo.screens[stuff->screen], - &isCapable)) { - return BadValue; - } - rep.isCapable = isCapable; - - if (!LocalClient(client)) - rep.isCapable = 0; - - WriteToClient(client, - sizeof(xXF86DRIQueryDirectRenderingCapableReply), (char *)&rep); - return (client->noClientException); -} - -static int -ProcXF86DRIOpenConnection( - register ClientPtr client -) -{ - xXF86DRIOpenConnectionReply rep; - drm_handle_t hSAREA; - char* busIdString; - - REQUEST(xXF86DRIOpenConnectionReq); - REQUEST_SIZE_MATCH(xXF86DRIOpenConnectionReq); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - if (!DRIOpenConnection( screenInfo.screens[stuff->screen], - &hSAREA, - &busIdString)) { - return BadValue; - } - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.busIdStringLength = 0; - if (busIdString) - rep.busIdStringLength = strlen(busIdString); - rep.length = (SIZEOF(xXF86DRIOpenConnectionReply) - SIZEOF(xGenericReply) + - ((rep.busIdStringLength + 3) & ~3)) >> 2; - - rep.hSAREALow = (CARD32)(hSAREA & 0xffffffff); -#if defined(LONG64) && !defined(__linux__) - rep.hSAREAHigh = (CARD32)(hSAREA >> 32); -#else - rep.hSAREAHigh = 0; -#endif - - WriteToClient(client, sizeof(xXF86DRIOpenConnectionReply), (char *)&rep); - if (rep.busIdStringLength) - WriteToClient(client, rep.busIdStringLength, busIdString); - return (client->noClientException); -} - -static int -ProcXF86DRIAuthConnection( - register ClientPtr client -) -{ - xXF86DRIAuthConnectionReply rep; - - REQUEST(xXF86DRIAuthConnectionReq); - REQUEST_SIZE_MATCH(xXF86DRIAuthConnectionReq); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.authenticated = 1; - - if (!DRIAuthConnection( screenInfo.screens[stuff->screen], stuff->magic)) { - ErrorF("Failed to authenticate %lu\n", (unsigned long)stuff->magic); - rep.authenticated = 0; - } - WriteToClient(client, sizeof(xXF86DRIAuthConnectionReply), (char *)&rep); - return (client->noClientException); -} - -static int -ProcXF86DRICloseConnection( - register ClientPtr client -) -{ - REQUEST(xXF86DRICloseConnectionReq); - REQUEST_SIZE_MATCH(xXF86DRICloseConnectionReq); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - DRICloseConnection( screenInfo.screens[stuff->screen]); - - return (client->noClientException); -} - -static int -ProcXF86DRIGetClientDriverName( - register ClientPtr client -) -{ - xXF86DRIGetClientDriverNameReply rep; - char* clientDriverName; - - REQUEST(xXF86DRIGetClientDriverNameReq); - REQUEST_SIZE_MATCH(xXF86DRIGetClientDriverNameReq); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - DRIGetClientDriverName( screenInfo.screens[stuff->screen], - (int *)&rep.ddxDriverMajorVersion, - (int *)&rep.ddxDriverMinorVersion, - (int *)&rep.ddxDriverPatchVersion, - &clientDriverName); - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.clientDriverNameLength = 0; - if (clientDriverName) - rep.clientDriverNameLength = strlen(clientDriverName); - rep.length = (SIZEOF(xXF86DRIGetClientDriverNameReply) - - SIZEOF(xGenericReply) + - ((rep.clientDriverNameLength + 3) & ~3)) >> 2; - - WriteToClient(client, - sizeof(xXF86DRIGetClientDriverNameReply), (char *)&rep); - if (rep.clientDriverNameLength) - WriteToClient(client, - rep.clientDriverNameLength, - clientDriverName); - return (client->noClientException); -} - -static int -ProcXF86DRICreateContext( - register ClientPtr client -) -{ - xXF86DRICreateContextReply rep; - ScreenPtr pScreen; - VisualPtr visual; - int i; - - REQUEST(xXF86DRICreateContextReq); - REQUEST_SIZE_MATCH(xXF86DRICreateContextReq); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - - pScreen = screenInfo.screens[stuff->screen]; - visual = pScreen->visuals; - - /* Find the requested X visual */ - for (i = 0; i < pScreen->numVisuals; i++, visual++) - if (visual->vid == stuff->visual) - break; - if (i == pScreen->numVisuals) { - /* No visual found */ - return BadValue; - } - - if (!DRICreateContext( pScreen, - visual, - stuff->context, - (drm_context_t *)&rep.hHWContext)) { - return BadValue; - } - - WriteToClient(client, sizeof(xXF86DRICreateContextReply), (char *)&rep); - return (client->noClientException); -} - -static int -ProcXF86DRIDestroyContext( - register ClientPtr client -) -{ - REQUEST(xXF86DRIDestroyContextReq); - REQUEST_SIZE_MATCH(xXF86DRIDestroyContextReq); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - if (!DRIDestroyContext( screenInfo.screens[stuff->screen], - stuff->context)) { - return BadValue; - } - - return (client->noClientException); -} - -static int -ProcXF86DRICreateDrawable( - ClientPtr client -) -{ - xXF86DRICreateDrawableReply rep; - DrawablePtr pDrawable; - - REQUEST(xXF86DRICreateDrawableReq); - REQUEST_SIZE_MATCH(xXF86DRICreateDrawableReq); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - - if (!(pDrawable = (DrawablePtr)SecurityLookupDrawable( - (Drawable)stuff->drawable, - client, - SecurityReadAccess))) { - return BadValue; - } - - if (!DRICreateDrawable( screenInfo.screens[stuff->screen], - (Drawable)stuff->drawable, - pDrawable, - (drm_drawable_t *)&rep.hHWDrawable)) { - return BadValue; - } - - WriteToClient(client, sizeof(xXF86DRICreateDrawableReply), (char *)&rep); - return (client->noClientException); -} - -static int -ProcXF86DRIDestroyDrawable( - register ClientPtr client -) -{ - REQUEST(xXF86DRIDestroyDrawableReq); - DrawablePtr pDrawable; - REQUEST_SIZE_MATCH(xXF86DRIDestroyDrawableReq); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - if (!(pDrawable = (DrawablePtr)SecurityLookupDrawable( - (Drawable)stuff->drawable, - client, - SecurityReadAccess))) { - return BadValue; - } - - if (!DRIDestroyDrawable( screenInfo.screens[stuff->screen], - (Drawable)stuff->drawable, - pDrawable)) { - return BadValue; - } - - return (client->noClientException); -} - -static int -ProcXF86DRIGetDrawableInfo( - register ClientPtr client -) -{ - xXF86DRIGetDrawableInfoReply rep; - DrawablePtr pDrawable; - int X, Y, W, H; - drm_clip_rect_t * pClipRects; - drm_clip_rect_t * pBackClipRects; - int backX, backY; - - REQUEST(xXF86DRIGetDrawableInfoReq); - REQUEST_SIZE_MATCH(xXF86DRIGetDrawableInfoReq); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - - if (!(pDrawable = (DrawablePtr)SecurityLookupDrawable( - (Drawable)stuff->drawable, - client, - SecurityReadAccess))) { - return BadValue; - } - - if (!DRIGetDrawableInfo( screenInfo.screens[stuff->screen], - pDrawable, - (unsigned int*)&rep.drawableTableIndex, - (unsigned int*)&rep.drawableTableStamp, - (int*)&X, - (int*)&Y, - (int*)&W, - (int*)&H, - (int*)&rep.numClipRects, - &pClipRects, - &backX, - &backY, - (int*)&rep.numBackClipRects, - &pBackClipRects)) { - return BadValue; - } - - rep.drawableX = X; - rep.drawableY = Y; - rep.drawableWidth = W; - rep.drawableHeight = H; - rep.length = (SIZEOF(xXF86DRIGetDrawableInfoReply) - - SIZEOF(xGenericReply)); - - rep.backX = backX; - rep.backY = backY; - - if (rep.numBackClipRects) - rep.length += sizeof(drm_clip_rect_t) * rep.numBackClipRects; - - if (rep.numClipRects) - rep.length += sizeof(drm_clip_rect_t) * rep.numClipRects; - - rep.length = ((rep.length + 3) & ~3) >> 2; - - WriteToClient(client, sizeof(xXF86DRIGetDrawableInfoReply), (char *)&rep); - - if (rep.numClipRects) { - WriteToClient(client, - sizeof(drm_clip_rect_t) * rep.numClipRects, - (char *)pClipRects); - } - - if (rep.numBackClipRects) { - WriteToClient(client, - sizeof(drm_clip_rect_t) * rep.numBackClipRects, - (char *)pBackClipRects); - } - - return (client->noClientException); -} - -static int -ProcXF86DRIGetDeviceInfo( - register ClientPtr client -) -{ - xXF86DRIGetDeviceInfoReply rep; - drm_handle_t hFrameBuffer; - void *pDevPrivate; - - REQUEST(xXF86DRIGetDeviceInfoReq); - REQUEST_SIZE_MATCH(xXF86DRIGetDeviceInfoReq); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - - if (!DRIGetDeviceInfo( screenInfo.screens[stuff->screen], - &hFrameBuffer, - (int*)&rep.framebufferOrigin, - (int*)&rep.framebufferSize, - (int*)&rep.framebufferStride, - (int*)&rep.devPrivateSize, - &pDevPrivate)) { - return BadValue; - } - - rep.hFrameBufferLow = (CARD32)(hFrameBuffer & 0xffffffff); -#if defined(LONG64) && !defined(__linux__) - rep.hFrameBufferHigh = (CARD32)(hFrameBuffer >> 32); -#else - rep.hFrameBufferHigh = 0; -#endif - - rep.length = 0; - if (rep.devPrivateSize) { - rep.length = (SIZEOF(xXF86DRIGetDeviceInfoReply) - - SIZEOF(xGenericReply) + - ((rep.devPrivateSize + 3) & ~3)) >> 2; - } - - WriteToClient(client, sizeof(xXF86DRIGetDeviceInfoReply), (char *)&rep); - if (rep.length) { - WriteToClient(client, rep.devPrivateSize, (char *)pDevPrivate); - } - return (client->noClientException); -} - -static int -ProcXF86DRIDispatch ( - register ClientPtr client -) -{ - REQUEST(xReq); - - switch (stuff->data) - { - case X_XF86DRIQueryVersion: - return ProcXF86DRIQueryVersion(client); - case X_XF86DRIQueryDirectRenderingCapable: - return ProcXF86DRIQueryDirectRenderingCapable(client); - } - - if (!LocalClient(client)) - return DRIErrorBase + XF86DRIClientNotLocal; - - switch (stuff->data) - { - case X_XF86DRIOpenConnection: - return ProcXF86DRIOpenConnection(client); - case X_XF86DRICloseConnection: - return ProcXF86DRICloseConnection(client); - case X_XF86DRIGetClientDriverName: - return ProcXF86DRIGetClientDriverName(client); - case X_XF86DRICreateContext: - return ProcXF86DRICreateContext(client); - case X_XF86DRIDestroyContext: - return ProcXF86DRIDestroyContext(client); - case X_XF86DRICreateDrawable: - return ProcXF86DRICreateDrawable(client); - case X_XF86DRIDestroyDrawable: - return ProcXF86DRIDestroyDrawable(client); - case X_XF86DRIGetDrawableInfo: - return ProcXF86DRIGetDrawableInfo(client); - case X_XF86DRIGetDeviceInfo: - return ProcXF86DRIGetDeviceInfo(client); - case X_XF86DRIAuthConnection: - return ProcXF86DRIAuthConnection(client); - /* {Open,Close}FullScreen are deprecated now */ - default: - return BadRequest; - } -} - -static int -SProcXF86DRIQueryVersion( - register ClientPtr client -) -{ - register int n; - REQUEST(xXF86DRIQueryVersionReq); - swaps(&stuff->length, n); - return ProcXF86DRIQueryVersion(client); -} - -static int -SProcXF86DRIDispatch ( - register ClientPtr client -) -{ - REQUEST(xReq); - - /* It is bound to be non-local when there is byte swapping */ - if (!LocalClient(client)) - return DRIErrorBase + XF86DRIClientNotLocal; - - /* only local clients are allowed DRI access */ - switch (stuff->data) - { - case X_XF86DRIQueryVersion: - return SProcXF86DRIQueryVersion(client); - default: - return BadRequest; - } -} diff --git a/nx-X11/programs/Xserver/GL/windows/ChangeLog b/nx-X11/programs/Xserver/GL/windows/ChangeLog deleted file mode 100644 index 43a817d6a..000000000 --- a/nx-X11/programs/Xserver/GL/windows/ChangeLog +++ /dev/null @@ -1,64 +0,0 @@ -2005-09-27 Ian Romanick - - * indirect.c: - Remove __glEvalComputeK. It is no longer used. - - -2005-04-09 Alexander Gottwald - - * indirect.c: - Fix passing of non-RGB visuals. The old code did not initialize the - structure properly which lead to a crash in 8bpp mode - -2005-03-01 Alexander Gottwald - - * indirect.c: - * glwindows.h: - If a context is already attached copy it instead of reattaching to keep - displaylists and share displaylists - Enable tracing of often called functions with GLWIN_ENABLE_TRACE - ForceCurrent is a no-op now - -2005-02-02 Alexander Gottwald - - * Imakefile: - Bugzilla #1866 (https://bugs.freedesktop.org/show_bug.cgi?id=1866) - attachment #1819 (https://bugs.freedesktop.org/attachment.cgi?id=1819): - Define APIENTRY on windows to prevent from loading - -2005-02-02 Alexander Gottwald - - * glwrap.c: - * glwindows.h: - Bugzilla #1866 (https://bugs.freedesktop.org/show_bug.cgi?id=1866) - attachment #1818 (https://bugs.freedesktop.org/attachment.cgi?id=1818): - Include Xwindows.h before GL/gl.h to prevent loading windows.h which - pollutes our namespace with some symbols. - -2005-01-27 Alexander Gottwald - - * glwrap.c: - Functions like glGenTextures and glBindTexture are in OpenGL 1.1 - and can be resolved at linktime. - -2004-11-15 Alexander Gottwald - - * indirect.c: - Bugzilla #1802, http://freedesktop.org/bugzilla/show_bug.cgi?id=1802 - Added mingw (Win32) port - -2004-08-13 Alexander Gottwald - - * Imakefile: Added $(MESASRCDIR)/src/mesa/glapi to INCLUDES. - Removed $(SERVERSRC)/mi from INCLUDES. - Rearranged INCLUDES for better readability. - * glwindows.h: Removed mipointrst.h and miscstruct.h from #include - since they are not used anymore. - -2004-05-27 Alexander Gottwald - - * glwindows.h: write current function and line in debug output - * indirect.c: moved actual setup and creation of windows GL context to - glWinCreateContextReal. - * indirect.c (glWinCreateContext): Deferred context creation to attach. - * indirect.c (glWinMakeCurrent): Check if context is NULL. Fixes segfault. diff --git a/nx-X11/programs/Xserver/GL/windows/Imakefile b/nx-X11/programs/Xserver/GL/windows/Imakefile deleted file mode 100755 index 2b3ddeb12..000000000 --- a/nx-X11/programs/Xserver/GL/windows/Imakefile +++ /dev/null @@ -1,36 +0,0 @@ -#include - -LinkSourceFile(compsize.c,$(MESASRCDIR)/src/glx/x11) - - SRCS = compsize.c indirect.c glwrap.c - OBJS = compsize.o indirect.o glwrap.o - - INCLUDES = -I. \ - -I$(INCLUDESRC) \ - -I$(XINCLUDESRC) \ - -I$(EXTINCSRC) \ - -I$(SERVERSRC)/include \ - -I$(SERVERSRC)/render \ - -I$(SERVERSRC)/hw/xwin \ - -I$(SERVERSRC)/GL/include \ - -I$(SERVERSRC)/GL/glx \ - -I$(LIBSRC)/GL/glx \ - -I$(LIBSRC)/GL/include \ - -I$(MESASRCDIR)/include \ - -I$(MESASRCDIR)/src \ - -I$(MESASRCDIR)/src/mesa/glapi \ - $(GL_INCLUDES) - -#if defined(GlxUseWindows) && GlxUseWindows - CYGWIN_GL_DEFINES = -DUSE_OPENGL32 -#endif -#if defined(Win32Architecture) -# undef __stdcall - APIENTRY_DEFS = -DAPIENTRY=__stdcall -#endif - DEFINES = $(GLX_DEFINES) $(CYGWIN_GL_DEFINES) $(APIENTRY_DEFS) - -NormalLibraryTarget(GLcore,$(OBJS)) -NormalLibraryObjectRule() - -DependTarget() diff --git a/nx-X11/programs/Xserver/GL/windows/glwindows.h b/nx-X11/programs/Xserver/GL/windows/glwindows.h deleted file mode 100644 index 74e81f24f..000000000 --- a/nx-X11/programs/Xserver/GL/windows/glwindows.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -typedef struct { - unsigned enableDebug : 1; - unsigned enableTrace : 1; - unsigned dumpPFD : 1; - unsigned dumpHWND : 1; - unsigned dumpDC : 1; -} glWinDebugSettingsRec, *glWinDebugSettingsPtr; -extern glWinDebugSettingsRec glWinDebugSettings; - -typedef struct { - int num_vis; - __GLcontextModes *modes; - void **priv; - - /* wrapped screen functions */ - RealizeWindowProcPtr RealizeWindow; - UnrealizeWindowProcPtr UnrealizeWindow; - CopyWindowProcPtr CopyWindow; -} glWinScreenRec; - -extern glWinScreenRec glWinScreens[MAXSCREENS]; - -#define glWinGetScreenPriv(pScreen) &glWinScreens[pScreen->myNum] -#define glWinScreenPriv(pScreen) glWinScreenRec *pScreenPriv = glWinGetScreenPriv(pScreen); - -#if 1 -#define GLWIN_TRACE() if (glWinDebugSettings.enableTrace) ErrorF("%s:%d: Trace\n", __FUNCTION__, __LINE__ ) -#define GLWIN_TRACE_MSG(msg, args...) if (glWinDebugSettings.enableTrace) ErrorF("%s:%d: " msg, __FUNCTION__, __LINE__, ##args ) -#define GLWIN_DEBUG_MSG(msg, args...) if (glWinDebugSettings.enableDebug) ErrorF("%s:%d: " msg, __FUNCTION__, __LINE__, ##args ) -#define GLWIN_DEBUG_MSG2(msg, args...) if (glWinDebugSettings.enableDebug) ErrorF(msg, ##args ) -#else -#define GLWIN_TRACE() -#define GLWIN_TRACE_MSG(a, ...) -#define GLWIN_DEBUG_MSG(a, ...) -#define GLWIN_DEBUG_MSG2(a, ...) -#endif - diff --git a/nx-X11/programs/Xserver/GL/windows/glwrap.c b/nx-X11/programs/Xserver/GL/windows/glwrap.c deleted file mode 100755 index f0b38b228..000000000 --- a/nx-X11/programs/Xserver/GL/windows/glwrap.c +++ /dev/null @@ -1,583 +0,0 @@ -/* - * GLX implementation that uses Win32's OpenGL - * Wrapper functions for Win32's OpenGL - * - * Authors: Alexander Gottwald - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include - -#define RESOLVE_RET(procname, symbol, retval) \ - static Bool init = TRUE; \ - static procname proc = NULL; \ - if (init) { \ - proc = (procname)wglGetProcAddress(symbol); \ - init = FALSE; \ - if (proc == NULL) { \ - ErrorF("glwrap: Can't resolve \"%s\"\n", symbol); \ - } else \ - ErrorF("glwrap: resolved \"%s\"\n", symbol); \ - } \ - if (proc == NULL) { \ - __glXErrorCallBack(NULL, 0); \ - return retval; \ - } -#define RESOLVE(procname, symbol) RESOLVE_RET(procname, symbol,) - - -/* - * GL_ARB_imaging - */ - - -GLAPI void GLAPIENTRY glColorTable( GLenum target, GLenum internalformat, - GLsizei width, GLenum format, - GLenum type, const GLvoid *table ) -{ - RESOLVE(PFNGLCOLORTABLEPROC, "glColorTable"); - proc(target, internalformat, width, format, type, table); -} - -GLAPI void GLAPIENTRY glColorSubTable( GLenum target, - GLsizei start, GLsizei count, - GLenum format, GLenum type, - const GLvoid *data ) -{ - RESOLVE(PFNGLCOLORSUBTABLEPROC, "glColorSubTable"); - proc(target, start, count, format, type, data); -} - -GLAPI void GLAPIENTRY glColorTableParameteriv(GLenum target, GLenum pname, - const GLint *params) -{ - RESOLVE(PFNGLCOLORTABLEPARAMETERIVPROC, "glColorTableParameteriv"); - proc(target, pname, params); -} - -GLAPI void GLAPIENTRY glColorTableParameterfv(GLenum target, GLenum pname, - const GLfloat *params) -{ - RESOLVE(PFNGLCOLORTABLEPARAMETERFVPROC, "glColorTableParameterfv"); - proc(target, pname, params); -} - -GLAPI void GLAPIENTRY glCopyColorSubTable( GLenum target, GLsizei start, - GLint x, GLint y, GLsizei width ) -{ - RESOLVE(PFNGLCOPYCOLORSUBTABLEPROC, "glCopyColorSubTable"); - proc(target, start, x, y, width); -} - -GLAPI void GLAPIENTRY glCopyColorTable( GLenum target, GLenum internalformat, - GLint x, GLint y, GLsizei width ) -{ - RESOLVE(PFNGLCOPYCOLORTABLEPROC, "glCopyColorTable"); - proc(target, internalformat, x, y, width); -} - - -GLAPI void GLAPIENTRY glGetColorTable( GLenum target, GLenum format, - GLenum type, GLvoid *table ) -{ - RESOLVE(PFNGLGETCOLORTABLEPROC, "glGetColorTable"); - proc(target, format, type, table); -} - -GLAPI void GLAPIENTRY glGetColorTableParameterfv( GLenum target, GLenum pname, - GLfloat *params ) -{ - RESOLVE(PFNGLGETCOLORTABLEPARAMETERFVPROC, "glGetColorTableParameterfv"); - proc(target, pname, params); -} - -GLAPI void GLAPIENTRY glGetColorTableParameteriv( GLenum target, GLenum pname, - GLint *params ) -{ - RESOLVE(PFNGLGETCOLORTABLEPARAMETERIVPROC, "glGetColorTableParameteriv"); - proc(target, pname, params); -} - -GLAPI void GLAPIENTRY glBlendEquation( GLenum mode ) -{ - RESOLVE(PFNGLBLENDEQUATIONPROC, "glBlendEquation"); - proc(mode); -} - -GLAPI void GLAPIENTRY glBlendColor( GLclampf red, GLclampf green, - GLclampf blue, GLclampf alpha ) -{ - RESOLVE(PFNGLBLENDCOLORPROC, "glBlendColor"); - proc(red, green, blue, alpha); -} - -GLAPI void GLAPIENTRY glHistogram( GLenum target, GLsizei width, - GLenum internalformat, GLboolean sink ) -{ - RESOLVE(PFNGLHISTOGRAMPROC, "glHistogram"); - proc(target, width, internalformat, sink); -} - -GLAPI void GLAPIENTRY glResetHistogram( GLenum target ) -{ - RESOLVE(PFNGLRESETHISTOGRAMPROC, "glResetHistogram"); - proc(target); -} - -GLAPI void GLAPIENTRY glGetHistogram( GLenum target, GLboolean reset, - GLenum format, GLenum type, - GLvoid *values ) -{ - RESOLVE(PFNGLGETHISTOGRAMPROC, "glGetHistogram"); - proc(target, reset, format, type, values); -}; - -GLAPI void GLAPIENTRY glGetHistogramParameterfv( GLenum target, GLenum pname, - GLfloat *params ) -{ - RESOLVE(PFNGLGETHISTOGRAMPARAMETERFVPROC, "glGetHistogramParameterfv"); - proc(target, pname, params); -} - -GLAPI void GLAPIENTRY glGetHistogramParameteriv( GLenum target, GLenum pname, - GLint *params ) -{ - RESOLVE(PFNGLGETHISTOGRAMPARAMETERIVPROC, "glGetHistogramParameteriv"); - proc(target, pname, params); -} - -GLAPI void GLAPIENTRY glMinmax( GLenum target, GLenum internalformat, - GLboolean sink ) -{ - RESOLVE(PFNGLMINMAXPROC, "glMinmax"); - proc(target, internalformat, sink); -} - -GLAPI void GLAPIENTRY glResetMinmax( GLenum target ) -{ - RESOLVE(PFNGLRESETMINMAXPROC, "glResetMinmax"); - proc(target); -} - -GLAPI void GLAPIENTRY glGetMinmax( GLenum target, GLboolean reset, - GLenum format, GLenum types, - GLvoid *values ) -{ - RESOLVE(PFNGLGETMINMAXPROC, "glGetMinmax"); - proc(target, reset, format, types, values); -} - -GLAPI void GLAPIENTRY glGetMinmaxParameterfv( GLenum target, GLenum pname, - GLfloat *params ) -{ - RESOLVE(PFNGLGETMINMAXPARAMETERFVPROC, "glGetMinmaxParameterfv"); - proc(target, pname, params); -} - -GLAPI void GLAPIENTRY glGetMinmaxParameteriv( GLenum target, GLenum pname, - GLint *params ) -{ - RESOLVE(PFNGLGETMINMAXPARAMETERIVPROC, "glGetMinmaxParameteriv"); - proc(target, pname, params); -} - -GLAPI void GLAPIENTRY glConvolutionFilter1D( GLenum target, - GLenum internalformat, GLsizei width, GLenum format, GLenum type, - const GLvoid *image ) -{ - RESOLVE(PFNGLCONVOLUTIONFILTER1DPROC, "glConvolutionFilter1D"); - proc(target, internalformat, width, format, type, image); -} - -GLAPI void GLAPIENTRY glConvolutionFilter2D( GLenum target, - GLenum internalformat, GLsizei width, GLsizei height, GLenum format, - GLenum type, const GLvoid *image ) -{ - RESOLVE(PFNGLCONVOLUTIONFILTER2DPROC, "glConvolutionFilter2D"); - proc(target, internalformat, width, height, format, type, image); -} - -GLAPI void GLAPIENTRY glConvolutionParameterf( GLenum target, GLenum pname, - GLfloat params ) -{ - RESOLVE(PFNGLCONVOLUTIONPARAMETERFPROC, "glConvolutionParameterf"); - proc(target, pname, params); -} - -GLAPI void GLAPIENTRY glConvolutionParameterfv( GLenum target, GLenum pname, - const GLfloat *params ) -{ - RESOLVE(PFNGLCONVOLUTIONPARAMETERFVPROC, "glConvolutionParameterfv"); - proc(target, pname, params); -} - -GLAPI void GLAPIENTRY glConvolutionParameteri( GLenum target, GLenum pname, - GLint params ) -{ - RESOLVE(PFNGLCONVOLUTIONPARAMETERIPROC, "glConvolutionParameteri"); - proc(target, pname, params); -} - -GLAPI void GLAPIENTRY glConvolutionParameteriv( GLenum target, GLenum pname, - const GLint *params ) -{ - RESOLVE(PFNGLCONVOLUTIONPARAMETERIVPROC, "glConvolutionParameteriv"); - proc(target, pname, params); -} - -GLAPI void GLAPIENTRY glCopyConvolutionFilter1D( GLenum target, - GLenum internalformat, GLint x, GLint y, GLsizei width ) -{ - RESOLVE(PFNGLCOPYCONVOLUTIONFILTER1DPROC, "glCopyConvolutionFilter1D"); - proc(target, internalformat, x, y, width); -} - -GLAPI void GLAPIENTRY glCopyConvolutionFilter2D( GLenum target, - GLenum internalformat, GLint x, GLint y, GLsizei width, - GLsizei height) -{ - RESOLVE(PFNGLCOPYCONVOLUTIONFILTER2DPROC, "glCopyConvolutionFilter2D"); - proc(target, internalformat, x, y, width, height); -} - -GLAPI void GLAPIENTRY glGetConvolutionFilter( GLenum target, GLenum format, - GLenum type, GLvoid *image ) -{ - RESOLVE(PFNGLGETCONVOLUTIONFILTERPROC, "glGetConvolutionFilter"); - proc(target, format, type, image); -} - -GLAPI void GLAPIENTRY glGetConvolutionParameterfv( GLenum target, GLenum pname, - GLfloat *params ) -{ - RESOLVE(PFNGLGETCONVOLUTIONPARAMETERFVPROC, "glGetConvolutionParameterfv"); - proc(target, pname, params); -} - -GLAPI void GLAPIENTRY glGetConvolutionParameteriv( GLenum target, GLenum pname, - GLint *params ) -{ - RESOLVE(PFNGLGETCONVOLUTIONPARAMETERIVPROC, "glGetConvolutionParameteriv"); - proc(target, pname, params); -} - -GLAPI void GLAPIENTRY glSeparableFilter2D( GLenum target, - GLenum internalformat, GLsizei width, GLsizei height, GLenum format, - GLenum type, const GLvoid *row, const GLvoid *column ) -{ - RESOLVE(PFNGLSEPARABLEFILTER2DPROC, "glSeparableFilter2D"); - proc(target, internalformat, width, height, format, type, row, column); -} - -GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format, - GLenum type, GLvoid *row, GLvoid *column, GLvoid *span ) -{ - RESOLVE(PFNGLGETSEPARABLEFILTERPROC, "glGetSeparableFilter"); - proc(target, format, type, row, column, span); -} - -/* - * OpenGL 1.2 - */ - -GLAPI void GLAPIENTRY glTexImage3D( GLenum target, GLint level, - GLint internalFormat, - GLsizei width, GLsizei height, - GLsizei depth, GLint border, - GLenum format, GLenum type, - const GLvoid *pixels ) -{ - RESOLVE(PFNGLTEXIMAGE3DPROC, "glTexImage3D"); - proc(target, level, internalFormat, width, height, depth, border, format, type, pixels); -} - -GLAPI void GLAPIENTRY glTexSubImage3D( GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint zoffset, GLsizei width, - GLsizei height, GLsizei depth, - GLenum format, - GLenum type, const GLvoid *pixels) -{ - RESOLVE(PFNGLTEXSUBIMAGE3DPROC, "glTexSubImage3D"); - proc(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); -} - -GLAPI void GLAPIENTRY glCopyTexSubImage3D( GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint zoffset, GLint x, - GLint y, GLsizei width, - GLsizei height ) -{ - RESOLVE(PFNGLCOPYTEXSUBIMAGE3DPROC, "glCopyTexSubImage3D"); - proc(target, level, xoffset, yoffset, zoffset, x, y, width, height); -} - - -/* - * 20. GL_EXT_texture_object - */ -GLAPI void GLAPIENTRY glGenTexturesEXT( GLsizei n, GLuint *textures ) -{ - glGenTextures(n, textures); -} - -GLAPI void GLAPIENTRY glDeleteTexturesEXT( GLsizei n, const GLuint *textures) -{ - glDeleteTextures(n, textures); -} - -GLAPI void GLAPIENTRY glBindTextureEXT( GLenum target, GLuint texture ) -{ - glBindTexture(target, target); -} - -GLAPI void GLAPIENTRY glPrioritizeTexturesEXT( GLsizei n, const GLuint *textures, const GLclampf *priorities ) -{ - glPrioritizeTextures(n, textures, priorities); -} - -GLAPI GLboolean GLAPIENTRY glAreTexturesResidentEXT( GLsizei n, const GLuint *textures, GLboolean *residences ) -{ - return glAreTexturesResident(n, textures, residences); -} - -GLAPI GLboolean GLAPIENTRY glIsTextureEXT( GLuint texture ) -{ - return glIsTexture(texture); -} - -/* - * GL_ARB_multitexture (ARB extension 1 and OpenGL 1.2.1) - */ - -GLAPI void GLAPIENTRY glActiveTextureARB(GLenum texture) -{ - RESOLVE(PFNGLACTIVETEXTUREARBPROC, "glActiveTextureARB"); - proc(texture); -} - -GLAPI void GLAPIENTRY glMultiTexCoord1dvARB(GLenum target, const GLdouble *v) -{ - RESOLVE(PFNGLMULTITEXCOORD1DVARBPROC, "glMultiTexCoord1dvARB"); - proc(target, v); -} - -GLAPI void GLAPIENTRY glMultiTexCoord1fvARB(GLenum target, const GLfloat *v) -{ - RESOLVE(PFNGLMULTITEXCOORD1FVARBPROC, "glMultiTexCoord1fvARB"); - proc(target, v); -} - -GLAPI void GLAPIENTRY glMultiTexCoord1ivARB(GLenum target, const GLint *v) -{ - RESOLVE(PFNGLMULTITEXCOORD1IVARBPROC, "glMultiTexCoord1ivARB"); - proc(target, v); -} - -GLAPI void GLAPIENTRY glMultiTexCoord1svARB(GLenum target, const GLshort *v) -{ - RESOLVE(PFNGLMULTITEXCOORD1SVARBPROC, "glMultiTexCoord1svARB"); - proc(target, v); -} -GLAPI void GLAPIENTRY glMultiTexCoord2dvARB(GLenum target, const GLdouble *v) -{ - RESOLVE(PFNGLMULTITEXCOORD2DVARBPROC, "glMultiTexCoord2dvARB"); - proc(target, v); -} -GLAPI void GLAPIENTRY glMultiTexCoord2fvARB(GLenum target, const GLfloat *v) -{ - RESOLVE(PFNGLMULTITEXCOORD2FVARBPROC, "glMultiTexCoord2fvARB"); - proc(target, v); -} -GLAPI void GLAPIENTRY glMultiTexCoord2ivARB(GLenum target, const GLint *v) -{ - RESOLVE(PFNGLMULTITEXCOORD2IVARBPROC, "glMultiTexCoord2ivARB"); - proc(target, v); -} -GLAPI void GLAPIENTRY glMultiTexCoord2svARB(GLenum target, const GLshort *v) -{ - RESOLVE(PFNGLMULTITEXCOORD1SVARBPROC, "glMultiTexCoord1svARB"); - proc(target, v); -} -GLAPI void GLAPIENTRY glMultiTexCoord3dvARB(GLenum target, const GLdouble *v) -{ - RESOLVE(PFNGLMULTITEXCOORD3DVARBPROC, "glMultiTexCoord3dvARB"); - proc(target, v); -} -GLAPI void GLAPIENTRY glMultiTexCoord3fvARB(GLenum target, const GLfloat *v) -{ - RESOLVE(PFNGLMULTITEXCOORD3FVARBPROC, "glMultiTexCoord3fvARB"); - proc(target, v); -} -GLAPI void GLAPIENTRY glMultiTexCoord3ivARB(GLenum target, const GLint *v) -{ - RESOLVE(PFNGLMULTITEXCOORD3IVARBPROC, "glMultiTexCoord3ivARB"); - proc(target, v); -} -GLAPI void GLAPIENTRY glMultiTexCoord3svARB(GLenum target, const GLshort *v) -{ - RESOLVE(PFNGLMULTITEXCOORD1SVARBPROC, "glMultiTexCoord1svARB"); - proc(target, v); -} -GLAPI void GLAPIENTRY glMultiTexCoord4dvARB(GLenum target, const GLdouble *v) -{ - RESOLVE(PFNGLMULTITEXCOORD4DVARBPROC, "glMultiTexCoord4dvARB"); - proc(target, v); -} -GLAPI void GLAPIENTRY glMultiTexCoord4fvARB(GLenum target, const GLfloat *v) -{ - RESOLVE(PFNGLMULTITEXCOORD4FVARBPROC, "glMultiTexCoord4fvARB"); - proc(target, v); -} -GLAPI void GLAPIENTRY glMultiTexCoord4ivARB(GLenum target, const GLint *v) -{ - RESOLVE(PFNGLMULTITEXCOORD4IVARBPROC, "glMultiTexCoord4ivARB"); - proc(target, v); -} -GLAPI void GLAPIENTRY glMultiTexCoord4svARB(GLenum target, const GLshort *v) -{ - RESOLVE(PFNGLMULTITEXCOORD1SVARBPROC, "glMultiTexCoord1svARB"); - proc(target, v); -} - - -GLAPI void GLAPIENTRY glActiveStencilFaceEXT(GLenum face) -{ - RESOLVE(PFNGLACTIVESTENCILFACEEXTPROC, "glActiveStencilFaceEXT"); - proc(face); -} - -GLAPI void APIENTRY glPointParameterfARB(GLenum pname, GLfloat param) -{ - RESOLVE(PFNGLPOINTPARAMETERFARBPROC, "glPointParameterfARB"); - proc(pname, param); -} - -GLAPI void APIENTRY glPointParameterfvARB(GLenum pname, const GLfloat *params) -{ - RESOLVE(PFNGLPOINTPARAMETERFVARBPROC, "glPointParameterfvARB"); - proc(pname, params); -} - - -GLAPI void APIENTRY glWindowPos3fARB(GLfloat x, GLfloat y, GLfloat z) -{ - RESOLVE(PFNGLWINDOWPOS3FARBPROC, "glWindowPos3fARB"); - proc(x, y, z); -} - -GLAPI void APIENTRY glPointParameteri(GLenum pname, GLint param) -{ - RESOLVE(PFNGLPOINTPARAMETERIPROC, "glPointParameteri"); - proc(pname, param); -} - -GLAPI void APIENTRY glPointParameteriv(GLenum pname, const GLint *params) -{ - RESOLVE(PFNGLPOINTPARAMETERIVPROC, "glPointParameteriv"); - proc(pname, params); -} - -GLAPI void APIENTRY glPointParameteriNV(GLenum pname, GLint param) -{ - RESOLVE(PFNGLPOINTPARAMETERINVPROC, "glPointParameteriNV"); - proc(pname, param); -} - -GLAPI void APIENTRY glPointParameterivNV(GLenum pname, const GLint *params) -{ - RESOLVE(PFNGLPOINTPARAMETERIVNVPROC, "glPointParameterivNV"); - proc(pname, params); -} - -GLAPI void APIENTRY glSecondaryColor3bv(const GLbyte *v) -{ - RESOLVE(PFNGLSECONDARYCOLOR3BVPROC, "glSecondaryColor3bv"); - proc(v); -} -GLAPI void APIENTRY glSecondaryColor3dv(const GLdouble *v) -{ - RESOLVE(PFNGLSECONDARYCOLOR3DVPROC, "glSecondaryColor3dv"); - proc(v); -} -GLAPI void APIENTRY glSecondaryColor3fv(const GLfloat *v) -{ - RESOLVE(PFNGLSECONDARYCOLOR3FVPROC, "glSecondaryColor3fv"); - proc(v); -} -GLAPI void APIENTRY glSecondaryColor3iv(const GLint *v) -{ - RESOLVE(PFNGLSECONDARYCOLOR3IVPROC, "glSecondaryColor3iv"); - proc(v); -} -GLAPI void APIENTRY glSecondaryColor3sv(const GLshort *v) -{ - RESOLVE(PFNGLSECONDARYCOLOR3SVPROC, "glSecondaryColor3sv"); - proc(v); -} -GLAPI void APIENTRY glSecondaryColor3ubv(const GLubyte *v) -{ - RESOLVE(PFNGLSECONDARYCOLOR3UBVPROC, "glSecondaryColor3ubv"); - proc(v); -} -GLAPI void APIENTRY glSecondaryColor3uiv(const GLuint *v) -{ - RESOLVE(PFNGLSECONDARYCOLOR3UIVPROC, "glSecondaryColor3uiv"); - proc(v); -} -GLAPI void APIENTRY glSecondaryColor3usv(const GLushort *v) -{ - RESOLVE(PFNGLSECONDARYCOLOR3USVPROC, "glSecondaryColor3usv"); - proc(v); -} -GLAPI void APIENTRY glSecondaryColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) -{ - RESOLVE(PFNGLSECONDARYCOLORPOINTERPROC, "glSecondaryColorPointer"); - proc(size, type, stride, pointer); -} - - -GLAPI void APIENTRY glBlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) -{ - RESOLVE(PFNGLBLENDFUNCSEPARATEPROC, "glBlendFuncSeparate"); - proc(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha); -} -GLAPI void APIENTRY glFogCoordfv(const GLfloat *coord) -{ - RESOLVE(PFNGLFOGCOORDFVPROC, "glFogCoordfv"); - proc(coord); -} -GLAPI void APIENTRY glFogCoorddv(const GLdouble *coord) -{ - RESOLVE(PFNGLFOGCOORDDVPROC, "glFogCoorddv"); - proc(coord); -} -GLAPI void APIENTRY glFogCoordPointer(GLenum type, GLsizei stride, const GLvoid *pointer) -{ - RESOLVE(PFNGLFOGCOORDPOINTERPROC, "glFogCoordPointer"); - proc(type, stride, pointer); -} - - -GLAPI void APIENTRY glSampleCoverageARB(GLclampf value, GLboolean invert) -{ - RESOLVE(PFNGLSAMPLECOVERAGEARBPROC, "glSampleCoverageARB"); - proc(value, invert); -} -GLAPI void APIENTRY glSampleMaskSGIS(GLclampf value, GLboolean invert) -{ - RESOLVE(PFNGLSAMPLEMASKSGISPROC, "glSampleMaskSGIS"); - proc(value, invert); -} -GLAPI void APIENTRY glSamplePatternSGIS(GLenum pattern) -{ - RESOLVE(PFNGLSAMPLEPATTERNSGISPROC, "glSamplePatternSGIS"); - proc(pattern); -} diff --git a/nx-X11/programs/Xserver/GL/windows/indirect.c b/nx-X11/programs/Xserver/GL/windows/indirect.c deleted file mode 100755 index 5e12022f4..000000000 --- a/nx-X11/programs/Xserver/GL/windows/indirect.c +++ /dev/null @@ -1,1605 +0,0 @@ -/* - * GLX implementation that uses Windows OpenGL library - * (Indirect rendering path) - * - * Authors: Alexander Gottwald - */ -/* - * Portions of this file are copied from GL/apple/indirect.c, - * which contains the following copyright: - * - * Copyright (c) 2002 Greg Parker. All Rights Reserved. - * Copyright (c) 2002 Apple Computer, Inc. - * - * Portions of this file are copied from xf86glx.c, - * which contains the following copyright: - * - * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ - - - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "glwindows.h" -#include -#include - -#include - -#define GLWIN_DEBUG_HWND(hwnd) \ - if (glWinDebugSettings.dumpHWND) { \ - char buffer[1024]; \ - if (GetWindowText(hwnd, buffer, sizeof(buffer))==0) *buffer=0; \ - GLWIN_DEBUG_MSG("Got HWND %s (%p)\n", buffer, hwnd); \ - } - - -/* ggs: needed to call back to glx with visual configs */ -extern void GlxSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs, void **configprivs); - -glWinDebugSettingsRec glWinDebugSettings = { 1, 0, 0, 0, 0}; - -static void glWinInitDebugSettings(void) -{ - char *envptr; - - envptr = getenv("GLWIN_ENABLE_DEBUG"); - if (envptr != NULL) - glWinDebugSettings.enableDebug = (atoi(envptr) == 1); - - envptr = getenv("GLWIN_ENABLE_TRACE"); - if (envptr != NULL) - glWinDebugSettings.enableTrace = (atoi(envptr) == 1); - - envptr = getenv("GLWIN_DUMP_PFD"); - if (envptr != NULL) - glWinDebugSettings.dumpPFD = (atoi(envptr) == 1); - - envptr = getenv("GLWIN_DUMP_HWND"); - if (envptr != NULL) - glWinDebugSettings.dumpHWND = (atoi(envptr) == 1); - - envptr = getenv("GLWIN_DUMP_DC"); - if (envptr != NULL) - glWinDebugSettings.dumpDC = (atoi(envptr) == 1); -} - -static char errorbuffer[1024]; -const char *glWinErrorMessage(void) -{ - if (!FormatMessage( - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR) &errorbuffer, - sizeof(errorbuffer), - NULL )) - { - snprintf(errorbuffer, sizeof(errorbuffer), "Unknown error in FormatMessage: %08x!\n", (unsigned)GetLastError()); - } - return errorbuffer; -} - -/* - * GLX implementation that uses Win32's OpenGL - */ - -/* - * Server-side GLX uses these functions which are normally defined - * in the OpenGL SI. - */ - -GLuint __glFloorLog2(GLuint val) -{ - int c = 0; - - while (val > 1) { - c++; - val >>= 1; - } - return c; -} - -/* some prototypes */ -static Bool glWinScreenProbe(int screen); -static Bool glWinInitVisuals(VisualPtr *visualp, DepthPtr *depthp, - int *nvisualp, int *ndepthp, - int *rootDepthp, VisualID *defaultVisp, - unsigned long sizes, int bitsPerRGB); -static void glWinSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs, - void **privates); -static __GLinterface *glWinCreateContext(__GLimports *imports, - __GLcontextModes *mode, - __GLinterface *shareGC); -static void glWinCreateBuffer(__GLXdrawablePrivate *glxPriv); -static void glWinResetExtension(void); - -/* - * This structure is statically allocated in the __glXScreens[] - * structure. This struct is not used anywhere other than in - * __glXScreenInit to initialize each of the active screens - * (__glXActiveScreens[]). Several of the fields must be initialized by - * the screenProbe routine before they are copied to the active screens - * struct. In particular, the contextCreate, pGlxVisual, numVisuals, - * and numUsableVisuals fields must be initialized. - */ -static __GLXscreenInfo __glDDXScreenInfo = { - glWinScreenProbe, /* Must be generic and handle all screens */ - glWinCreateContext, /* Substitute screen's createContext routine */ - glWinCreateBuffer, /* Substitute screen's createBuffer routine */ - NULL, /* Set up pGlxVisual in probe */ - NULL, /* Set up pVisualPriv in probe */ - 0, /* Set up numVisuals in probe */ - 0, /* Set up numUsableVisuals in probe */ - "Vendor String", /* GLXvendor is overwritten by __glXScreenInit */ - "Version String", /* GLXversion is overwritten by __glXScreenInit */ - "Extensions String", /* GLXextensions is overwritten by __glXScreenInit */ - NULL /* WrappedPositionWindow is overwritten */ -}; - -void *__glXglDDXScreenInfo(void) { - return &__glDDXScreenInfo; -} - -static __GLXextensionInfo __glDDXExtensionInfo = { - GL_CORE_WINDOWS, - glWinResetExtension, - glWinInitVisuals, - glWinSetVisualConfigs -}; - -void *__glXglDDXExtensionInfo(void) { - return &__glDDXExtensionInfo; -} - -/* prototypes */ - -static GLboolean glWinDestroyContext(__GLcontext *gc); -static GLboolean glWinLoseCurrent(__GLcontext *gc); -static GLboolean glWinMakeCurrent(__GLcontext *gc); -static GLboolean glWinShareContext(__GLcontext *gc, __GLcontext *gcShare); -static GLboolean glWinCopyContext(__GLcontext *dst, const __GLcontext *src, - GLuint mask); -static GLboolean glWinForceCurrent(__GLcontext *gc); - -/* Drawing surface notification callbacks */ -static GLboolean glWinNotifyResize(__GLcontext *gc); -static void glWinNotifyDestroy(__GLcontext *gc); -static void glWinNotifySwapBuffers(__GLcontext *gc); - -/* Dispatch table override control for external agents like libGLS */ -static struct __GLdispatchStateRec* glWinDispatchExec(__GLcontext *gc); -static void glWinBeginDispatchOverride(__GLcontext *gc); -static void glWinEndDispatchOverride(__GLcontext *gc); - -/* Debug output */ -static void pfdOut(const PIXELFORMATDESCRIPTOR *pfd); - -static __GLexports glWinExports = { - glWinDestroyContext, - glWinLoseCurrent, - glWinMakeCurrent, - glWinShareContext, - glWinCopyContext, - glWinForceCurrent, - - glWinNotifyResize, - glWinNotifyDestroy, - glWinNotifySwapBuffers, - - glWinDispatchExec, - glWinBeginDispatchOverride, - glWinEndDispatchOverride -}; - -glWinScreenRec glWinScreens[MAXSCREENS]; - -/* __GLdrawablePrivate->private */ -typedef struct { - DrawablePtr pDraw; - /* xp_surface_id sid; */ -} GLWinDrawableRec; - -struct __GLcontextRec { - struct __GLinterfaceRec interface; /* required to be first */ - - HGLRC ctx; /* Windows GL Context */ - - HDC dc; /* Windows Device Context */ - winWindowInfoRec winInfo; /* Window info from XWin */ - - PIXELFORMATDESCRIPTOR pfd; /* Pixelformat flags */ - int pixelFormat; /* Pixelformat index */ - - unsigned isAttached :1; /* Flag to track if context is attached */ -}; - -static HDC glWinMakeDC(__GLcontext *gc) -{ - HDC dc; - - /*if (gc->winInfo.hrgn == NULL) - { - GLWIN_DEBUG_MSG("Creating region from RECT(%ld,%ld,%ld,%ld):", - gc->winInfo.rect.left, - gc->winInfo.rect.top, - gc->winInfo.rect.right, - gc->winInfo.rect.bottom); - gc->winInfo.hrgn = CreateRectRgnIndirect(&gc->winInfo.rect); - GLWIN_DEBUG_MSG2("%p\n", gc->winInfo.hrgn); - }*/ - - if (glWinDebugSettings.enableTrace) - GLWIN_DEBUG_HWND(gc->winInfo.hwnd); - - dc = GetDC(gc->winInfo.hwnd); - /*dc = GetDCEx(gc->winInfo.hwnd, gc->winInfo.hrgn, - DCX_WINDOW | DCX_NORESETATTRS ); */ - - if (dc == NULL) - ErrorF("GetDC error: %s\n", glWinErrorMessage()); - return dc; -} - -static void unattach(__GLcontext *gc) -{ - BOOL ret; - GLWIN_DEBUG_MSG("unattach (ctx %p)\n", gc->ctx); - if (!gc->isAttached) - { - ErrorF("called unattach on an unattached context\n"); - return; - } - - if (gc->ctx) - { - ret = wglDeleteContext(gc->ctx); - if (!ret) - ErrorF("wglDeleteContext error: %s\n", glWinErrorMessage()); - gc->ctx = NULL; - } - - if (gc->winInfo.hrgn) - { - ret = DeleteObject(gc->winInfo.hrgn); - if (!ret) - ErrorF("DeleteObject error: %s\n", glWinErrorMessage()); - gc->winInfo.hrgn = NULL; - } - - gc->isAttached = 0; -} - -static BOOL glWinAdjustHWND(__GLcontext *gc, WindowPtr pWin) -{ - HDC dc; - BOOL ret; - HGLRC newctx; - HWND oldhwnd; - - GLWIN_DEBUG_MSG("glWinAdjustHWND (ctx %p, pWin %p)\n", gc->ctx, pWin); - - if (pWin == NULL) - { - GLWIN_DEBUG_MSG("Deferring until window is created\n"); - return FALSE; - } - - oldhwnd = gc->winInfo.hwnd; - winGetWindowInfo(pWin, &gc->winInfo); - - GLWIN_DEBUG_HWND(gc->winInfo.hwnd); - if (gc->winInfo.hwnd == NULL) - { - GLWIN_DEBUG_MSG("Deferring until window is created\n"); - return FALSE; - } - - dc = glWinMakeDC(gc); - - if (glWinDebugSettings.dumpDC) - GLWIN_DEBUG_MSG("Got HDC %p\n", dc); - - gc->pixelFormat = ChoosePixelFormat(dc, &gc->pfd); - if (gc->pixelFormat == 0) - { - ErrorF("ChoosePixelFormat error: %s\n", glWinErrorMessage()); - ReleaseDC(gc->winInfo.hwnd, dc); - return FALSE; - } - - ret = SetPixelFormat(dc, gc->pixelFormat, &gc->pfd); - if (!ret) { - ErrorF("SetPixelFormat error: %s\n", glWinErrorMessage()); - ReleaseDC(gc->winInfo.hwnd, dc); - return FALSE; - } - - newctx = wglCreateContext(dc); - if (newctx == NULL) { - ErrorF("wglCreateContext error: %s\n", glWinErrorMessage()); - ReleaseDC(gc->winInfo.hwnd, dc); - return FALSE; - } - - GLWIN_DEBUG_MSG("wglCreateContext (ctx %p)\n", newctx); - - if (!wglShareLists(gc->ctx, newctx)) - { - ErrorF("wglShareLists error: %s\n", glWinErrorMessage()); - ReleaseDC(gc->winInfo.hwnd, dc); - return FALSE; - } - - if (oldhwnd != gc->winInfo.hwnd) - { - GLWIN_DEBUG_MSG("Trying wglCopyContext\n"); - if (!wglCopyContext(gc->ctx, newctx, GL_ALL_ATTRIB_BITS)) - { - ErrorF("wglCopyContext error: %s\n", glWinErrorMessage()); - ReleaseDC(gc->winInfo.hwnd, dc); - return FALSE; - } - } - - if (!wglDeleteContext(gc->ctx)) - { - ErrorF("wglDeleteContext error: %s\n", glWinErrorMessage()); - } - - gc->ctx = newctx; - - if (!wglMakeCurrent(dc, gc->ctx)) { - ErrorF("glMakeCurrent error: %s\n", glWinErrorMessage()); - ReleaseDC(gc->winInfo.hwnd, dc); - return FALSE; - } - - ReleaseDC(gc->winInfo.hwnd, dc); - - return TRUE; -} - -static BOOL glWinCreateContextReal(__GLcontext *gc, WindowPtr pWin) -{ - HDC dc; - BOOL ret; - - GLWIN_DEBUG_MSG("glWinCreateContextReal (pWin %p)\n", pWin); - - if (pWin == NULL) - { - GLWIN_DEBUG_MSG("Deferring until window is created\n"); - return FALSE; - } - - winGetWindowInfo(pWin, &gc->winInfo); - - GLWIN_DEBUG_HWND(gc->winInfo.hwnd); - if (gc->winInfo.hwnd == NULL) - { - GLWIN_DEBUG_MSG("Deferring until window is created\n"); - return FALSE; - } - - - dc = glWinMakeDC(gc); - - if (glWinDebugSettings.dumpDC) - GLWIN_DEBUG_MSG("Got HDC %p\n", dc); - - gc->pixelFormat = ChoosePixelFormat(dc, &gc->pfd); - if (gc->pixelFormat == 0) - { - ErrorF("ChoosePixelFormat error: %s\n", glWinErrorMessage()); - ReleaseDC(gc->winInfo.hwnd, dc); - return FALSE; - } - - ret = SetPixelFormat(dc, gc->pixelFormat, &gc->pfd); - if (!ret) { - ErrorF("SetPixelFormat error: %s\n", glWinErrorMessage()); - ReleaseDC(gc->winInfo.hwnd, dc); - return FALSE; - } - - gc->ctx = wglCreateContext(dc); - if (gc->ctx == NULL) { - ErrorF("wglCreateContext error: %s\n", glWinErrorMessage()); - ReleaseDC(gc->winInfo.hwnd, dc); - return FALSE; - } - - GLWIN_DEBUG_MSG("glWinCreateContextReal (ctx %p)\n", gc->ctx); - - if (!wglMakeCurrent(dc, gc->ctx)) { - ErrorF("glMakeCurrent error: %s\n", glWinErrorMessage()); - ReleaseDC(gc->winInfo.hwnd, dc); - return FALSE; - } - - ReleaseDC(gc->winInfo.hwnd, dc); - - return TRUE; -} - -static void attach(__GLcontext *gc, __GLdrawablePrivate *glPriv) -{ - __GLXdrawablePrivate *glxPriv = (__GLXdrawablePrivate *)glPriv->other; - - GLWIN_DEBUG_MSG("attach (ctx %p)\n", gc->ctx); - - if (gc->isAttached) - { - ErrorF("called attach on an attached context\n"); - return; - } - - if (glxPriv->type == DRAWABLE_WINDOW) - { - WindowPtr pWin = (WindowPtr) glxPriv->pDraw; - if (pWin == NULL) - { - GLWIN_DEBUG_MSG("Deferring ChoosePixelFormat until window is created\n"); - } else - { - if (glWinCreateContextReal(gc, pWin)) - { - gc->isAttached = TRUE; - GLWIN_DEBUG_MSG("attached\n"); - } - } - } -} - -static GLboolean glWinLoseCurrent(__GLcontext *gc) -{ - GLWIN_TRACE_MSG("glWinLoseCurrent (ctx %p)\n", gc->ctx); - - __glXLastContext = NULL; /* Mesa does this; why? */ - - return GL_TRUE; -} - -/* Context manipulation; return GL_FALSE on failure */ -static GLboolean glWinDestroyContext(__GLcontext *gc) -{ - GLWIN_DEBUG_MSG("glWinDestroyContext (ctx %p)\n", gc->ctx); - - if (gc != NULL) - { - if (gc->isAttached) - unattach(gc); - if (gc->dc != NULL) - DeleteDC(gc->dc); - free(gc); - } - - return GL_TRUE; -} - -static GLboolean glWinMakeCurrent(__GLcontext *gc) -{ - __GLdrawablePrivate *glPriv = gc->interface.imports.getDrawablePrivate(gc); - BOOL ret; - HDC dc; - - GLWIN_TRACE_MSG(" (ctx %p)\n", gc->ctx); - - if (!gc->isAttached) - attach(gc, glPriv); - - if (gc->ctx == NULL) { - ErrorF("Context is NULL\n"); - return GL_FALSE; - } - - dc = glWinMakeDC(gc); - ret = wglMakeCurrent(dc, gc->ctx); - if (!ret) - ErrorF("glMakeCurrent error: %s\n", glWinErrorMessage()); - ReleaseDC(gc->winInfo.hwnd, dc); - - return ret?GL_TRUE:GL_FALSE; -} - -static GLboolean glWinShareContext(__GLcontext *gc, __GLcontext *gcShare) -{ - GLWIN_DEBUG_MSG("glWinShareContext unimplemented\n"); - - return GL_TRUE; -} - -static GLboolean glWinCopyContext(__GLcontext *dst, const __GLcontext *src, - GLuint mask) -{ - BOOL ret; - - GLWIN_DEBUG_MSG("glWinCopyContext\n"); - - ret = wglCopyContext(src->ctx, dst->ctx, mask); - if (!ret) - { - ErrorF("wglCopyContext error: %s\n", glWinErrorMessage()); - return GL_FALSE; - } - - return GL_TRUE; -} - -static GLboolean glWinForceCurrent(__GLcontext *gc) -{ - GLWIN_TRACE_MSG(" (ctx %p)\n", gc->ctx); - - return GL_TRUE; -} - -/* Drawing surface notification callbacks */ - -static GLboolean glWinNotifyResize(__GLcontext *gc) -{ - GLWIN_DEBUG_MSG("unimplemented glWinNotifyResize"); - return GL_TRUE; -} - -static void glWinNotifyDestroy(__GLcontext *gc) -{ - GLWIN_DEBUG_MSG("unimplemented glWinNotifyDestroy"); -} - -static void glWinNotifySwapBuffers(__GLcontext *gc) -{ - GLWIN_DEBUG_MSG("unimplemented glWinNotifySwapBuffers"); -} - -/* Dispatch table override control for external agents like libGLS */ -static struct __GLdispatchStateRec* glWinDispatchExec(__GLcontext *gc) -{ - GLWIN_DEBUG_MSG("unimplemented glWinDispatchExec"); - return NULL; -} - -static void glWinBeginDispatchOverride(__GLcontext *gc) -{ - GLWIN_DEBUG_MSG("unimplemented glWinBeginDispatchOverride"); -} - -static void glWinEndDispatchOverride(__GLcontext *gc) -{ - GLWIN_DEBUG_MSG("unimplemented glWinEndDispatchOverride"); -} - -#define DUMP_PFD_FLAG(flag) \ - if (pfd->dwFlags & flag) { \ - ErrorF("%s%s", pipesym, #flag); \ - pipesym = " | "; \ - } - -static void pfdOut(const PIXELFORMATDESCRIPTOR *pfd) -{ - const char *pipesym = ""; /* will be set after first flag dump */ - ErrorF("PIXELFORMATDESCRIPTOR:\n"); - ErrorF("nSize = %u\n", pfd->nSize); - ErrorF("nVersion = %u\n", pfd->nVersion); - ErrorF("dwFlags = %lu = {", pfd->dwFlags); - DUMP_PFD_FLAG(PFD_MAIN_PLANE); - DUMP_PFD_FLAG(PFD_OVERLAY_PLANE); - DUMP_PFD_FLAG(PFD_UNDERLAY_PLANE); - DUMP_PFD_FLAG(PFD_DOUBLEBUFFER); - DUMP_PFD_FLAG(PFD_STEREO); - DUMP_PFD_FLAG(PFD_DRAW_TO_WINDOW); - DUMP_PFD_FLAG(PFD_DRAW_TO_BITMAP); - DUMP_PFD_FLAG(PFD_SUPPORT_GDI); - DUMP_PFD_FLAG(PFD_SUPPORT_OPENGL); - DUMP_PFD_FLAG(PFD_GENERIC_FORMAT); - DUMP_PFD_FLAG(PFD_NEED_PALETTE); - DUMP_PFD_FLAG(PFD_NEED_SYSTEM_PALETTE); - DUMP_PFD_FLAG(PFD_SWAP_EXCHANGE); - DUMP_PFD_FLAG(PFD_SWAP_COPY); - DUMP_PFD_FLAG(PFD_SWAP_LAYER_BUFFERS); - DUMP_PFD_FLAG(PFD_GENERIC_ACCELERATED); - DUMP_PFD_FLAG(PFD_DEPTH_DONTCARE); - DUMP_PFD_FLAG(PFD_DOUBLEBUFFER_DONTCARE); - DUMP_PFD_FLAG(PFD_STEREO_DONTCARE); - ErrorF("}\n"); - - ErrorF("iPixelType = %hu = %s\n", pfd->iPixelType, - (pfd->iPixelType == PFD_TYPE_RGBA ? "PFD_TYPE_RGBA" : "PFD_TYPE_COLORINDEX")); - ErrorF("cColorBits = %hhu\n", pfd->cColorBits); - ErrorF("cRedBits = %hhu\n", pfd->cRedBits); - ErrorF("cRedShift = %hhu\n", pfd->cRedShift); - ErrorF("cGreenBits = %hhu\n", pfd->cGreenBits); - ErrorF("cGreenShift = %hhu\n", pfd->cGreenShift); - ErrorF("cBlueBits = %hhu\n", pfd->cBlueBits); - ErrorF("cBlueShift = %hhu\n", pfd->cBlueShift); - ErrorF("cAlphaBits = %hhu\n", pfd->cAlphaBits); - ErrorF("cAlphaShift = %hhu\n", pfd->cAlphaShift); - ErrorF("cAccumBits = %hhu\n", pfd->cAccumBits); - ErrorF("cAccumRedBits = %hhu\n", pfd->cAccumRedBits); - ErrorF("cAccumGreenBits = %hhu\n", pfd->cAccumGreenBits); - ErrorF("cAccumBlueBits = %hhu\n", pfd->cAccumBlueBits); - ErrorF("cAccumAlphaBits = %hhu\n", pfd->cAccumAlphaBits); - ErrorF("cDepthBits = %hhu\n", pfd->cDepthBits); - ErrorF("cStencilBits = %hhu\n", pfd->cStencilBits); - ErrorF("cAuxBuffers = %hhu\n", pfd->cAuxBuffers); - ErrorF("iLayerType = %hhu\n", pfd->iLayerType); - ErrorF("bReserved = %hhu\n", pfd->bReserved); - ErrorF("dwLayerMask = %lu\n", pfd->dwLayerMask); - ErrorF("dwVisibleMask = %lu\n", pfd->dwVisibleMask); - ErrorF("dwDamageMask = %lu\n", pfd->dwDamageMask); - ErrorF("\n"); -} - -static int makeFormat(__GLcontextModes *mode, PIXELFORMATDESCRIPTOR *pfdret) -{ - PIXELFORMATDESCRIPTOR pfd = { - sizeof(PIXELFORMATDESCRIPTOR), /* size of this pfd */ - 1, /* version number */ - PFD_DRAW_TO_WINDOW | /* support window */ - PFD_SUPPORT_OPENGL, /* support OpenGL */ - PFD_TYPE_RGBA, /* RGBA type */ - 24, /* 24-bit color depth */ - 0, 0, 0, 0, 0, 0, /* color bits ignored */ - 0, /* no alpha buffer */ - 0, /* shift bit ignored */ - 0, /* no accumulation buffer */ - 0, 0, 0, 0, /* accum bits ignored */ - 0, /* 32-bit z-buffer */ - 0, /* no stencil buffer */ - 0, /* no auxiliary buffer */ - PFD_MAIN_PLANE, /* main layer */ - 0, /* reserved */ - 0, 0, 0 /* layer masks ignored */ - }, *result = &pfd; - - /* disable anything but rgba. must get rgba to work first */ - if (!mode->rgbMode) - return -1; - - if (mode->stereoMode) { - result->dwFlags |= PFD_STEREO; - } - if (mode->doubleBufferMode) { - result->dwFlags |= PFD_DOUBLEBUFFER; - } - - if (mode->colorIndexMode) { - /* ignored, see above */ - result->iPixelType = PFD_TYPE_COLORINDEX; - result->cColorBits = mode->redBits + mode->greenBits + mode->blueBits; - result->cRedBits = mode->redBits; - result->cRedShift = 0; /* FIXME */ - result->cGreenBits = mode->greenBits; - result->cGreenShift = 0; /* FIXME */ - result->cBlueBits = mode->blueBits; - result->cBlueShift = 0; /* FIXME */ - result->cAlphaBits = mode->alphaBits; - result->cAlphaShift = 0; /* FIXME */ - } - - if (mode->rgbMode) { - result->iPixelType = PFD_TYPE_RGBA; - result->cColorBits = mode->redBits + mode->greenBits + mode->blueBits; - result->cRedBits = mode->redBits; - result->cRedShift = 0; /* FIXME */ - result->cGreenBits = mode->greenBits; - result->cGreenShift = 0; /* FIXME */ - result->cBlueBits = mode->blueBits; - result->cBlueShift = 0; /* FIXME */ - result->cAlphaBits = mode->alphaBits; - result->cAlphaShift = 0; /* FIXME */ - } - - if (mode->haveAccumBuffer) { - result->cAccumBits = mode->accumRedBits + mode->accumGreenBits - + mode->accumBlueBits + mode->accumAlphaBits; - result->cAccumRedBits = mode->accumRedBits; - result->cAccumGreenBits = mode->accumGreenBits; - result->cAccumBlueBits = mode->accumBlueBits; - result->cAccumAlphaBits = mode->accumAlphaBits; - } - - if (mode->haveDepthBuffer) { - result->cDepthBits = mode->depthBits; - } - if (mode->haveStencilBuffer) { - result->cStencilBits = mode->stencilBits; - } - - /* result->cAuxBuffers = mode->numAuxBuffers; */ - - /* mode->level ignored */ - - /* mode->pixmapMode ? */ - - *pfdret = pfd; - - return 0; -} - -static __GLinterface *glWinCreateContext(__GLimports *imports, - __GLcontextModes *mode, - __GLinterface *shareGC) -{ - __GLcontext *result; - - GLWIN_DEBUG_MSG("glWinCreateContext\n"); - - result = (__GLcontext *)calloc(1, sizeof(__GLcontext)); - if (!result) - return NULL; - - result->interface.imports = *imports; - result->interface.exports = glWinExports; - - if (makeFormat(mode, &result->pfd)) - { - ErrorF("makeFormat failed\n"); - free(result); - return NULL; - } - - if (glWinDebugSettings.dumpPFD) - pfdOut(&result->pfd); - - GLWIN_DEBUG_MSG("glWinCreateContext done\n"); - return (__GLinterface *)result; -} - -Bool -glWinRealizeWindow(WindowPtr pWin) -{ - /* If this window has GL contexts, tell them to reattach */ - /* reattaching is bad: display lists and parameters get lost */ - Bool result; - ScreenPtr pScreen = pWin->drawable.pScreen; - glWinScreenRec *screenPriv = &glWinScreens[pScreen->myNum]; - __GLXdrawablePrivate *glxPriv; - - GLWIN_DEBUG_MSG("glWinRealizeWindow\n"); - - /* Allow the window to be created (RootlessRealizeWindow is inside our wrap) */ - pScreen->RealizeWindow = screenPriv->RealizeWindow; - result = pScreen->RealizeWindow(pWin); - pScreen->RealizeWindow = glWinRealizeWindow; - - /* Re-attach this window's GL contexts, if any. */ - glxPriv = __glXFindDrawablePrivate(pWin->drawable.id); - if (glxPriv) { - __GLXcontext *gx; - __GLcontext *gc; - __GLdrawablePrivate *glPriv = &glxPriv->glPriv; - GLWIN_DEBUG_MSG("glWinRealizeWindow is GL drawable!\n"); - - /* GL contexts bound to this window for drawing */ - for (gx = glxPriv->drawGlxc; gx != NULL; gx = gx->next) { - gc = (__GLcontext *)gx->gc; - if (gc->isAttached) -#if 1 - { - GLWIN_DEBUG_MSG("context is already bound! Adjusting HWND.\n"); - glWinAdjustHWND(gc, pWin); - continue; - } -#else - unattach(gc); -#endif - attach(gc, glPriv); - } - - /* GL contexts bound to this window for reading */ - for (gx = glxPriv->readGlxc; gx != NULL; gx = gx->next) { - gc = (__GLcontext *)gx->gc; - if (gc->isAttached) -#if 1 - { - GLWIN_DEBUG_MSG("context is already bound! Adjusting HWND.\n"); - glWinAdjustHWND(gc, pWin); - continue; - } -#else - unattach(gc); -#endif - attach(gc, glPriv); - } - } - - return result; -} - - -void -glWinCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc) -{ - ScreenPtr pScreen = pWindow->drawable.pScreen; - glWinScreenRec *screenPriv = &glWinScreens[pScreen->myNum]; - __GLXdrawablePrivate *glxPriv; - - GLWIN_TRACE_MSG(" (pWindow %p)\n", pWindow); - - /* Check if the window is attached and discard any drawing request */ - glxPriv = __glXFindDrawablePrivate(pWindow->drawable.id); - if (glxPriv) { - __GLXcontext *gx; - - /* GL contexts bound to this window for drawing */ - for (gx = glxPriv->drawGlxc; gx != NULL; gx = gx->next) { -/* - GLWIN_DEBUG_MSG("glWinCopyWindow - calling glDrawBuffer\n"); - glDrawBuffer(GL_FRONT); - */ - - return; - } - - /* GL contexts bound to this window for reading */ - for (gx = glxPriv->readGlxc; gx != NULL; gx = gx->next) { - return; - } - } - - GLWIN_DEBUG_MSG("glWinCopyWindow - passing to hw layer\n"); - - pScreen->CopyWindow = screenPriv->CopyWindow; - pScreen->CopyWindow(pWindow, ptOldOrg, prgnSrc); - pScreen->CopyWindow = glWinCopyWindow; -} - -Bool -glWinUnrealizeWindow(WindowPtr pWin) -{ - /* If this window has GL contexts, tell them to unattach */ - Bool result; - ScreenPtr pScreen = pWin->drawable.pScreen; - glWinScreenRec *screenPriv = &glWinScreens[pScreen->myNum]; - __GLXdrawablePrivate *glxPriv; - - GLWIN_DEBUG_MSG("glWinUnrealizeWindow\n"); - - /* The Aqua window may have already been destroyed (windows - * are unrealized from top down) - */ - - /* Unattach this window's GL contexts, if any. */ - glxPriv = __glXFindDrawablePrivate(pWin->drawable.id); - if (glxPriv) { - __GLXcontext *gx; - __GLcontext *gc; - GLWIN_DEBUG_MSG("glWinUnealizeWindow is GL drawable!\n"); - - /* GL contexts bound to this window for drawing */ - for (gx = glxPriv->drawGlxc; gx != NULL; gx = gx->next) { - gc = (__GLcontext *)gx->gc; - unattach(gc); - } - - /* GL contexts bound to this window for reading */ - for (gx = glxPriv->readGlxc; gx != NULL; gx = gx->next) { - gc = (__GLcontext *)gx->gc; - unattach(gc); - } - } - - pScreen->UnrealizeWindow = screenPriv->UnrealizeWindow; - result = pScreen->UnrealizeWindow(pWin); - pScreen->UnrealizeWindow = glWinUnrealizeWindow; - - return result; -} - - -/* - * In the case the driver has no GLX visuals we'll use these. - * [0] = RGB, double buffered - * [1] = RGB, double buffered, stencil, accum - */ -/* Originally copied from Mesa */ - -static int numConfigs = 0; -static __GLXvisualConfig *visualConfigs = NULL; -static void **visualPrivates = NULL; - -#define NUM_FALLBACK_CONFIGS 2 -static __GLXvisualConfig FallbackConfigs[NUM_FALLBACK_CONFIGS] = { - { - -1, /* vid */ - -1, /* class */ - True, /* rgba */ - -1, -1, -1, 0, /* rgba sizes */ - -1, -1, -1, 0, /* rgba masks */ - 0, 0, 0, 0, /* rgba accum sizes */ - True, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 0, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE_EXT, /* visualRating */ - 0, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ - }, - { - -1, /* vid */ - -1, /* class */ - True, /* rgba */ - -1, -1, -1, 0, /* rgba sizes */ - -1, -1, -1, 0, /* rgba masks */ - 16, 16, 16, 0, /* rgba accum sizes */ - True, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 8, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE_EXT, /* visualRating */ - 0, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ - } -}; - -static __GLXvisualConfig NullConfig = { - -1, /* vid */ - -1, /* class */ - False, /* rgba */ - -1, -1, -1, 0, /* rgba sizes */ - -1, -1, -1, 0, /* rgba masks */ - 0, 0, 0, 0, /* rgba accum sizes */ - False, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 0, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE_EXT, /* visualRating */ - 0, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ -}; - -static inline int count_bits(uint32_t x) -{ - x = x - ((x >> 1) & 0x55555555); - x = (x & 0x33333333) + ((x >> 2) & 0x33333333); - x = (x + (x >> 4)) & 0x0f0f0f0f; - x = x + (x >> 8); - x = x + (x >> 16); - return x & 63; -} - -/* Mostly copied from Mesa's xf86glx.c */ -static Bool init_visuals(int *nvisualp, VisualPtr *visualp, - VisualID *defaultVisp, - int ndepth, DepthPtr pdepth, - int rootDepth) -{ - int numRGBconfigs; - int numCIconfigs; - int numVisuals = *nvisualp; - int numNewVisuals; - int numNewConfigs; - VisualPtr pVisual = *visualp; - VisualPtr pVisualNew = NULL; - VisualID *orig_vid = NULL; - __GLcontextModes *modes = NULL; - __GLXvisualConfig *pNewVisualConfigs = NULL; - void **glXVisualPriv; - void **pNewVisualPriv; - int found_default; - int i, j, k; - - GLWIN_DEBUG_MSG("init_visuals\n"); - - if (numConfigs > 0) - numNewConfigs = numConfigs; - else - numNewConfigs = NUM_FALLBACK_CONFIGS; - - /* Alloc space for the list of new GLX visuals */ - pNewVisualConfigs = (__GLXvisualConfig *) - __glXMalloc(numNewConfigs * sizeof(__GLXvisualConfig)); - if (!pNewVisualConfigs) { - return FALSE; - } - - /* Alloc space for the list of new GLX visual privates */ - pNewVisualPriv = (void **) __glXMalloc(numNewConfigs * sizeof(void *)); - if (!pNewVisualPriv) { - __glXFree(pNewVisualConfigs); - return FALSE; - } - - /* - ** If SetVisualConfigs was not called, then use default GLX - ** visual configs. - */ - if (numConfigs == 0) { - memcpy(pNewVisualConfigs, FallbackConfigs, - NUM_FALLBACK_CONFIGS * sizeof(__GLXvisualConfig)); - memset(pNewVisualPriv, 0, NUM_FALLBACK_CONFIGS * sizeof(void *)); - } - else { - /* copy driver's visual config info */ - for (i = 0; i < numConfigs; i++) { - pNewVisualConfigs[i] = visualConfigs[i]; - pNewVisualPriv[i] = visualPrivates[i]; - } - } - - /* Count the number of RGB and CI visual configs */ - numRGBconfigs = 0; - numCIconfigs = 0; - for (i = 0; i < numNewConfigs; i++) { - if (pNewVisualConfigs[i].rgba) - numRGBconfigs++; - else - numCIconfigs++; - } - - /* Count the total number of visuals to compute */ - numNewVisuals = 0; - for (i = 0; i < numVisuals; i++) { - int count; - - count = ((pVisual[i].class == TrueColor - || pVisual[i].class == DirectColor) - ? numRGBconfigs : numCIconfigs); - if (count == 0) - count = 1; /* preserve the existing visual */ - - numNewVisuals += count; - } - - /* Reset variables for use with the next screen/driver's visual configs */ - visualConfigs = NULL; - numConfigs = 0; - - /* Alloc temp space for the list of orig VisualIDs for each new visual */ - orig_vid = (VisualID *)__glXMalloc(numNewVisuals * sizeof(VisualID)); - if (!orig_vid) { - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); - return FALSE; - } - - /* Alloc space for the list of glXVisuals */ - modes = _gl_context_modes_create(numNewVisuals, sizeof(__GLcontextModes)); - if (modes == NULL) { - __glXFree(orig_vid); - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); - return FALSE; - } - - /* Alloc space for the list of glXVisualPrivates */ - glXVisualPriv = (void **)__glXMalloc(numNewVisuals * sizeof(void *)); - if (!glXVisualPriv) { - _gl_context_modes_destroy( modes ); - __glXFree(orig_vid); - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); - return FALSE; - } - - /* Alloc space for the new list of the X server's visuals */ - pVisualNew = (VisualPtr)__glXMalloc(numNewVisuals * sizeof(VisualRec)); - if (!pVisualNew) { - __glXFree(glXVisualPriv); - _gl_context_modes_destroy( modes ); - __glXFree(orig_vid); - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); - return FALSE; - } - - /* Initialize the new visuals */ - found_default = FALSE; - glWinScreens[screenInfo.numScreens-1].modes = modes; - for (i = j = 0; i < numVisuals; i++) { - int is_rgb = (pVisual[i].class == TrueColor || - pVisual[i].class == DirectColor); - - if (!is_rgb) - { - /* We don't support non-rgb visuals for GL. But we don't - want to remove them either, so just pass them through - with null glX configs */ - - pVisualNew[j] = pVisual[i]; - pVisualNew[j].vid = FakeClientID(0); - - /* Check for the default visual */ - if (!found_default && pVisual[i].vid == *defaultVisp) { - *defaultVisp = pVisualNew[j].vid; - found_default = TRUE; - } - - /* Save the old VisualID */ - orig_vid[j] = pVisual[i].vid; - - /* Initialize the glXVisual */ - _gl_copy_visual_to_context_mode( modes, & NullConfig ); - modes->visualID = pVisualNew[j].vid; - - j++; - - continue; - } - - for (k = 0; k < numNewConfigs; k++) { - if (pNewVisualConfigs[k].rgba != is_rgb) - continue; - - assert( modes != NULL ); - - /* Initialize the new visual */ - pVisualNew[j] = pVisual[i]; - pVisualNew[j].vid = FakeClientID(0); - - /* Check for the default visual */ - if (!found_default && pVisual[i].vid == *defaultVisp) { - *defaultVisp = pVisualNew[j].vid; - found_default = TRUE; - } - - /* Save the old VisualID */ - orig_vid[j] = pVisual[i].vid; - - /* Initialize the glXVisual */ - _gl_copy_visual_to_context_mode( modes, & pNewVisualConfigs[k] ); - modes->visualID = pVisualNew[j].vid; - - /* - * If the class is -1, then assume the X visual information - * is identical to what GLX needs, and take them from the X - * visual. NOTE: if class != -1, then all other fields MUST - * be initialized. - */ - if (modes->visualType == GLX_NONE) { - modes->visualType = _gl_convert_from_x_visual_type( pVisual[i].class ); - modes->redBits = count_bits(pVisual[i].redMask); - modes->greenBits = count_bits(pVisual[i].greenMask); - modes->blueBits = count_bits(pVisual[i].blueMask); - modes->alphaBits = modes->alphaBits; - modes->redMask = pVisual[i].redMask; - modes->greenMask = pVisual[i].greenMask; - modes->blueMask = pVisual[i].blueMask; - modes->alphaMask = modes->alphaMask; - modes->rgbBits = (is_rgb) - ? (modes->redBits + modes->greenBits + - modes->blueBits + modes->alphaBits) - : rootDepth; - } - - /* Save the device-dependent private for this visual */ - glXVisualPriv[j] = pNewVisualPriv[k]; - - j++; - modes = modes->next; - } - } - - assert(j <= numNewVisuals); - - /* Save the GLX visuals in the screen structure */ - glWinScreens[screenInfo.numScreens-1].num_vis = numNewVisuals; - glWinScreens[screenInfo.numScreens-1].priv = glXVisualPriv; - - /* Set up depth's VisualIDs */ - for (i = 0; i < ndepth; i++) { - int numVids = 0; - VisualID *pVids = NULL; - int k, n = 0; - - /* Count the new number of VisualIDs at this depth */ - for (j = 0; j < pdepth[i].numVids; j++) - for (k = 0; k < numNewVisuals; k++) - if (pdepth[i].vids[j] == orig_vid[k]) - numVids++; - - /* Allocate a new list of VisualIDs for this depth */ - pVids = (VisualID *)__glXMalloc(numVids * sizeof(VisualID)); - - /* Initialize the new list of VisualIDs for this depth */ - for (j = 0; j < pdepth[i].numVids; j++) - for (k = 0; k < numNewVisuals; k++) - if (pdepth[i].vids[j] == orig_vid[k]) - pVids[n++] = pVisualNew[k].vid; - - /* Update this depth's list of VisualIDs */ - __glXFree(pdepth[i].vids); - pdepth[i].vids = pVids; - pdepth[i].numVids = numVids; - } - - /* Update the X server's visuals */ - *nvisualp = numNewVisuals; - *visualp = pVisualNew; - - /* Free the old list of the X server's visuals */ - __glXFree(pVisual); - - /* Clean up temporary allocations */ - __glXFree(orig_vid); - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); - - /* Free the private list created by DDX HW driver */ - if (visualPrivates) - xfree(visualPrivates); - visualPrivates = NULL; - - return TRUE; -} - - -static void fixup_visuals(int screen) -{ - ScreenPtr pScreen = screenInfo.screens[screen]; - glWinScreenRec *pScr = &glWinScreens[screen]; - __GLcontextModes *modes; - int j; - - GLWIN_DEBUG_MSG("fixup_visuals\n"); - - for (modes = pScr->modes; modes != NULL; modes = modes->next ) { - const int vis_class = _gl_convert_to_x_visual_type( modes->visualType ); - const int nplanes = (modes->rgbBits - modes->alphaBits); - VisualPtr pVis = pScreen->visuals; - - /* Find a visual that matches the GLX visual's class and size */ - for (j = 0; j < pScreen->numVisuals; j++) { - if (pVis[j].class == vis_class && - pVis[j].nplanes == nplanes) { - - /* Fixup the masks */ - modes->redMask = pVis[j].redMask; - modes->greenMask = pVis[j].greenMask; - modes->blueMask = pVis[j].blueMask; - - /* Recalc the sizes */ - modes->redBits = count_bits(modes->redMask); - modes->greenBits = count_bits(modes->greenMask); - modes->blueBits = count_bits(modes->blueMask); - } - } - } -} - -static void init_screen_visuals(int screen) -{ - ScreenPtr pScreen = screenInfo.screens[screen]; - __GLcontextModes *modes; - int *used; - int i, j; - - GLWIN_DEBUG_MSG("init_screen_visuals\n"); - - used = (int *)__glXMalloc(pScreen->numVisuals * sizeof(int)); - __glXMemset(used, 0, pScreen->numVisuals * sizeof(int)); - - i = 0; - for ( modes = glWinScreens[screen].modes - ; modes != NULL - ; modes = modes->next) { - const int vis_class = _gl_convert_to_x_visual_type( modes->visualType ); - const int nplanes = (modes->rgbBits - modes->alphaBits); - const VisualPtr pVis = pScreen->visuals; - - for (j = 0; j < pScreen->numVisuals; j++) { - - if (pVis[j].class == vis_class && - pVis[j].nplanes == nplanes && - pVis[j].redMask == modes->redMask && - pVis[j].greenMask == modes->greenMask && - pVis[j].blueMask == modes->blueMask && - !used[j]) { - -#if 0 - /* Create the XMesa visual */ - pXMesaVisual[i] = - XMesaCreateVisual(pScreen, - pVis, - modes->rgbMode, - (modes->alphaBits > 0), - modes->doubleBufferMode, - modes->stereoMode, - GL_TRUE, /* ximage_flag */ - modes->depthBits, - modes->stencilBits, - modes->accumRedBits, - modes->accumGreenBits, - modes->accumBlueBits, - modes->accumAlphaBits, - modes->samples, - modes->level, - modes->visualRating); -#endif - - /* Set the VisualID */ - modes->visualID = pVis[j].vid; - - /* Mark this visual used */ - used[j] = 1; - break; - } - } - - if ( j == pScreen->numVisuals ) { - ErrorF("No matching visual for __GLcontextMode with " - "visual class = %d (%d), nplanes = %u\n", - vis_class, - modes->visualType, - (modes->rgbBits - modes->alphaBits) ); - } - else if ( modes->visualID == -1 ) { - FatalError( "Matching visual found, but visualID still -1!\n" ); - } - - i++; - - } - - __glXFree(used); - - /* glWinScreens[screen].xm_vis = pXMesaVisual; */ -} - -static Bool glWinScreenProbe(int screen) -{ - ScreenPtr pScreen; - glWinScreenRec *screenPriv; - - GLWIN_DEBUG_MSG("glWinScreenProbe\n"); - - /* - * Set up the current screen's visuals. - */ - __glDDXScreenInfo.modes = glWinScreens[screen].modes; - __glDDXScreenInfo.pVisualPriv = glWinScreens[screen].priv; - __glDDXScreenInfo.numVisuals = - __glDDXScreenInfo.numUsableVisuals = glWinScreens[screen].num_vis; - - /* - * Set the current screen's createContext routine. This could be - * wrapped by a DDX GLX context creation routine. - */ - __glDDXScreenInfo.createContext = glWinCreateContext; - - /* - * The ordering of the rgb compenents might have been changed by the - * driver after mi initialized them. - */ - fixup_visuals(screen); - - /* - * Find the GLX visuals that are supported by this screen and create - * XMesa's visuals. - */ - init_screen_visuals(screen); - - /* Wrap RealizeWindow and UnrealizeWindow on this screen */ - pScreen = screenInfo.screens[screen]; - screenPriv = &glWinScreens[screen]; - screenPriv->RealizeWindow = pScreen->RealizeWindow; - pScreen->RealizeWindow = glWinRealizeWindow; - screenPriv->UnrealizeWindow = pScreen->UnrealizeWindow; - pScreen->UnrealizeWindow = glWinUnrealizeWindow; - screenPriv->CopyWindow = pScreen->CopyWindow; - pScreen->CopyWindow = glWinCopyWindow; - - return TRUE; -} - -static GLboolean glWinSwapBuffers(__GLXdrawablePrivate *glxPriv) -{ - /* swap buffers on only *one* of the contexts - * (e.g. the last one for drawing) - */ - __GLcontext *gc = (__GLcontext *)glxPriv->drawGlxc->gc; - HDC dc; - BOOL ret; - - GLWIN_TRACE_MSG("glWinSwapBuffers (ctx %p)\n", (gc!=NULL?gc->ctx:NULL)); - - if (gc != NULL && gc->ctx != NULL) - { - dc = glWinMakeDC(gc); - if (dc == NULL) - return GL_FALSE; - - ret = SwapBuffers(dc); - if (!ret) - ErrorF("SwapBuffers failed: %s\n", glWinErrorMessage()); - - ReleaseDC(gc->winInfo.hwnd, dc); - if (!ret) - return GL_FALSE; - } - - return GL_TRUE; -} - -static void glWinDestroyDrawablePrivate(__GLdrawablePrivate *glPriv) -{ - GLWIN_DEBUG_MSG("glWinDestroyDrawablePrivate\n"); - - /* It doesn't work to call DRIDestroySurface here, the drawable's - already gone.. But dri.c notices the window destruction and - frees the surface itself. */ - - free(glPriv->private); - glPriv->private = NULL; -} - - -static void glWinCreateBuffer(__GLXdrawablePrivate *glxPriv) -{ - GLWinDrawableRec *winPriv = malloc(sizeof(GLWinDrawableRec)); - __GLdrawablePrivate *glPriv = &glxPriv->glPriv; - - /*winPriv->sid = 0; */ - winPriv->pDraw = NULL; - - GLWIN_DEBUG_MSG("glWinCreateBuffer\n"); - - /* replace swapBuffers (original is never called) */ - glxPriv->swapBuffers = glWinSwapBuffers; - - /* stash private data */ - glPriv->private = winPriv; - glPriv->freePrivate = glWinDestroyDrawablePrivate; -} - -static void glWinResetExtension(void) -{ - GLWIN_DEBUG_MSG("glWinResetExtension\n"); -} - -/* based on code in apples/indirect.c which is based on i830_dri.c */ -static void -glWinInitVisualConfigs(void) -{ - int lclNumConfigs = 0; - __GLXvisualConfig *lclVisualConfigs = NULL; - void **lclVisualPrivates = NULL; - - int depth, aux, buffers, stencil, accum; - int i = 0; - - GLWIN_DEBUG_MSG("glWinInitVisualConfigs "); - - /* count num configs: - 2 Z buffer (0, 24 bit) - 2 AUX buffer (0, 2) - 2 buffers (single, double) - 2 stencil (0, 8 bit) - 2 accum (0, 64 bit) - = 32 configs */ - - lclNumConfigs = 2 * 2 * 2 * 2 * 2; /* 32 */ - - /* alloc */ - lclVisualConfigs = xcalloc(sizeof(__GLXvisualConfig), lclNumConfigs); - lclVisualPrivates = xcalloc(sizeof(void *), lclNumConfigs); - - /* fill in configs */ - if (NULL != lclVisualConfigs) { - i = 0; /* current buffer */ - for (depth = 0; depth < 2; depth++) { - for (aux = 0; aux < 2; aux++) { - for (buffers = 0; buffers < 2; buffers++) { - for (stencil = 0; stencil < 2; stencil++) { - for (accum = 0; accum < 2; accum++) { - lclVisualConfigs[i].vid = -1; - lclVisualConfigs[i].class = -1; - lclVisualConfigs[i].rgba = TRUE; - lclVisualConfigs[i].redSize = -1; - lclVisualConfigs[i].greenSize = -1; - lclVisualConfigs[i].blueSize = -1; - lclVisualConfigs[i].redMask = -1; - lclVisualConfigs[i].greenMask = -1; - lclVisualConfigs[i].blueMask = -1; - lclVisualConfigs[i].alphaMask = 0; - if (accum) { - lclVisualConfigs[i].accumRedSize = 16; - lclVisualConfigs[i].accumGreenSize = 16; - lclVisualConfigs[i].accumBlueSize = 16; - lclVisualConfigs[i].accumAlphaSize = 16; - } - else { - lclVisualConfigs[i].accumRedSize = 0; - lclVisualConfigs[i].accumGreenSize = 0; - lclVisualConfigs[i].accumBlueSize = 0; - lclVisualConfigs[i].accumAlphaSize = 0; - } - lclVisualConfigs[i].doubleBuffer = buffers ? TRUE : FALSE; - lclVisualConfigs[i].stereo = FALSE; - lclVisualConfigs[i].bufferSize = -1; - - lclVisualConfigs[i].depthSize = depth? 24 : 0; - lclVisualConfigs[i].stencilSize = stencil ? 8 : 0; - lclVisualConfigs[i].auxBuffers = aux ? 2 : 0; - lclVisualConfigs[i].level = 0; - lclVisualConfigs[i].visualRating = GLX_NONE_EXT; - lclVisualConfigs[i].transparentPixel = 0; - lclVisualConfigs[i].transparentRed = 0; - lclVisualConfigs[i].transparentGreen = 0; - lclVisualConfigs[i].transparentBlue = 0; - lclVisualConfigs[i].transparentAlpha = 0; - lclVisualConfigs[i].transparentIndex = 0; - i++; - } - } - } - } - } - } - if (i != lclNumConfigs) - GLWIN_DEBUG_MSG("glWinInitVisualConfigs failed to alloc visual configs"); - - GlxSetVisualConfigs(lclNumConfigs, lclVisualConfigs, lclVisualPrivates); -} - -/* Copied from Mesa */ -static void glWinSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs, - void **privates) -{ - GLWIN_DEBUG_MSG("glWinSetVisualConfigs\n"); - - numConfigs = nconfigs; - visualConfigs = configs; - visualPrivates = privates; -} - -/* Copied from Mesa */ -static Bool glWinInitVisuals(VisualPtr *visualp, DepthPtr *depthp, - int *nvisualp, int *ndepthp, - int *rootDepthp, VisualID *defaultVisp, - unsigned long sizes, int bitsPerRGB) -{ - glWinInitDebugSettings(); - - GLWIN_DEBUG_MSG("glWinInitVisuals\n"); - - if (0 == numConfigs) /* if no configs */ - glWinInitVisualConfigs(); /* ensure the visula configs are setup */ - - /* - * Setup the visuals supported by this particular screen. - */ - return init_visuals(nvisualp, visualp, defaultVisp, - *ndepthp, *depthp, *rootDepthp); -} diff --git a/nx-X11/programs/Xserver/XFree86.def b/nx-X11/programs/Xserver/XFree86.def deleted file mode 100644 index a233c197e..000000000 --- a/nx-X11/programs/Xserver/XFree86.def +++ /dev/null @@ -1,5 +0,0 @@ -NAME XFree86 NOTWINDOWCOMPAT -DESCRIPTION "@#XFREE86:4.4.0#@ $XFree86: xc/programs/Xserver/XFree86.def,v 1.4 2002/05/31 18:45:53 dawes Exp $" -PROTMODE -EXETYPE OS2 - diff --git a/nx-X11/programs/Xserver/Xnest.def b/nx-X11/programs/Xserver/Xnest.def deleted file mode 100644 index 3bfef9a74..000000000 --- a/nx-X11/programs/Xserver/Xnest.def +++ /dev/null @@ -1,4 +0,0 @@ -NAME Xnest WINDOWCOMPAT -DESCRIPTION "@#XFREE86:4.4.0#@ $XFree86: xc/programs/Xserver/Xnest.def,v 3.4 2003/11/06 03:25:42 dawes Exp $" -PROTMODE -EXETYPE OS2 diff --git a/nx-X11/programs/Xserver/Xorg.def b/nx-X11/programs/Xserver/Xorg.def deleted file mode 100644 index fac275d35..000000000 --- a/nx-X11/programs/Xserver/Xorg.def +++ /dev/null @@ -1,5 +0,0 @@ -NAME Xorg NOTWINDOWCOMPAT -DESCRIPTION "@#XORG:4.4.0#@ $XdotOrg: xc/programs/Xserver/Xorg.def,v 1.2 2004/04/23 18:44:35 eich Exp $" -PROTMODE -EXETYPE OS2 - diff --git a/nx-X11/programs/Xserver/XpConfig/C/Imakefile b/nx-X11/programs/Xserver/XpConfig/C/Imakefile deleted file mode 100644 index 930cc6711..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/Imakefile +++ /dev/null @@ -1,8 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.1 2002/06/09 05:42:52 gisburn Exp $ -#define IHaveSubdirs -#define PassCDebugFlags CDEBUGFLAGS="$(CDEBUGFLAGS)" - -SUBDIRS = print - -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/Imakefile b/nx-X11/programs/Xserver/XpConfig/C/print/Imakefile deleted file mode 100644 index fe224df64..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/Imakefile +++ /dev/null @@ -1,23 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.1 2003/11/20 04:22:52 gisburn Exp $ -#define IHaveSubdirs -#define PassCDebugFlags CDEBUGFLAGS="$(CDEBUGFLAGS)" - -SUBDIRS = attributes ddx-config models - -#if HasGhostScript -all:: Xprinters.ghostscript - -# Enable the "xp_pdf_spooldir_tmp_Xprintjobs" printer if we have GS -Xprinters.ghostscript: Xprinters - sed Xprinters.ghostscript - -clean:: - $(RM) Xprinters.ghostscript - -InstallNamedNonExec(Xprinters.ghostscript,Xprinters,$(XPRINTDIR)/C/print) -#else -InstallNamedNonExec(Xprinters,Xprinters,$(XPRINTDIR)/C/print) -#endif /* HasGhostScript */ - -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/Xprinters b/nx-X11/programs/Xserver/XpConfig/C/print/Xprinters deleted file mode 100644 index a32c02dc2..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/Xprinters +++ /dev/null @@ -1,49 +0,0 @@ -######################################################################## -# -# $Xorg: Xprinters,v 1.3 2000/08/17 19:48:02 cpqbld Exp $ -# -# X*printers sample configuration file -# -# -# This file belongs in /usr/lib/X11/X*printers, where the "*" is the -# display number of the server. For example, if the server is -# invoked using the command X :0, then the X0printers file is used. -######################################################################## - -######################################################################## -# Use lpstat to augment the list of printers managed by the -# server. (This is the default behavior if the X*printers file does -# not exist, or if an "Augment_Printer_List" line is not specified.) -######################################################################## -#Augment_Printer_List %(default)% - -######################################################################## -# Use the specified command pipeline to augment the list of printers -# managed by the server. -######################################################################## -#Augment_Printer_List lpstat -a | cut -d " " -f 1 # equivalent to default - -######################################################################## -# Do not augment the list of printers managed by the server. -######################################################################## -#Augment_Printer_List %none% - -######################################################################## -# Preconfigured entry for the PSspooldir model -# (which sends jobs to /tmp/Xprintjobs instead to a physical printer) -######################################################################## -#Printer xp_pdf_spooldir_tmp_Xprintjobs -Printer xp_ps_spooldir_tmp_Xprintjobs - -######################################################################## -# Add individual printers to the list of printers managed by the -# server. These are aliases, determined by driver name. -######################################################################## - - -# EXAMPLES -# -# Printer xppspr -# Printer xppclpr -# Printer xppclmonopr -# Printer xprasterpr diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/attributes/Imakefile b/nx-X11/programs/Xserver/XpConfig/C/print/attributes/Imakefile deleted file mode 100644 index e0daf54d2..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/attributes/Imakefile +++ /dev/null @@ -1,8 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.1 2002/06/09 05:42:52 gisburn Exp $ - -XPATTRIBUTEDIR = $(XPRINTDIR)/C/print/attributes - -InstallNonExecFile(document,$(XPATTRIBUTEDIR)) -InstallNonExecFile(job,$(XPATTRIBUTEDIR)) -InstallNonExecFile(printer,$(XPATTRIBUTEDIR)) - diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/attributes/document b/nx-X11/programs/Xserver/XpConfig/C/print/attributes/document deleted file mode 100644 index b1651bd94..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/attributes/document +++ /dev/null @@ -1,49 +0,0 @@ -# $Xorg: document,v 1.3 2000/08/17 19:48:03 cpqbld Exp $ -# Document DPA-Object initial attribute values - -# Attribute IDs must be qualified by using one of the following -# (listed in order of precedence): -# -# printer-name -# Set this attribute for a specific printer. -# Example: "dj_1.plex: duplex" -# -# printer-model -# Set this attribute for all printers of a specific model. -# Example: "HPDJ1600C.plex: duplex" -# -# '*' -# Set this attribute for all printers. -# Example: "*.plex: duplex" - - -*content-orientation: portrait -*copy-count: 1 -*default-medium: iso-a4 -*default-printer-resolution: 600 - -# "PSspooldir" jobs should always be 300 DPI -# (to be compatible to DPS-based PostScript viewers such as sdtimage) -PSspooldir.default-printer-resolution: 300 - -# "PS2PDFspooldir-GS" jobs should always be 600 DPI -PS2PDFspooldir-GS.default-printer-resolution: 600 - -# Some resolution defaults to make applications happy which are too lazy -# to pick an own default in absence of "default-printer-resolution" -HPLJ4050-PS.default-printer-resolution: 600 -SPSPARC2.default-printer-resolution: 300 -CANONBJ10E-GS.default-printer-resolution: 360 -CANONC3200-PS.default-printer-resolution: 600 - -# EXAMPLES -# -# *content-orientation: landscape -# *copy-count: 3 -# *default-input-tray: main -# *default-medium: iso-a4 -# *default-printer-resolution: 600 -# *document-format: {PCL 5} -# *plex: simplex -# *xp-listfonts-modes: xp-list-internal-printer-fonts - diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/attributes/job b/nx-X11/programs/Xserver/XpConfig/C/print/attributes/job deleted file mode 100644 index aa1911dcd..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/attributes/job +++ /dev/null @@ -1,25 +0,0 @@ -# $Xorg: job,v 1.3 2000/08/17 19:48:03 cpqbld Exp $ -# Job DPA-Object initial attribute values - -# Attribute IDs must be qualified by using one of the following -# (listed in order of precedence): -# -# printer-name -# Set this attribute for a specific printer. -# Example: "laser_1.job-priority: 1" -# -# printer-model -# Set this attribute for all printers of a specific model. -# Example: "HPDJ1600C.job-priority: 1" -# -# '*' -# Set this attribute for all printers. -# Example: "*.job-priority: 1" - -*notification-profile: {} - -# EXAMPLES -# -# *job-name: Example Job Name -# *notification-profile: {{event-report-job-completed} electronic-mail} -# *xp-spooler-command-options: -onb diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/attributes/printer b/nx-X11/programs/Xserver/XpConfig/C/print/attributes/printer deleted file mode 100644 index 41e13b44b..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/attributes/printer +++ /dev/null @@ -1,96 +0,0 @@ -# $Xorg: printer,v 1.3 2000/08/17 19:48:03 cpqbld Exp $ -# Printer DPA-Object initial attribute values - -# Attribute IDs must be qualified by using one of the following -# (listed in order of precedence): -# -# printer-name -# Set this attribute for a specific printer. -# Example: "dj_1.document-formats-ready: {pcl 5}" -# -# printer-model -# Set this attribute for all printers of a specific model. -# Example: "HPDJ1600C.document-formats-ready: {pcl 5}" -# -# '*' -# Set this attribute for all printers. -# Example: "*.document-formats-ready: {pcl 5}" - -# Remove this line and replace them with per printer settings -# if you want to use more than one DDX!! -*xp-model-identifier: PSdefault - - -# Sample entry for the "PSspooldir" model -# Just add a printer called "xp_ps_spooldir_tmp_Xprintjobs" to "Xprinters" -# and you will get an extra printer which files the PostScript jobs -# in the "/tmp/Xprintjobs/" directory. -xp_ps_spooldir_tmp_Xprintjobs.xp-model-identifier: PSspooldir - -# Sample entry for the "PS2PDFspooldir-GS" model -# Just add a printer called "xp_pdf_spooldir_tmp_Xprintjobs" to "Xprinters" -# and you will get an extra printer which convertes the PostScript jobs -# to PDF using "ps2pdf" and files them into the "/tmp/Xprintjobs/" directory. -# NOTE: Future versions of Xprint will use the PDF DDX instead directly -# instead of relying on GhostScript/ps2pdf... -xp_pdf_spooldir_tmp_Xprintjobs.xp-model-identifier: PS2PDFspooldir-GS - - -# IMPORTANT EXAMPLES -# -# The following are examples of how a printer name is bound -# to a model-config file and ddx driver. -# -# Warning: most X-Servers have a hard limit on the number of ddx -# drivers (ie, screens) they can support at runtime (usually 3 or -# 4). Whatever the number of printers, they cannot create a -# dependency for more than the limit on ddx drivers. Assuming -# "Xprinters" listed all four xp*pr printers below, X-Servers -# with a limit of 3 would not work. -# -# xppspr.xp-model-identifier: HPDJ1600C -# xppspr.xp-ddx-identifier: XP-POSTSCRIPT -# xppspr.document-formats-ready: { PostScript 2 } -# -# xppclpr.xp-model-identifier: HPDJ1600C -# xppclpr.xp-ddx-identifier: XP-PCL-COLOR -# xppclpr.document-formats-ready: { PCL 5 } -# -# xppclmonopr.xp-model-identifier: HPDJ1600C -# xppclmonopr.xp-ddx-identifier: XP-PCL-MONO -# xppclmonopr.document-formats-ready: { PCL 5 } -# -# xprasterpr.xp-model-identifier: HPDJ1600C -# xprasterpr.xp-ddx-identifier: XP-RASTER - - -# MORE EXAMPLES of items often configured in this file -# -# *descriptor: This printer has not been given a name -# *dt-pdm-command: dtpdm -# *input-trays-medium: {top na-letter} {bottom iso-a4} -# *xp-model-identifier: HPDJ1600C -# *xp-spooler-command: /opt/mystuff/bin/mylp -p %printer-name% -c %copy-count% \ -# -j %job-name% -o %options% - - -# USUALLY SET BY THE ddx driver -# -# *content-orientations-supported: portrait landscape reverse-portrait reverse-landscape - - -# USUALLY SET BY THE model-config FILE -# -# *document-formats-supported: {PCL 5} -# *medium-source-sizes-supported: \ -# { top {iso-a4 FALSE {10 200 10 287}} {iso-a5 FALSE {10 138 10 200}} } \ -# { bottom {iso-a4 FALSE {10 200 10 287}} {iso-a5 FALSE {10 138 10 200}} } -# *plexes-supported: simplex duplex tumble -# *printer-model: Hewlett-Packard LaserJet IV -# *printer-resolutions-supported: 300 -# *xp-ddx-identifier: XP-PCL-COLOR -# *xp-embedded-formats-supported: {PCL 5} {HPGL 2} -# *xp-listfonts-modes-supported: xp-list-internal-printer-fonts -# *xp-raw-formats-supported: {PCL 5} -# *xp-setup-proviso: xp-setup-optional - diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/ddx-config/Imakefile b/nx-X11/programs/Xserver/XpConfig/C/print/ddx-config/Imakefile deleted file mode 100644 index 71f7a7817..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/ddx-config/Imakefile +++ /dev/null @@ -1,8 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.1 2002/06/09 05:42:52 gisburn Exp $ -#define IHaveSubdirs -#define PassCDebugFlags CDEBUGFLAGS="$(CDEBUGFLAGS)" - -SUBDIRS = raster - -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/ddx-config/raster/Imakefile b/nx-X11/programs/Xserver/XpConfig/C/print/ddx-config/raster/Imakefile deleted file mode 100644 index 85950c946..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/ddx-config/raster/Imakefile +++ /dev/null @@ -1,6 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.1 2002/06/09 05:42:52 gisburn Exp $ - -XPDDXCONFIGRASTERDIR = $(XPRINTDIR)/C/print/ddx-config/raster - -InstallNonExecFile(pcl,$(XPDDXCONFIGRASTERDIR)) -InstallNonExecFile(postscript,$(XPDDXCONFIGRASTERDIR)) diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/ddx-config/raster/pcl b/nx-X11/programs/Xserver/XpConfig/C/print/ddx-config/raster/pcl deleted file mode 100644 index 15d33e7b3..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/ddx-config/raster/pcl +++ /dev/null @@ -1,39 +0,0 @@ -# $Xorg: pcl,v 1.3 2000/08/17 19:48:03 cpqbld Exp $ -# This is the file which you should customize to include the printers that -# will print through the raster driver. The early part of this file -# specifies some commn useful defaults. You can override them when -# you list your printers in the second part of this file. This file is -# an X Resource file. To learn more about this file format, consult -# the functional specification. - -# Note that the reference printer for CDEnext is the HP DeskJet 1600C. -# This driver may work for other printers, but the reference printer -# is the only officially supported printer. - - -# DEFAULTS -# ======== - -# The attributes below apply to all printers unless the section below -# specifies something different for the printer. - -# Default printer attributes -# -------------------------- -# Printer attributes control the choices that users will see in the -# setup dialog for those printers. - -# The attributes below apply to all printes unless the section below -# specifies something different for the printer. - -*.media-ready: na-letter-white -*.descriptor: Printer supported by CDEnext DtPrint System. -*.printer-model: HPDJ1600C - -# Printer Specifics - -# Use this section to override the defaults listed above or to override the -# printer attributes described in the model file. -# The lines describing "laser" are just a sample to help you get started. - -# laser.printer-name: laser -# laser.spooler-name: laser diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/ddx-config/raster/postscript b/nx-X11/programs/Xserver/XpConfig/C/print/ddx-config/raster/postscript deleted file mode 100644 index e69de29bb..000000000 diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/CANONBJ10E-GS/Imakefile b/nx-X11/programs/Xserver/XpConfig/C/print/models/CANONBJ10E-GS/Imakefile deleted file mode 100644 index 59521467b..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/models/CANONBJ10E-GS/Imakefile +++ /dev/null @@ -1,15 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.1 2003/02/10 05:42:52 gisburn Exp $ - -XPMODELNAME = CANONBJ10E-GS - -MODELDIR = $(XPRINTDIR)/C/print/models/$(XPMODELNAME) - -InstallNonExecFile(model-config,$(MODELDIR)) - -# All GhostScript-printer models should use the printer-builtin fonts from the -# "GSdefault" printer model (unless they employ more or other builtin fonts) -# (native PostScript printers should use the fonts from the "PSdefault" model) -install:: - $(RM) $(DESTDIR)$(MODELDIR)/fonts - $(LN) ../GSdefault/fonts $(DESTDIR)$(MODELDIR) - diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/CANONBJ10E-GS/model-config b/nx-X11/programs/Xserver/XpConfig/C/print/models/CANONBJ10E-GS/model-config deleted file mode 100644 index 97bfd8196..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/models/CANONBJ10E-GS/model-config +++ /dev/null @@ -1,23 +0,0 @@ -# $Xprint.org: CANONBJ10E-GS model-config,v 1.4 2003/02/10 14:48:04 gisburn Exp $ - -*content-orientations-supported: portrait landscape -*descriptor: Canon BJ-10e (GhostScript) -*document-formats-supported: {POSTSCRIPT 2} -*input-trays-supported: -*medium-source-sizes-supported: \ -{ '' \ - {iso-b5 FALSE {6.35 169.65 6.35 243.65}}\ - {iso-a4 FALSE {6.35 203.65 6.35 290.65}}\ - {na-letter FALSE {6.35 209.55 6.35 273.05}}\ - {na-legal FALSE {6.35 209.55 6.35 349.25}}\ -} - -*plexes-supported: simplex -*printer-model: "Canon BJ-10e (GhostScript)" -*printer-resolutions-supported: 360 -*xp-ddx-identifier: XP-POSTSCRIPT -*xp-listfonts-modes-supported: xp-list-internal-printer-fonts xp-list-glyph-fonts -*xp-embedded-formats-supported: {POSTSCRIPT 2} -*xp-raw-formats-supported: {POSTSCRIPT 2} -*xp-setup-proviso: setup-optional -# EOF. diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/CANONC3200-PS/Imakefile b/nx-X11/programs/Xserver/XpConfig/C/print/models/CANONC3200-PS/Imakefile deleted file mode 100644 index 3bfbcc913..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/models/CANONC3200-PS/Imakefile +++ /dev/null @@ -1,15 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.1 2004/06/24 09:25:02 gisburn Exp $ -#define IHaveSubdirs -#define PassCDebugFlags CDEBUGFLAGS="$(CDEBUGFLAGS)" - -SUBDIRS = fonts - -XPMODELNAME = CANONC3200-PS - -MODELDIR = $(XPRINTDIR)/C/print/models/$(XPMODELNAME) - -InstallNonExecFile(model-config,$(MODELDIR)) - -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) - diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/CANONC3200-PS/fonts/Imakefile b/nx-X11/programs/Xserver/XpConfig/C/print/models/CANONC3200-PS/fonts/Imakefile deleted file mode 100644 index b4e1b3df3..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/models/CANONC3200-PS/fonts/Imakefile +++ /dev/null @@ -1,45 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.1 2004/06/24 09:25:23 gisburn Exp $ - -XPFONTS = \ - AvantGarde-Book.pmf \ - AvantGarde-BookOblique.pmf \ - AvantGarde-Demi.pmf \ - AvantGarde-DemiOblique.pmf \ - Courier-Bold.pmf \ - Courier-BoldOblique.pmf \ - Courier-Oblique.pmf \ - Courier.pmf \ - Helvetica-Bold.pmf \ - Helvetica-BoldOblique.pmf \ - Helvetica-Oblique.pmf \ - Helvetica.pmf \ - LubalinGraph-Book.pmf \ - LubalinGraph-BookOblique.pmf \ - LubalinGraph-Demi.pmf \ - LubalinGraph-DemiOblique.pmf \ - NewCenturySchlbk-Bold.pmf \ - NewCenturySchlbk-BoldItalic.pmf \ - NewCenturySchlbk-Italic.pmf \ - NewCenturySchlbk-Roman.pmf \ - Souvenir-Demi.pmf \ - Souvenir-DemiItalic.pmf \ - Souvenir-Light.pmf \ - Souvenir-LightItalic.pmf \ - Symbol.pmf \ - Times-Bold.pmf \ - Times-BoldItalic.pmf \ - Times-Italic.pmf \ - Times-Roman.pmf \ - ZapfDingbats.pmf - -XPMODELNAME = CANONC3200-PS - -MODELDIR = $(XPRINTDIR)/C/print/models/$(XPMODELNAME) -MODELFONTDIR = $(MODELDIR)/fonts - -# We reuse some of the PSdefault fonts -PARENTMODELFONTDIR=../../PSdefault/fonts - -InstallXpMultiplePMFLinks($(XPFONTS),$(PARENTMODELFONTDIR),$(MODELFONTDIR)) -InstallXpPMFFontsDir($(MODELFONTDIR)) - diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/CANONC3200-PS/model-config b/nx-X11/programs/Xserver/XpConfig/C/print/models/CANONC3200-PS/model-config deleted file mode 100644 index cdb3f4958..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/models/CANONC3200-PS/model-config +++ /dev/null @@ -1,40 +0,0 @@ -# $Xprint.org: CANONC3200-PS model-config,v 1.1 2004/06/24 09:18:04 gisburn Exp $ -# model-config for the PostScript DDX -# -# automatically generated by xpppdtomodelconfig V0.1 -# -# DO NOT MODIFY THIS FILE!! -# -# Attributes supported for this printer model -*content-orientations-supported: portrait landscape reverse-portrait reverse-landscape -*descriptor: Canon iR C3200 -*document-formats-supported: {POSTSCRIPT 2} -*input-trays-supported: -*medium-source-sizes-supported: \ -{ '' \ - {iso-a4 FALSE {4.002 206 4.002 293}}\ - {na-letter FALSE {4.002 211.9 4.002 275.4}}\ - {na-legal FALSE {4.002 211.9 4.002 351.6}}\ - {iso-a3 FALSE {4.002 293 4.002 416}}\ - {iso-a5 FALSE {4.002 144 4.002 206}}\ - {iso-b4 FALSE {4.002 246 4.002 349}}\ - {iso-b5 FALSE {4.002 172 4.002 246}}\ - {executive FALSE {4.002 180.1 4.002 262.7}}\ - {invoice FALSE {4.002 135.7 4.002 211.9}}\ - {monarch-envelope FALSE {4.002 94.3 4.002 186.5}}\ - {na-number-10-envelop FALSE {4.002 100.8 4.002 237.3}}\ - {iso-c5 FALSE {4.002 158 4.002 225}}\ -} - -*plexes-supported: simplex duplex tumble -*printer-model: "Canon iR C3200" -*printer-resolutions-supported: 600 -*xp-ddx-identifier: XP-POSTSCRIPT -*xp-listfonts-modes-supported: xp-list-internal-printer-fonts xp-list-glyph-fonts -*xp-embedded-formats-supported: {POSTSCRIPT 2} -*xp-raw-formats-supported: {POSTSCRIPT 2} -*xp-setup-proviso: setup-optional -# NOTE: xp-psddx-* attributes are EXPERIMENTAL for now. -*xp-psddx-download-fonts: pfa pfb ttf ttc otf otc -*xp-psddx-download-font-type: pstype1 -# EOF. diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/GSdefault/Imakefile b/nx-X11/programs/Xserver/XpConfig/C/print/models/GSdefault/Imakefile deleted file mode 100644 index 6ac1d0d24..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/models/GSdefault/Imakefile +++ /dev/null @@ -1,14 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.1 2002/06/09 05:42:52 gisburn Exp $ - -XPMODELNAME = GSdefault - -MODELDIR = $(XPRINTDIR)/C/print/models/$(XPMODELNAME) - -InstallNonExecFile(model-config,$(MODELDIR)) - -# All PostScript-printer models should use the printer-builtin fonts from the -# "PSdefault" printer model (unless they employ more or other builtin fonts) -install:: - $(RM) $(DESTDIR)$(MODELDIR)/fonts - $(LN) ../PSdefault/fonts $(DESTDIR)$(MODELDIR) - diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/GSdefault/model-config b/nx-X11/programs/Xserver/XpConfig/C/print/models/GSdefault/model-config deleted file mode 100644 index 61dac18b8..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/models/GSdefault/model-config +++ /dev/null @@ -1,137 +0,0 @@ -# $Xprint.org: GSdefault model-config,v 1.1 2003/02/10 14:48:04 gisburn Exp $ -# Generic default model-config for the PostScript DDX when using GhostScript -# as printer driver -# -# DO NOT MODIFY THIS FILE!! -# -# If you want to make customisations for your printer create a copy -# of this printer model. -# Example (for creating a model config "MYCOMPANYlaserxx"): -# 1. Create model config dir: -# % mkdir MYCOMPANYlaserxx -# 2. Link (or copy) the PMF (printer font metrics) for the -# printer buildin fonts: -# % ln -s GSdefault/fonts MYCOMPANYlaserxx/. -# 3. Copy the model config file: -# % cp GSdefault/model-config MYCOMPANYlaserxx/. -# 4. Customize MYCOMPANYlaserxx/model-config to match your needs. -# - -# Attributes supported for this printer model -# You may want to cut the lists here down to the attributes supported -# by your printer. -*content-orientations-supported: portrait landscape reverse-portrait reverse-landscape -*descriptor: GhostScript default model -*document-formats-supported: {POSTSCRIPT 2} -*input-trays-supported: -*medium-source-sizes-supported: \ -{ '' \ - {na-letter FALSE {6.35 209.55 6.35 273.05}}\ - {na-legal FALSE {6.35 209.55 6.35 349.25}}\ - {executive FALSE {6.35 177.80 6.35 260.35}}\ - {folio FALSE {6.35 204.47 6.35 323.85}}\ - {invoice FALSE {6.35 133.35 6.35 209.55}}\ - {ledger FALSE {6.35 273.05 6.35 425.45}}\ - {quarto FALSE {6.35 209.55 6.35 268.732}}\ - {a FALSE {6.35 209.55 6.35 273.05}}\ - {b FALSE {6.35 273.05 6.35 425.45}}\ - {c FALSE {6.35 425.45 6.35 552.45}}\ - {d FALSE {6.35 552.45 6.35 857.25}}\ - {e FALSE {6.35 857.25 6.35 1111.25}}\ - {na-6x9-envelope FALSE {6.35 146.05 6.35 222.25}}\ - {na-10x15-envelope FALSE {6.35 247.65 6.35 374.65}}\ - {monarch-envelope FALSE {6.35 91.948 6.35 184.15}}\ - {na-10x13-envelope FALSE {6.35 247.65 6.35 323.85}}\ - {na-9x12-envelope FALSE {6.35 222.25 6.35 298.45}}\ - {na-number-10-envelope FALSE {6.35 98.425 6.35 234.95}}\ - {na-7x9-envelope FALSE {6.35 171.45 6.35 222.25}}\ - {na-9x11-envelope FALSE {6.35 222.25 6.35 273.05}}\ - {na-10x14-envelope FALSE {6.35 247.65 6.35 349.25}}\ - {na-number-9-envelope FALSE {6.35 92.075 6.35 219.075}}\ - {iso-a0 FALSE {6.35 834.65 6.35 1182.65}}\ - {iso-a1 FALSE {6.35 587.65 6.35 834.65}}\ - {iso-a2 FALSE {6.35 413.65 6.35 587.65}}\ - {iso-a3 FALSE {6.35 290.65 6.35 413.65}}\ - {iso-a4 FALSE {6.35 203.65 6.35 290.65}}\ - {iso-a5 FALSE {6.35 141.65 6.35 203.65}}\ - {iso-a6 FALSE {6.35 98.65 6.35 141.65}}\ - {iso-a7 FALSE {6.35 67.65 6.35 98.65}}\ - {iso-a8 FALSE {6.35 45.65 6.35 67.65}}\ - {iso-a9 FALSE {6.35 30.65 6.35 45.65}}\ - {iso-a10 FALSE {6.35 19.65 6.35 30.65}}\ - {iso-b1 FALSE {6.35 700.65 6.35 993.65}}\ - {iso-b2 FALSE {6.35 493.65 6.35 700.65}}\ - {iso-b3 FALSE {6.35 346.65 6.35 493.65}}\ - {iso-b4 FALSE {6.35 243.65 6.35 346.65}}\ - {iso-b5 FALSE {6.35 169.65 6.35 243.65}}\ - {iso-b6 FALSE {6.35 118.65 6.35 169.65}}\ - {iso-b7 FALSE {6.35 81.65 6.35 118.65}}\ - {iso-b8 FALSE {6.35 55.65 6.35 81.65}}\ - {iso-b9 FALSE {6.35 37.65 6.35 55.65}}\ - {iso-b10 FALSE {6.35 24.65 6.35 37.65}}\ - {jis-b1 FALSE {6.35 721.65 6.35 1023.65}}\ - {jis-b2 FALSE {6.35 508.65 6.35 721.65}}\ - {jis-b3 FALSE {6.35 357.65 6.35 508.65}}\ - {jis-b4 FALSE {6.35 250.65 6.35 357.65}}\ - {jis-b5 FALSE {6.35 175.65 6.35 250.65}}\ - {jis-b6 FALSE {6.35 121.65 6.35 175.65}}\ - {jis-b7 FALSE {6.35 84.65 6.35 121.65}}\ - {jis-b8 FALSE {6.35 57.65 6.35 84.65}}\ - {jis-b9 FALSE {6.35 38.65 6.35 57.65}}\ - {jis-b10 FALSE {6.35 25.65 6.35 38.65}}\ - {iso-c3 FALSE {6.35 317.65 6.35 451.65}}\ - {iso-c4 FALSE {6.35 222.65 6.35 317.65}}\ - {iso-c5 FALSE {6.35 155.65 6.35 222.65}}\ - {iso-c6 FALSE {6.35 107.65 6.35 155.65}}\ - {iso-designated-long FALSE {6.35 103.65 6.35 213.65}}\ - {hp-2x-postcard FALSE {6.35 141.65 6.35 193.65}}\ - {hp-european-edp FALSE {6.35 298.45 6.35 349.25}}\ - {hp-mini FALSE {6.35 133.35 6.35 209.55}}\ - {hp-postcard FALSE {6.35 93.65 6.35 141.65}}\ - {hp-tabloid FALSE {6.35 273.05 6.35 425.45}}\ - {hp-us-edp FALSE {6.35 273.05 6.35 349.25}}\ - {hp-us-government-legal FALSE {6.35 196.85 6.35 323.85}}\ - {hp-us-government-letter FALSE {6.35 196.85 6.35 247.65}}\ -} -# If you have more than one tray use the following example: -# 1. List the supported trays -#*input-trays-supported: main manual -# 2. Define each tray and it's paper sizes -#*medium-source-sizes-supported: \ -#{ main \ -# {na-letter FALSE {6.35 209.55 6.35 273.05}} \ -# {na-legal FALSE {6.35 209.55 6.35 349.25}} \ -# {iso-a4 FALSE {6.35 203.65 6.35 290.65}} \ -#} \ -#{ manual \ -# {iso-a5 FALSE {6.35 141.65 6.35 203.65}} \ -# {iso-c5 FALSE {6.35 155.65 6.35 222.65}} \ -# {iso-designated-long FALSE {6.35 103.65 6.35 213.65}} \ -# {jis-b5 FALSE {6.35 175.65 6.35 250.65}} \ -# {monarch-envelope FALSE {6.35 91.948 6.35 184.15}} \ -# {na-legal FALSE {6.35 209.55 6.35 349.25}} \ -# {na-number-10-envelope FALSE {6.35 98.425 6.35 234.95}} \ -# {executive FALSE {6.35 177.8 6.35 260.35}} \ -# {iso-a3 FALSE {6.35 290.65 6.35 413.65}} \ -# {iso-a0 FALSE {6.35 834.65 6.35 1182.65}} \ -#} -*plexes-supported: simplex duplex tumble -*printer-model: "GhostScript default model" -# 75, 100, 120, 150, 180, 200, 240, 300, 360, 400, 600, 720, -# 940, 1200 and 2440 are supported DPI values, we limit it here -# to some common values: -*printer-resolutions-supported: 300 360 400 600 -*xp-ddx-identifier: XP-POSTSCRIPT -*xp-listfonts-modes-supported: xp-list-internal-printer-fonts xp-list-glyph-fonts -*xp-embedded-formats-supported: {POSTSCRIPT 2} -*xp-raw-formats-supported: {POSTSCRIPT 2} -*xp-setup-proviso: setup-optional - -# NOTE: xp-psddx-* attributes are EXPERIMENTAL for now. -# xp-psddx-download-fonts defines which fonts should be downloaded as outlines -# (valid types are "pfa", "pfb", "ttf", "ttc", "otf", "otc") -*xp-psddx-download-fonts: pfa pfb ttf ttc otf otc -# xp-psddx-download-font-type defines which font type is used to download outlines -# (valid values are "bitmap", "pstype1" and "pstype3") -*xp-psddx-download-font-type: pstype1 -# EOF. diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/Imakefile b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/Imakefile deleted file mode 100644 index 9e8c8e4dc..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/Imakefile +++ /dev/null @@ -1,14 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.1 2002/06/09 05:42:52 gisburn Exp $ -#define IHaveSubdirs -#define PassCDebugFlags CDEBUGFLAGS="$(CDEBUGFLAGS)" - -SUBDIRS = fonts - -XPMODELNAME = HPDJ1600C - -MODELDIR = $(XPRINTDIR)/C/print/models/$(XPMODELNAME) - -InstallNonExecFile(model-config,$(MODELDIR)) - -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00051.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00051.pmf deleted file mode 100644 index 09cc489a5..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00051.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00052.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00052.pmf deleted file mode 100644 index b21a9a2a8..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00052.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00053.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00053.pmf deleted file mode 100644 index 485b874c5..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00053.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00054.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00054.pmf deleted file mode 100644 index 524934c71..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00054.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00055.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00055.pmf deleted file mode 100644 index 2ef9bc52c..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00055.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00056.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00056.pmf deleted file mode 100644 index 3d69311ef..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00056.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00057.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00057.pmf deleted file mode 100644 index 3833d4f54..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00057.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00058.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00058.pmf deleted file mode 100644 index 289a95e5c..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00058.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00059.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00059.pmf deleted file mode 100644 index a5984bed1..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00059.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00060.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00060.pmf deleted file mode 100644 index df27cd71e..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00060.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00061.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00061.pmf deleted file mode 100644 index fb2b5a433..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00061.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00062.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00062.pmf deleted file mode 100644 index f0e58c435..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00062.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00063.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00063.pmf deleted file mode 100644 index 8821ff155..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00063.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00064.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00064.pmf deleted file mode 100644 index e5980fc0e..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00064.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00065.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00065.pmf deleted file mode 100644 index d9a151d7f..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00065.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00066.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00066.pmf deleted file mode 100644 index d14fca56f..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00066.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00067.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00067.pmf deleted file mode 100644 index 7a341506f..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00067.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00068.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00068.pmf deleted file mode 100644 index c20e39a21..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00068.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00069.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00069.pmf deleted file mode 100644 index 4a4a35281..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00069.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00070.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00070.pmf deleted file mode 100644 index 8d97d4339..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00070.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00071.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00071.pmf deleted file mode 100644 index 19844c9c6..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00071.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00072.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00072.pmf deleted file mode 100644 index 5415c3f44..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00072.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00073.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00073.pmf deleted file mode 100644 index 038dfdb46..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00073.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00074.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00074.pmf deleted file mode 100644 index 382a78575..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00074.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00075.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00075.pmf deleted file mode 100644 index 1c7edf653..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00075.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00076.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00076.pmf deleted file mode 100644 index 2f077f40f..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00076.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00077.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00077.pmf deleted file mode 100644 index 1ce190d51..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00077.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00079.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00079.pmf deleted file mode 100644 index 45d6906ba..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00079.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00080.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00080.pmf deleted file mode 100644 index b991b5edb..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00080.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00081.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00081.pmf deleted file mode 100644 index 1935a9f00..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00081.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00082.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00082.pmf deleted file mode 100644 index 2000dc057..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00082.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00083.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00083.pmf deleted file mode 100644 index 90f0e45a8..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00083.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00084.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00084.pmf deleted file mode 100644 index 52ba39b96..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00084.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00085.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00085.pmf deleted file mode 100644 index f5c9053af..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00085.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00086.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00086.pmf deleted file mode 100644 index b7586ca61..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00086.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00087.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00087.pmf deleted file mode 100644 index 82f054999..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00087.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00088.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00088.pmf deleted file mode 100644 index 591c96b59..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00088.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00089.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00089.pmf deleted file mode 100644 index c8160954a..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00089.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00090.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00090.pmf deleted file mode 100644 index 895cfe26a..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00090.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00091.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00091.pmf deleted file mode 100644 index 3bdcae4ba..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00091.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00092.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00092.pmf deleted file mode 100644 index a56d47504..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00092.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00093.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00093.pmf deleted file mode 100644 index c85f3b4de..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00093.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00094.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00094.pmf deleted file mode 100644 index 875bf1df8..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00094.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/Imakefile b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/Imakefile deleted file mode 100644 index 0c899365a..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/Imakefile +++ /dev/null @@ -1,57 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.1 2002/06/09 05:42:52 gisburn Exp $ - -XPFONTS = \ - 9nb00051.pmf \ - 9nb00052.pmf \ - 9nb00053.pmf \ - 9nb00054.pmf \ - 9nb00055.pmf \ - 9nb00056.pmf \ - 9nb00057.pmf \ - 9nb00058.pmf \ - 9nb00059.pmf \ - 9nb00060.pmf \ - 9nb00061.pmf \ - 9nb00062.pmf \ - 9nb00063.pmf \ - 9nb00064.pmf \ - 9nb00065.pmf \ - 9nb00066.pmf \ - 9nb00067.pmf \ - 9nb00068.pmf \ - 9nb00069.pmf \ - 9nb00070.pmf \ - 9nb00071.pmf \ - 9nb00072.pmf \ - 9nb00073.pmf \ - 9nb00074.pmf \ - 9nb00075.pmf \ - 9nb00076.pmf \ - 9nb00077.pmf \ - 9nb00079.pmf \ - 9nb00080.pmf \ - 9nb00081.pmf \ - 9nb00082.pmf \ - 9nb00083.pmf \ - 9nb00084.pmf \ - 9nb00085.pmf \ - 9nb00086.pmf \ - 9nb00087.pmf \ - 9nb00088.pmf \ - 9nb00089.pmf \ - 9nb00090.pmf \ - 9nb00091.pmf \ - 9nb00092.pmf \ - 9nb00093.pmf \ - 9nb00094.pmf \ - lpr0ye1a.pmf \ - fonts.alias \ - fonts.dir \ - README - -XPMODELNAME = HPDJ1600C - -MODELDIR = $(XPRINTDIR)/C/print/models/$(XPMODELNAME) -MODELFONTDIR = $(MODELDIR)/fonts -InstallMultipleDest(install,$(XPFONTS),$(MODELFONTDIR)) - diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/README b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/README deleted file mode 100644 index cccc2be32..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/README +++ /dev/null @@ -1,197 +0,0 @@ -$Xorg: README,v 1.3 2000/08/17 19:48:04 cpqbld Exp $ - -This directory contains "printer metric files" for the X Print -Server suitable for the DeskJet 1600C printer. The following -*.pmf files were generated by the Hewlett-Packard Company. - - 9nb00051.pmf - 9nb00052.pmf - 9nb00053.pmf - 9nb00054.pmf - 9nb00055.pmf - 9nb00056.pmf - 9nb00057.pmf - 9nb00058.pmf - 9nb00059.pmf - 9nb00060.pmf - 9nb00061.pmf - 9nb00062.pmf - 9nb00063.pmf - 9nb00064.pmf - 9nb00065.pmf - 9nb00066.pmf - 9nb00067.pmf - 9nb00068.pmf - 9nb00069.pmf - 9nb00070.pmf - 9nb00071.pmf - 9nb00072.pmf - 9nb00073.pmf - 9nb00074.pmf - 9nb00075.pmf - 9nb00076.pmf - 9nb00077.pmf - 9nb00079.pmf - 9nb00080.pmf - 9nb00081.pmf - 9nb00082.pmf - 9nb00083.pmf - 9nb00084.pmf - 9nb00085.pmf - 9nb00086.pmf - 9nb00087.pmf - 9nb00088.pmf - 9nb00089.pmf - 9nb00090.pmf - 9nb00091.pmf - 9nb00092.pmf - 9nb00093.pmf - 9nb00094.pmf - lpr0ye1a.pmf - -For reasons of not supporting iso8859.1 and hp-roman8, the following -DeskJet 1600C printer fonts were not converted to *.pmf files. - - 9nb00078.pmf - 9nb00095.pmf - lpr0ylga.pmf - lpr0ypca.pmf - lpr0ypda.pmf - lpr0ypma.pmf - lpr0yr8a.pmf - -Output from the conversion utility is as follows: - - Creating iso8859 1 pmf for 9nb00051.tfm as iso8859.1/9nb00051.pmf - -COMPUGRAPHIC-Albertus-Extra Bold-r-Normal--8782-2500-2540-2540-P-42480-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00052.tfm as iso8859.1/9nb00052.pmf - -COMPUGRAPHIC-Albertus-Semi Bold-r-Normal--8782-2500-2540-2540-P-37640-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00053.tfm as iso8859.1/9nb00053.pmf - -COMPUGRAPHIC-Antique Olive-Bold-r-Normal--8782-2500-2540-2540-P-50490-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00054.tfm as iso8859.1/9nb00054.pmf - -COMPUGRAPHIC-Antique Olive-Medium-i-Normal--8782-2500-2540-2540-P-46140-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00055.tfm as iso8859.1/9nb00055.pmf - -COMPUGRAPHIC-Antique Olive-Medium-r-Normal--8782-2500-2540-2540-P-46380-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00056.tfm as iso8859.1/9nb00056.pmf - -Monotype-Arial-Bold-r-Normal--2048-2500-589-589-P-9800-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00057.tfm as iso8859.1/9nb00057.pmf - -Monotype-Arial-Medium-i-Normal--2048-2500-589-589-P-9040-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00058.tfm as iso8859.1/9nb00058.pmf - -Monotype-Arial-Bold-i-Normal--2048-2500-589-589-P-9800-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00059.tfm as iso8859.1/9nb00059.pmf - -Monotype-Arial-Medium-r-Normal--2048-2500-589-589-P-9040-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00060.tfm as iso8859.1/9nb00060.pmf - -COMPUGRAPHIC-Clarendon-Bold-r-Condensed--8782-2500-2540-2540-P-35080-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00061.tfm as iso8859.1/9nb00061.pmf - -COMPUGRAPHIC-Courier-Bold-r-Normal--8782-2500-2540-2540-M-52910-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00062.tfm as iso8859.1/9nb00062.pmf - -COMPUGRAPHIC-Courier-Medium-i-Normal--8782-2500-2540-2540-M-52910-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00063.tfm as iso8859.1/9nb00063.pmf - -COMPUGRAPHIC-Courier-Bold-i-Normal--8782-2500-2540-2540-M-52910-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00064.tfm as iso8859.1/9nb00064.pmf - -COMPUGRAPHIC-Courier-Medium-r-Normal--8782-2500-2540-2540-M-52910-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00065.tfm as iso8859.1/9nb00065.pmf - -COMPUGRAPHIC-Garamond-Bold-r-Normal--8782-2500-2540-2540-P-38730-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00066.tfm as iso8859.1/9nb00066.pmf - -COMPUGRAPHIC-Garamond-Medium-i-Normal--8782-2500-2540-2540-P-34280-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00067.tfm as iso8859.1/9nb00067.pmf - -COMPUGRAPHIC-Garamond-Bold-i-Normal--8782-2500-2540-2540-P-37020-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00068.tfm as iso8859.1/9nb00068.pmf - -COMPUGRAPHIC-Garamond-Medium-r-Normal--8782-2500-2540-2540-P-36560-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00069.tfm as iso8859.1/9nb00069.pmf - -COMPUGRAPHIC-Letter Gothic-Bold-r-Normal--8782-2500-2540-2540-M-44090-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00070.tfm as iso8859.1/9nb00070.pmf - -COMPUGRAPHIC-Letter Gothic-Medium-i-Normal--8782-2500-2540-2540-M-44090-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00071.tfm as iso8859.1/9nb00071.pmf - -COMPUGRAPHIC-Letter Gothic-Medium-r-Normal--8782-2500-2540-2540-M-44090-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00072.tfm as iso8859.1/9nb00072.pmf - -COMPUGRAPHIC-Marigold-Medium-r-Normal--8782-2500-2540-2540-P-21890-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00073.tfm as iso8859.1/9nb00073.pmf - -COMPUGRAPHIC-Omega-Bold-r-Normal--8782-2500-2540-2540-P-38600-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00074.tfm as iso8859.1/9nb00074.pmf - -COMPUGRAPHIC-Omega-Medium-i-Normal--8782-2500-2540-2540-P-37980-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00075.tfm as iso8859.1/9nb00075.pmf - -COMPUGRAPHIC-Omega-Bold-i-Normal--8782-2500-2540-2540-P-38560-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00076.tfm as iso8859.1/9nb00076.pmf - -COMPUGRAPHIC-Omega-Medium-r-Normal--8782-2500-2540-2540-P-37770-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00077.tfm as iso8859.1/9nb00077.pmf - -COMPUGRAPHIC-Coronet-Medium-i-Normal--8782-2500-2540-2540-P-22870-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00079.tfm as iso8859.1/9nb00079.pmf - -Monotype-Times New Roman-Bold-r-Normal--2048-2500-589-589-P-8740-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00080.tfm as iso8859.1/9nb00080.pmf - -Monotype-Times New Roman-Medium-i-Normal--2048-2500-589-589-P-8230-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00081.tfm as iso8859.1/9nb00081.pmf - -Monotype-Times New Roman-Bold-i-Normal--2048-2500-589-589-P-8440-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00082.tfm as iso8859.1/9nb00082.pmf - -Monotype-Times New Roman-Medium-r-Normal--2048-2500-589-589-P-8210-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00083.tfm as iso8859.1/9nb00083.pmf - -COMPUGRAPHIC-Times-Bold-r-Normal--8782-2500-2540-2540-P-38200-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00084.tfm as iso8859.1/9nb00084.pmf - -COMPUGRAPHIC-Times-Medium-i-Normal--8782-2500-2540-2540-P-36000-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00085.tfm as iso8859.1/9nb00085.pmf - -COMPUGRAPHIC-Times-Bold-i-Normal--8782-2500-2540-2540-P-36900-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00086.tfm as iso8859.1/9nb00086.pmf - -COMPUGRAPHIC-Times-Medium-r-Normal--8782-2500-2540-2540-P-36080-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00087.tfm as iso8859.1/9nb00087.pmf - -COMPUGRAPHIC-Univers-Medium-i-Condensed--8782-2500-2540-2540-P-29970-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00088.tfm as iso8859.1/9nb00088.pmf - -COMPUGRAPHIC-Univers-Bold-r-Normal--8782-2500-2540-2540-P-41280-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00089.tfm as iso8859.1/9nb00089.pmf - -COMPUGRAPHIC-Univers-Medium-r-Condensed--8782-2500-2540-2540-P-29970-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00090.tfm as iso8859.1/9nb00090.pmf - -COMPUGRAPHIC-Univers-Bold-r-Condensed--8782-2500-2540-2540-P-33030-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00091.tfm as iso8859.1/9nb00091.pmf - -COMPUGRAPHIC-Univers-Bold-i-Condensed--8782-2500-2540-2540-P-33030-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00092.tfm as iso8859.1/9nb00092.pmf - -COMPUGRAPHIC-Univers-Medium-i-Normal--8782-2500-2540-2540-P-41280-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00093.tfm as iso8859.1/9nb00093.pmf - -COMPUGRAPHIC-Univers-Bold-i-Normal--8782-2500-2540-2540-P-41280-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00094.tfm as iso8859.1/9nb00094.pmf - -COMPUGRAPHIC-Univers-Medium-r-Normal--8782-2500-2540-2540-P-41280-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for lpr0ye1a.tfm as iso8859.1/lpr0ye1a.pmf - -HP-Line Printer-Medium-r-Normal--35-85-300-300-M-180-iso8859-1 - ------------------------------------ - diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/fonts.alias b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/fonts.alias deleted file mode 100644 index e69de29bb..000000000 diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/fonts.dir b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/fonts.dir deleted file mode 100644 index da702ccc1..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/fonts.dir +++ /dev/null @@ -1,45 +0,0 @@ -44 -lpr0ye1a.pmf -hp-line printer-medium-r-normal--35-85-300-300-m-180-iso8859-1 -9nb00080.pmf -monotype-times new roman-medium-i-normal--2048-2500-589-589-p-8230-iso8859-1 -9nb00092.pmf -compugraphic-univers-medium-i-normal--8782-2500-2540-2540-p-41280-iso8859-1 -9nb00081.pmf -monotype-times new roman-bold-i-normal--2048-2500-589-589-p-8440-iso8859-1 -9nb00093.pmf -compugraphic-univers-bold-i-normal--8782-2500-2540-2540-p-41280-iso8859-1 -9nb00082.pmf -monotype-times new roman-medium-r-normal--2048-2500-589-589-p-8210-iso8859-1 -9nb00090.pmf -compugraphic-univers-bold-r-condensed--8782-2500-2540-2540-p-33030-iso8859-1 -9nb00083.pmf -compugraphic-times-bold-r-normal--8782-2500-2540-2540-p-38200-iso8859-1 -9nb00091.pmf -compugraphic-univers-bold-i-condensed--8782-2500-2540-2540-p-33030-iso8859-1 -9nb00084.pmf -compugraphic-times-medium-i-normal--8782-2500-2540-2540-p-36000-iso8859-1 -9nb00085.pmf -compugraphic-times-bold-i-normal--8782-2500-2540-2540-p-36900-iso8859-1 -9nb00086.pmf -compugraphic-times-medium-r-normal--8782-2500-2540-2540-p-36080-iso8859-1 -9nb00094.pmf -compugraphic-univers-medium-r-normal--8782-2500-2540-2540-p-41280-iso8859-1 -9nb00087.pmf -compugraphic-univers-medium-i-condensed--8782-2500-2540-2540-p-29970-iso8859-1 -9nb00088.pmf -compugraphic-univers-bold-r-normal--8782-2500-2540-2540-p-41280-iso8859-1 -9nb00089.pmf -compugraphic-univers-medium-r-condensed--8782-2500-2540-2540-p-29970-iso8859-1 -9nb00058.pmf -monotype-arial-bold-i-normal--2048-2500-589-589-p-9800-iso8859-1 -9nb00059.pmf -monotype-arial-medium-r-normal--2048-2500-589-589-p-9040-iso8859-1 -9nb00068.pmf -compugraphic-garamond-medium-r-normal--8782-2500-2540-2540-p-36560-iso8859-1 -9nb00069.pmf -compugraphic-letter gothic-bold-r-normal--8782-2500-2540-2540-m-44090-iso8859-1 -9nb00079.pmf -monotype-times new roman-bold-r-normal--2048-2500-589-589-p-8740-iso8859-1 -9nb00052.pmf -compugraphic-albertus-semi bold-r-normal--8782-2500-2540-2540-p-37640-iso8859-1 -9nb00064.pmf -compugraphic-courier-medium-r-normal--8782-2500-2540-2540-m-52910-iso8859-1 -9nb00076.pmf -compugraphic-omega-medium-r-normal--8782-2500-2540-2540-p-37770-iso8859-1 -9nb00053.pmf -compugraphic-antique olive-bold-r-normal--8782-2500-2540-2540-p-50490-iso8859-1 -9nb00065.pmf -compugraphic-garamond-bold-r-normal--8782-2500-2540-2540-p-38730-iso8859-1 -9nb00077.pmf -compugraphic-coronet-medium-i-normal--8782-2500-2540-2540-p-22870-iso8859-1 -9nb00066.pmf -compugraphic-garamond-medium-i-normal--8782-2500-2540-2540-p-34280-iso8859-1 -9nb00074.pmf -compugraphic-omega-medium-i-normal--8782-2500-2540-2540-p-37980-iso8859-1 -9nb00051.pmf -compugraphic-albertus-extra bold-r-normal--8782-2500-2540-2540-p-42480-iso8859-1 -9nb00067.pmf -compugraphic-garamond-bold-i-normal--8782-2500-2540-2540-p-37020-iso8859-1 -9nb00075.pmf -compugraphic-omega-bold-i-normal--8782-2500-2540-2540-p-38560-iso8859-1 -9nb00056.pmf -monotype-arial-bold-r-normal--2048-2500-589-589-p-9800-iso8859-1 -9nb00060.pmf -compugraphic-clarendon-bold-r-condensed--8782-2500-2540-2540-p-35080-iso8859-1 -9nb00072.pmf -compugraphic-marigold-medium-r-normal--8782-2500-2540-2540-p-21890-iso8859-1 -9nb00057.pmf -monotype-arial-medium-i-normal--2048-2500-589-589-p-9040-iso8859-1 -9nb00061.pmf -compugraphic-courier-bold-r-normal--8782-2500-2540-2540-m-52910-iso8859-1 -9nb00073.pmf -compugraphic-omega-bold-r-normal--8782-2500-2540-2540-p-38600-iso8859-1 -9nb00054.pmf -compugraphic-antique olive-medium-i-normal--8782-2500-2540-2540-p-46140-iso8859-1 -9nb00062.pmf -compugraphic-courier-medium-i-normal--8782-2500-2540-2540-m-52910-iso8859-1 -9nb00070.pmf -compugraphic-letter gothic-medium-i-normal--8782-2500-2540-2540-m-44090-iso8859-1 -9nb00055.pmf -compugraphic-antique olive-medium-r-normal--8782-2500-2540-2540-p-46380-iso8859-1 -9nb00063.pmf -compugraphic-courier-bold-i-normal--8782-2500-2540-2540-m-52910-iso8859-1 -9nb00071.pmf -compugraphic-letter gothic-medium-r-normal--8782-2500-2540-2540-m-44090-iso8859-1 diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/lpr0ye1a.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/lpr0ye1a.pmf deleted file mode 100644 index 483748893..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/fonts/lpr0ye1a.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/model-config b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/model-config deleted file mode 100644 index 5d45d4495..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPDJ1600C/model-config +++ /dev/null @@ -1,40 +0,0 @@ -# $Xprint.org: HPDJ1600C model-config,v 1.4 2002/11/07 19:48:04 gisburn Exp $ -# This is the configuration file for the HP DeskJet 1600C printer. -# -# The CDEnext SI supports two 1600C drivers XP-PCL-MONO and -# XP-PCL-COLOR, which work with this configuration file. -# - -*content-orientations-supported: portrait landscape -*descriptor: Hewlett-Packard DeskJet 1600C -*document-formats-supported: {PCL 5} {PostScript 2} -*input-trays-supported: -# 1/4" unprintable margins -*medium-source-sizes-supported:\ -{ '' \ - {na-letter FALSE {6.35 209.55 6.35 273.05}}\ - {executive FALSE {6.35 177.75 6.35 260.35}}\ - {na-legal FALSE {6.35 209.55 6.35 349.25}}\ - {iso-a3 FALSE {6.35 290.65 6.35 413.35}}\ - {iso-a4 FALSE {6.35 203.65 6.35 290.65}}\ - {jis-b4 FALSE {6.35 251.65 6.35 367.65}}\ - {jis-b5 FALSE {6.35 175.65 6.35 250.65}}\ - {monarch-envelope FALSE {6.35 91.94 6.35 184.15}}\ - {iso-designated-long FALSE {6.35 103.65 6.35 213.65}}\ - {iso-c5 FALSE {6.35 155.65 6.35 222.65}}\ - {na-number-10-envelope FALSE {6.35 98.45 6.35 234.95}}\ - {hp-tabloid FALSE {6.35 273.05 6.35 425.45}}\ - {ledger FALSE {6.35 273.05 6.35 425.45}}\ - {b FALSE {6.35 273.05 6.35 425.45}}\ - {hp-japanese-postcard FALSE {6 94 6 142 }}\ - {hp-japanese-doublepostcard FALSE {6 142 6 194 }}\ -} -*plexes-supported: simplex duplex -*printer-model: "Hewlett-Packard DeskJet 1600C" -*printer-resolutions-supported: 300 -*xp-ddx-identifier: XP-PCL-COLOR -*xp-listfonts-modes-supported: xp-list-internal-printer-fonts xp-list-glyph-fonts -*xp-embedded-formats-supported: { PCL 5 } { PostScript 2 } -*xp-raw-formats-supported: { PCL 5 } -*xp-setup-proviso: setup-optional -# EOF. diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4050-PS/Imakefile b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4050-PS/Imakefile deleted file mode 100644 index b62236366..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4050-PS/Imakefile +++ /dev/null @@ -1,15 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.1 2003/12/16 00:42:52 gisburn Exp $ -#define IHaveSubdirs -#define PassCDebugFlags CDEBUGFLAGS="$(CDEBUGFLAGS)" - -SUBDIRS = fonts - -XPMODELNAME = HPLJ4050-PS - -MODELDIR = $(XPRINTDIR)/C/print/models/$(XPMODELNAME) - -InstallNonExecFile(model-config,$(MODELDIR)) - -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) - diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4050-PS/fonts/Imakefile b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4050-PS/fonts/Imakefile deleted file mode 100644 index 9c9c3c1ef..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4050-PS/fonts/Imakefile +++ /dev/null @@ -1,45 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.1 2003/12/16 00:42:52 gisburn Exp $ - -XPFONTS = \ - AvantGarde-Book.pmf \ - AvantGarde-BookOblique.pmf \ - AvantGarde-Demi.pmf \ - AvantGarde-DemiOblique.pmf \ - Courier-Bold.pmf \ - Courier-BoldOblique.pmf \ - Courier-Oblique.pmf \ - Courier.pmf \ - Helvetica-Bold.pmf \ - Helvetica-BoldOblique.pmf \ - Helvetica-Oblique.pmf \ - Helvetica.pmf \ - LubalinGraph-Book.pmf \ - LubalinGraph-BookOblique.pmf \ - LubalinGraph-Demi.pmf \ - LubalinGraph-DemiOblique.pmf \ - NewCenturySchlbk-Bold.pmf \ - NewCenturySchlbk-BoldItalic.pmf \ - NewCenturySchlbk-Italic.pmf \ - NewCenturySchlbk-Roman.pmf \ - Souvenir-Demi.pmf \ - Souvenir-DemiItalic.pmf \ - Souvenir-Light.pmf \ - Souvenir-LightItalic.pmf \ - Symbol.pmf \ - Times-Bold.pmf \ - Times-BoldItalic.pmf \ - Times-Italic.pmf \ - Times-Roman.pmf \ - ZapfDingbats.pmf - -XPMODELNAME = HPLJ4050-PS - -MODELDIR = $(XPRINTDIR)/C/print/models/$(XPMODELNAME) -MODELFONTDIR = $(MODELDIR)/fonts - -# We reuse some of the PSdefault fonts -PARENTMODELFONTDIR=../../PSdefault/fonts - -InstallXpMultiplePMFLinks($(XPFONTS),$(PARENTMODELFONTDIR),$(MODELFONTDIR)) -InstallXpPMFFontsDir($(MODELFONTDIR)) - diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4050-PS/model-config b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4050-PS/model-config deleted file mode 100644 index 159206de2..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4050-PS/model-config +++ /dev/null @@ -1,36 +0,0 @@ -# $Xprint.org: HPLJ4050-PS model-config,v 1.1 2003/12/16 00:48:04 gisburn Exp $ -# model-config for the HP LaserJet 4050 PostScript printer series -# -*content-orientations-supported: portrait landscape reverse-portrait reverse-landscape -*descriptor: Hewlett-Packard LaserJet 4050 PostScript printer -*document-formats-supported: {POSTSCRIPT 2} -*input-trays-supported: -*medium-source-sizes-supported: \ -{ '' \ - {na-letter FALSE {6.35 209.55 6.35 273.05}}\ - {na-legal FALSE {6.35 209.55 6.35 349.25}}\ - {executive FALSE {6.35 177.80 6.35 260.35}}\ - {iso-a4 FALSE {6.35 203.65 6.35 290.65}}\ - {iso-a5 FALSE {6.35 141.65 6.35 203.65}}\ - {iso-b5 FALSE {6.35 169.65 6.35 243.65}}\ - {jis-b5 FALSE {6.35 175.65 6.35 250.65}}\ -} - -# Duplex unit is optional for HPLJ4050 series -*plexes-supported: simplex -*printer-model: "Hewlett-Packard LaserJet 4050 PostScript printer" -*printer-resolutions-supported: 600 1200 -*xp-ddx-identifier: XP-POSTSCRIPT -*xp-listfonts-modes-supported: xp-list-internal-printer-fonts xp-list-glyph-fonts -*xp-embedded-formats-supported: {POSTSCRIPT 2} -*xp-raw-formats-supported: {POSTSCRIPT 2} -*xp-setup-proviso: setup-optional - -# NOTE: xp-psddx-* attributes are EXPERIMENTAL for now. -# xp-psddx-download-fonts defines which fonts should be downloaded as outlines -# (valid types are "pfa", "pfb", "ttf", "ttc", "otf", "otc") -*xp-psddx-download-fonts: pfa pfb ttf ttc otf otc -# xp-psddx-download-font-type defines which font type is used to download outlines -# (valid values are "bitmap", "pstype1" and "pstype3") -*xp-psddx-download-font-type: pstype1 -# EOF. diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/Imakefile b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/Imakefile deleted file mode 100644 index 28601153c..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/Imakefile +++ /dev/null @@ -1,14 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.1 2002/06/09 05:42:52 gisburn Exp $ -#define IHaveSubdirs -#define PassCDebugFlags CDEBUGFLAGS="$(CDEBUGFLAGS)" - -SUBDIRS = fonts - -XPMODELNAME = HPLJ4family - -MODELDIR = $(XPRINTDIR)/C/print/models/$(XPMODELNAME) - -InstallNonExecFile(model-config,$(MODELDIR)) - -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00051.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00051.pmf deleted file mode 100644 index 09cc489a5..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00051.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00052.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00052.pmf deleted file mode 100644 index b21a9a2a8..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00052.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00053.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00053.pmf deleted file mode 100644 index 485b874c5..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00053.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00054.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00054.pmf deleted file mode 100644 index 524934c71..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00054.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00055.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00055.pmf deleted file mode 100644 index 2ef9bc52c..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00055.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00056.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00056.pmf deleted file mode 100644 index 3d69311ef..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00056.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00057.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00057.pmf deleted file mode 100644 index 3833d4f54..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00057.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00058.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00058.pmf deleted file mode 100644 index 289a95e5c..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00058.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00059.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00059.pmf deleted file mode 100644 index a5984bed1..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00059.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00060.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00060.pmf deleted file mode 100644 index df27cd71e..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00060.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00061.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00061.pmf deleted file mode 100644 index fb2b5a433..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00061.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00062.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00062.pmf deleted file mode 100644 index f0e58c435..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00062.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00063.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00063.pmf deleted file mode 100644 index 8821ff155..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00063.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00064.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00064.pmf deleted file mode 100644 index e5980fc0e..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00064.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00065.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00065.pmf deleted file mode 100644 index d9a151d7f..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00065.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00066.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00066.pmf deleted file mode 100644 index d14fca56f..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00066.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00067.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00067.pmf deleted file mode 100644 index 7a341506f..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00067.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00068.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00068.pmf deleted file mode 100644 index c20e39a21..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00068.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00069.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00069.pmf deleted file mode 100644 index 4a4a35281..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00069.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00070.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00070.pmf deleted file mode 100644 index 8d97d4339..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00070.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00071.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00071.pmf deleted file mode 100644 index 19844c9c6..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00071.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00072.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00072.pmf deleted file mode 100644 index 5415c3f44..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00072.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00073.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00073.pmf deleted file mode 100644 index 038dfdb46..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00073.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00074.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00074.pmf deleted file mode 100644 index 382a78575..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00074.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00075.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00075.pmf deleted file mode 100644 index 1c7edf653..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00075.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00076.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00076.pmf deleted file mode 100644 index 2f077f40f..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00076.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00077.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00077.pmf deleted file mode 100644 index 1ce190d51..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00077.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00079.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00079.pmf deleted file mode 100644 index 45d6906ba..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00079.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00080.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00080.pmf deleted file mode 100644 index b991b5edb..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00080.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00081.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00081.pmf deleted file mode 100644 index 1935a9f00..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00081.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00082.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00082.pmf deleted file mode 100644 index 2000dc057..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00082.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00083.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00083.pmf deleted file mode 100644 index 90f0e45a8..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00083.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00084.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00084.pmf deleted file mode 100644 index 52ba39b96..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00084.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00085.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00085.pmf deleted file mode 100644 index f5c9053af..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00085.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00086.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00086.pmf deleted file mode 100644 index b7586ca61..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00086.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00087.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00087.pmf deleted file mode 100644 index 82f054999..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00087.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00088.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00088.pmf deleted file mode 100644 index 591c96b59..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00088.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00089.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00089.pmf deleted file mode 100644 index c8160954a..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00089.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00090.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00090.pmf deleted file mode 100644 index 895cfe26a..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00090.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00091.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00091.pmf deleted file mode 100644 index 3bdcae4ba..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00091.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00092.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00092.pmf deleted file mode 100644 index a56d47504..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00092.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00093.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00093.pmf deleted file mode 100644 index c85f3b4de..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00093.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00094.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00094.pmf deleted file mode 100644 index 875bf1df8..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/9nb00094.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/Imakefile b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/Imakefile deleted file mode 100644 index 868aa8a8c..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/Imakefile +++ /dev/null @@ -1,56 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.1 2002/06/09 05:42:52 gisburn Exp $ - -XPFONTS = \ - 9nb00051.pmf \ - 9nb00052.pmf \ - 9nb00053.pmf \ - 9nb00054.pmf \ - 9nb00055.pmf \ - 9nb00056.pmf \ - 9nb00057.pmf \ - 9nb00058.pmf \ - 9nb00059.pmf \ - 9nb00060.pmf \ - 9nb00061.pmf \ - 9nb00062.pmf \ - 9nb00063.pmf \ - 9nb00064.pmf \ - 9nb00065.pmf \ - 9nb00066.pmf \ - 9nb00067.pmf \ - 9nb00068.pmf \ - 9nb00069.pmf \ - 9nb00070.pmf \ - 9nb00071.pmf \ - 9nb00072.pmf \ - 9nb00073.pmf \ - 9nb00074.pmf \ - 9nb00075.pmf \ - 9nb00076.pmf \ - 9nb00077.pmf \ - 9nb00079.pmf \ - 9nb00080.pmf \ - 9nb00081.pmf \ - 9nb00082.pmf \ - 9nb00083.pmf \ - 9nb00084.pmf \ - 9nb00085.pmf \ - 9nb00086.pmf \ - 9nb00087.pmf \ - 9nb00088.pmf \ - 9nb00089.pmf \ - 9nb00090.pmf \ - 9nb00091.pmf \ - 9nb00092.pmf \ - 9nb00093.pmf \ - 9nb00094.pmf \ - fonts.alias \ - fonts.dir \ - lpr0ye1a.pmf \ - README - -XPMODELNAME = HPLJ4family - -MODELDIR = $(XPRINTDIR)/C/print/models/$(XPMODELNAME) -MODELFONTDIR = $(MODELDIR)/fonts -InstallMultipleDest(install,$(XPFONTS),$(MODELFONTDIR)) diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/README b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/README deleted file mode 100644 index 2c9821834..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/README +++ /dev/null @@ -1,203 +0,0 @@ -$Xorg: README,v 1.3 2000/08/17 19:48:04 cpqbld Exp $ - -This directory contains "printer metric files" for the X Print -Server suitable for the LaserJet 4 family of printers - 4, 4L, -4M, 4ML, 4MP, 4P, 4Si, 4Si-MX. The following *.pmf files were -generated by the Hewlett-Packard Company. - - 9nb00051.pmf - 9nb00052.pmf - 9nb00053.pmf - 9nb00054.pmf - 9nb00055.pmf - * 9nb00056.pmf - * 9nb00057.pmf - * 9nb00058.pmf - * 9nb00059.pmf - * 9nb00060.pmf - 9nb00061.pmf - 9nb00062.pmf - 9nb00063.pmf - 9nb00064.pmf - * 9nb00065.pmf - * 9nb00066.pmf - * 9nb00067.pmf - * 9nb00068.pmf - 9nb00069.pmf - 9nb00070.pmf - 9nb00071.pmf - * 9nb00072.pmf - * 9nb00073.pmf - * 9nb00074.pmf - * 9nb00075.pmf - * 9nb00076.pmf - 9nb00077.pmf - * 9nb00079.pmf - * 9nb00080.pmf - * 9nb00081.pmf - * 9nb00082.pmf - 9nb00083.pmf - 9nb00084.pmf - 9nb00085.pmf - 9nb00086.pmf - 9nb00087.pmf - 9nb00088.pmf - 9nb00089.pmf - 9nb00090.pmf - 9nb00091.pmf - 9nb00092.pmf - 9nb00093.pmf - 9nb00094.pmf - lpr0ye1a.pmf - - - * note - the marked fonts are NOT supported by the 4L printer. If - making extensive use of the 4L, you may want to create a special - 4L model-config area and exclude these fonts. - -For reasons of not supporting iso8859.1 and hp-roman8, the following -Laserjet 4 printer fonts were not converted to *.pmf files. - - 9nb00078.pmf - 9nb00095.pmf - lpr0ylga.pmf - lpr0ypca.pmf - lpr0ypda.pmf - lpr0ypma.pmf - lpr0yr8a.pmf - -Output from the conversion utility is as follows: - - Creating iso8859 1 pmf for 9nb00051.tfm as iso8859.1/9nb00051.pmf - -COMPUGRAPHIC-Albertus-Extra Bold-r-Normal--8782-2500-2540-2540-P-42480-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00052.tfm as iso8859.1/9nb00052.pmf - -COMPUGRAPHIC-Albertus-Semi Bold-r-Normal--8782-2500-2540-2540-P-37640-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00053.tfm as iso8859.1/9nb00053.pmf - -COMPUGRAPHIC-Antique Olive-Bold-r-Normal--8782-2500-2540-2540-P-50490-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00054.tfm as iso8859.1/9nb00054.pmf - -COMPUGRAPHIC-Antique Olive-Medium-i-Normal--8782-2500-2540-2540-P-46140-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00055.tfm as iso8859.1/9nb00055.pmf - -COMPUGRAPHIC-Antique Olive-Medium-r-Normal--8782-2500-2540-2540-P-46380-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00056.tfm as iso8859.1/9nb00056.pmf - -Monotype-Arial-Bold-r-Normal--2048-2500-589-589-P-9800-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00057.tfm as iso8859.1/9nb00057.pmf - -Monotype-Arial-Medium-i-Normal--2048-2500-589-589-P-9040-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00058.tfm as iso8859.1/9nb00058.pmf - -Monotype-Arial-Bold-i-Normal--2048-2500-589-589-P-9800-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00059.tfm as iso8859.1/9nb00059.pmf - -Monotype-Arial-Medium-r-Normal--2048-2500-589-589-P-9040-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00060.tfm as iso8859.1/9nb00060.pmf - -COMPUGRAPHIC-Clarendon-Bold-r-Condensed--8782-2500-2540-2540-P-35080-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00061.tfm as iso8859.1/9nb00061.pmf - -COMPUGRAPHIC-Courier-Bold-r-Normal--8782-2500-2540-2540-M-52910-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00062.tfm as iso8859.1/9nb00062.pmf - -COMPUGRAPHIC-Courier-Medium-i-Normal--8782-2500-2540-2540-M-52910-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00063.tfm as iso8859.1/9nb00063.pmf - -COMPUGRAPHIC-Courier-Bold-i-Normal--8782-2500-2540-2540-M-52910-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00064.tfm as iso8859.1/9nb00064.pmf - -COMPUGRAPHIC-Courier-Medium-r-Normal--8782-2500-2540-2540-M-52910-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00065.tfm as iso8859.1/9nb00065.pmf - -COMPUGRAPHIC-Garamond-Bold-r-Normal--8782-2500-2540-2540-P-38730-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00066.tfm as iso8859.1/9nb00066.pmf - -COMPUGRAPHIC-Garamond-Medium-i-Normal--8782-2500-2540-2540-P-34280-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00067.tfm as iso8859.1/9nb00067.pmf - -COMPUGRAPHIC-Garamond-Bold-i-Normal--8782-2500-2540-2540-P-37020-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00068.tfm as iso8859.1/9nb00068.pmf - -COMPUGRAPHIC-Garamond-Medium-r-Normal--8782-2500-2540-2540-P-36560-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00069.tfm as iso8859.1/9nb00069.pmf - -COMPUGRAPHIC-Letter Gothic-Bold-r-Normal--8782-2500-2540-2540-M-44090-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00070.tfm as iso8859.1/9nb00070.pmf - -COMPUGRAPHIC-Letter Gothic-Medium-i-Normal--8782-2500-2540-2540-M-44090-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00071.tfm as iso8859.1/9nb00071.pmf - -COMPUGRAPHIC-Letter Gothic-Medium-r-Normal--8782-2500-2540-2540-M-44090-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00072.tfm as iso8859.1/9nb00072.pmf - -COMPUGRAPHIC-Marigold-Medium-r-Normal--8782-2500-2540-2540-P-21890-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00073.tfm as iso8859.1/9nb00073.pmf - -COMPUGRAPHIC-Omega-Bold-r-Normal--8782-2500-2540-2540-P-38600-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00074.tfm as iso8859.1/9nb00074.pmf - -COMPUGRAPHIC-Omega-Medium-i-Normal--8782-2500-2540-2540-P-37980-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00075.tfm as iso8859.1/9nb00075.pmf - -COMPUGRAPHIC-Omega-Bold-i-Normal--8782-2500-2540-2540-P-38560-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00076.tfm as iso8859.1/9nb00076.pmf - -COMPUGRAPHIC-Omega-Medium-r-Normal--8782-2500-2540-2540-P-37770-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00077.tfm as iso8859.1/9nb00077.pmf - -COMPUGRAPHIC-Coronet-Medium-i-Normal--8782-2500-2540-2540-P-22870-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00079.tfm as iso8859.1/9nb00079.pmf - -Monotype-Times New Roman-Bold-r-Normal--2048-2500-589-589-P-8740-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00080.tfm as iso8859.1/9nb00080.pmf - -Monotype-Times New Roman-Medium-i-Normal--2048-2500-589-589-P-8230-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00081.tfm as iso8859.1/9nb00081.pmf - -Monotype-Times New Roman-Bold-i-Normal--2048-2500-589-589-P-8440-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00082.tfm as iso8859.1/9nb00082.pmf - -Monotype-Times New Roman-Medium-r-Normal--2048-2500-589-589-P-8210-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00083.tfm as iso8859.1/9nb00083.pmf - -COMPUGRAPHIC-Times-Bold-r-Normal--8782-2500-2540-2540-P-38200-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00084.tfm as iso8859.1/9nb00084.pmf - -COMPUGRAPHIC-Times-Medium-i-Normal--8782-2500-2540-2540-P-36000-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00085.tfm as iso8859.1/9nb00085.pmf - -COMPUGRAPHIC-Times-Bold-i-Normal--8782-2500-2540-2540-P-36900-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00086.tfm as iso8859.1/9nb00086.pmf - -COMPUGRAPHIC-Times-Medium-r-Normal--8782-2500-2540-2540-P-36080-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00087.tfm as iso8859.1/9nb00087.pmf - -COMPUGRAPHIC-Univers-Medium-i-Condensed--8782-2500-2540-2540-P-29970-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00088.tfm as iso8859.1/9nb00088.pmf - -COMPUGRAPHIC-Univers-Bold-r-Normal--8782-2500-2540-2540-P-41280-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00089.tfm as iso8859.1/9nb00089.pmf - -COMPUGRAPHIC-Univers-Medium-r-Condensed--8782-2500-2540-2540-P-29970-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00090.tfm as iso8859.1/9nb00090.pmf - -COMPUGRAPHIC-Univers-Bold-r-Condensed--8782-2500-2540-2540-P-33030-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00091.tfm as iso8859.1/9nb00091.pmf - -COMPUGRAPHIC-Univers-Bold-i-Condensed--8782-2500-2540-2540-P-33030-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00092.tfm as iso8859.1/9nb00092.pmf - -COMPUGRAPHIC-Univers-Medium-i-Normal--8782-2500-2540-2540-P-41280-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00093.tfm as iso8859.1/9nb00093.pmf - -COMPUGRAPHIC-Univers-Bold-i-Normal--8782-2500-2540-2540-P-41280-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for 9nb00094.tfm as iso8859.1/9nb00094.pmf - -COMPUGRAPHIC-Univers-Medium-r-Normal--8782-2500-2540-2540-P-41280-iso8859-1 - ------------------------------------ - Creating iso8859 1 pmf for lpr0ye1a.tfm as iso8859.1/lpr0ye1a.pmf - -HP-Line Printer-Medium-r-Normal--35-85-300-300-M-180-iso8859-1 - ------------------------------------ - diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/fonts.alias b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/fonts.alias deleted file mode 100644 index e69de29bb..000000000 diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/fonts.dir b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/fonts.dir deleted file mode 100644 index da702ccc1..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/fonts.dir +++ /dev/null @@ -1,45 +0,0 @@ -44 -lpr0ye1a.pmf -hp-line printer-medium-r-normal--35-85-300-300-m-180-iso8859-1 -9nb00080.pmf -monotype-times new roman-medium-i-normal--2048-2500-589-589-p-8230-iso8859-1 -9nb00092.pmf -compugraphic-univers-medium-i-normal--8782-2500-2540-2540-p-41280-iso8859-1 -9nb00081.pmf -monotype-times new roman-bold-i-normal--2048-2500-589-589-p-8440-iso8859-1 -9nb00093.pmf -compugraphic-univers-bold-i-normal--8782-2500-2540-2540-p-41280-iso8859-1 -9nb00082.pmf -monotype-times new roman-medium-r-normal--2048-2500-589-589-p-8210-iso8859-1 -9nb00090.pmf -compugraphic-univers-bold-r-condensed--8782-2500-2540-2540-p-33030-iso8859-1 -9nb00083.pmf -compugraphic-times-bold-r-normal--8782-2500-2540-2540-p-38200-iso8859-1 -9nb00091.pmf -compugraphic-univers-bold-i-condensed--8782-2500-2540-2540-p-33030-iso8859-1 -9nb00084.pmf -compugraphic-times-medium-i-normal--8782-2500-2540-2540-p-36000-iso8859-1 -9nb00085.pmf -compugraphic-times-bold-i-normal--8782-2500-2540-2540-p-36900-iso8859-1 -9nb00086.pmf -compugraphic-times-medium-r-normal--8782-2500-2540-2540-p-36080-iso8859-1 -9nb00094.pmf -compugraphic-univers-medium-r-normal--8782-2500-2540-2540-p-41280-iso8859-1 -9nb00087.pmf -compugraphic-univers-medium-i-condensed--8782-2500-2540-2540-p-29970-iso8859-1 -9nb00088.pmf -compugraphic-univers-bold-r-normal--8782-2500-2540-2540-p-41280-iso8859-1 -9nb00089.pmf -compugraphic-univers-medium-r-condensed--8782-2500-2540-2540-p-29970-iso8859-1 -9nb00058.pmf -monotype-arial-bold-i-normal--2048-2500-589-589-p-9800-iso8859-1 -9nb00059.pmf -monotype-arial-medium-r-normal--2048-2500-589-589-p-9040-iso8859-1 -9nb00068.pmf -compugraphic-garamond-medium-r-normal--8782-2500-2540-2540-p-36560-iso8859-1 -9nb00069.pmf -compugraphic-letter gothic-bold-r-normal--8782-2500-2540-2540-m-44090-iso8859-1 -9nb00079.pmf -monotype-times new roman-bold-r-normal--2048-2500-589-589-p-8740-iso8859-1 -9nb00052.pmf -compugraphic-albertus-semi bold-r-normal--8782-2500-2540-2540-p-37640-iso8859-1 -9nb00064.pmf -compugraphic-courier-medium-r-normal--8782-2500-2540-2540-m-52910-iso8859-1 -9nb00076.pmf -compugraphic-omega-medium-r-normal--8782-2500-2540-2540-p-37770-iso8859-1 -9nb00053.pmf -compugraphic-antique olive-bold-r-normal--8782-2500-2540-2540-p-50490-iso8859-1 -9nb00065.pmf -compugraphic-garamond-bold-r-normal--8782-2500-2540-2540-p-38730-iso8859-1 -9nb00077.pmf -compugraphic-coronet-medium-i-normal--8782-2500-2540-2540-p-22870-iso8859-1 -9nb00066.pmf -compugraphic-garamond-medium-i-normal--8782-2500-2540-2540-p-34280-iso8859-1 -9nb00074.pmf -compugraphic-omega-medium-i-normal--8782-2500-2540-2540-p-37980-iso8859-1 -9nb00051.pmf -compugraphic-albertus-extra bold-r-normal--8782-2500-2540-2540-p-42480-iso8859-1 -9nb00067.pmf -compugraphic-garamond-bold-i-normal--8782-2500-2540-2540-p-37020-iso8859-1 -9nb00075.pmf -compugraphic-omega-bold-i-normal--8782-2500-2540-2540-p-38560-iso8859-1 -9nb00056.pmf -monotype-arial-bold-r-normal--2048-2500-589-589-p-9800-iso8859-1 -9nb00060.pmf -compugraphic-clarendon-bold-r-condensed--8782-2500-2540-2540-p-35080-iso8859-1 -9nb00072.pmf -compugraphic-marigold-medium-r-normal--8782-2500-2540-2540-p-21890-iso8859-1 -9nb00057.pmf -monotype-arial-medium-i-normal--2048-2500-589-589-p-9040-iso8859-1 -9nb00061.pmf -compugraphic-courier-bold-r-normal--8782-2500-2540-2540-m-52910-iso8859-1 -9nb00073.pmf -compugraphic-omega-bold-r-normal--8782-2500-2540-2540-p-38600-iso8859-1 -9nb00054.pmf -compugraphic-antique olive-medium-i-normal--8782-2500-2540-2540-p-46140-iso8859-1 -9nb00062.pmf -compugraphic-courier-medium-i-normal--8782-2500-2540-2540-m-52910-iso8859-1 -9nb00070.pmf -compugraphic-letter gothic-medium-i-normal--8782-2500-2540-2540-m-44090-iso8859-1 -9nb00055.pmf -compugraphic-antique olive-medium-r-normal--8782-2500-2540-2540-p-46380-iso8859-1 -9nb00063.pmf -compugraphic-courier-bold-i-normal--8782-2500-2540-2540-m-52910-iso8859-1 -9nb00071.pmf -compugraphic-letter gothic-medium-r-normal--8782-2500-2540-2540-m-44090-iso8859-1 diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/lpr0ye1a.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/lpr0ye1a.pmf deleted file mode 100644 index 483748893..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/fonts/lpr0ye1a.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/model-config b/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/model-config deleted file mode 100644 index 1ac997ebe..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/models/HPLJ4family/model-config +++ /dev/null @@ -1,39 +0,0 @@ -# $Xprint.org: HPLJ4family model-config,v 1.4 2002/11/07 19:48:04 gisburn Exp $ -# This is the configuration file for the HP LaserJet 4 Printers. -# -# Though not a deliverable for the CDEnext SI, the XP-PCL-MONO -# driver should be able to support the LaserJet 4 printers. -# -*content-orientations-supported: portrait landscape -*descriptor: Hewlett-Packard LaserJet 4 Series -*document-formats-supported: {PCL 5} {PostScript 2} -*input-trays-supported: -# 1/4" unprintable margins -*medium-source-sizes-supported:\ -{ '' \ - {na-letter FALSE {6.35 209.55 6.35 273.05}}\ - {executive FALSE {6.35 177.75 6.35 260.35}}\ - {na-legal FALSE {6.35 209.55 6.35 349.25}}\ - {iso-a3 FALSE {6.35 290.65 6.35 413.35}}\ - {iso-a4 FALSE {6.35 203.65 6.35 290.65}}\ - {jis-b4 FALSE {6.35 251.65 6.35 367.65}}\ - {jis-b5 FALSE {6.35 175.65 6.35 250.65}}\ - {monarch-envelope FALSE {6.35 91.94 6.35 184.15}}\ - {iso-designated-long FALSE {6.35 103.65 6.35 213.65}}\ - {iso-c5 FALSE {6.35 155.65 6.35 222.65}}\ - {na-number-10-envelope FALSE {6.35 98.45 6.35 234.95}}\ - {hp-tabloid FALSE {6.35 273.05 6.35 425.45}}\ - {ledger FALSE {6.35 273.05 6.35 425.45}}\ - {b FALSE {6.35 273.05 6.35 425.45}}\ - {hp-japanese-postcard FALSE {6 94 6 142 }}\ - {hp-japanese-doublepostcard FALSE {6 142 6 194 }}\ -} -*plexes-supported: simplex duplex -*printer-model: "Hewlett-Packard LaserJet 4 Series" -*printer-resolutions-supported: 300 600 -*xp-ddx-identifier: XP-PCL-MONO -*xp-listfonts-modes-supported: xp-list-internal-printer-fonts xp-list-glyph-fonts -*xp-embedded-formats-supported: { PCL 5 } { PostScript 2 } -*xp-raw-formats-supported: { PCL 5 } -*xp-setup-proviso: setup-optional -# EOF. diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/Imakefile b/nx-X11/programs/Xserver/XpConfig/C/print/models/Imakefile deleted file mode 100644 index c8c54cef4..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/models/Imakefile +++ /dev/null @@ -1,45 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.1 2002/06/09 05:42:52 gisburn Exp $ -#define IHaveSubdirs -#define PassCDebugFlags CDEBUGFLAGS="$(CDEBUGFLAGS)" - -#if XpPostScriptDDX -PS_MODELDIRS = \ - PSdefault \ - SPSPARC2 \ - HPLJ4050-PS \ - CANONC3200-PS \ - PSspooldir - -#if HasGhostScript -XCOMM Models for printers which need GhostScript for post-processing -GS_MODELDIRS = \ - GSdefault \ - CANONBJ10E-GS \ - PS2PDFspooldir-GS -#endif /* HasGhostScript */ -#endif /* XpPostScriptDDX */ - -#if XpColorPclDDX -PCL_COLOR_MODELDIRS = \ - HPDJ1600C -#endif - -#if XpMonoPclDDX -PCL_MONO_MODELDIRS = \ - HPLJ4family -#endif - -#if XpRasterDDX -RASTER_MODELDIRS = -#endif - -SUBDIRS = \ - $(PS_MODELDIRS) \ - $(GS_MODELDIRS) \ - $(PCL_COLOR_MODELDIRS) \ - $(PCL_MONO_MODELDIRS) \ - $(RASTER_MODELDIRS) - - -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/PS2PDFspooldir-GS/Imakefile b/nx-X11/programs/Xserver/XpConfig/C/print/models/PS2PDFspooldir-GS/Imakefile deleted file mode 100644 index 14f9ee59f..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/models/PS2PDFspooldir-GS/Imakefile +++ /dev/null @@ -1,35 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.1 2003/11/20 03:42:52 gisburn Exp $ - -XPMODELNAME = PS2PDFspooldir-GS - -MODELDIR = $(XPRINTDIR)/C/print/models/$(XPMODELNAME) - -#if BuildGISWxprintglue || BuildGISWxprint -XCOMM Hack for Solaris's native /usr/openwin/bin/Xprt which does not -XCOMM understand the new %xpconfigdir% modelconfig variable -XCOMM (this is only used for the GISWxprintglue package build; -XCOMM the GISWxprint does not need it but using it avoids confusion -XCOMM if someone uses GISWxprint to run both Solaris native Xprt and -XCOMM our own binary side-by-side using the same config) -all:: model-config.SolarisXprt - -model-config.SolarisXprt: model-config - nawk model-config.SolarisXprt - -clean:: - $(RM) model-config.SolarisXprt - -InstallNamedNonExec(model-config.SolarisXprt,model-config,$(MODELDIR)) -#else -InstallNonExecFile(model-config,$(MODELDIR)) -#endif /* BuildGISWxprintglue || BuildGISWxprint */ - -InstallNamedProg(ps2pdf_spooltodir.sh,ps2pdf_spooltodir.sh,$(MODELDIR)) - -# All printer models which use GhostScript for filtering should use the -# printer-builtin fonts from the "GSdefault" printer model -# (unless they employ more or other builtin fonts) -install:: - $(RM) $(DESTDIR)$(MODELDIR)/fonts - $(LN) ../GSdefault/fonts $(DESTDIR)$(MODELDIR) - diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/PS2PDFspooldir-GS/model-config b/nx-X11/programs/Xserver/XpConfig/C/print/models/PS2PDFspooldir-GS/model-config deleted file mode 100644 index 1d74b8676..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/models/PS2PDFspooldir-GS/model-config +++ /dev/null @@ -1,72 +0,0 @@ -# $Xprint.org: PS2PDFspooldir-GS model-config,v 1.1 2003/11/20 03:48:04 gisburn Exp $ -# PostScript DDX model-config which converts jobs to PDF via GhostScript's "ps2pdf" -# and then sends them to a spool dir instead to a print queue -# -# This model is basically a cut-down GSdefault model with a custom *xp-spooler-command -# -# DO NOT MODIFY THIS FILE!! -# -# If you want to make customisations for your printer create a copy -# of this printer model. -# Example (for creating a model config "MYCOMPANYlaserxx"): -# 1. Create model config dir: -# % mkdir MYCOMPANYlaserxx -# 2. Link (or copy) the PMF (printer font metrics) for the -# printer buildin fonts: -# % ln -s PS2PDFspooldir-GS/fonts MYCOMPANYlaserxx/. -# 3. Copy the model config file: -# % cp PS2PDFspooldir-GS/model-config MYCOMPANYlaserxx/. -# 4. Customize MYCOMPANYlaserxx/model-config to match your needs. -# -# Attributes supported for this printer model -*content-orientations-supported: portrait landscape reverse-portrait reverse-landscape -*descriptor: PDF job spool dir /tmp/Xprintjobs -*document-formats-supported: {POSTSCRIPT 2} -*input-trays-supported: -*medium-source-sizes-supported: \ -{ '' \ - {na-letter FALSE {6.35 209.55 6.35 273.05}}\ - {na-legal FALSE {6.35 209.55 6.35 349.25}}\ - {executive FALSE {6.35 177.80 6.35 260.35}}\ - {ledger FALSE {6.35 273.05 6.35 425.45}}\ - {quarto FALSE {6.35 209.55 6.35 268.732}}\ - {iso-a3 FALSE {6.35 290.65 6.35 413.65}}\ - {iso-a4 FALSE {6.35 203.65 6.35 290.65}}\ - {iso-a5 FALSE {6.35 141.65 6.35 203.65}}\ - {iso-b3 FALSE {6.35 346.65 6.35 493.65}}\ - {iso-b4 FALSE {6.35 243.65 6.35 346.65}}\ - {iso-b5 FALSE {6.35 169.65 6.35 243.65}}\ - {jis-b3 FALSE {6.35 357.65 6.35 508.65}}\ - {jis-b4 FALSE {6.35 250.65 6.35 357.65}}\ - {jis-b5 FALSE {6.35 175.65 6.35 250.65}}\ - {iso-c3 FALSE {6.35 317.65 6.35 451.65}}\ - {iso-c4 FALSE {6.35 222.65 6.35 317.65}}\ - {iso-c5 FALSE {6.35 155.65 6.35 222.65}}\ -} - -*plexes-supported: simplex duplex tumble -*printer-model: "PDF job spool dir /tmp/Xprintjobs" -# 75, 100, 120, 150, 180, 200, 240, 300, 360, 400, 600, 720, -# 940, 1200 and 2440 are supported DPI values, we limit it here -# to some common values: -*printer-resolutions-supported: 300 360 400 600 -*xp-ddx-identifier: XP-POSTSCRIPT -*xp-listfonts-modes-supported: xp-list-internal-printer-fonts xp-list-glyph-fonts -*xp-embedded-formats-supported: {POSTSCRIPT 2} -*xp-raw-formats-supported: {POSTSCRIPT 2} -*xp-setup-proviso: setup-optional - -# Use custom spooler script which sends the output to a dir instead to a printer queue -# Note that "%xpconfigdir%" is currently only supported in Xprt servers build -# from xprint.mozdev.org sources, other platforms have replace it with the -# absolute path name to the script -*xp-spooler-command: %xpconfigdir%/C/print/models/PS2PDFspooldir-GS/ps2pdf_spooltodir.sh -d /tmp/Xprintjobs -s .pdf -u 077 -p %printer-name% -c %copy-count% -t %job-name% -o "%options%" - -# NOTE: xp-psddx-* attributes are EXPERIMENTAL for now. -# xp-psddx-download-fonts defines which fonts should be downloaded as outlines -# (valid types are "pfa", "pfb", "ttf", "ttc", "otf", "otc") -*xp-psddx-download-fonts: pfa pfb ttf ttc otf otc -# xp-psddx-download-font-type defines which font type is used to download outlines -# (valid values are "bitmap", "pstype1" and "pstype3") -*xp-psddx-download-font-type: pstype1 -# EOF. diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/PS2PDFspooldir-GS/ps2pdf_spooltodir.sh b/nx-X11/programs/Xserver/XpConfig/C/print/models/PS2PDFspooldir-GS/ps2pdf_spooltodir.sh deleted file mode 100755 index 5739807d8..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/models/PS2PDFspooldir-GS/ps2pdf_spooltodir.sh +++ /dev/null @@ -1,130 +0,0 @@ -#!/bin/sh -PATH=/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/bin -export PATH - -verbose_msgs="false" -DEFAULT_SPOOLDIR=/tmp/Xprintjobs - -usage() -{ - printf "Usage: ${0}: [options]\n" - printf "-v\tbe verbose\n" - printf "-d dirname\tdefine spool dir\n" - printf "-p string\tname of printer selected by user\n" - printf "-c integer\tnumber of copies\n" - printf "-t string\tjob title\n" - printf "-s string\tfile name suffix\n" - printf "-o string\tspooler options\n" - printf "-u mask\tpermission mask for new files (see umask)\n" - exit 2 -} - -verbose() -{ - if ${verbose_msgs} ; then - echo "$1" - fi -} - -spooldir="${DEFAULT_SPOOLDIR}" -printername= -num_job_copies= -job_title= -filename_suffix= -spooler_options= -permmask= -while getopts va:b:d:p:c:t:s:o:u: i -do - case $i in - v) - verbose_msgs="true" - ;; - d) - spooldir="$OPTARG" - ;; - p) - printername="$OPTARG" - ;; - c) - num_job_copies="$OPTARG" - ;; - t) - job_title="$OPTARG" - ;; - s) - filename_suffix="$OPTARG" - ;; - o) - spooler_options="$OPTARG" - ;; - u) - permmask="$OPTARG" - ;; - ?) usage - ;; - esac -done - -verbose "# spooldir=\"$spooldir\"" -verbose "# printername=\"$printername\"" -verbose "# num_job_copies=\"$num_job_copies\"" -verbose "# job_title=\"$job_title\"" -verbose "# spooler_options=\"$spooler_options\"" -verbose "# umask=\"$permmask\"" - -if [ ! -d "${DEFAULT_SPOOLDIR}" ] ; then - mkdir "${DEFAULT_SPOOLDIR}" - chmod a+rwxt "${DEFAULT_SPOOLDIR}" -fi - -if [ "${permmask}" != "" ] ; then - umask ${permmask} -fi - -if [ ! -d "$spooldir" ] ; then - echo "$0: spooldir \"$spooldir\" does not exits." >&2 - exit 1 -fi -if [ ! -w "$spooldir" ] ; then - echo "$0: Cannot write to spooldir \"$spooldir\"." >&2 - exit 1 -fi - -# Create first part of the output file name (prefix and an "unique" -# id(=date and time))... -filename="Xpjob_`date +%Y%m%d%H%M%S`" - -# ... then add options ... -if [ "${printername}" != "" ] ; then - filename="${filename}_${printername}" -fi -if [ "${num_job_copies}" != "" -a "${num_job_copies}" != "1" ] ; then - filename="${filename}_copies_${num_job_copies}" -fi -if [ "${job_title}" != "" ] ; then - filename="${filename}_title_${job_title}" -fi - -# ... mangle output file name and filter chars (like whitespaces) -# which may screw-up further processing by other shell scripts ... -filename="`echo \"${filename}\" | tr '[:blank:]' '_' | tr -c -d '[:alnum:]_.-'`" - -# ... add path and suffix ... -filename="${spooldir}/${filename}${filename_suffix}" - -verbose "# File name is \"$filename\"." - -# ... and finally capture stdin to the file (we are using "gs" directly to -# avoid the problem that "ps2pdf" is not available in all Linux -# distributions by default). -#ps2pdf - - | cat >"${filename}" -gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite "-sOutputFile=-" -dCompatibilityLevel=1.2 -c .setpdfwrite -f - | cat >"${filename}" - -if ${verbose_msgs} ; then - printf "# File is " ; ls -l "${filename}" -fi - -verbose "# Done." - -exit 0 -# EOF. diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/Imakefile b/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/Imakefile deleted file mode 100644 index c2442f32d..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/Imakefile +++ /dev/null @@ -1,14 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.1 2002/06/09 05:42:52 gisburn Exp $ -#define IHaveSubdirs -#define PassCDebugFlags CDEBUGFLAGS="$(CDEBUGFLAGS)" - -SUBDIRS = fonts - -XPMODELNAME = PSdefault - -MODELDIR = $(XPRINTDIR)/C/print/models/$(XPMODELNAME) - -InstallNonExecFile(model-config,$(MODELDIR)) - -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/AvantGarde-Book.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/AvantGarde-Book.pmf deleted file mode 100644 index 331178985..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/AvantGarde-Book.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/AvantGarde-BookOblique.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/AvantGarde-BookOblique.pmf deleted file mode 100644 index 61bcb22b9..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/AvantGarde-BookOblique.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/AvantGarde-Demi.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/AvantGarde-Demi.pmf deleted file mode 100644 index 88ccf0834..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/AvantGarde-Demi.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/AvantGarde-DemiOblique.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/AvantGarde-DemiOblique.pmf deleted file mode 100644 index 45cc8857b..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/AvantGarde-DemiOblique.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Courier-Bold.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Courier-Bold.pmf deleted file mode 100644 index ac760fdb9..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Courier-Bold.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Courier-BoldOblique.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Courier-BoldOblique.pmf deleted file mode 100644 index 8db974018..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Courier-BoldOblique.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Courier-Oblique.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Courier-Oblique.pmf deleted file mode 100644 index 87aee16cc..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Courier-Oblique.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Courier.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Courier.pmf deleted file mode 100644 index 6109c8c11..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Courier.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Helvetica-Bold.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Helvetica-Bold.pmf deleted file mode 100644 index 30d462d95..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Helvetica-Bold.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Helvetica-BoldOblique.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Helvetica-BoldOblique.pmf deleted file mode 100644 index 89619516f..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Helvetica-BoldOblique.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Helvetica-Oblique.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Helvetica-Oblique.pmf deleted file mode 100644 index 2a0de8afc..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Helvetica-Oblique.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Helvetica.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Helvetica.pmf deleted file mode 100644 index b1fd475bb..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Helvetica.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Imakefile b/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Imakefile deleted file mode 100644 index 9a51ed099..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Imakefile +++ /dev/null @@ -1,41 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.1 2002/06/09 05:42:52 gisburn Exp $ - -XPFONTS = \ - AvantGarde-Book.pmf \ - AvantGarde-BookOblique.pmf \ - AvantGarde-Demi.pmf \ - AvantGarde-DemiOblique.pmf \ - Courier-Bold.pmf \ - Courier-BoldOblique.pmf \ - Courier-Oblique.pmf \ - Courier.pmf \ - Helvetica-Bold.pmf \ - Helvetica-BoldOblique.pmf \ - Helvetica-Oblique.pmf \ - Helvetica.pmf \ - LubalinGraph-Book.pmf \ - LubalinGraph-BookOblique.pmf \ - LubalinGraph-Demi.pmf \ - LubalinGraph-DemiOblique.pmf \ - NewCenturySchlbk-Bold.pmf \ - NewCenturySchlbk-BoldItalic.pmf \ - NewCenturySchlbk-Italic.pmf \ - NewCenturySchlbk-Roman.pmf \ - Souvenir-Demi.pmf \ - Souvenir-DemiItalic.pmf \ - Souvenir-Light.pmf \ - Souvenir-LightItalic.pmf \ - Symbol.pmf \ - Times-Bold.pmf \ - Times-BoldItalic.pmf \ - Times-Italic.pmf \ - Times-Roman.pmf \ - ZapfDingbats.pmf - -XPMODELNAME = PSdefault - -MODELDIR = $(XPRINTDIR)/C/print/models/$(XPMODELNAME) -MODELFONTDIR = $(MODELDIR)/fonts -InstallMultipleDest(install,$(XPFONTS),$(MODELFONTDIR)) -InstallXpPMFFontsDir($(MODELFONTDIR)) - diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/LubalinGraph-Book.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/LubalinGraph-Book.pmf deleted file mode 100644 index aff4b4949..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/LubalinGraph-Book.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/LubalinGraph-BookOblique.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/LubalinGraph-BookOblique.pmf deleted file mode 100644 index b5b77f353..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/LubalinGraph-BookOblique.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/LubalinGraph-Demi.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/LubalinGraph-Demi.pmf deleted file mode 100644 index 100339854..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/LubalinGraph-Demi.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/LubalinGraph-DemiOblique.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/LubalinGraph-DemiOblique.pmf deleted file mode 100644 index a8550e70d..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/LubalinGraph-DemiOblique.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/NewCenturySchlbk-Bold.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/NewCenturySchlbk-Bold.pmf deleted file mode 100644 index ab22aabf5..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/NewCenturySchlbk-Bold.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/NewCenturySchlbk-BoldItalic.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/NewCenturySchlbk-BoldItalic.pmf deleted file mode 100644 index e68811eb7..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/NewCenturySchlbk-BoldItalic.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/NewCenturySchlbk-Italic.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/NewCenturySchlbk-Italic.pmf deleted file mode 100644 index 390f223cb..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/NewCenturySchlbk-Italic.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/NewCenturySchlbk-Roman.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/NewCenturySchlbk-Roman.pmf deleted file mode 100644 index 655b9b6c0..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/NewCenturySchlbk-Roman.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Souvenir-Demi.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Souvenir-Demi.pmf deleted file mode 100644 index 5e786ec42..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Souvenir-Demi.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Souvenir-DemiItalic.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Souvenir-DemiItalic.pmf deleted file mode 100644 index 094b348cc..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Souvenir-DemiItalic.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Souvenir-Light.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Souvenir-Light.pmf deleted file mode 100644 index 0bb62bde6..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Souvenir-Light.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Souvenir-LightItalic.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Souvenir-LightItalic.pmf deleted file mode 100644 index 3c19a7fbf..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Souvenir-LightItalic.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Symbol.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Symbol.pmf deleted file mode 100644 index 48925f816..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Symbol.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Times-Bold.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Times-Bold.pmf deleted file mode 100644 index cf46ca03f..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Times-Bold.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Times-BoldItalic.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Times-BoldItalic.pmf deleted file mode 100644 index ffe51af80..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Times-BoldItalic.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Times-Italic.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Times-Italic.pmf deleted file mode 100644 index 865433f83..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Times-Italic.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Times-Roman.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Times-Roman.pmf deleted file mode 100644 index 625e0c43f..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/Times-Roman.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/ZapfDingbats.pmf b/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/ZapfDingbats.pmf deleted file mode 100644 index 1ae9a7688..000000000 Binary files a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/fonts/ZapfDingbats.pmf and /dev/null differ diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/model-config b/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/model-config deleted file mode 100644 index 05a19d859..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSdefault/model-config +++ /dev/null @@ -1,136 +0,0 @@ -# $Xprint.org: PSdefault model-config,v 1.2 2002/11/07 19:48:04 gisburn Exp $ -# Generic default model-config for the PostScript DDX -# -# DO NOT MODIFY THIS FILE!! -# -# If you want to make customisations for your printer create a copy -# of this printer model. -# Example (for creating a model config "MYCOMPANYlaserxx"): -# 1. Create model config dir: -# % mkdir MYCOMPANYlaserxx -# 2. Link (or copy) the PMF (printer font metrics) for the -# printer buildin fonts: -# % ln -s PSdefault/fonts MYCOMPANYlaserxx/. -# 3. Copy the model config file: -# % cp PSdefault/model-config MYCOMPANYlaserxx/. -# 4. Customize MYCOMPANYlaserxx/model-config to match your needs. -# - -# Attributes supported for this printer model -# You may want to cut the lists here down to the attributes supported -# by your printer. -*content-orientations-supported: portrait landscape reverse-portrait reverse-landscape -*descriptor: PostScript default model -*document-formats-supported: {POSTSCRIPT 2} -*input-trays-supported: -*medium-source-sizes-supported: \ -{ '' \ - {na-letter FALSE {6.35 209.55 6.35 273.05}}\ - {na-legal FALSE {6.35 209.55 6.35 349.25}}\ - {executive FALSE {6.35 177.80 6.35 260.35}}\ - {folio FALSE {6.35 204.47 6.35 323.85}}\ - {invoice FALSE {6.35 133.35 6.35 209.55}}\ - {ledger FALSE {6.35 273.05 6.35 425.45}}\ - {quarto FALSE {6.35 209.55 6.35 268.732}}\ - {a FALSE {6.35 209.55 6.35 273.05}}\ - {b FALSE {6.35 273.05 6.35 425.45}}\ - {c FALSE {6.35 425.45 6.35 552.45}}\ - {d FALSE {6.35 552.45 6.35 857.25}}\ - {e FALSE {6.35 857.25 6.35 1111.25}}\ - {na-6x9-envelope FALSE {6.35 146.05 6.35 222.25}}\ - {na-10x15-envelope FALSE {6.35 247.65 6.35 374.65}}\ - {monarch-envelope FALSE {6.35 91.948 6.35 184.15}}\ - {na-10x13-envelope FALSE {6.35 247.65 6.35 323.85}}\ - {na-9x12-envelope FALSE {6.35 222.25 6.35 298.45}}\ - {na-number-10-envelope FALSE {6.35 98.425 6.35 234.95}}\ - {na-7x9-envelope FALSE {6.35 171.45 6.35 222.25}}\ - {na-9x11-envelope FALSE {6.35 222.25 6.35 273.05}}\ - {na-10x14-envelope FALSE {6.35 247.65 6.35 349.25}}\ - {na-number-9-envelope FALSE {6.35 92.075 6.35 219.075}}\ - {iso-a0 FALSE {6.35 834.65 6.35 1182.65}}\ - {iso-a1 FALSE {6.35 587.65 6.35 834.65}}\ - {iso-a2 FALSE {6.35 413.65 6.35 587.65}}\ - {iso-a3 FALSE {6.35 290.65 6.35 413.65}}\ - {iso-a4 FALSE {6.35 203.65 6.35 290.65}}\ - {iso-a5 FALSE {6.35 141.65 6.35 203.65}}\ - {iso-a6 FALSE {6.35 98.65 6.35 141.65}}\ - {iso-a7 FALSE {6.35 67.65 6.35 98.65}}\ - {iso-a8 FALSE {6.35 45.65 6.35 67.65}}\ - {iso-a9 FALSE {6.35 30.65 6.35 45.65}}\ - {iso-a10 FALSE {6.35 19.65 6.35 30.65}}\ - {iso-b1 FALSE {6.35 700.65 6.35 993.65}}\ - {iso-b2 FALSE {6.35 493.65 6.35 700.65}}\ - {iso-b3 FALSE {6.35 346.65 6.35 493.65}}\ - {iso-b4 FALSE {6.35 243.65 6.35 346.65}}\ - {iso-b5 FALSE {6.35 169.65 6.35 243.65}}\ - {iso-b6 FALSE {6.35 118.65 6.35 169.65}}\ - {iso-b7 FALSE {6.35 81.65 6.35 118.65}}\ - {iso-b8 FALSE {6.35 55.65 6.35 81.65}}\ - {iso-b9 FALSE {6.35 37.65 6.35 55.65}}\ - {iso-b10 FALSE {6.35 24.65 6.35 37.65}}\ - {jis-b1 FALSE {6.35 721.65 6.35 1023.65}}\ - {jis-b2 FALSE {6.35 508.65 6.35 721.65}}\ - {jis-b3 FALSE {6.35 357.65 6.35 508.65}}\ - {jis-b4 FALSE {6.35 250.65 6.35 357.65}}\ - {jis-b5 FALSE {6.35 175.65 6.35 250.65}}\ - {jis-b6 FALSE {6.35 121.65 6.35 175.65}}\ - {jis-b7 FALSE {6.35 84.65 6.35 121.65}}\ - {jis-b8 FALSE {6.35 57.65 6.35 84.65}}\ - {jis-b9 FALSE {6.35 38.65 6.35 57.65}}\ - {jis-b10 FALSE {6.35 25.65 6.35 38.65}}\ - {iso-c3 FALSE {6.35 317.65 6.35 451.65}}\ - {iso-c4 FALSE {6.35 222.65 6.35 317.65}}\ - {iso-c5 FALSE {6.35 155.65 6.35 222.65}}\ - {iso-c6 FALSE {6.35 107.65 6.35 155.65}}\ - {iso-designated-long FALSE {6.35 103.65 6.35 213.65}}\ - {hp-2x-postcard FALSE {6.35 141.65 6.35 193.65}}\ - {hp-european-edp FALSE {6.35 298.45 6.35 349.25}}\ - {hp-mini FALSE {6.35 133.35 6.35 209.55}}\ - {hp-postcard FALSE {6.35 93.65 6.35 141.65}}\ - {hp-tabloid FALSE {6.35 273.05 6.35 425.45}}\ - {hp-us-edp FALSE {6.35 273.05 6.35 349.25}}\ - {hp-us-government-legal FALSE {6.35 196.85 6.35 323.85}}\ - {hp-us-government-letter FALSE {6.35 196.85 6.35 247.65}}\ -} -# If you have more than one tray use the following example: -# 1. List the supported trays -#*input-trays-supported: main manual -# 2. Define each tray and it's paper sizes -#*medium-source-sizes-supported: \ -#{ main \ -# {na-letter FALSE {6.35 209.55 6.35 273.05}} \ -# {na-legal FALSE {6.35 209.55 6.35 349.25}} \ -# {iso-a4 FALSE {6.35 203.65 6.35 290.65}} \ -#} \ -#{ manual \ -# {iso-a5 FALSE {6.35 141.65 6.35 203.65}} \ -# {iso-c5 FALSE {6.35 155.65 6.35 222.65}} \ -# {iso-designated-long FALSE {6.35 103.65 6.35 213.65}} \ -# {jis-b5 FALSE {6.35 175.65 6.35 250.65}} \ -# {monarch-envelope FALSE {6.35 91.948 6.35 184.15}} \ -# {na-legal FALSE {6.35 209.55 6.35 349.25}} \ -# {na-number-10-envelope FALSE {6.35 98.425 6.35 234.95}} \ -# {executive FALSE {6.35 177.8 6.35 260.35}} \ -# {iso-a3 FALSE {6.35 290.65 6.35 413.65}} \ -# {iso-a0 FALSE {6.35 834.65 6.35 1182.65}} \ -#} -*plexes-supported: simplex duplex tumble -*printer-model: "PostScript default model" -# 75, 100, 120, 150, 180, 200, 240, 300, 360, 400, 600, 720, -# 940, 1200 and 2440 are supported DPI values, we limit it here -# to some common values: -*printer-resolutions-supported: 300 360 400 600 -*xp-ddx-identifier: XP-POSTSCRIPT -*xp-listfonts-modes-supported: xp-list-internal-printer-fonts xp-list-glyph-fonts -*xp-embedded-formats-supported: {POSTSCRIPT 2} -*xp-raw-formats-supported: {POSTSCRIPT 2} -*xp-setup-proviso: setup-optional - -# NOTE: xp-psddx-* attributes are EXPERIMENTAL for now. -# xp-psddx-download-fonts defines which fonts should be downloaded as outlines -# (valid types are "pfa", "pfb", "ttf", "ttc", "otf", "otc") -*xp-psddx-download-fonts: pfa pfb ttf ttc otf otc -# xp-psddx-download-font-type defines which font type is used to download outlines -# (valid values are "bitmap", "pstype1" and "pstype3") -*xp-psddx-download-font-type: pstype1 -# EOF. diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSspooldir/Imakefile b/nx-X11/programs/Xserver/XpConfig/C/print/models/PSspooldir/Imakefile deleted file mode 100644 index 65f602f7f..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSspooldir/Imakefile +++ /dev/null @@ -1,34 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.1 2002/06/09 05:42:52 gisburn Exp $ - -XPMODELNAME = PSspooldir - -MODELDIR = $(XPRINTDIR)/C/print/models/$(XPMODELNAME) - -#if BuildGISWxprintglue || BuildGISWxprint -XCOMM Hack for Solaris's native /usr/openwin/bin/Xprt which does not -XCOMM understand the new %xpconfigdir% modelconfig variable -XCOMM (this is only used for the GISWxprintglue package build; -XCOMM the GISWxprint does not need it but using it avoids confusion -XCOMM if someone uses GISWxprint to run both Solaris native Xprt and -XCOMM our own binary side-by-side using the same config) -all:: model-config.SolarisXprt - -model-config.SolarisXprt: model-config - nawk model-config.SolarisXprt - -clean:: - $(RM) model-config.SolarisXprt - -InstallNamedNonExec(model-config.SolarisXprt,model-config,$(MODELDIR)) -#else -InstallNonExecFile(model-config,$(MODELDIR)) -#endif /* BuildGISWxprintglue || BuildGISWxprint */ - -InstallNamedProg(spooltodir.sh,spooltodir.sh,$(MODELDIR)) - -# All PostScript-printer models should use the printer-builtin fonts from the -# "PSdefault" printer model (unless they employ more or other builtin fonts) -install:: - $(RM) $(DESTDIR)$(MODELDIR)/fonts - $(LN) ../PSdefault/fonts $(DESTDIR)$(MODELDIR) - diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSspooldir/model-config b/nx-X11/programs/Xserver/XpConfig/C/print/models/PSspooldir/model-config deleted file mode 100644 index 6bb477767..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSspooldir/model-config +++ /dev/null @@ -1,71 +0,0 @@ -# $Xprint.org: PSspooldir model-config,v 1.1 2002/11/25 19:48:04 gisburn Exp $ -# PostScript DDX model-config which sends jobs to a spool dir instead to a print queue -# -# This model is basically a cut-down PSdefault model with a custom *xp-spooler-command -# -# DO NOT MODIFY THIS FILE!! -# -# If you want to make customisations for your printer create a copy -# of this printer model. -# Example (for creating a model config "MYCOMPANYlaserxx"): -# 1. Create model config dir: -# % mkdir MYCOMPANYlaserxx -# 2. Link (or copy) the PMF (printer font metrics) for the -# printer buildin fonts: -# % ln -s PSspooldir/fonts MYCOMPANYlaserxx/. -# 3. Copy the model config file: -# % cp PSspooldir/model-config MYCOMPANYlaserxx/. -# 4. Customize MYCOMPANYlaserxx/model-config to match your needs. -# -# Attributes supported for this printer model -*content-orientations-supported: portrait landscape reverse-portrait reverse-landscape -*descriptor: PostScript job spool dir /tmp/Xprintjobs -*document-formats-supported: {POSTSCRIPT 2} -*input-trays-supported: -*medium-source-sizes-supported: \ -{ '' \ - {na-letter FALSE {6.35 209.55 6.35 273.05}}\ - {na-legal FALSE {6.35 209.55 6.35 349.25}}\ - {executive FALSE {6.35 177.80 6.35 260.35}}\ - {ledger FALSE {6.35 273.05 6.35 425.45}}\ - {quarto FALSE {6.35 209.55 6.35 268.732}}\ - {iso-a3 FALSE {6.35 290.65 6.35 413.65}}\ - {iso-a4 FALSE {6.35 203.65 6.35 290.65}}\ - {iso-a5 FALSE {6.35 141.65 6.35 203.65}}\ - {iso-b3 FALSE {6.35 346.65 6.35 493.65}}\ - {iso-b4 FALSE {6.35 243.65 6.35 346.65}}\ - {iso-b5 FALSE {6.35 169.65 6.35 243.65}}\ - {jis-b3 FALSE {6.35 357.65 6.35 508.65}}\ - {jis-b4 FALSE {6.35 250.65 6.35 357.65}}\ - {jis-b5 FALSE {6.35 175.65 6.35 250.65}}\ - {iso-c3 FALSE {6.35 317.65 6.35 451.65}}\ - {iso-c4 FALSE {6.35 222.65 6.35 317.65}}\ - {iso-c5 FALSE {6.35 155.65 6.35 222.65}}\ -} - -*plexes-supported: simplex duplex tumble -*printer-model: "PostScript job spool dir /tmp/Xprintjobs" -# 75, 100, 120, 150, 180, 200, 240, 300, 360, 400, 600, 720, -# 940, 1200 and 2440 are supported DPI values, we limit it here -# to some common values: -*printer-resolutions-supported: 300 360 400 600 -*xp-ddx-identifier: XP-POSTSCRIPT -*xp-listfonts-modes-supported: xp-list-internal-printer-fonts xp-list-glyph-fonts -*xp-embedded-formats-supported: {POSTSCRIPT 2} -*xp-raw-formats-supported: {POSTSCRIPT 2} -*xp-setup-proviso: setup-optional - -# Use custom spooler script which sends the output to a dir instead to a printer queue -# Note that "%xpconfigdir%" is currently only supported in Xprt servers build -# from xprint.mozdev.org sources, other platforms have replace it with the -# absolute path name to the script -*xp-spooler-command: %xpconfigdir%/C/print/models/PSspooldir/spooltodir.sh -d /tmp/Xprintjobs -s .ps -u 077 -p %printer-name% -c %copy-count% -t %job-name% -o "%options%" - -# NOTE: xp-psddx-* attributes are EXPERIMENTAL for now. -# xp-psddx-download-fonts defines which fonts should be downloaded as outlines -# (valid types are "pfa", "pfb", "ttf", "ttc", "otf", "otc") -*xp-psddx-download-fonts: pfa pfb ttf ttc otf otc -# xp-psddx-download-font-type defines which font type is used to download outlines -# (valid values are "bitmap", "pstype1" and "pstype3") -*xp-psddx-download-font-type: pstype1 -# EOF. diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSspooldir/spooltodir.sh b/nx-X11/programs/Xserver/XpConfig/C/print/models/PSspooldir/spooltodir.sh deleted file mode 100755 index aba14e1b3..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/models/PSspooldir/spooltodir.sh +++ /dev/null @@ -1,127 +0,0 @@ -#!/bin/sh -PATH=/usr/bin:/usr/sbin:/bin:/sbin -export PATH - -verbose_msgs="false" -DEFAULT_SPOOLDIR=/tmp/Xprintjobs - -usage() -{ - printf "Usage: ${0}: [options]\n" - printf "-v\tbe verbose\n" - printf "-d dirname\tdefine spool dir\n" - printf "-p string\tname of printer selected by user\n" - printf "-c integer\tnumber of copies\n" - printf "-t string\tjob title\n" - printf "-s string\tfile name suffix\n" - printf "-o string\tspooler options\n" - printf "-u mask\tpermission mask for new files (see umask)\n" - exit 2 -} - -verbose() -{ - if ${verbose_msgs} ; then - echo "$1" - fi -} - -spooldir="${DEFAULT_SPOOLDIR}" -printername= -num_job_copies= -job_title= -filename_suffix= -spooler_options= -permmask= -while getopts va:b:d:p:c:t:s:o:u: i -do - case $i in - v) - verbose_msgs="true" - ;; - d) - spooldir="$OPTARG" - ;; - p) - printername="$OPTARG" - ;; - c) - num_job_copies="$OPTARG" - ;; - t) - job_title="$OPTARG" - ;; - s) - filename_suffix="$OPTARG" - ;; - o) - spooler_options="$OPTARG" - ;; - u) - permmask="$OPTARG" - ;; - ?) usage - ;; - esac -done - -verbose "# spooldir=\"$spooldir\"" -verbose "# printername=\"$printername\"" -verbose "# num_job_copies=\"$num_job_copies\"" -verbose "# job_title=\"$job_title\"" -verbose "# spooler_options=\"$spooler_options\"" -verbose "# umask=\"$permmask\"" - -if [ ! -d "${DEFAULT_SPOOLDIR}" ] ; then - mkdir "${DEFAULT_SPOOLDIR}" - chmod a+rwxt "${DEFAULT_SPOOLDIR}" -fi - -if [ "${permmask}" != "" ] ; then - umask ${permmask} -fi - -if [ ! -d "$spooldir" ] ; then - echo "$0: spooldir \"$spooldir\" does not exits." >&2 - exit 1 -fi -if [ ! -w "$spooldir" ] ; then - echo "$0: Cannot write to spooldir \"$spooldir\"." >&2 - exit 1 -fi - -# Create first part of the output file name (prefix and an "unique" -# id(=date and time))... -filename="Xpjob_`date +%Y%m%d%H%M%S`" - -# ... then add options ... -if [ "${printername}" != "" ] ; then - filename="${filename}_${printername}" -fi -if [ "${num_job_copies}" != "" -a "${num_job_copies}" != "1" ] ; then - filename="${filename}_copies_${num_job_copies}" -fi -if [ "${job_title}" != "" ] ; then - filename="${filename}_title_${job_title}" -fi - -# ... mangle output file name and filter chars (like whitespaces) -# which may screw-up further processing by other shell scripts ... -filename="`echo \"${filename}\" | tr '[:blank:]' '_' | tr -c -d '[:alnum:]_.-'`" - -# ... add path and suffix ... -filename="${spooldir}/${filename}${filename_suffix}" - -verbose "# File name is \"$filename\"." - -# ... and finally capture stdin to the file. -cat >"${filename}" - -if ${verbose_msgs} ; then - printf "# File is " ; ls -l "${filename}" -fi - -verbose "# Done." - -exit 0 -# EOF. diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/SPSPARC2/Imakefile b/nx-X11/programs/Xserver/XpConfig/C/print/models/SPSPARC2/Imakefile deleted file mode 100644 index 750fc2fb2..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/models/SPSPARC2/Imakefile +++ /dev/null @@ -1,15 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.1 2002/06/09 05:42:52 gisburn Exp $ -#define IHaveSubdirs -#define PassCDebugFlags CDEBUGFLAGS="$(CDEBUGFLAGS)" - -SUBDIRS = fonts - -XPMODELNAME = SPSPARC2 - -MODELDIR = $(XPRINTDIR)/C/print/models/$(XPMODELNAME) - -InstallNonExecFile(model-config,$(MODELDIR)) - -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) - diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/SPSPARC2/fonts/Imakefile b/nx-X11/programs/Xserver/XpConfig/C/print/models/SPSPARC2/fonts/Imakefile deleted file mode 100644 index 649dd56b6..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/models/SPSPARC2/fonts/Imakefile +++ /dev/null @@ -1,28 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.1 2003/10/22 02:42:52 gisburn Exp $ - -XPFONTS = \ - Courier-Bold.pmf \ - Courier-BoldOblique.pmf \ - Courier-Oblique.pmf \ - Courier.pmf \ - Helvetica-Bold.pmf \ - Helvetica-BoldOblique.pmf \ - Helvetica-Oblique.pmf \ - Helvetica.pmf \ - Symbol.pmf \ - Times-Bold.pmf \ - Times-BoldItalic.pmf \ - Times-Italic.pmf \ - Times-Roman.pmf - -XPMODELNAME = SPSPARC2 - -MODELDIR = $(XPRINTDIR)/C/print/models/$(XPMODELNAME) -MODELFONTDIR = $(MODELDIR)/fonts - -# We reuse some of the PSdefault fonts -PARENTMODELFONTDIR=../../PSdefault/fonts - -InstallXpMultiplePMFLinks($(XPFONTS),$(PARENTMODELFONTDIR),$(MODELFONTDIR)) -InstallXpPMFFontsDir($(MODELFONTDIR)) - diff --git a/nx-X11/programs/Xserver/XpConfig/C/print/models/SPSPARC2/model-config b/nx-X11/programs/Xserver/XpConfig/C/print/models/SPSPARC2/model-config deleted file mode 100644 index 9f29b9992..000000000 --- a/nx-X11/programs/Xserver/XpConfig/C/print/models/SPSPARC2/model-config +++ /dev/null @@ -1,18 +0,0 @@ -# $Xprint.org: SPSPARC2 model-config,v 1.4 2002/11/07 19:48:04 gisburn Exp $ -*content-orientations-supported: portrait landscape -*descriptor: SunPics SPARCprinter II -*document-formats-supported: {POSTSCRIPT 2} -*input-trays-supported: -*medium-source-sizes-supported: \ - { '' {na-letter FALSE {6.35 209.55 6.35 273.05}} \ - {na-legal FALSE {6.35 209.55 6.35 349.25}} \ - {iso-a4 FALSE {6.35 203.65 6.35 290.65}}} -*plexes-supported: simplex -*printer-model: "SunPics SPARCprinter II" -*printer-resolutions-supported: 300 -*xp-ddx-identifier: XP-POSTSCRIPT -*xp-listfonts-modes-supported: xp-list-internal-printer-fonts xp-list-glyph-fonts -*xp-embedded-formats-supported: {POSTSCRIPT 2} -*xp-raw-formats-supported: {POSTSCRIPT 2} -*xp-setup-proviso: setup-optional -# EOF. diff --git a/nx-X11/programs/Xserver/XpConfig/Imakefile b/nx-X11/programs/Xserver/XpConfig/Imakefile deleted file mode 100644 index 9ee5d42e8..000000000 --- a/nx-X11/programs/Xserver/XpConfig/Imakefile +++ /dev/null @@ -1,761 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.3 2003/12/12 03:42:52 gisburn Exp $ -#define IHaveSubdirs -#define PassCDebugFlags CDEBUGFLAGS="$(CDEBUGFLAGS)" - -SUBDIRS = \ - C \ - en_US - -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) - -InstallNonExecFile(README,$(XPRINTDIR)/) - -## Locale mappings -## Notes: -## - only ASCII chars are allowed -## - "C" and "en_US" should not be used, they are real directories - -# List of locales which should be linked to the "C" locale -C_LOCALES= \ - POSIX \ - af \ - af_ZA \ - af_ZA.iso88591 \ - af_ZA.utf8 \ - afrikaans \ - ar \ - ar_AE \ - ar_AE.iso88596 \ - ar_AE.utf8 \ - ar_BH \ - ar_BH.iso88596 \ - ar_BH.utf8 \ - ar_DZ \ - ar_DZ.iso88596 \ - ar_DZ.utf8 \ - ar_EG \ - ar_EG.ISO8859-6 \ - ar_EG.UTF-8 \ - ar_EG.iso88596 \ - ar_EG.utf8 \ - ar_IN.utf8 \ - ar_IQ \ - ar_IQ.iso88596 \ - ar_IQ.utf8 \ - ar_JO \ - ar_JO.iso88596 \ - ar_JO.utf8 \ - ar_KW \ - ar_KW.iso88596 \ - ar_KW.utf8 \ - ar_LB \ - ar_LB.iso88596 \ - ar_LB.utf8 \ - ar_LY \ - ar_LY.iso88596 \ - ar_LY.utf8 \ - ar_MA \ - ar_MA.iso88596 \ - ar_MA.utf8 \ - ar_OM \ - ar_OM.iso88596 \ - ar_OM.utf8 \ - ar_QA \ - ar_QA.iso88596 \ - ar_QA.utf8 \ - ar_SA \ - ar_SA.iso88596 \ - ar_SA.utf8 \ - ar_SD \ - ar_SD.iso88596 \ - ar_SD.utf8 \ - ar_SY \ - ar_SY.iso88596 \ - ar_SY.utf8 \ - ar_TN \ - ar_TN.iso88596 \ - ar_TN.utf8 \ - ar_YE \ - ar_YE.iso88596 \ - ar_YE.utf8 \ - be_BY \ - be_BY.cp1251 \ - be_BY.utf8 \ - bg_BG \ - bg_BG.ISO8859-5 \ - bg_BG.cp1251 \ - bg_BG.utf8 \ - bn_IN.UTF-8 \ - bn_IN.utf8 \ - br_FR \ - br_FR.iso88591 \ - bs \ - bs_BA \ - bs_BA.iso88592 \ - bs_BA.ISO8859-2 \ - bs_BA.ISO-8859-2 \ - bs_BA.ISO_8859-2 \ - bs_BA.UTF-8 \ - bokmal \ - ca \ - ca.ISO8859-1 \ - ca.ISO8859-15 \ - ca_ES \ - ca_ES.ISO8859-1 \ - ca_ES.ISO8859-15 \ - ca_ES.iso88591 \ - ca_ES.iso885915@euro \ - ca_ES.utf8 \ - ca_ES@euro \ - catalan \ - croatian \ - cs_CZ \ - cs_CZ.ISO8859-2 \ - cs_CZ.iso88592 \ - cs_CZ.utf8 \ - cy_GB \ - cy_GB.iso885914 \ - cz \ - cz.ISO8859-2 \ - czech \ - da \ - da.ISO8859-1 \ - da.ISO8859-15 \ - danish \ - dansk \ - da_DK \ - da_DK.ISO8859-1 \ - da_DK.ISO8859-15 \ - da_DK.iso88591 \ - da_DK.iso885915 \ - da_DK.utf8 \ - de \ - de.ISO8859-1 \ - de.ISO8859-15 \ - de.UTF-8 \ - deutsch \ - de_AT \ - de_AT.ISO8859-1 \ - de_AT.ISO8859-15 \ - de_AT.iso88591 \ - de_AT.iso885915@euro \ - de_AT.utf8 \ - de_AT@euro \ - de_BE \ - de_BE.iso88591 \ - de_BE.iso885915@euro \ - de_BE@euro \ - de_CH \ - de_CH.ISO8859-1 \ - de_CH.iso88591 \ - de_CH.utf8 \ - de_DE \ - de_DE.ISO8859-1 \ - de_DE.ISO8859-15 \ - de_DE.UTF-8 \ - de_DE.iso88591 \ - de_DE.iso885915@euro \ - de_DE.utf8 \ - de_DE@euro \ - de_LU \ - de_LU.iso88591 \ - de_LU.iso885915@euro \ - de_LU.utf8 \ - de_LU@euro \ - el_GR \ - el_GR.ISO8859-7 \ - el_GR.ISO8859-7@euro \ - el_GR.iso88597 \ - el_GR.utf8 \ - en_AU \ - en_AU.ISO8859-1 \ - en_AU.iso88591 \ - en_AU.utf8 \ - en_BW \ - en_BW.iso88591 \ - en_DK \ - en_DK.iso88591 \ - en_GB \ - en_GB.ISO8859-1 \ - en_GB.ISO8859-15 \ - en_GB.iso88591 \ - en_GB.iso885915 \ - en_GB.utf8 \ - en_HK \ - en_HK.iso88591 \ - en_IE \ - en_IE.ISO8859-1 \ - en_IE.ISO8859-15 \ - en_IE.iso88591 \ - en_IE.iso885915@euro \ - en_IE.utf8 \ - en_IE@euro \ - en_IN \ - en_IN.utf8 \ - en_NZ \ - en_NZ.ISO8859-1 \ - en_NZ.iso88591 \ - en_NZ.utf8 \ - en_PH \ - en_PH.iso88591 \ - en_SG \ - en_SG.iso88591 \ - en_ZA \ - en_ZA.iso88591 \ - en_ZA.utf8 \ - en_ZW \ - en_ZW.iso88591 \ - es_AR \ - es_AR.ISO8859-1 \ - es_AR.iso88591 \ - es_AR.utf8 \ - es_BO \ - es_BO.ISO8859-1 \ - es_BO.iso88591 \ - es_BO.utf8 \ - es_CL \ - es_CL.ISO8859-1 \ - es_CL.iso88591 \ - es_CL.utf8 \ - es_CO \ - es_CO.ISO8859-1 \ - es_CO.iso88591 \ - es_CO.utf8 \ - es_CR \ - es_CR.ISO8859-1 \ - es_CR.iso88591 \ - es_CR.utf8 \ - es_DO \ - es_DO.iso88591 \ - es_DO.utf8 \ - es_EC \ - es_EC.ISO8859-1 \ - es_EC.iso88591 \ - es_EC.utf8 \ - es_ES \ - es_ES.ISO8859-1 \ - es_ES.ISO8859-15 \ - es_ES.UTF-8 \ - es_ES.iso88591 \ - es_ES.iso885915@euro \ - es_ES.utf8 \ - es_ES@euro \ - es_GT \ - es_GT.ISO8859-1 \ - es_GT.iso88591 \ - es_GT.utf8 \ - es_HN \ - es_HN.iso88591 \ - es_HN.utf8 \ - es_MX \ - es_MX.ISO8859-1 \ - es_MX.iso88591 \ - es_MX.utf8 \ - es_NI \ - es_NI.ISO8859-1 \ - es_NI.iso88591 \ - es_NI.utf8 \ - es_PA \ - es_PA.ISO8859-1 \ - es_PA.iso88591 \ - es_PA.utf8 \ - es_PE \ - es_PE.ISO8859-1 \ - es_PE.iso88591 \ - es_PE.utf8 \ - es_PY \ - es_PY.ISO8859-1 \ - es_PY.iso88591 \ - es_PY.utf8 \ - es_SV \ - es_SV.ISO8859-1 \ - es_SV.iso88591 \ - es_SV.utf8 \ - es_UY \ - es_UY.ISO8859-1 \ - es_UY.iso88591 \ - es_UY.utf8 \ - es_VE \ - es_VE.ISO8859-1 \ - es_VE.iso88591 \ - es_VE.utf8 \ - et_EE \ - et_EE.ISO8859-15 \ - et_EE.iso88591 \ - et_EE.utf8 \ - eu_ES \ - eu_ES.iso88591 \ - eu_ES.iso885915@euro \ - eu_ES@euro \ - fa_IR.utf8 \ - fi_FI \ - fi_FI.ISO8859-1 \ - fi_FI.ISO8859-15 \ - fi_FI.UTF-8 \ - fi_FI.iso88591 \ - fi_FI.iso885915@euro \ - fi_FI.utf8 \ - fi_FI@euro \ - fo_FO \ - fo_FO.iso88591 \ - fo_FO.utf8 \ - fr_BE \ - fr_BE.ISO8859-1 \ - fr_BE.ISO8859-15 \ - fr_BE.UTF-8 \ - fr_BE.iso88591 \ - fr_BE.iso885915@euro \ - fr_BE.utf8 \ - fr_BE@euro \ - fr_CH \ - fr_CH.ISO8859-1 \ - fr_CH.iso88591 \ - fr_CH.utf8 \ - fr_FR \ - fr_FR.ISO8859-1 \ - fr_FR.ISO8859-15 \ - fr_FR.UTF-8 \ - fr_FR.iso88591 \ - fr_FR.iso885915@euro \ - fr_FR.utf8 \ - fr_FR@euro \ - fr_LU \ - fr_LU.iso88591 \ - fr_LU.iso885915@euro \ - fr_LU.utf8 \ - fr_LU@euro \ - ga_IE \ - ga_IE.iso88591 \ - ga_IE.iso885915@euro \ - ga_IE.utf8 \ - ga_IE@euro \ - gl_ES \ - gl_ES.iso88591 \ - gl_ES.iso885915@euro \ - gl_ES.utf8 \ - gl_ES@euro \ - gu_IN.UTF-8 \ - gu_IN.utf8 \ - gv_GB \ - gv_GB.iso88591 \ - hebrew \ - he \ - he_IL \ - he_IL.ISO8859-8 \ - he_IL.UTF-8 \ - he_IL.iso88598 \ - he_IL.utf8 \ - hi_IN.UTF-8 \ - hi_IN.utf8 \ - hr_HR \ - hr_HR.ISO8859-2 \ - hr_HR.iso88592 \ - hr_HR.utf8 \ - hu_HU \ - hu_HU.ISO8859-2 \ - hu_HU.iso88592 \ - hu_HU.utf8 \ - id_ID \ - id_ID.iso88591 \ - id_ID.utf8 \ - is_IS \ - is_IS.ISO8859-1 \ - is_IS.iso88591 \ - is_IS.utf8 \ - it \ - it.ISO8859-1 \ - it.ISO8859-15 \ - it.UTF-8 \ - italian \ - it_CH \ - it_CH.iso88591 \ - it_CH.utf8 \ - it_IT \ - it_IT.ISO8859-1 \ - it_IT.ISO8859-15 \ - it_IT.UTF-8 \ - it_IT.iso88591 \ - it_IT.iso885915@euro \ - it_IT.utf8 \ - it_IT@euro \ - iw_IL \ - iw_IL.iso88598 \ - ja \ - japan \ - japanese \ - japanese.euc \ - japanese.sjis \ - ja_JP \ - ja_JP.EUC \ - ja_JP.PCK \ - ja_JP.UTF-8 \ - ja_JP.eucJP \ - ja_JP.eucjp \ - ja_JP.sjis \ - ja_JP.ujis \ - ja_JP.utf8 \ - ka_GE \ - ka_GE.georgianps \ - kl_GL \ - kl_GL.iso88591 \ - kl_GL.utf8 \ - ko \ - ko.UTF-8 \ - korean \ - korean.euc \ - ko_KR \ - ko_KR.EUC \ - ko_KR.EUC@dict \ - ko_KR.UTF-8 \ - ko_KR.UTF-8@dict \ - ko_KR.euckr \ - ko_KR.utf8 \ - kw_GB \ - kw_GB.iso88591 \ - ky_KG \ - ky_KG.UTF-8 \ - ky_KG.utf8 \ - lt_LT \ - lt_LT.ISO8859-13 \ - lt_LT.iso885913 \ - lt_LT.utf8 \ - lithuanian \ - lt \ - lt.ISO8859-13 \ - lv \ - lv.ISO8859-13 \ - lv_LV \ - lv_LV.ISO8859-13 \ - lv_LV.iso885913 \ - lv_LV.utf8 \ - mi_NZ \ - mi_NZ.iso885913 \ - mk_MK \ - mk_MK.ISO8859-5 \ - mk_MK.iso88595 \ - mk_MK.utf8 \ - mr_IN.utf8 \ - ms_MY \ - ms_MY.iso88591 \ - mt_MT \ - mt_MT.iso88593 \ - nb_NO \ - nb_NO.ISO-8859-1 \ - nl \ - nl.ISO8859-1 \ - nl.ISO8859-15 \ - nl_BE \ - nl_BE.ISO8859-1 \ - nl_BE.ISO8859-15 \ - nl_BE.iso88591 \ - nl_BE.iso885915@euro \ - nl_BE.utf8 \ - nl_BE@euro \ - nl_NL \ - nl_NL.ISO8859-1 \ - nl_NL.ISO8859-15 \ - nl_NL.iso88591 \ - nl_NL.iso885915@euro \ - nl_NL.utf8 \ - nl_NL@euro \ - nn_NO \ - nn_NO.iso88591 \ - no \ - no.ISO8859-1 \ - no_NO \ - no_NO.ISO8859-1@bokmal \ - no_NO.ISO8859-1@nynorsk \ - no_NO.iso88591 \ - no_NO.utf8 \ - norwegian \ - nr \ - nr_ZA \ - nr_ZA.iso88591 \ - nr_ZA.utf8 \ - ndebele \ - nso \ - nso_ZA \ - nso_ZA.iso885915 \ - nso_ZA.utf8 \ - sepedi \ - oc_FR \ - oc_FR.iso88591 \ - pa_IN.UTF-8 \ - pa_IN.utf8 \ - polish \ - pl_PL \ - pl_PL.ISO8859-2 \ - pl_PL.UTF-8 \ - pl_PL.iso88592 \ - pl_PL.utf8 \ - portuguese \ - pt \ - pt.ISO8859-1 \ - pt.ISO8859-15 \ - pt_BR \ - pt_BR.ISO8859-1 \ - pt_BR.ISO-8859-1 \ - pt_BR.ISO_8859-1 \ - pt_BR.iso88591 \ - pt_BR.iso885915 \ - pt_BR.88591 \ - pt_BR.88591.en \ - pt_BR.utf8 \ - pt_BR.UTF-8 \ - pt_PT \ - pt_PT.ISO8859-1 \ - pt_PT.ISO8859-15 \ - pt_PT.iso88591 \ - pt_PT.iso885915@euro \ - pt_PT.utf8 \ - pt_PT@euro \ - ro_RO \ - ro_RO.ISO8859-2 \ - ro_RO.iso88592 \ - ro_RO.utf8 \ - ru \ - ru.ISO8859-5 \ - ru.UTF-8 \ - ru.ansi1251 \ - ru.koi8-r \ - ru_SU \ - russian \ - ru_RU \ - ru_RU.ANSI1251 \ - ru_RU.ISO8859-5 \ - ru_RU.KOI8-R \ - ru_RU.UTF-8 \ - ru_RU.iso88595 \ - ru_RU.koi8r \ - ru_RU.utf8 \ - ru_UA \ - ru_UA.koi8u \ - romanian \ - se_NO \ - se_NO.utf8 \ - si \ - sinhala \ - si_LK \ - si_LK.UTF8 \ - sk \ - sk.ISO8859-2 \ - slovak \ - slovene \ - slovenian \ - spanish \ - sk_SK \ - sk_SK.ISO8859-2 \ - sk_SK.iso88592 \ - sk_SK.utf8 \ - sh \ - sh.ISO8859-2 \ - sh_BA.ISO8859-2@bosnia \ - sh_YU \ - sh_YU.iso88592 \ - sh_YU.utf8 \ - sl_SI \ - sl_SI.ISO8859-2 \ - sl_SI.iso88592 \ - sl_SI.utf8 \ - su \ - su.ISO8859-1 \ - sq_AL \ - sq_AL.ISO8859-2 \ - sq_AL.iso88591 \ - sq_AL.utf8 \ - sr_SP \ - sr_SP.ISO8859-5 \ - sr_YU \ - sr_YU.ISO8859-5 \ - sr_YU.iso88592 \ - sr_YU.iso88595@cyrillic \ - sr_YU.utf8 \ - sr_YU@cyrillic \ - ss \ - ss_ZA \ - ss_ZA.iso88591 \ - ss_ZA.utf8 \ - siswati \ - st \ - st_ZA \ - st_ZA.iso88591 \ - st_ZA.utf8 \ - sesotho \ - sv \ - sv.ISO8859-1 \ - sv.ISO8859-15 \ - sv.UTF-8 \ - sv_FI \ - sv_FI.iso88591 \ - sv_FI.iso885915@euro \ - sv_FI.utf8 \ - sv_FI@euro \ - sv_SE \ - sv_SE.ISO8859-1 \ - sv_SE.ISO8859-15 \ - sv_SE.UTF-8 \ - sv_SE.iso88591 \ - sv_SE.iso885915 \ - sv_SE.utf8 \ - swedish \ - ta_IN \ - ta_IN.utf8 \ - te_IN \ - te_IN.utf8 \ - tg_TJ \ - tg_TJ.koi8t \ - th \ - thai \ - th_TH \ - th_TH.ISO8859-11 \ - th_TH.TIS620 \ - th_TH.UTF-8 \ - th_TH.tis620 \ - th_TH.utf8 \ - tl_PH \ - tl_PH.iso88591 \ - tn \ - tn_ZA \ - tn_ZA.iso885915 \ - tn_ZA.utf8 \ - setswana \ - tr \ - tr.ISO8859-9 \ - turkish \ - tr_TR \ - tr_TR.ISO8859-9 \ - tr_TR.UTF-8 \ - tr_TR.iso88599 \ - tr_TR.utf8 \ - ts \ - ts_ZA \ - ts_ZA.iso88591 \ - ts_ZA.utf8 \ - tsonga \ - uk_UA \ - uk_UA.koi8u \ - uk_UA.utf8 \ - ur_PK \ - ur_PK.utf8 \ - uz_UZ \ - uz_UZ.iso88591 \ - ve \ - ve_ZA \ - ve_ZA.utf8 \ - venda \ - vi_VN \ - vi_VN.tcvn \ - vi_VN.utf8 \ - wa_BE \ - wa_BE.iso88591 \ - wa_BE.iso885915@euro \ - wa_BE@euro \ - xh \ - xh_ZA \ - xh_ZA.iso88591 \ - xh_ZA.utf8 \ - xhosa \ - zh \ - zh.GBK \ - zh.UTF-8 \ - zh_CN \ - zh_CN.EUC \ - zh_CN.EUC@pinyin \ - zh_CN.EUC@radical \ - zh_CN.EUC@stroke \ - zh_CN.GB18030 \ - zh_CN.GB18030@pinyin \ - zh_CN.GB18030@radical \ - zh_CN.GB18030@stroke \ - zh_CN.GBK \ - zh_CN.GBK@pinyin \ - zh_CN.GBK@radical \ - zh_CN.GBK@stroke \ - zh_CN.UTF-8 \ - zh_CN.UTF-8@pinyin \ - zh_CN.UTF-8@radical \ - zh_CN.UTF-8@stroke \ - zh_CN.gb18030 \ - zh_CN.gb2312 \ - zh_CN.gbk \ - zh_CN.utf8 \ - zh_HK \ - zh_HK.BIG5HK \ - zh_HK.BIG5HK@radical \ - zh_HK.BIG5HK@stroke \ - zh_HK.UTF-8 \ - zh_HK.UTF-8@radical \ - zh_HK.UTF-8@stroke \ - zh_HK.big5hkscs \ - zh_HK.utf8 \ - zh_TW \ - zh_TW.BIG5 \ - zh_TW.BIG5@pinyin \ - zh_TW.BIG5@radical \ - zh_TW.BIG5@stroke \ - zh_TW.BIG5@zhuyin \ - zh_TW.EUC \ - zh_TW.EUC@pinyin \ - zh_TW.EUC@radical \ - zh_TW.EUC@stroke \ - zh_TW.EUC@zhuyin \ - zh_TW.UTF-8 \ - zh_TW.UTF-8@pinyin \ - zh_TW.UTF-8@radical \ - zh_TW.UTF-8@stroke \ - zh_TW.UTF-8@zhuyin \ - zh_TW.big5 \ - zh_TW.euctw \ - zh_TW.utf8 \ - zu \ - zu_ZA \ - zu_ZA.iso88591 \ - zu_ZA.utf8 \ - zulu - - -# List of locales which should be linked to the "en_US" locale, -# e.g. these locales should get the defaults (for example that -# US-Letter is used as default papersize) mainly used in the USA -US_LOCALES= \ - en_CA \ - en_CA.ISO8859-1 \ - en_CA.iso88591 \ - en_CA.utf8 \ - en_US.ISO8859-1 \ - en_US.ISO8859-15 \ - en_US.UTF-8 \ - en_US.iso88591 \ - en_US.iso885915 \ - en_US.utf8 \ - es_PR \ - es_PR.iso88591 \ - es_PR.utf8 \ - es_US \ - es_US.iso88591 \ - fr_CA \ - fr_CA.ISO8859-1 \ - fr_CA.iso88591 \ - fr_CA.utf8 \ - yi_US \ - yi_US.cp1255 - -install:: - ( \ - cd $(DESTDIR)$(XPRINTDIR) ; \ - for i in $(C_LOCALES) \ - ; do \ - $(RM) $$i ; \ - $(LN) C $$i ; \ - done \ - ) ; \ - ( \ - cd $(DESTDIR)$(XPRINTDIR) ; \ - for i in $(US_LOCALES) \ - ; do \ - $(RM) $$i ; \ - $(LN) en_US $$i ; \ - done \ - ) - diff --git a/nx-X11/programs/Xserver/XpConfig/README b/nx-X11/programs/Xserver/XpConfig/README deleted file mode 100644 index d7447815d..000000000 --- a/nx-X11/programs/Xserver/XpConfig/README +++ /dev/null @@ -1,318 +0,0 @@ - - -------------------------------------- - The X Print Service - The Basics - -------------------------------------- - -Index - - 1.0 X Print Service Overview - - - 2.0 How the X Print Service Works - - - 3.0 Using the X Print Service - - 3.1 X Print Server Configuration - - 3.2 Starting the X Print Service - - 3.3 Configuring the environment - - 3.4 General End-User Sequence - - -1.0 X Print Service Overview -============================= - -The "X Print Service" technology allows X rendering to devices such as -printers and fax. Most of the service is available in the X11 -technology stack as Xp, with the remainder in the CDE technology stack -as DtPrint. Modifications have also been made to the Motif technology -stack to support Xp and DtPrint. - -The Xp portion consists of: - * Xp Extension for the X-Server (included in the X-Server Xprt) - * Xp Extension API for the client side (libXp) - * PCL ddx driver that converts core X to native PCL - * Postscript ddx driver that converts core X to native Postscript - * Raster ddx driver that generates xwd rasters which can be - converted to PCL or Postscript rasters - -The DtPrint portion consists of: - * A collection of print GUIs (libDtPrint) - * A Print Dialog Manager that can assist a client in - setting printing options (dtpdm, dtpdmd) - -From an X clients perspective, it can attach to one of two nearly -identical X-Servers, a "Video" X-Server, and a "Print" X-Server -which has the additional Xp capability but otherwise looks and -behaves the same. - - - -2.0 How the X Print Service Works -================================== - -The X Print Service expands on the traditional X-Server and Xlib world -in four ways. - -1. Most obvious is the use of "print ddx drivers" instead of - "video ddx drivers". While a video ddx driver modifies pixels - in a video frame buffer, a print ddx driver generates "page - description language (PDL)" output such as PCL or Postscript. - - Once a print ddx driver generates PDL output, it can be sent to - a spooler such as lp(1) or retrieved by the client. - - Though not currently done, a single X-Server can support both - print and video ddx drivers. - -2. Since printers support "paged" output, unlike video, a portion - of the Xp Extension supports APIs to delineate printed output. - For example, XpStartPage and XpEndPage tell the X-Server where - a physical page starts and ends in an otherwise continuous - stream of X rendering primitives. Likewise, XpStartJob and - XpEndJob determine when a collection of pages starts and ends. - XpEndJob typically causes the generated PDL to be submitted to - a spooler, such as lp(1). - -3. Since printers have extensive capabilities, another portion of - the Xp Extension supports APIs to manipulate "print contexts". - - Once a printer is selected using the Xp Extension API, a print - context to represent it can be created. A print context - embodies the printer selected - it contains the printer's - default capabilities, selectable range of capabilities, - printer state, and generated output. Some "attributes" within - the print context can be modified by the user, and the - X-Server and print ddx driver will react accordingly. For - example, the attribute "content-orientation" can be set to - "landscape" or "portrait". - -4. Since printers can have "built in" fonts, the Xp Extension in - the X-Server works with the print ddx drivers to make - available (for printing only) additional fonts on a per print - context basis. - - When a print context is created and set for a given printer, - the X font calls may be able to access additional printer - fonts. To do this (typically), the X-Server must have access - to "printer metric files" (.pmf) that describe at minimum the - metrics of the built in fonts. - - - -3.0 Using the X Print Service -============================== - -There are three tasks to start the X Print Service: 1) configuring the -X Print Server, 2) starting the X Print Service, 3) configuring the user -session so that clients can find the running X Print Service. - -The tasks are described in detail below. - - -3.1 X Print Server Configuration ---------------------------------- - -The X Print Server (Xprt) can read a number of configuration files which -control its behavior and support for printers. Each vendor platform has -a default location for this information. Xprt can also read the -environment variable XPCONFIGDIR to locate alternate configuration -directories. Common settings include: - - * export XPCONFIGDIR=/X11/lib/X11/XpConfig/ - - * export XPCONFIGDIR=/proj/x11/xc/programs/Xserver/XpConfig/ - -Xprt has many built-in defaults, and lacking any configuration files, -will immediately try to support all printers visible via lpstat(1). - -In order of importance for configuration by a system administrator, the -configuration files for a "C" locale are as follows. - - ${XPCONFIGDIR}/C/print/Xprinters - - `Xprinters' is the top most configuration file. It tells - Xprt which specific printer names (e.g. mylaser) should - be supported, and whether lpstat(1) or other commands - should be used to automatically supplement the list of - printers. - - ${XPCONFIGDIR}/C/print/attributes/printer - - The `printer' file maps printer names to model - configurations (see `model-config' below). For example, - "mylaser" could be mapped to a "HPDJ1600C", and all other - arbitrary printers could be mapped to a default, such as - "HPLJ4SI". When depending on lpstat(1) in the Xprinters - file, setting up defaults in `printer' becomes all the - more important. - - ${XPCONFIGDIR}/C/print/attributes/document - - The `document' file specifies the initial document values - for any print jobs. For example, which paper tray to - use, what default resolution, etc. - - ${XPCONFIGDIR}/C/print/attributes/job - - The `job' file specifies the initial job values for any - print jobs. For example, "notification-profile" can be - set so that when a print job is successfully sent to a - printer, e-mail is sent to the user. - - ${XPCONFIGDIR}/C/print/models/HPDJ1600C/model-config - ${XPCONFIGDIR}/C/print/models/HPDJ1600C/fonts/fonts.dir - ${XPCONFIGDIR}/C/print/models/HPDJ1600C/fonts/9nb00051.pmf - ${XPCONFIGDIR}/C/print/models/HPDJ1600C/fonts/9nb00093.pmf - - The `model-config' file has attributes that describe the - printer model's capabilities and default settings. - Printer model fonts may also be present. The model-config - file also identifies the print ddx driver to be used. - - For each printer model supported, a complete hierarchy of - files should exist. In most cases, these files do not - need to be modified. - - ${XPCONFIGDIR}/C/print/ddx-config/raster/pcl - ${XPCONFIGDIR}/C/print/ddx-config/raster/postscript - - The print ddx drivers can have highly specific - configuration files to control their behavior. In most - cases, these files do not need to be modified. - - -3.2 Starting the X Print Service ---------------------------------- - -The summary checklist for starting the X Print Service is as follows: - -1. Choose an execution model for the X Print Service. The X - Print Service can be run on a per-user session basis, per - machine basis, or can be run on a few machines globally - available to a number of users. - -2. If print jobs are to be submitted to a spooler (almost always - the case), make sure all needed printers are available to the - spooler subsystem (most often lp(1)) on the same machine - running the X Print Service. - -3. Configure the X Print Server. See ``X Print Server - Configuration''. - -4. Depending on #1, start the X Print Server process "Xprt", and - then the Print Dialog Manager Daemon process "dtpdmd" at the - appropriate times. - -The details are described below. - -Because the X Print Service is based on X, it can be easily distributed. -The most significant factors in which execution model to choose will be -driven by: - - * how many printers will be accessable through the printer - subsystem on any given machine. A system administrator may - choose to cluster printers on a few given machines, or - scatter them across an organization and possibly make - extensive use of remote spoolers to make them globally - available. - - * how many machines will need a copy of the X Print Server - configuration files. The files have been architected so - that one super-set version of them can be maintained and - distributed (e.g. via NFS), and a per-machine or per-user - version of the `Xprinters' is all that is needed to have the - appropriate information in them utilized or ignored. - - * how many users can demand services from a given X Print - Service. - -With the above in mind, some obvious execution models include: - - * Global - in this model, the system administrator is choosing - to run the X Print Service on a *few* select machines with - appropriate printers configured, and allow clients access to - the global resource. This can centralize the administration - of printers and configuration files, but may have to be - monitored for performance loading. - - Startup would likely be done by boot-up scripts. - - * Per-machine - every machine with potential X Print Service - users would run the service. Printer and configuration file - administration is decentralized, and usage would be limited - to the users on the machine. - - Startup would likely be done by boot-up scripts. - - * Per-user session - every user would run an entire X Print - Service for themselves. In the future, the Video X Server - normally started may contain Print X Server capability, so - this model becomes very natural. - - Startup would likely be done at session login or by - launching actions or processes manually once the user - logs in. Note: the dtpdmd must be started after Xprt. - -Starting of the processes is straight forward. In strict order: - - [machineA] % Xprt [-XpFile ] [:dispNum] & - - Note that Xprt will look for configuration files in either - a default location or where XPCONFIGDIR points. - - -XpFile specifies an alternate `Xprinters' file, rather - than the default one or `${XPCONFIGDIR}/C/print/Xprinters'. - - [machineA] % dtpdmd -d machineA[:dispNum] [-l /tmp/dtpdmd.log] & - - The dtpdmd will maintain an X-Selection on the X-Server, - and will start dtpdm's as required to service requests. - -In all but the per-user session model, the machine running the dtpdmd -(thus dtpdm's) will need display authorization to the users video -display. - - - -3.3 Configuring the environment --------------------------------- - -Once a X Print Server and dtpdmd have been started -- many of them -in some cases -- clients will need to find and use them. There are -two mechanisms that allow clients to discover X Print Servers and -printers. - - * "X Print Specifier" - assuming usage of the DtPrint print - dialogs, the following notation is understood: - - printer_name@machine[:dispNum] - - For example: - - colorlj7@printhub:2 - - In the above example, the X Print Server running at `printhub:2' - is assumed to support the printer named `colorlj7'. - - * "XPSERVERLIST" - assuming usage of the DtPrint print dialogs, - the environment variable "XPSERVERLIST" can contain a list - of X Print Servers. For example: - - XPSERVERLIST="printhub:2 printhub:3 otherdept:0" - - Then in the dialogs, only a printer name needs to be entered. - The dialog will then search the X Print Servers in XPSERVERLIST - for a server than supports the printer, and then establish - contact. - -3.4 General End-User Sequence ------------------------------- - -From most CDEnext applications, printing is accomplished by bringing -down the menu and selecting . This will result in -the DtPrintSetupBox dialog, which will request the name of a printer, -and offer limited capability to configure print options (e.g. number -of copies). If the user wishes, they can select , which -will start a dtpdm capable of modifying additional print options. -Finally, the user should select . - - - -$Xorg: README,v 1.3 2000/08/17 19:48:02 cpqbld Exp $ diff --git a/nx-X11/programs/Xserver/XpConfig/en_US/Imakefile b/nx-X11/programs/Xserver/XpConfig/en_US/Imakefile deleted file mode 100644 index 1beed3bca..000000000 --- a/nx-X11/programs/Xserver/XpConfig/en_US/Imakefile +++ /dev/null @@ -1,8 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.1 2002/11/23 05:42:52 gisburn Exp $ -#define IHaveSubdirs -#define PassCDebugFlags CDEBUGFLAGS="$(CDEBUGFLAGS)" - -SUBDIRS = print - -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) diff --git a/nx-X11/programs/Xserver/XpConfig/en_US/print/Imakefile b/nx-X11/programs/Xserver/XpConfig/en_US/print/Imakefile deleted file mode 100644 index 113a5456b..000000000 --- a/nx-X11/programs/Xserver/XpConfig/en_US/print/Imakefile +++ /dev/null @@ -1,26 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.1 2002/06/09 05:42:52 gisburn Exp $ -#define IHaveSubdirs -#define PassCDebugFlags CDEBUGFLAGS="$(CDEBUGFLAGS)" - -SUBDIRS = attributes - -XPLOCALEPRINTDIR=$(XPRINTDIR)/en_US/print - -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) - -MakeDirectories(install,$(XPLOCALEPRINTDIR)) - -# We only have different values in "attributes", so link all other files -# to the "defaults" in the C locale -LINK_TO_C_LOCALE=Xprinters ddx-config models - -install:: - ( \ - cd $(DESTDIR)$(XPLOCALEPRINTDIR) ; \ - for i in $(LINK_TO_C_LOCALE) \ - ; do \ - $(RM) $$i ; \ - $(LN) ../../C/print/$$i $$i ; \ - done \ - ) diff --git a/nx-X11/programs/Xserver/XpConfig/en_US/print/attributes/Imakefile b/nx-X11/programs/Xserver/XpConfig/en_US/print/attributes/Imakefile deleted file mode 100644 index 86979a31c..000000000 --- a/nx-X11/programs/Xserver/XpConfig/en_US/print/attributes/Imakefile +++ /dev/null @@ -1,18 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.1 2002/11/23 05:42:52 gisburn Exp $ - -XPATTRIBUTEDIR = $(XPRINTDIR)/en_US/print/attributes - -# Install the "en_US"-specific "document" attribute resources... -InstallNonExecFile(document,$(XPATTRIBUTEDIR)) - -# ... and reuse "job" and "printer" pools from the C locale -install:: - ( \ - cd $(DESTDIR)$(XPATTRIBUTEDIR) ; \ - for i in job printer \ - ; do \ - $(RM) $$i ; \ - $(LN) ../../../C/print/attributes/$$i $$i ; \ - done \ - ) - diff --git a/nx-X11/programs/Xserver/XpConfig/en_US/print/attributes/document b/nx-X11/programs/Xserver/XpConfig/en_US/print/attributes/document deleted file mode 100644 index 253c46bce..000000000 --- a/nx-X11/programs/Xserver/XpConfig/en_US/print/attributes/document +++ /dev/null @@ -1,13 +0,0 @@ -# $Xorg: document,v 1.2 2002/11/30 22:10:03 gisburn Exp $ -# Document DPA-Object initial attribute values for en_US(-like) locales -# -# Note that the defaults (for all locales) are set in -# ${XPCONFIGDIR}/C/print/attributes/document -# Values in ${XPCONFIGDIR}/${LANG}/print/attributes/document are used to -# set/override these defaults for a specific locale on demand - -# US and some other countries use US-Letter as default paper size -# ("C"-locale default is "ISO-A4") -*default-medium: na-letter - -# EOF. diff --git a/nx-X11/programs/Xserver/Xprint/AttrValid.c b/nx-X11/programs/Xserver/Xprint/AttrValid.c deleted file mode 100644 index cf9476003..000000000 --- a/nx-X11/programs/Xserver/Xprint/AttrValid.c +++ /dev/null @@ -1,702 +0,0 @@ -/* $Xorg: AttrValid.c,v 1.4 2001/03/14 18:43:17 pookie Exp $ */ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include - -#include "attributes.h" - -/* - * default medium-source-sizes supported = na-letter w/.25" margins - */ -static XpOidMediumDiscreteSize DefaultMediumSize = { - xpoid_val_medium_size_na_letter, xFalse, {6.35, 209.55, 6.35, 273.05} -}; -static XpOidMediumDiscreteSizeList DefaultMediumSizeList = { - &DefaultMediumSize, 1 -}; -static XpOidMediumSourceSize DefaultMediumSourceSize = { - xpoid_unspecified, XpOidMediumSS_DISCRETE, { &DefaultMediumSizeList } -}; -static XpOidMediumSS DefaultMediumSS = { - &DefaultMediumSourceSize, 1 -}; - -/* - * if 'valid_oid_list' is NULL any oid found is considered valid - */ -XpOid -XpGetOidAttr(XpContextPtr pContext, - XPAttributes pool, - XpOid oid, - const XpOidList* valid_oid_list) -{ - XpOid value_oid; - - value_oid = XpOidFromString(XpGetStringAttr(pContext, pool, oid)); - if((const XpOidList*)NULL == valid_oid_list - || - XpOidListHasOid(valid_oid_list, value_oid)) - { - return value_oid; - } - else - { - return xpoid_none; - } -} - -void -XpPutOidAttr(XpContextPtr pContext, - XPAttributes pool, - XpOid oid, - XpOid value_oid) -{ - XpPutStringAttr(pContext, pool, oid, XpOidString(value_oid)); -} - -void -XpValidateOidAttr(XpContextPtr pContext, - XPAttributes pool, - XpOid oid, - const XpOidList* valid_oids, - XpOid default_oid) -{ - XpOid value_oid; - value_oid = XpGetOidAttr(pContext, pool, oid, valid_oids); - XpPutOidAttr(pContext, pool, oid, - value_oid == xpoid_none ? default_oid : value_oid); -} - -/* - * if 'valid_card_list' is NULL any cardinal found is considered valid - */ -unsigned long -XpGetCardAttr(XpContextPtr pContext, - XPAttributes pool, - XpOid oid, - const XpOidCardList* valid_card_list) -{ - unsigned long value_card; - - if(XpOidParseUnsignedValue(XpGetStringAttr(pContext, pool, oid), - (const char**)NULL, - &value_card)) - { - if((const XpOidCardList*)NULL == valid_card_list - || - XpOidCardListHasCard(valid_card_list, value_card)) - { - return value_card; - } - } - return 0; -} - -void -XpPutCardAttr(XpContextPtr pContext, - XPAttributes pool, - XpOid oid, - unsigned long value_card) -{ - if(value_card > 0) - { - char value_out[16]; - sprintf(value_out, "%lu", value_card); - XpPutStringAttr(pContext, pool, oid, value_out); - } - else - XpPutStringAttr(pContext, pool, oid, (const char*)NULL); -} - -void -XpValidateCardAttr(XpContextPtr pContext, - XPAttributes pool, - XpOid oid, - const XpOidCardList* valid_cards, - unsigned long default_card) -{ - unsigned long value_card; - value_card = XpGetCardAttr(pContext, pool, oid, valid_cards); - XpPutCardAttr(pContext, pool, oid, - value_card == 0 ? default_card : value_card); -} - -XpOidList* -XpGetListAttr(XpContextPtr pContext, - XPAttributes pool, - XpOid oid, - const XpOidList* valid_oid_list) -{ - return XpOidListNew(XpGetStringAttr(pContext, pool, oid), valid_oid_list); -} - -void -XpPutListAttr(XpContextPtr pContext, - XPAttributes pool, - XpOid oid, - const XpOidList* list) -{ - char* value_out; - - value_out = XpOidListString(list); - XpPutStringAttr(pContext, pool, oid, value_out); - XpOidFree(value_out); -} - -void -XpValidateListAttr(XpContextPtr pContext, - XPAttributes pool, - XpOid oid, - const XpOidList* valid_oids, - const XpOidList* default_oids) -{ - XpOidList* list = XpGetListAttr(pContext, pool, oid, valid_oids); - if(XpOidListCount(list) == 0) - XpPutListAttr(pContext, pool, oid, default_oids); - else - XpPutListAttr(pContext, pool, oid, list); - XpOidListDelete(list); -} - -XpOidCardList* -XpGetCardListAttr(XpContextPtr pContext, - XPAttributes pool, - XpOid oid, - const XpOidCardList* valid_card_list) -{ - return XpOidCardListNew(XpGetStringAttr(pContext, pool, oid), - valid_card_list); -} - -void -XpPutCardListAttr(XpContextPtr pContext, - XPAttributes pool, - XpOid oid, - const XpOidCardList* list) -{ - char* value_out; - - value_out = XpOidCardListString(list); - XpPutStringAttr(pContext, pool, oid, value_out); - XpOidFree(value_out); -} - -void -XpValidateCardListAttr(XpContextPtr pContext, - XPAttributes pool, - XpOid oid, - const XpOidCardList* valid_cards, - const XpOidCardList* default_cards) -{ - XpOidCardList* list = XpGetCardListAttr(pContext, pool, oid, valid_cards); - if(XpOidCardListCount(list) == 0 && (XpOidCardList*)NULL != default_cards) - XpPutCardListAttr(pContext, pool, oid, default_cards); - else - XpPutCardListAttr(pContext, pool, oid, list); - XpOidCardListDelete(list); -} - -XpOidDocFmtList* -XpGetDocFmtListAttr(XpContextPtr pContext, - XPAttributes pool, - XpOid oid, - const XpOidDocFmtList* valid_fmt_list) -{ - return XpOidDocFmtListNew(XpGetStringAttr(pContext, pool, oid), - valid_fmt_list); -} - -void -XpPutDocFmtListAttr(XpContextPtr pContext, - XPAttributes pool, - XpOid oid, - const XpOidDocFmtList* list) -{ - char* value_out; - - value_out = XpOidDocFmtListString(list); - XpPutStringAttr(pContext, pool, oid, value_out); - XpOidFree(value_out); -} - -void -XpValidateDocFmtListAttr(XpContextPtr pContext, - XPAttributes pool, - XpOid oid, - const XpOidDocFmtList* valid_fmts, - const XpOidDocFmtList* default_fmts) -{ - XpOidDocFmtList* list; - - list = XpGetDocFmtListAttr(pContext, pool, oid, valid_fmts); - if(XpOidDocFmtListCount(list) == 0 - && - (XpOidDocFmtList*)NULL != default_fmts) - { - XpPutDocFmtListAttr(pContext, pool, oid, default_fmts); - } - else - { - XpPutDocFmtListAttr(pContext, pool, oid, list); - } - XpOidDocFmtListDelete(list); -} - -XpOidMediumSS* -XpGetMediumSSAttr(XpContextPtr pContext, - XPAttributes pool, - XpOid oid, - const XpOidList* valid_trays, - const XpOidList* valid_sizes) -{ - return XpOidMediumSSNew(XpGetStringAttr(pContext, pool, oid), - valid_trays, valid_sizes); -} - -void -XpPutMediumSSAttr(XpContextPtr pContext, - XPAttributes pool, - XpOid oid, - const XpOidMediumSS* msss) -{ - char* value_out; - - value_out = XpOidMediumSSString(msss); - XpPutStringAttr(pContext, pool, oid, value_out); - XpOidFree(value_out); -} - -const XpOidMediumSS* -XpGetDefaultMediumSS() -{ - return &DefaultMediumSS; -} - -XpOidTrayMediumList* -XpGetTrayMediumListAttr(XpContextPtr pContext, - XPAttributes pool, - XpOid oid, - const XpOidList* valid_trays, - const XpOidMediumSS* msss) -{ - return XpOidTrayMediumListNew(XpGetStringAttr(pContext, pool, oid), - valid_trays, msss); -} - -void -XpPutTrayMediumListAttr(XpContextPtr pContext, - XPAttributes pool, - XpOid oid, - const XpOidTrayMediumList* tm) -{ - char* value_out; - - value_out = XpOidTrayMediumListString(tm); - XpPutStringAttr(pContext, pool, oid, value_out); - XpOidFree(value_out); -} - -void -XpValidatePrinterMediaAttrs(XpContextPtr pContext, - const XpOidList* valid_trays, - const XpOidList* valid_sizes) -{ - const XpOidMediumSS* msss; - XpOidMediumSS* pool_msss; - XpOidTrayMediumList* tm; - - pool_msss = XpGetMediumSSAttr(pContext, XPPrinterAttr, - xpoid_att_medium_source_sizes_supported, - valid_trays, valid_sizes); - if(0 == XpOidMediumSSCount(pool_msss)) - msss = XpGetDefaultMediumSS(); - else - msss = pool_msss; - XpPutMediumSSAttr(pContext, XPPrinterAttr, - xpoid_att_medium_source_sizes_supported, msss); - - tm = XpGetTrayMediumListAttr(pContext, XPPrinterAttr, - xpoid_att_input_trays_medium, - valid_trays, msss); - XpPutTrayMediumListAttr(pContext, XPPrinterAttr, - xpoid_att_input_trays_medium, tm); - - XpOidMediumSSDelete(pool_msss); - XpOidTrayMediumListDelete(tm); -} - - -void -XpValidatePrinterPool(XpContextPtr pContext, - const XpValidatePoolsRec* vpr) -{ - /* - * content-orientations-supported - */ - XpValidateListAttr(pContext, XPPrinterAttr, - xpoid_att_content_orientations_supported, - vpr->valid_content_orientations_supported, - vpr->default_content_orientations_supported); - /* - * document-formats-supported - */ - XpValidateDocFmtListAttr(pContext, XPPrinterAttr, - xpoid_att_document_formats_supported, - vpr->valid_document_formats_supported, - vpr->default_document_formats_supported); - /* - * plexes-supported - */ - XpValidateListAttr(pContext, XPPrinterAttr, xpoid_att_plexes_supported, - vpr->valid_plexes_supported, - vpr->default_plexes_supported); - /* - * printer-resolutions-supported - */ - XpValidateCardListAttr(pContext, XPPrinterAttr, - xpoid_att_printer_resolutions_supported, - vpr->valid_printer_resolutions_supported, - vpr->default_printer_resolutions_supported); - /* - * xp-embedded-formats-supported - */ - XpValidateDocFmtListAttr(pContext, XPPrinterAttr, - xpoid_att_xp_embedded_formats_supported, - vpr->valid_xp_embedded_formats_supported, - vpr->default_xp_embedded_formats_supported); - /* - * xp-listfonts-modes-supported - */ - XpValidateListAttr(pContext, XPPrinterAttr, - xpoid_att_xp_listfonts_modes_supported, - vpr->valid_xp_listfonts_modes_supported, - vpr->default_xp_listfonts_modes_supported); - /* - * xp-raw-formats-supported - */ - XpValidateDocFmtListAttr(pContext, XPPrinterAttr, - xpoid_att_xp_raw_formats_supported, - vpr->valid_xp_raw_formats_supported, - vpr->default_xp_raw_formats_supported); - /* - * xp-setup-proviso - */ - XpValidateOidAttr(pContext, XPPrinterAttr, xpoid_att_xp_setup_proviso, - vpr->valid_xp_setup_proviso, xpoid_none); - /* - * medium-source-sizes-supported - * input-trays-mdeium - */ - XpValidatePrinterMediaAttrs(pContext, - vpr->valid_input_trays, - vpr->valid_medium_sizes); - /* - * available-compressions-supported - */ - XpValidateListAttr(pContext, XPPrinterAttr, - xpoid_att_available_compressions_supported, - vpr->valid_available_compressions_supported, - vpr->default_available_compressions_supported); -} - - -void -XpValidateNotificationProfile(XpContextPtr pContext) -{ - const char* value_in; - const char* value_out; - - value_in = XpGetStringAttr(pContext, XPJobAttr, - xpoid_att_notification_profile); - value_out = XpOidNotifyString(XpOidNotifyParse(value_in)); - XpPutStringAttr(pContext, XPJobAttr, - xpoid_att_notification_profile, value_out); -} - -void -XpValidateJobPool(XpContextPtr pContext, - const XpValidatePoolsRec* vpr) -{ - /* - * Note: the 'vpr' argument is unused in this - * implementation; it is reserved for future use - */ - XpOidList* job_attrs_supported; - /* - * only validate attributes found in job-attributes-supported - */ - job_attrs_supported = XpGetListAttr(pContext, XPPrinterAttr, - xpoid_att_job_attributes_supported, - (const XpOidList*)NULL); - /* - * notification-profile - */ - if(XpOidListHasOid(job_attrs_supported, xpoid_att_notification_profile)) - { - XpValidateNotificationProfile(pContext); - } - /* - * clean up - */ - XpOidListDelete(job_attrs_supported); -} - - -static void -XpValidateDocOrPagePool(XpContextPtr pContext, - XPAttributes pool, /* XPDocAttr or XPPageAttr */ - const XpOidList* attrs_supported, - const XpValidatePoolsRec* vpr) -{ - /* - * content-orientation - */ - if(XpOidListHasOid(attrs_supported, xpoid_att_content_orientation)) - { - XpOidList* content_orientations_supported; - content_orientations_supported = - XpGetListAttr(pContext, XPPrinterAttr, - xpoid_att_content_orientations_supported, - vpr->valid_content_orientations_supported); - XpValidateOidAttr(pContext, pool, xpoid_att_content_orientation, - content_orientations_supported, xpoid_none); - XpOidListDelete(content_orientations_supported); - } - /* - * copy-count - */ - if(XpOidListHasOid(attrs_supported, xpoid_att_copy_count)) - XpValidateCardAttr(pContext, pool, xpoid_att_copy_count, - (const XpOidCardList*)NULL, 0); - /* - * default-printer-resolution - */ - if(XpOidListHasOid(attrs_supported, xpoid_att_default_printer_resolution)) - { - XpOidCardList* printer_resolutions_supported; - printer_resolutions_supported = - XpGetCardListAttr(pContext, XPPrinterAttr, - xpoid_att_printer_resolutions_supported, - vpr->valid_printer_resolutions_supported); - XpValidateCardAttr(pContext, pool, - xpoid_att_default_printer_resolution, - printer_resolutions_supported, 0); - XpOidCardListDelete(printer_resolutions_supported); - } - /* - * default-input-tray - */ - if(XpOidListHasOid(attrs_supported, xpoid_att_default_input_tray)) - { - XpOidTrayMediumList* input_trays_medium; - const char* value_in; - XpOid value_tray; - - input_trays_medium = - XpGetTrayMediumListAttr(pContext, XPPrinterAttr, - xpoid_att_input_trays_medium, - (const XpOidList*)NULL, - (const XpOidMediumSS*)NULL); - value_in = - XpGetStringAttr(pContext, pool, xpoid_att_default_input_tray); - value_tray = XpOidFromString(value_in); - if(!XpOidTrayMediumListHasTray(input_trays_medium, value_tray)) - value_tray = xpoid_none; - XpPutOidAttr(pContext, pool, xpoid_att_default_input_tray, value_tray); - XpOidTrayMediumListDelete(input_trays_medium); - } - /* - * default-medium - */ - if(XpOidListHasOid(attrs_supported, xpoid_att_default_medium)) - { - XpOidMediumSS* msss; - const char* value_in; - XpOid value_size; - - msss = XpGetMediumSSAttr(pContext, XPPrinterAttr, - xpoid_att_medium_source_sizes_supported, - (const XpOidList*)NULL, - (const XpOidList*)NULL); - value_in = XpGetStringAttr(pContext, pool, xpoid_att_default_medium); - value_size = XpOidFromString(value_in); - if(!XpOidMediumSSHasSize(msss, value_size)) - value_size = xpoid_none; - XpPutOidAttr(pContext, pool, xpoid_att_default_medium, value_size); - XpOidMediumSSDelete(msss); - } - /* - * document-format - */ - if(XpOidListHasOid(attrs_supported, xpoid_att_document_format)) - { - XpOidDocFmtList* document_formats_supported; - const char* value_in; - XpOidDocFmt* document_format; - const char* value_out; - - document_formats_supported = - XpGetDocFmtListAttr(pContext, XPPrinterAttr, - xpoid_att_document_formats_supported, - vpr->valid_document_formats_supported); - value_in = XpGetStringAttr(pContext, pool, xpoid_att_document_format); - document_format = XpOidDocFmtNew(value_in); - if(XpOidDocFmtListHasFmt(document_formats_supported, document_format)) - value_out = XpOidDocFmtString(document_format); - else - value_out = XpOidDocFmtString(vpr->default_document_format); - XpOidDocFmtListDelete(document_formats_supported); - XpOidDocFmtDelete(document_format); - XpPutStringAttr(pContext, pool, xpoid_att_document_format, value_out); - XpOidFree(value_out); - } - /* - * plex - */ - if(XpOidListHasOid(attrs_supported, xpoid_att_plex)) - { - XpOidList* plexes_supported; - plexes_supported = - XpGetListAttr(pContext, XPPrinterAttr, xpoid_att_plexes_supported, - vpr->valid_plexes_supported); - XpValidateOidAttr(pContext, pool, xpoid_att_plex, - plexes_supported, xpoid_none); - XpOidListDelete(plexes_supported); - } - /* - * xp-listfonts-modes - */ - if(XpOidListHasOid(attrs_supported, xpoid_att_xp_listfonts_modes)) - { - XpOidList* xp_listfonts_modes_supported; - xp_listfonts_modes_supported = - XpGetListAttr(pContext, XPPrinterAttr, - xpoid_att_xp_listfonts_modes_supported, - vpr->valid_xp_listfonts_modes_supported); - XpValidateListAttr(pContext, pool, xpoid_att_xp_listfonts_modes, - xp_listfonts_modes_supported, - (const XpOidList*)NULL); - XpOidListDelete(xp_listfonts_modes_supported); - } - /* - * available-compressions - */ - if(XpOidListHasOid(attrs_supported, xpoid_att_available_compression)) - { - XpOidList* available_compressions_supported; - available_compressions_supported = - XpGetListAttr(pContext, XPPrinterAttr, - xpoid_att_available_compressions_supported, - vpr->valid_available_compressions_supported); - XpValidateOidAttr(pContext, pool, xpoid_att_available_compression, - available_compressions_supported, xpoid_none); - XpOidListDelete(available_compressions_supported); - } -} - -void -XpValidateDocumentPool(XpContextPtr pContext, - const XpValidatePoolsRec* vpr) -{ - XpOidList* document_attrs_supported; - /* - * only validate attributes found in document-attributes-supported - */ - document_attrs_supported = - XpGetListAttr(pContext, XPPrinterAttr, - xpoid_att_document_attributes_supported, - (const XpOidList*)NULL); - /* - * validate - */ - XpValidateDocOrPagePool(pContext, XPDocAttr, - document_attrs_supported, vpr); - /* - * clean up - */ - XpOidListDelete(document_attrs_supported); -} - -void -XpValidatePagePool(XpContextPtr pContext, - const XpValidatePoolsRec* vpr) -{ - XpOidList* page_attrs_supported; - /* - * only validate attributes found in xp-page-attributes-supported - */ - page_attrs_supported = - XpGetListAttr(pContext, XPPrinterAttr, - xpoid_att_xp_page_attributes_supported, - (const XpOidList*)NULL); - /* - * validate - */ - XpValidateDocOrPagePool(pContext, XPPageAttr, - page_attrs_supported, vpr); - /* - * clean up - */ - XpOidListDelete(page_attrs_supported); -} - -void -XpValidateAttributePool(XpContextPtr pContext, - XPAttributes pool, - const XpValidatePoolsRec* vpr) -{ - switch(pool) - { - case XPPrinterAttr: - XpValidatePrinterPool(pContext, vpr); - break; - - case XPDocAttr: - XpValidateDocumentPool(pContext, vpr); - break; - - case XPJobAttr: - XpValidateJobPool(pContext, vpr); - break; - - case XPPageAttr: - XpValidatePagePool(pContext, vpr); - break; - - default: - break; - } -} diff --git a/nx-X11/programs/Xserver/Xprint/AttrValid.h b/nx-X11/programs/Xserver/Xprint/AttrValid.h deleted file mode 100644 index 440bea06f..000000000 --- a/nx-X11/programs/Xserver/Xprint/AttrValid.h +++ /dev/null @@ -1,216 +0,0 @@ -/* $Xorg: AttrValid.h,v 1.4 2001/03/14 18:43:40 pookie Exp $ */ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifndef _Xp_AttrValid_h -#define _Xp_AttrValid_h - -#include -#include "Oid.h" - -#define XpNumber(a) (sizeof(a) / sizeof(*(a))) - -/* - * Attribute pool validation valid values and defaults - */ -typedef struct -{ - XpOidList* valid_content_orientations_supported; - XpOidList* default_content_orientations_supported; - - XpOidDocFmtList* valid_document_formats_supported; - XpOidDocFmtList* default_document_formats_supported; - - XpOidList* valid_input_trays; - XpOidList* valid_medium_sizes; - - XpOidList* valid_plexes_supported; - XpOidList* default_plexes_supported; - - XpOidCardList* valid_printer_resolutions_supported; - XpOidCardList* default_printer_resolutions_supported; - - XpOidDocFmtList* valid_xp_embedded_formats_supported; - XpOidDocFmtList* default_xp_embedded_formats_supported; - - XpOidList* valid_xp_listfonts_modes_supported; - XpOidList* default_xp_listfonts_modes_supported; - - XpOidDocFmtList* valid_xp_raw_formats_supported; - XpOidDocFmtList* default_xp_raw_formats_supported; - - XpOidList* valid_xp_setup_proviso; - - XpOidDocFmt* default_document_format; - XpOidList* valid_available_compressions_supported; - XpOidList* default_available_compressions_supported; - -} XpValidatePoolsRec; - -/* - * XpOid resource access - */ -#define XpGetStringAttr(pContext, pool, oid) \ - (const char*)XpGetOneAttribute(pContext, pool, (char*)XpOidString(oid)) -#define XpPutStringAttr(pContext, pool, oid, value) \ - XpPutOneAttribute(pContext, pool, XpOidString(oid), value) - -#ifdef _XP_PRINT_SERVER_ /* needed for XpContextPtr in Printstr.h */ - -/* - * XpOid-valued attribute access - */ -XpOid XpGetOidAttr(XpContextPtr pContext, - XPAttributes pool, - XpOid oid, - const XpOidList* valid_oid_list); -void XpPutOidAttr(XpContextPtr pContext, - XPAttributes pool, - XpOid oid, - XpOid value_oid); -void XpValidateOidAttr(XpContextPtr pContext, - XPAttributes pool, - XpOid oid, - const XpOidList* valid_oids, - XpOid default_oid); -/* - * cardinal-valued attribute access - */ -unsigned long XpGetCardAttr(XpContextPtr pContext, - XPAttributes pool, - XpOid oid, - const XpOidCardList* valid_card_list); -void XpPutCardAttr(XpContextPtr pContext, - XPAttributes pool, - XpOid oid, - unsigned long value_card); -void XpValidateCardAttr(XpContextPtr pContext, - XPAttributes pool, - XpOid oid, - const XpOidCardList* valid_cards, - unsigned long default_card); -/* - * XpOidList-valued attribute access - */ -XpOidList* XpGetListAttr(XpContextPtr pContext, - XPAttributes pool, - XpOid oid, - const XpOidList* valid_oid_list); -void XpPutListAttr(XpContextPtr pContext, - XPAttributes pool, - XpOid oid, - const XpOidList* list); -void XpValidateListAttr(XpContextPtr pContext, - XPAttributes pool, - XpOid oid, - const XpOidList* valid_oids, - const XpOidList* default_oids); -/* - * XpOidCardList-valued attribute access - */ -XpOidCardList* XpGetCardListAttr(XpContextPtr pContext, - XPAttributes pool, - XpOid oid, - const XpOidCardList* valid_card_list); -void XpPutCardListAttr(XpContextPtr pContext, - XPAttributes pool, - XpOid oid, - const XpOidCardList* list); -void XpValidateCardListAttr(XpContextPtr pContext, - XPAttributes pool, - XpOid oid, - const XpOidCardList* valid_cards, - const XpOidCardList* default_cards); -/* - * XpOidDocFmtList-valued attribute access - */ -XpOidDocFmtList* XpGetDocFmtListAttr(XpContextPtr pContext, - XPAttributes pool, - XpOid oid, - const XpOidDocFmtList* valid_fmt_list); -void XpPutDocFmtListAttr(XpContextPtr pContext, - XPAttributes pool, - XpOid oid, - const XpOidDocFmtList* list); -void XpValidateDocFmtListAttr(XpContextPtr pContext, - XPAttributes pool, - XpOid oid, - const XpOidDocFmtList* valid_fmts, - const XpOidDocFmtList* default_fmts); -/* - * XpOidMediumSS-valued attribute access - */ -XpOidMediumSS* XpGetMediumSSAttr(XpContextPtr pContext, - XPAttributes pool, - XpOid oid, - const XpOidList* valid_trays, - const XpOidList* valid_sizes); -void XpPutMediumSSAttr(XpContextPtr pContext, - XPAttributes pool, - XpOid oid, - const XpOidMediumSS* msss); -const XpOidMediumSS* XpGetDefaultMediumSS(); - -/* - * XpOidTrayMediumList-valued attribute access - */ -XpOidTrayMediumList* XpGetTrayMediumListAttr(XpContextPtr pContext, - XPAttributes pool, - XpOid oid, - const XpOidList* valid_trays, - const XpOidMediumSS* msss); -void XpPutTrayMediumListAttr(XpContextPtr pContext, - XPAttributes pool, - XpOid oid, - const XpOidTrayMediumList* tm); -/* - * Attribute pool validation - */ -void XpValidateAttributePool(XpContextPtr pContext, - XPAttributes pool, - const XpValidatePoolsRec* vpr); -void XpValidatePrinterPool(XpContextPtr pContext, - const XpValidatePoolsRec* vpr); -void XpValidateJobPool(XpContextPtr pContext, - const XpValidatePoolsRec* vpr); -void XpValidateDocumentPool(XpContextPtr pContext, - const XpValidatePoolsRec* vpr); -void XpValidatePagePool(XpContextPtr pContext, - const XpValidatePoolsRec* vpr); - -#endif /* _XP_PRINT_SERVER_ */ - -#endif /* _Xp_AttrValid_h - don't add anything after this line */ diff --git a/nx-X11/programs/Xserver/Xprint/DiPrint.h b/nx-X11/programs/Xserver/Xprint/DiPrint.h deleted file mode 100644 index a26477971..000000000 --- a/nx-X11/programs/Xserver/Xprint/DiPrint.h +++ /dev/null @@ -1,81 +0,0 @@ -/* $Xorg: DiPrint.h,v 1.3 2000/08/17 19:48:04 cpqbld Exp $ */ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ -/* - * The XpDiListEntry struct is the type of each element of the array - * handed back to the extension code to handle a GetPrinterList request. - * We don't use the printerDb directly because of the desire to handle - * multiple locales. Creating this new array for each GetPrinterList - * request will allow us to build it with the description in the locale of - * the requesting client. - */ -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifndef _XpDiPrint_H_ -#define _XpDiPrint_H_ 1 - -#include "scrnintstr.h" - -typedef struct _diListEntry { - char *name; - char *description; - char *localeName; - unsigned long rootWinId; -} XpDiListEntry; - -extern void XpDiFreePrinterList(XpDiListEntry **list); - -extern XpDiListEntry **XpDiGetPrinterList( - int nameLen, - char *name, - int localeLen, - char *locale); - -extern char * XpDiGetDriverName(int index, char *printerName); - -extern WindowPtr XpDiValidatePrinter(char *printerName, int printerNameLen); - -extern int PrinterOptions(int argc, char **argv, int i); - -extern void PrinterUseMsg(void); - -extern void PrinterInitGlobals(void); - -extern void PrinterInitOutput(ScreenInfo *pScreenInfo, int argc, char **argv); - -extern void _XpVoidNoop(void); - -extern Bool _XpBoolNoop(void); - -#endif /* _XpDiPrint_H_ */ diff --git a/nx-X11/programs/Xserver/Xprint/Imakefile b/nx-X11/programs/Xserver/Xprint/Imakefile deleted file mode 100644 index 0e66bf55d..000000000 --- a/nx-X11/programs/Xserver/Xprint/Imakefile +++ /dev/null @@ -1,135 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.4 2001/03/14 18:44:11 pookie Exp $ -#include - -#ifndef XpRasterDDX -#define XpRasterDDX YES -#endif -#ifndef XpColorPclDDX -#define XpColorPclDDX YES -#endif -#ifndef XpMonoPclDDX -#define XpMonoPclDDX NO -#endif -#ifndef XpPostScriptDDX -#define XpPostScriptDDX YES -#endif - -SRCS1 = Init.c Quarks.c spooler.c attributes.c Util.c mediaSizes.c \ - Oid.c AttrValid.c - -OBJS1 = Init.o Quarks.o spooler.o attributes.o Util.o mediaSizes.o \ - Oid.o AttrValid.o - -#ifdef OS2Architecture -SRCS_OS2 = os2_stubs.c -OBJS_OS2 = os2_stubs.o -#endif - -#if XprtServer -#if PrintOnlyServer || defined(PrintServerExtensions) -#if PrintOnlyServer -PO_DEFINES = -DPRINT_ONLY_SERVER -#endif -#endif -#ifdef PrintServerExtensions -XPEXT_DEFINES = PrintServerExtensions -#else -XPEXT_DEFINES = $(EXT_DEFINES) -#endif -SRCS2 = ddxInit.c -OBJS2 = ddxInit.o -#endif - -SRCS3 = miinitext.c dpmsstubs.c -OBJS3 = miinitext.o dpmsstubs.o - -SRCS = $(SRCS1) $(SRCS2) $(SRCS3) $(SRCS_OS2) - -OBJS = $(OBJS1) $(OBJS_OS2) - -#if XpRasterDDX -RASTDIR = raster -RASTDEF = -DXPRASTERDDX -#endif -#if XpColorPclDDX -PCLDIR = pcl -PCLDEF = -DXPPCLDDX -#endif -#if XpMonoPclDDX -MPCLDIR = pcl-mono -MPCLDEF = -DXPMONOPCLDDX -#endif -#if XpPostScriptDDX -PSDIR = ps -PSDEF = -DXPPSDDX -#endif - -#if HasMkstemp -MKTMP_DEFINES = -DHAS_MKSTEMP -#endif - -#if XpRasterDDX || XpColorPclDDX || XpMonoPclDDX || XpPostScriptDDX - -SUBDIRS = $(RASTDIR) $(PCLDIR) $(MPCLDIR) $(PSDIR) etc -#define IHaveSubdirs - -#endif - - INCLUDES = -I$(XINCLUDESRC) -I. -I../mfb -I../mi -I../cfb \ - -I../include -I$(TOP)/include -I$(LIBSRC) \ - -I$(EXTINCSRC) -I$(FONTINCSRC) -I$(XLIBSRC) - - - LINTLIBS = $(TOP)/server/dix/llib-ldix.ln $(TOP)/server/os/llib-los.ln \ - $(TOP)/server/ddx/mfb/llib-lmfb.ln \ - $(TOP)/server/ddx/mi/llib-lmi.ln \ - $(TOP)/server/ddx/cfb/llib-lcfb.ln - -DEFINES = -DXPRINTDIR=\"$(XPRINTDIR)\" $(RASTDEF) $(PCLDEF) $(MPCLDEF) \ - $(PSDEF) $(MKTMP_DEFINES) -UXFree86LOADER -D_XP_PRINT_SERVER_ - -/* Go ahead: Call me paranoid ... */ -Makefiles:: - RemoveFiles(Quark.c Xlcint.h Xresource.h Xrm.c XrmI.h) - -LinkSourceFile(Quarks.c,$(XLIBSRC)) - -NormalLibraryObjectRule() - -#if XprtServer -all:: $(OBJS2) $(OBJS_OS2) $(OBJS3) -#endif - -NormalLibraryTarget(printer,$(OBJS)) -NormalLintTarget($(SRCS)) - -SpecialCObjectRule(ddxInit,$(ICONFIGFILES),$(PO_DEFINES) $(OS_DEFINES) $(EXT_DEFINES)) -#if XprtServer -LinkSourceFile(miinitext.c,$(SERVERSRC)/mi) -SpecialCObjectRule(miinitext,$(ICONFIGFILES), -DPRINT_ONLY_SERVER $(OS_DEFINES) $(XPEXT_DEFINES) -DXPRINT) -LinkSourceFile(dpmsstubs.c,$(SERVERSRC)/Xext) -LinkSourceFile(dpmsproc.h,$(SERVERSRC)/Xext) -SpecialCObjectRule(dpmsstubs,$(ICONFIGFILES),$(PO_DEFINES) $(OS_DEFINES) $(XPEXT_DEFINES) -DXPRINT) -#endif - -#ifdef OS2Architecture -LinkSourceFile(os2_stubs.c,../hw/xfree86/os-support/os2) -SpecialCObjectRule(os2_stubs,$(ICONFIGFILES),-DOS2NULLSELECT) -#endif - -#ifdef IHaveSubdirs -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) -MakeLintLibSubdirs($(SUBDIRS)) -#endif - -DependTarget() - -InstallManPage(Xprt,$(MANDIR)) - -#ifdef HasDocBookTools -all:: Xprt.man Xprt.html - -ConvertDocBookToManPage(Xprt.sgml, Xprt.man) -ConvertDocBookToHTML(Xprt.sgml, Xprt.html) -#endif /* HasDocBookTools */ diff --git a/nx-X11/programs/Xserver/Xprint/Init.c b/nx-X11/programs/Xserver/Xprint/Init.c deleted file mode 100644 index 0bc1cf39e..000000000 --- a/nx-X11/programs/Xserver/Xprint/Init.c +++ /dev/null @@ -1,1934 +0,0 @@ -/* $Xorg: Init.c,v 1.5 2001/03/07 17:31:33 pookie Exp $ */ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996-2004 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. -(c) Copyright 2003-2004 Roland Mainz - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ -/******************************************************************* -** -** ********************************************************* -** * -** * File: printer/Init.c -** * -** * Contents: -** * The InitOutput routine here would presumably -** * be called from the normal server's InitOutput -** * after all display screens have been added. -** * There is are ifdef'd routines suitable for -** * use in building a printer-only server. Turn -** * on the "PRINTER_ONLY_SERVER" define if this is -** * to be the only ddx-level driver. -** * -** * Copyright: Copyright 1993,1995 Hewlett-Packard Company -** * -** ********************************************************* -** -********************************************************************/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef __hpux -#include -#endif - -#include -#define NEED_EVENTS 1 -#include -#include - -#include "screenint.h" -#include "input.h" -#include "cursor.h" -#include "misc.h" -#include "windowstr.h" -#include "inputstr.h" - -#include "gcstruct.h" -#include -#include "errno.h" - -typedef char *XPointer; -#define HAVE_XPointer 1 - -#define Status int -#include - -#include "DiPrint.h" -#include "attributes.h" - -#include "os.h" -#include "spooler.h" - -static void GenericScreenInit( - int index, - ScreenPtr pScreen, - int argc, - char **argv); -static Bool InitPrintDrivers( - int index, - ScreenPtr pScreen, - int argc, - char **argv); - -/* - * The following two defines are used to build the name "X*printers", where - * the "*" is replaced by the display number. This is used to construct - * the name of the default printers configuration file if the -XpFile - * command line option was not specified. - */ -#define XNPRINTERSFILEPREFIX "/X" -#define XNPRINTERSFILESUFFIX "printers" -#define XPRINTERSFILENAME "Xprinters" - -#define MODELDIRNAME "/models" -#define FONTDIRNAME "/fonts" - -#ifdef XPRASTERDDX - -static -PixmapFormatRec RasterPixmapFormats[] = { - { 1, 1, BITMAP_SCANLINE_PAD } -}; -#define NUMRASTFORMATS (sizeof RasterPixmapFormats)/(sizeof RasterPixmapFormats[0]) - -#include "raster/Raster.h" - -#endif - -#ifdef XPPCLDDX - -static -PixmapFormatRec ColorPclPixmapFormats[] = { - { 1, 1, BITMAP_SCANLINE_PAD }, - { 8, 8, BITMAP_SCANLINE_PAD }, - { 24, 32, BITMAP_SCANLINE_PAD } -}; - -#define NUMCPCLFORMATS (sizeof ColorPclPixmapFormats)/(sizeof ColorPclPixmapFormats[0]) - -#endif - -#ifdef XPMONOPCLDDX - -static -PixmapFormatRec MonoPclPixmapFormats[] = { - { 1, 1, BITMAP_SCANLINE_PAD } -}; - -#define NUMMPCLFORMATS (sizeof MonoPclPixmapFormats)/(sizeof MonoPclPixmapFormats[0]) - -#endif - -#if defined(XPPCLDDX) || defined(XPMONOPCLDDX) -#include "pcl/Pcl.h" -#endif - -#ifdef XPPSDDX - -static -PixmapFormatRec PSPixmapFormats[] = { - { 1, 1, BITMAP_SCANLINE_PAD }, - { 8, 8, BITMAP_SCANLINE_PAD }, - { 12, 16, BITMAP_SCANLINE_PAD }, - { 14, 16, BITMAP_SCANLINE_PAD }, - { 16, 16, BITMAP_SCANLINE_PAD }, - { 24, 32, BITMAP_SCANLINE_PAD } -}; - -#define NUMPSFORMATS (sizeof PSPixmapFormats)/(sizeof PSPixmapFormats[0]) - -#include "ps/Ps.h" - -#endif - -/* - * The driverInitArray contains an entry for each driver the - * server knows about. Each element contains pointers to pixmap formats, the - * driver's initialization routine, and pointers to the driver's - * attribute validation rec, and/or a driver function which - * returns the maximum medium width&height, and maximum resolution - * given a printer name. Either the validation rec OR the dimension - * function can be NULL. If the function is non-NULL then it - * will be called, and will be passed the (possibly NULL) validation rec. - * If the function is NULL, then XpGetMaxWidthHeightRes() is called. - */ -typedef struct _driverInitRec { - char *driverName; - pBFunc initFunc; - XpValidatePoolsRec *pValRec; - pVFunc dimensionsFunc; - PixmapFormatRec *pFmts; - int numFmts; -} driverInitRec; - -static driverInitRec driverInits[] = { -#ifdef XPRASTERDDX - { - "XP-RASTER", - InitializeRasterDriver, - &RasterValidatePoolsRec, - (pVFunc) NULL, - RasterPixmapFormats, - NUMRASTFORMATS - }, -#endif -#ifdef XPPCLDDX - { - "XP-PCL-COLOR", - InitializeColorPclDriver, - &PclValidatePoolsRec, - (pVFunc) NULL, - ColorPclPixmapFormats, - NUMCPCLFORMATS - }, -#endif -#ifdef XPMONOPCLDDX - { - "XP-PCL-MONO", - InitializeMonoPclDriver, - &PclValidatePoolsRec, - (pVFunc) NULL, - MonoPclPixmapFormats, - NUMMPCLFORMATS - }, -#endif -#ifdef XPPSDDX - { - "XP-POSTSCRIPT", - InitializePsDriver, - &PsValidatePoolsRec, - (pVFunc) NULL, - PSPixmapFormats, - NUMPSFORMATS - }, -#endif -}; - - -/* - * The printerDb variable points to a list of PrinterDbEntry structs - * which map printer names with screen numbers and driver names. - */ -typedef struct _printerDbEntry { - struct _printerDbEntry *next; - char *name; - char *qualifier; - int screenNum; - char *driverName; - char *desc; -} PrinterDbEntry, *PrinterDbPtr; - -static PrinterDbPtr printerDb = (PrinterDbPtr)NULL; - -/* - * The nameMap is a list used in initializing the attribute store - * for each printer. The list is freed once the printerDb is built - * and the attribute stores for all printers have been initialized. - */ -typedef struct _nameMapEntry { - struct _nameMapEntry *next; - char *name; - char *qualifier; -} NameMapEntry, *NameMapPtr; - -static NameMapPtr nameMap = (NameMapPtr)NULL; - -/* - * The driverMap is a list which provides the mapping between driver names - * and screen numbers. It is built and used - * by RehashPrinterList to correctly fill in the screenNum field in the - * printerDb entries. The list is freed before RehashPrinterList terminates. - */ -typedef struct _driverMapping { - struct _driverMapping *next; - char *driverName; - int screenNum; -} DriverMapEntry, *DriverMapPtr; - -static const char configFilePath[] = -"/etc/dt/config/print:/usr/dt/config/print"; - -static const char printServerConfigDir[] = "XPSERVERCONFIGDIR"; - -static int printScreenPrivIndex, - printWindowPrivIndex, - printGCPrivIndex; -static unsigned long printGeneration = 0; -static char *configFileName = (char *)NULL; -static Bool freeDefaultFontPath = FALSE; -static char *origFontPath = (char *)NULL; - -static Bool xprintInitGlobalsCalled = FALSE; -/* - * This function is responsible for doing initalisation of any global - * variables at an very early point of server startup (even before - * |ProcessCommandLine()|. - */ -void PrinterInitGlobals(void) -{ - extern char dispatchExceptionAtReset; /* defined in Xserver/dix/dispatch.c */ - - xprintInitGlobalsCalled = TRUE; - -#ifdef DAMAGE - /* Disable DAMAGE extension for now as it does not work with - * the Postscript DDX yet (see - * https://bugs.freedesktop.org/show_bug.cgi?id=1660) ... - * (you can enable the DAMAGE extension explicitly via - * % X +extension DAMAGE ... #) ;-( */ - { - extern Bool noDamageExtension; - noDamageExtension = TRUE; - } -#endif /* DAMAGE */ - -#ifdef SMART_SCHEDULE - /* Somehow the XF86 "smart scheduler" completely kills the Xprint DDX - * (see http://xprint.freedesktop.org/cgi-bin/bugzilla/show_bug.cgi?id=467 - * ("Xfree86's "smart scheduler" breaks Xprt") */ - SmartScheduleDisable = TRUE; -#endif /* SMART_SCHEDULE */ - - /* Disable internal screensaver for Xprint (workaround for - * http://pdx.freedesktop.org/cgi-bin/bugzilla/show_bug.cgi?id=567 ("Xorg - * Xprt starts to consume 100% CPU when being idle for some time")) */ - defaultScreenSaverTime = 0; - - /* Ensure that the maximum request size for the BIGREQUESTS extension - * is at least 8MB (see - * http://xprint.freedesktop.org/cgi-bin/bugzilla/show_bug.cgi?id=622 - "RFE: - * Xprt's default BIGREQUESTS extension buffer size should be 8MB") - */ - maxBigRequestSize = (8*1048576)-1; - - /* Xprt should not reset by default when the last client exists - * (default for Xprt is |0|, video Xservers use |DE_RESET|) */ - dispatchExceptionAtReset = 0; -} - -/* - * PrinterUseMsg() prints usage for the Xprint-specific options - */ -void PrinterUseMsg(void) -{ - XpSpoolerTypePtr curr = xpstm; - - /* Option '-XpFile' */ - ErrorF("-XpFile file specifies an alternate `Xprinters' file, rather\n"); - ErrorF(" than the default one (e.g.\n"); - ErrorF(" `${XPCONFIGDIR}/${LANG}/print/Xprinters') or\n"); - ErrorF(" `${XPCONFIGDIR}/C/print/Xprinters'.\n"); - - /* Option '-XpSpoolerType' */ - ErrorF("-XpSpoolerType string specifies a spooler type.\n"); - ErrorF(" Supported values are:\n"); - - while( curr->name != NULL ) - { - ErrorF(" - '%s'\n", curr->name); - curr++; - } - ErrorF(" (multiple values can be specified, seperated by ':',\n"); - ErrorF(" the first active spooler will be chosen).\n"); - ErrorF(" default is '%s'.\n", XPDEFAULTSPOOLERNAMELIST); -} - -/* - * PrinterOptions checks argv[i] to see if it is our command line - * option specifying a configuration file name. It returns the index - * of the next option to process. - */ -int -PrinterOptions( - int argc, - char **argv, - int i) -{ - extern void ddxUseMsg(); - if(strcmp(argv[i], "-XpFile") == 0) - { - if ((i + 1) >= argc) { - ddxUseMsg (); - return i + 2; - } - configFileName = argv[i + 1]; - return i + 2; - } - else if(strcmp(argv[i], "-XpSpoolerType") == 0) - { - if ((i + 1) >= argc) { - ddxUseMsg (); - return i + 2; - } - XpSetSpoolerTypeNameList(argv[i + 1]); - return i + 2; - } - else - { - return i; - } -} - -/************************************************************ - * GetInitFunc -- - * - * This routine is called from the InitPrintDrivers function. - * Given the name of a driver, return a pointer to the driver's - * initialization function. - * - * Results: - * Returns a pointer to the initialization function for the driver. - * - * - ************************************************************/ - -/* -typedef Bool (*pIFunc)(); -static pIFunc -GetInitFunc(driverName) -*/ - -static pBFunc GetInitFunc(char *driverName) -{ - driverInitRec *pInitRec; - int numDrivers = sizeof(driverInits)/sizeof(driverInitRec); - int i; - - for(pInitRec = driverInits, i = 0; i < numDrivers; pInitRec++, i++) - { - if( !strcmp( driverName, pInitRec->driverName ) ) - return pInitRec->initFunc; - } - - return 0; -} - -static void -GetDimFuncAndRec( - char *driverName, - XpValidatePoolsRec **pValRec, - pVFunc *dimensionsFunc) -{ - driverInitRec *pInitRec; - int numDrivers = sizeof(driverInits)/sizeof(driverInitRec); - int i; - - for(pInitRec = driverInits, i = 0; i < numDrivers; pInitRec++, i++) - { - if( !strcmp( driverName, pInitRec->driverName ) ) - { - *dimensionsFunc = pInitRec->dimensionsFunc; - *pValRec = pInitRec->pValRec; - return ; - } - } - - *dimensionsFunc = 0; - *pValRec = 0; - return; -} - -static void -FreePrinterDb(void) -{ - PrinterDbPtr pCurEntry, pNextEntry; - - for(pCurEntry = printerDb, pNextEntry = (PrinterDbPtr)NULL; - pCurEntry != (PrinterDbPtr)NULL; pCurEntry = pNextEntry) - { - pNextEntry = pCurEntry->next; - if(pCurEntry->name != (char *)NULL) - xfree(pCurEntry->name); - if(pCurEntry->desc != (char *)NULL) - xfree(pCurEntry->desc); - /* - * We don't free the driver name, because it's expected to simply - * be a pointer into the xrm database. - */ - xfree(pCurEntry); - } - printerDb = (PrinterDbPtr)NULL; -} - -/* - * AddPrinterDbName allocates an entry in the printerDb list, and - * initializes the "name". It returns TRUE if the element was - * successfully added, and FALSE if an allocation error ocurred. - * XXX AddPrinterDbName needs to check for (and not add) duplicate names. - */ -static Bool -AddPrinterDbName(char *name, char *desc) -{ - PrinterDbPtr pEntry = (PrinterDbPtr)xalloc(sizeof(PrinterDbEntry)); - - if(pEntry == (PrinterDbPtr)NULL) return FALSE; - pEntry->name = (name != NULL) ? strdup(name) : NULL; - pEntry->desc = (desc != NULL) ? strdup(desc) : NULL; - pEntry->qualifier = (char *)NULL; - - if(printerDb == (PrinterDbPtr)NULL) - { - pEntry->next = (PrinterDbPtr)NULL; - printerDb = pEntry; - } - else - { - pEntry->next = printerDb; - printerDb = pEntry; - } - return TRUE; -} - -static int -AugmentPrinterDb(const char *command) -{ - FILE *fp; - char name[256]; - int num_printers = 0; /* Number of printers we found */ - size_t namelen; - char *desc = NULL; - - fp = popen(command, "r"); - /* XXX is a 256 character limit overly restrictive for printer names? */ - while(fgets(name, 256, fp) != (char *)NULL && (namelen=strlen(name))) - { - char *option = name; - - name[namelen-1] = (char)'\0'; /* strip the \n */ - -#define XP_DESCRIPTOR "xp-printerattr.descriptor=" -#define XP_DESCRIPTOR_LEN (sizeof(XP_DESCRIPTOR)-1) - while ((option = strchr(option, '\t'))) { - option++; /* Skip the '\t' */ - if (!strncmp(option, XP_DESCRIPTOR, XP_DESCRIPTOR_LEN)) { - *(option-1) = '\0'; /* Kill the '\t' (only if we found a valid option) */ - option += XP_DESCRIPTOR_LEN; - if (*option != '\0') { - desc = option; - } - } - else - { - /* Unknown option */ - ErrorF("AugmentPrinterDb: Unknown option '%s'\n", option); - } - } - AddPrinterDbName(name, desc); - num_printers++; - } - pclose(fp); - return num_printers; -} - -/* - * FreeNameMap frees all remaining memory associated with the nameMap. - */ -static void -FreeNameMap(void) -{ - NameMapPtr pEntry, pTmp; - - for(pEntry = nameMap, pTmp = (NameMapPtr)NULL; - pEntry != (NameMapPtr)NULL; - pEntry = pTmp) - { - if(pEntry->name != (char *)NULL) - xfree(pEntry->name); - if(pEntry->qualifier != (char *)NULL) - xfree(pEntry->qualifier); - pTmp = pEntry->next; - xfree(pEntry); - } - nameMap = (NameMapPtr)NULL; -} - -/* - * AddNameMap adds an element to the nameMap linked list. - */ -static Bool -AddNameMap(char *name, char *qualifier) -{ - NameMapPtr pEntry; - - if((pEntry = (NameMapPtr)xalloc(sizeof(NameMapEntry))) == (NameMapPtr)NULL) - return FALSE; - pEntry->name = name; - pEntry->qualifier = qualifier; - pEntry->next = nameMap; - nameMap = pEntry; - return TRUE; -} - -/* - * MergeNameMap - puts the "map" names (aka qualifiers, aliases) into - * the printerDb. This should be called once, after both the printerDb - * and nameMap lists are complete. When/if MergeNameMap finds a map for - * an entry in the printerDb, the qualifier is _moved_ (not copied) to - * the printerDb. This means that the qualifier pointer in the nameMap - * is NULLed out. - */ -static void -MergeNameMap(void) -{ - NameMapPtr pMap; - PrinterDbPtr pDb; - - for(pMap = nameMap; pMap != (NameMapPtr)NULL; pMap = pMap->next) - { - for(pDb = printerDb; pDb != (PrinterDbPtr)NULL; pDb = pDb->next) - { - if(!strcmp(pMap->name, pDb->name)) - { - pDb->qualifier = pMap->qualifier; - pMap->qualifier = (char *)NULL; - } - } - } -} - -/* - * CreatePrinterAttrs causes the attribute stores to be built for - * each printer in the printerDb. - */ -static void -CreatePrinterAttrs(void) -{ - PrinterDbPtr pDb; - - for(pDb = printerDb; pDb != (PrinterDbPtr)NULL; pDb = pDb->next) - { - XpBuildAttributeStore(pDb->name, (pDb->qualifier)? - pDb->qualifier : pDb->name); - } -} - -#ifdef XPPSDDX -#define defaultDriver "XP-POSTSCRIPT" -#else -#ifdef XPPCLDDX -#define defaultDriver "XP-PCL-COLOR" -#else -#ifdef XPMONOPCLDDX -#define defaultDriver "XP-PCL-MONO" -#else -#define defaultDriver "XP-RASTER" -#endif -#endif -#endif - -/* - * StoreDriverNames - queries the attribute store for the ddx-identifier. - * if the ddx-identifier is not in the attribute database, then a default - * ddx-identifier is store in both the attribute store for the printer, - * and in the printerDb. - * The ddx-identifier is stored in the printerDb for use in initializing - * the screens. - */ -static void -StoreDriverNames(void) -{ - PrinterDbPtr pEntry; - - for(pEntry = printerDb; pEntry != (PrinterDbPtr)NULL; - pEntry = pEntry->next) - { - pEntry->driverName = (char*)XpGetPrinterAttribute(pEntry->name, - "xp-ddx-identifier"); - if(pEntry->driverName == (char *)NULL || - strlen(pEntry->driverName) == 0 || - GetInitFunc(pEntry->driverName) == (Bool(*)())NULL) - { - if (pEntry->driverName && (strlen(pEntry->driverName) != 0)) { - ErrorF("Xp Extension: Can't load driver %s\n", - pEntry->driverName); - ErrorF(" init function missing\n"); - } - - pEntry->driverName = defaultDriver; - XpAddPrinterAttribute(pEntry->name, - (pEntry->qualifier != (char *)NULL)? - pEntry->qualifier : pEntry->name, - "*xp-ddx-identifier", pEntry->driverName); - } - } -} - -/* - * StoreDescriptors - queries the attribute store for the descriptor. - * if the descriptor is not in the attribute database, then the descriptor - * from the printerDb is store in the attribute store for the printer. - */ -static void -StoreDescriptors() -{ - PrinterDbPtr pEntry; - - for(pEntry = printerDb; pEntry != (PrinterDbPtr)NULL; - pEntry = pEntry->next) - { - if (pEntry->desc != NULL) - { - XpAddPrinterAttribute(pEntry->name, - (pEntry->qualifier != (char *)NULL)? - pEntry->qualifier : pEntry->name, - "*descriptor", pEntry->desc); - } - } -} - -static char * -MbStrchr( - char *str, - int ch) -{ - size_t mbCurMax = MB_CUR_MAX; - wchar_t targetChar, curChar; - char tmpChar; - int i, numBytes, byteLen; - - if(mbCurMax <= 1) return strchr(str, ch); - - tmpChar = (char)ch; - mbtowc(&targetChar, &tmpChar, mbCurMax); - for(i = 0, numBytes = 0, byteLen = strlen(str); i < byteLen; i += numBytes) - { - numBytes = mbtowc(&curChar, &str[i], mbCurMax); - if(curChar == targetChar) return &str[i]; - } - return (char *)NULL; -} - -/* - * GetConfigFileName - Looks for a "Xprinters" file in - * $(XPRINTDIR)/$LANG/print, and then in $(XPRINTDIR)/C/print. If it - * finds such a file, it returns the path to the file. The returned - * string must be freed by the caller. - */ -static char * -GetConfigFileName(void) -{ - /* - * We need to find the system-wide file, if one exists. This - * file can be in either $(XPRINTDIR)/$LANG/print, or in - * $(PRINTDIR)/C/print, and the file itself is named "Xprinters". - */ - char *dirName, *filePath; - - /* - * Check for a LANG-specific file. - */ - if((dirName = XpGetConfigDir(TRUE))) - { - filePath = (char *)xalloc(strlen(dirName) + - strlen(XPRINTERSFILENAME) + 2); - - if(filePath == (char *)NULL) - { - xfree(dirName); - return (char *)NULL; - } - - sprintf(filePath, "%s/%s", dirName, XPRINTERSFILENAME); - xfree(dirName); - if(access(filePath, R_OK) == 0) - return filePath; - - xfree(filePath); - } - - if((dirName = XpGetConfigDir(FALSE))) - { - filePath = (char *)xalloc(strlen(dirName) + - strlen(XPRINTERSFILENAME) + 2); - if(filePath == (char *)NULL) - { - xfree(dirName); - return (char *)NULL; - } - sprintf(filePath, "%s/%s", dirName, XPRINTERSFILENAME); - xfree(dirName); - if(access(filePath, R_OK) == 0) - return filePath; - xfree(filePath); - } - return (char *)NULL; -} - -/* - * BuildPrinterDb - reads the config file if it exists, and if necessary - * executes a command such as lpstat to generate a list of printers. - * XXX - * XXX BuildPrinterDb must be rewritten to allow 16-bit characters in - * XXX printer names. The will involve replacing the use of strtok() and its - * XXX related functions. - * XXX At the same time, BuildPrinterDb and it's support routines should have - * XXX allocation error checking added. - * XXX - */ -static PrinterDbPtr -BuildPrinterDb(void) -{ - char *printerList, *augmentCmd = (char *)NULL; - Bool defaultAugment = TRUE, freeConfigFileName; - - if(configFileName && access(configFileName, R_OK) != 0) - { - ErrorF("Xp Extension: Can't open file %s\n", configFileName); - } - if(!configFileName && (configFileName = GetConfigFileName())) - freeConfigFileName = TRUE; - else - freeConfigFileName = FALSE; - - if(configFileName != (char *)NULL && access(configFileName, R_OK) == 0) - { - char line[256]; - FILE *fp = fopen(configFileName, "r"); - - while(fgets(line, 256, fp) != (char *)NULL) - { - char *tok, *ptr; - if((tok = strtok(line, " \t\012")) != (char *)NULL) - { - if(tok[0] == (char)'#') continue; - if(strcmp(tok, "Printer") == 0) - { - while((tok = strtok((char *)NULL, " \t")) != (char *)NULL) - { - if((ptr = MbStrchr(tok, '\012'))) - *ptr = (char)'\0'; - AddPrinterDbName(tok, NULL); - } - } - else if(strcmp(tok, "Map") == 0) - { - char *name, *qualifier; - - if((tok = strtok((char *)NULL, " \t\012")) == (char *)NULL) - continue; - name = strdup(tok); - if((tok = strtok((char *)NULL, " \t\012")) == (char *)NULL) - { - xfree(name); - continue; - } - qualifier = strdup(tok); - AddNameMap(name, qualifier); - } - else if(strcmp(tok, "Augment_Printer_List") == 0) - { - if((tok = strtok((char *)NULL, " \t\012")) == (char *)NULL) - continue; - - if(strcmp(tok, "%default%") == 0) - continue; - defaultAugment = FALSE; - if(strcmp(tok, "%none%") == 0) - continue; - AugmentPrinterDb(tok); - } - else - break; /* XXX Generate an error? */ - } - } - fclose(fp); - } - - if(defaultAugment == TRUE) - { - XpSpoolerTypePtr curr_spooler_type; /* spooler we are currently probing for queues */ - int num_printers_found; /* number of printers found by |AugmentPrinterDb()| */ - char *tok_lasts; /* strtok_r() position token */ - char *spnamelist; /* list of spooler names, seperated by ":" */ - char *spname; /* spooler name */ - - spnamelist = strdup(XpGetSpoolerTypeNameList()); /* strtok_r() modifies string so dup' it first */ - - for( spname = strtok_r(spnamelist, ":", &tok_lasts) ; - spname != NULL ; - spname = strtok_r(NULL, ":", &tok_lasts) ) - { - curr_spooler_type = XpSpoolerNameToXpSpoolerType(spname); - if(!curr_spooler_type) - { - FatalError("BuildPrinterDb: No spooler type entry found for '%s'.\n", spname); - } - - if(curr_spooler_type->list_queues_command == NULL || - strlen(curr_spooler_type->list_queues_command) == 0) - { - continue; - } - - num_printers_found = AugmentPrinterDb(curr_spooler_type->list_queues_command); - /* Did we found a spooler which works ? */ - if(num_printers_found > 0) - { - spooler_type = curr_spooler_type; -#ifdef DEBUG_gisburn - fprintf(stderr, "BuildPrinterDb: using '%s'.\n", spooler_type->name); -#endif /* DEBUG_gisburn */ - break; - } - } - - free(spnamelist); - } - - MergeNameMap(); - FreeNameMap(); - - /* Create the attribute stores for all printers */ - CreatePrinterAttrs(); - - /* - * Find the drivers for each printers, and store the driver names - * in the printerDb - */ - StoreDriverNames(); - StoreDescriptors(); - - if(freeConfigFileName) - { - xfree(configFileName); - configFileName = (char *)NULL; - } - - return printerDb; -} - -static void -FreeDriverMap(DriverMapPtr driverMap) -{ - DriverMapPtr pCurEntry, pNextEntry; - - for(pCurEntry = driverMap, pNextEntry = (DriverMapPtr)NULL; - pCurEntry != (DriverMapPtr)NULL; pCurEntry = pNextEntry) - { - pNextEntry = pCurEntry->next; - if(pCurEntry->driverName != (char *)NULL) - xfree(pCurEntry->driverName); - xfree(pCurEntry); - } -} - -/* - * XpRehashPrinterList rebuilds the list of printers known to the - * server. It first walks the printerDb to build a table mapping - * driver names and screen numbers, since this is not an easy mapping - * to change in the sample server. The normal configuration files are - * then read & parsed to create the new list of printers. Printers - * which require drivers other than those already initialized are - * deleted from the printerDb. This leaves attribute stores in place - * for inaccessible printers, but those stores will be cleaned up in - * the next rehash or server recycle. - */ -int -XpRehashPrinterList(void) -{ - PrinterDbPtr pEntry, pPrev; - DriverMapPtr driverMap = (DriverMapPtr)NULL, pDrvEnt; - int result; - - /* Build driverMap */ - for(pEntry = printerDb; pEntry != (PrinterDbPtr)NULL; pEntry = pEntry->next) - { - for(pDrvEnt = driverMap; pDrvEnt != (DriverMapPtr)NULL; - pDrvEnt = pDrvEnt->next) - { - if(!strcmp(pEntry->driverName, pDrvEnt->driverName)) - break; - } - - if(pDrvEnt != (DriverMapPtr)NULL) - continue; - - if((pDrvEnt = (DriverMapPtr)xalloc(sizeof(DriverMapEntry))) == - (DriverMapPtr)NULL) - { - FreeDriverMap(driverMap); - return BadAlloc; - } - pDrvEnt->driverName = strdup(pEntry->driverName); - pDrvEnt->screenNum = pEntry->screenNum; - pDrvEnt->next = driverMap; - driverMap = pDrvEnt; - } - - /* Free the old printerDb */ - FreePrinterDb(); - - /* Free/Rehash attribute stores */ - if((result = XpRehashAttributes()) != Success) - return result; - - /* Build a new printerDb */ - if(BuildPrinterDb() == (PrinterDbPtr)NULL) - return BadAlloc; - - /* Walk PrinterDb & either store screenNum, or delete printerDb entry */ - for(pEntry = printerDb, pPrev = (PrinterDbPtr)NULL; - pEntry != (PrinterDbPtr)NULL; pEntry = pEntry->next) - { - for(pDrvEnt = driverMap; pDrvEnt != (DriverMapPtr)NULL; - pDrvEnt = pDrvEnt->next) - { - if(!strcmp(printerDb->driverName, pDrvEnt->driverName)) - break; - } - - /* - * Either store the screen number, or delete the printerDb entry. - * Deleting the entry leaves orphaned attribute stores, but they'll - * get cleaned up at the next rehash or server recycle. - */ - if(pDrvEnt != (DriverMapPtr)NULL) - { - pEntry->screenNum = pDrvEnt->screenNum; - pPrev = pEntry; - } - else { - if(pPrev) - pPrev->next = pEntry->next; - else - pPrev = pEntry->next; - if(pEntry->name != (char *)NULL) - xfree(pEntry->name); - xfree(pEntry); - pEntry = pPrev; - } - } - - FreeDriverMap(driverMap); - - return Success; -} - -/* - * ValidateFontDir looks for a valid font directory for the specified - * printer model within the specified configuration directory. It returns - * the directory name, or NULL if no valid font directory was found. - * It is the caller's responsibility to free the returned font directory - * name. - */ -static char * -ValidateFontDir( - char *configDir, - char *modelName) -{ - char *pathName; - - if(!configDir || !modelName) - return (char *)NULL; - - pathName = (char *)xalloc(strlen(configDir) + strlen(MODELDIRNAME) + - strlen(modelName) + strlen(FONTDIRNAME) + - strlen("fonts.dir") + 5); - if(!pathName) - return (char *)NULL; - sprintf(pathName, "%s/%s/%s/%s/%s", configDir, MODELDIRNAME, modelName, - FONTDIRNAME, "fonts.dir"); - if(access(pathName, R_OK) != 0) - { - xfree(pathName); - return (char *)NULL; - } - pathName[strlen(pathName) - 9] = (char)'\0'; /* erase fonts.dir */ - return pathName; -} - -/* - * FindFontDir returns a pointer to the path name of the font directory - * for the specified printer model name, if such a directory exists. - * The directory contents are superficially checked for validity. - * The caller must free the returned char *. - * - * We first look in the locale-specific model-config directory, and - * then fall back to the C language model-config directory. - */ -static char * -FindFontDir( - char *modelName) -{ - char *configDir, *fontDir; - - if(!modelName || !strlen(modelName)) - return (char *)NULL; - - configDir = XpGetConfigDir(TRUE); - if((fontDir = ValidateFontDir(configDir, modelName))) - { - xfree(configDir); - return fontDir; - } - - if(configDir) - xfree(configDir); - configDir = XpGetConfigDir(FALSE); - fontDir = ValidateFontDir(configDir, modelName); - - xfree(configDir); - - return fontDir; -} - -/* - * AddToFontPath adds the specified font path element to the global - * defaultFontPath string. It adds the keyword "PRINTER:" to the front - * of the path to denote that this is a printer-specific font path - * element. - */ -static char PATH_PREFIX[] = "PRINTER:"; -static int PATH_PREFIX_LEN = sizeof(PATH_PREFIX) - 1; /* same as strlen() */ - -static void -AddToFontPath( - char *pathName) -{ - char *newPath; - Bool freeOldPath; - - if(defaultFontPath == origFontPath) - freeOldPath = FALSE; - else - freeOldPath = TRUE; - - newPath = (char *)xalloc(strlen(defaultFontPath) + strlen(pathName) + - PATH_PREFIX_LEN + 2); - - sprintf(newPath, "%s%s,%s", PATH_PREFIX, pathName, defaultFontPath); - - if(freeOldPath) - xfree(defaultFontPath); - - defaultFontPath = newPath; - return; -} - -/* - * AugmentFontPath adds printer-model-specific font path elements to - * the front of the font path global variable "defaultFontPath" (dix/globals.c). - * We can't call SetFontPath() because the font code has not yet been - * initialized when InitOutput is called (from whence this routine is called). - * - * This utilizes the static variables origFontPath and - * freeDefaultFontPath to track the original contents of defaultFontPath, - * and to properly free the modified version upon server recycle. - */ -static void -AugmentFontPath(void) -{ - char *newPath, *modelID, **allIDs = (char **)NULL; - PrinterDbPtr pDb, pDbEntry; - int numModels, i; - - if(!origFontPath) - origFontPath = defaultFontPath; - - if(freeDefaultFontPath) - { - xfree(defaultFontPath); - defaultFontPath = origFontPath; - freeDefaultFontPath = FALSE; - } - - /* - * Build a list of printer models to check for internal fonts. - */ - for(pDbEntry = printerDb, numModels = 0; - pDbEntry != (PrinterDbPtr)NULL; - pDbEntry = pDbEntry->next) - { - modelID = - (char*)XpGetPrinterAttribute(pDbEntry->name, - "xp-model-identifier"); - - if(modelID && strlen(modelID) != 0) - { - /* look for current model in the list of allIDs */ - for(i = 0; i < numModels; i++) - { - if(!strcmp(modelID, allIDs[i])) - { - modelID = (char *)NULL; - break; - } - } - } - - /* - * If this printer's model-identifier isn't in the allIDs list, - * then add it to allIDs. - */ - if(modelID && strlen(modelID) != 0) - { - allIDs = (char **)xrealloc(allIDs, (numModels+2) * sizeof(char *)); - if(allIDs == (char **)NULL) - return; - allIDs[numModels] = modelID; - allIDs[numModels + 1] = (char *)NULL; - numModels++; - } - } - - /* for each model, check for a valid font directory, and add it to - * the front of defaultFontPath. - */ - for(i = 0; allIDs != (char **)NULL && allIDs[i] != (char *)NULL; i ++) - { - char *fontDir; - if((fontDir = FindFontDir(allIDs[i]))) - { - AddToFontPath(fontDir); - xfree(fontDir); - freeDefaultFontPath = TRUE; - } - } - - if(allIDs) - xfree(allIDs); - - return; -} - -/* - * XpClientIsBitmapClient is called by the font code to find out if - * a particular client should be granted access to bitmap fonts. - * This function works by - * calling XpContextOfClient (in Xserver/Xext/xprint.c) to determine - * the context associated with the client, and then queries the context's - * attributes to determine whether the bitmap fonts should be visible. - * It looks at the value of the xp-listfonts-modes document/page attribute to - * see if xp-list-glyph-fonts has been left out of the mode list. Only - * if the xp-listfonts-modes attribute exists, and it does not contain - * xp-list-glyph-fonts does this function return FALSE. In any other - * case the funtion returns TRUE, indicating that the bitmap fonts - * should be visible to the client. - */ -Bool -XpClientIsBitmapClient( - ClientPtr client) -{ - XpContextPtr pContext; - char *mode; - - if(!(pContext = XpContextOfClient(client))) - return TRUE; - - /* - * Check the page attributes, and if it's not defined there, then - * check the document attributes. - */ - mode = XpGetOneAttribute(pContext, XPPageAttr, "xp-listfonts-modes"); - if(!mode || !strlen(mode)) - { - mode = XpGetOneAttribute(pContext, XPDocAttr, "xp-listfonts-modes"); - if(!mode || !strlen(mode)) - return TRUE; - } - - if(!strstr(mode, "xp-list-glyph-fonts")) - return FALSE; - - return TRUE; -} - -/* - * XpClientIsPrintClient is called by the font code to find out if - * a particular client has set a context which references a printer - * which utilizes a particular font path. - * This function works by calling XpContextOfClient - * (in Xserver/Xext/xprint.c) to determine the context associated with - * the client and then looks at the value of the xp-listfonts-modes - * document/page attribute to see if xp-list-internal-printer-fonts has - * been left out of the mode list. - * If the xp-listfonts-modes attribute exists, and it does not contain - * xp-list-internal-printer-fonts this function returns FALSE. - * Otherwise it looks up the font directory for the context. The font - * directory is then compared with the directory specified in the - * FontPathElement which is passed in. - */ -Bool -XpClientIsPrintClient( - ClientPtr client, - FontPathElementPtr fpe) -{ - XpContextPtr pContext; - char *mode; - char *modelID, *fontDir; - - if(!(pContext = XpContextOfClient(client))) - return FALSE; - - /* - * Check the page attributes, and if it's not defined there, then - * check the document attributes. - */ - mode = XpGetOneAttribute(pContext, XPPageAttr, "xp-listfonts-modes"); - if(!mode || !strlen(mode)) - { - mode = XpGetOneAttribute(pContext, XPDocAttr, "xp-listfonts-modes"); - } - - if(mode && strlen(mode)) - { - if(!strstr(mode, "xp-list-internal-printer-fonts")) - return FALSE; - } - - if (!fpe) - return TRUE; - - modelID = XpGetOneAttribute(pContext, XPPrinterAttr, "xp-model-identifier"); - if(!modelID || !strlen(modelID)) - return FALSE; - - if(!(fontDir = FindFontDir(modelID))) - return FALSE; - - /* - * The grunge here is to ignore the PATH_PREFIX at the front of the - * fpe->name. - */ - if(fpe->name_length < PATH_PREFIX_LEN || - (strlen(fontDir) != (fpe->name_length - PATH_PREFIX_LEN)) || - strncmp(fontDir, fpe->name + PATH_PREFIX_LEN, - fpe->name_length - PATH_PREFIX_LEN)) - { - xfree(fontDir); - return FALSE; - } - xfree(fontDir); - return TRUE; -} - -static void -AddFormats(ScreenInfo *pScreenInfo, char *driverName) -{ - int i, j; - driverInitRec *pInitRec; - int numDrivers = sizeof(driverInits)/sizeof(driverInitRec); - PixmapFormatRec *formats; - int numfmts; - - for (pInitRec = driverInits, i = 0; i < numDrivers; pInitRec++, i++) - { - if ( !strcmp( driverName, pInitRec->driverName ) ) - break; - } - if (i >= numDrivers) - return; - formats = pInitRec->pFmts; - numfmts = pInitRec->numFmts; - for (i = 0; i < numfmts && pScreenInfo->numPixmapFormats < MAXFORMATS; i++) - { - for (j = 0; j < pScreenInfo->numPixmapFormats; j++) { - if (pScreenInfo->formats[j].depth == formats[i].depth && - pScreenInfo->formats[j].bitsPerPixel == formats[i].bitsPerPixel && - pScreenInfo->formats[j].scanlinePad == formats[i].scanlinePad) - break; - } - if (j == pScreenInfo->numPixmapFormats) { - pScreenInfo->formats[j] = formats[i]; - pScreenInfo->numPixmapFormats++; - } - } -} - -/************************************************************ - * PrinterInitOutput -- - * This routine is to be called from a ddx's InitOutput - * during the server startup initialization, and when - * the server is to be reset. The routine creates the - * screens associated with configured printers by calling - * dix:AddScreen. The configuration information comes from a - * database read from the X*printers file. - * - * Results: - * The array of ScreenRec pointers referenced by - * pScreenInfo->screen is increased by the addition - * of the printer screen(s), as is the value of - * pScreenInfo->numScreens. This is done via calls - * to AddScreen() in dix. - * - ************************************************************/ - -void -PrinterInitOutput( - ScreenInfo *pScreenInfo, - int argc, - char **argv) -{ - PrinterDbPtr pDb, pDbEntry; - int driverCount = 0, i; - char **driverNames; - char *configDir; - - /* This should NEVER happen, but... */ - if( !xprintInitGlobalsCalled ) - { - FatalError("Internal error: PrinterInitGlobals() not called."); - } -#ifdef SMART_SCHEDULE - /* |PrinterInitGlobals| should have set |SmartScheduleDisable| to - * |TRUE| - if not we will trigger this safeguard. */ - if( SmartScheduleDisable != TRUE ) - { - FatalError("Internal error: XF86 smart scheduler incompatible to Xprint DDX."); - } -#endif /* SMART_SCHEDULE */ - /* Safeguard for - * http://pdx.freedesktop.org/cgi-bin/bugzilla/show_bug.cgi?id=567 ("Xorg - * Xprt starts to consume 100% CPU when being idle for some time") - * |PrinterInitGlobals| should have set |defaultScreenSaverTime| to - * |0| - if not we will trigger this trap. */ - if( defaultScreenSaverTime != 0 ) - { - FatalError("Internal screen saver must be OFF for printing."); - } - - /* Print a warnung when the maximum request size of the BIGREQUESTS - * extension is smaller than 8MB (see - * http://xprint.freedesktop.org/cgi-bin/bugzilla/show_bug.cgi?id=622) - */ - if (maxBigRequestSize < (8*1048576)-1) { - ErrorF("Xp Extension: BIGREQUESTS max. request is currently %ld bytes " - ", recommemded minimum for Xprint is 8MB.\n", (long)maxBigRequestSize); - } - - /* - * this little test is just a warning at startup to make sure - * that the config directory exists. - * - * what this ugly looking if says is that if both ways of - * calling configDir works and both directories don't exist, - * then print an error saying we can't find the non-lang one. - */ - if (((configDir = XpGetConfigDir(TRUE)) != NULL) && - (access(configDir, F_OK) == 0)) - { - xfree(configDir); - } - else if (((configDir = XpGetConfigDir(FALSE)) != NULL) && - (access(configDir, F_OK) == 0)) - { - xfree(configDir); - } - else { - /* Refuse to start when we do not have our config dir... */ - FatalError("Xp Extension: could not find config dir %s\n", - configDir ? configDir : XPRINTDIR); - } - - if(printerDb != (PrinterDbPtr)NULL) - FreePrinterDb(); - - /* - * Calling BuildPrinterDb serves to build the printer database, - * and to initialize the attribute store for each printer. - * The driver can, if it so desires, modify the attribute - * store at a later time. - */ - if((pDb = BuildPrinterDb()) == (PrinterDbPtr)NULL) return; - - /* - * We now have to decide how many screens to initialize, and call - * AddScreen for each one. The printerDb must be properly initialized - * for at least one screen's worth of printers prior to calling AddScreen - * because InitPrintDrivers reads the printerDb to determine which - * driver(s) to init on a particular screen. - * We put each driver's printers on a different - * screen, and call AddScreen for each screen/driver pair. - */ - /* count the number of printers */ - for(pDbEntry = pDb, driverCount = 0; pDbEntry != (PrinterDbPtr)NULL; - pDbEntry = pDbEntry->next, driverCount++) - ; - /* - * Allocate memory for the worst case - a driver per printer - */ - driverNames = (char **)xalloc(sizeof(char *) * driverCount); - - /* - * Assign the driver for the first printer to the first screen - */ - pDb->screenNum = screenInfo.numScreens; - driverNames[0] = pDb->driverName; - driverCount = 1; - AddFormats(pScreenInfo, pDb->driverName); - - /* - * For each printer, look to see if its driver is already assigned - * to a screen, and if so copy that screen number into the printerDb. - * Otherwise, assign a new screen number to the driver for this - * printer. - */ - for(pDbEntry = pDb; pDbEntry != (PrinterDbPtr)NULL; - pDbEntry = pDbEntry->next) - { - Bool foundMatch; - - for(i = 0, foundMatch = FALSE; i < driverCount; i++) - { - if(!strcmp(driverNames[i], pDbEntry->driverName)) - { - foundMatch = TRUE; - pDbEntry->screenNum = screenInfo.numScreens + i; - break; - } - } - if(foundMatch == FALSE) - { - driverNames[driverCount] = pDbEntry->driverName; - pDbEntry->screenNum = screenInfo.numScreens + driverCount; - AddFormats(pScreenInfo, pDbEntry->driverName); - driverCount++; - } - } - - for(i = 0; i < driverCount; i++) - { - int curScreen = screenInfo.numScreens; - if(AddScreen(InitPrintDrivers, argc, argv) < 0) - { - PrinterDbPtr pPrev; - /* - * AddScreen failed, so we pull the associated printers - * from the list. - */ - ErrorF("Xp Extension: Could not add screen for driver %s\n", - driverNames[i]); - for(pPrev = pDbEntry = printerDb; pDbEntry != (PrinterDbPtr)NULL; - pDbEntry = pDbEntry->next) - { - if(pDbEntry->screenNum == curScreen) - { - if(pPrev == printerDb) - { - printerDb = pDbEntry->next; - pPrev = printerDb; - } - else - pPrev->next = pDbEntry->next; - - xfree(pDbEntry->name); - xfree(pDbEntry); - pDbEntry = pPrev; - } - else - { - if(pDbEntry->screenNum > curScreen) - pDbEntry->screenNum--; - pPrev = pDbEntry; - } - } - } - } - - xfree(driverNames); - - AugmentFontPath(); - - if(pScreenInfo->numScreens > MAXSCREENS) - { - ErrorF("The number of printer screens requested "); - ErrorF("exceeds the allowable limit of %d screens.\n", MAXSCREENS); - ErrorF("Please reduce the number of requested printers in your "); - ErrorF("\nX%sprinters file.", display); - ErrorF("Server exiting...\n"); - exit(-1); - } -} - -/* - * InitPrintDrivers is called from dix:AddScreen. It in turn calls the - * driver initialization routine for any and all drivers which are - * implicated in supporting printers on the particular screen number - * specified by the "index" parameter. The printerDb variable is used - * to determine which printers are to be associated with a particular - * screen. - */ -static Bool -InitPrintDrivers( - int index, - ScreenPtr pScreen, - int argc, - char **argv) -{ - PrinterDbPtr pDb, pDb2; - - GenericScreenInit(index, pScreen, argc, argv); - - for(pDb = printerDb; pDb != (PrinterDbPtr)NULL; pDb = pDb->next) - { - if(pDb->screenNum == index) - { - Bool callInit = TRUE; - for(pDb2 = printerDb; pDb2 != pDb; pDb2 = pDb2->next) - { - if(!strcmp(pDb->driverName, pDb2->driverName)) - { - callInit = FALSE; - break; - } - } - if(callInit == TRUE) - { - Bool (*initFunc)(); - initFunc = GetInitFunc(pDb->driverName); - if(initFunc(index, pScreen, argc, argv) == FALSE) - { - /* XXX - What do I do if the driver's init fails? */ - } - } - } - } - return TRUE; -} - -void -_XpVoidNoop(void) -{ - return; -} - -Bool -_XpBoolNoop(void) -{ - return TRUE; -} - -/* - * GenericScreenInit - The common initializations required by all - * printer screens and drivers. It sets the screen's cursor functions - * to Noops, and computes the maximum screen (i.e. medium) dimensions. - */ - -static void -GenericScreenInit( - int index, - ScreenPtr pScreen, - int argc, - char **argv) -{ - int i; - float fWidth, fHeight, maxWidth, maxHeight; - unsigned short width, height; - PrinterDbPtr pDb, pDb2; - int res, maxRes; - - /* - * Set the cursor ops to no-op functions. - */ - pScreen->DisplayCursor = (DisplayCursorProcPtr)_XpBoolNoop; - pScreen->RealizeCursor = (RealizeCursorProcPtr)_XpBoolNoop; - pScreen->UnrealizeCursor = (UnrealizeCursorProcPtr)_XpBoolNoop; - pScreen->SetCursorPosition = (SetCursorPositionProcPtr)_XpBoolNoop; - pScreen->ConstrainCursor = (ConstrainCursorProcPtr)_XpVoidNoop; - pScreen->CursorLimits = (CursorLimitsProcPtr)_XpVoidNoop; - pScreen->RecolorCursor = (RecolorCursorProcPtr)_XpVoidNoop; - - /* - * Find the largest paper size for all the printers on the given - * screen. - */ - maxRes = 0; - maxWidth = maxHeight = 0.0; - for( pDb = printerDb; pDb != (PrinterDbPtr)NULL; pDb = pDb->next) - { - if(pDb->screenNum == index) - { - - XpValidatePoolsRec *pValRec; - pVFunc dimensionsFunc; - - GetDimFuncAndRec(pDb->driverName, &pValRec, &dimensionsFunc); - if(dimensionsFunc != (pVFunc)NULL) - dimensionsFunc(pDb->name, pValRec, &fWidth, &fHeight, &res); - else - XpGetMaxWidthHeightRes(pDb->name, pValRec, &fWidth, - &fHeight, &res); - if( res > maxRes ) - maxRes = res; - if( fWidth > maxWidth ) - maxWidth = fWidth; - if( fHeight > maxHeight ) - maxHeight = fHeight; - } - } - - width = (unsigned short) (maxWidth * maxRes / 25.4); - height = (unsigned short) (maxHeight * maxRes / 25.4); - pScreen->width = pScreen->height = ( width > height ) ? width : - height; - - pScreen->mmWidth = pScreen->mmHeight = ( maxWidth > maxHeight ) ? - (unsigned short)(maxWidth + 0.5) : - (unsigned short)(maxHeight + 0.5); -} - -/* - * QualifyName - takes an unqualified file name such as X6printers and - * a colon-separated list of directory path names such as - * /etc/opt/dt:/opt/dt/config. - * - * Returns a fully qualified file path name such as /etc/opt/dt/X6printers. - * The returned value is malloc'd, and the caller is responsible for - * freeing the associated memory. - */ -static char * -QualifyName(fileName, searchPath) - char *fileName; - char *searchPath; -{ - char * curPath = searchPath; - char * nextPath; - char * chance; - FILE *pFile; - - if (fileName == NULL || searchPath == NULL) - return NULL; - - while (1) { - if ((nextPath = strchr(curPath, ':')) != NULL) - *nextPath = 0; - - chance = (char *)xalloc(strlen(curPath) + strlen(fileName) + 2); - sprintf(chance,"%s/%s",curPath,fileName); - - /* see if we can read from the file */ - if((pFile = fopen(chance, "r")) != (FILE *)NULL) - { - fclose(pFile); - /* ... restore the colon, .... */ - if (nextPath) - *nextPath = ':'; - - return chance; - } - - xfree(chance); - - if (nextPath == NULL) /* End of path list? */ - break; - - /* try the next path */ - curPath = nextPath + 1; - } - return NULL; -} - -/* - * FillPrinterListEntry fills in a single XpDiListEntry element with data - * derived from the supplied PrinterDbPtr element. - * - * XXX A smarter (i.e. future) version of this routine might inspect the - * XXX "locale" parameter and attempt to match the "description" and - * XXX "localeName" elements of the XpDiListEntry to the specified locale. - */ -static void -FillPrinterListEntry( - XpDiListEntry *pEntry, - PrinterDbPtr pDb, - int localeLen, - char *locale) -{ - static char *localeStr = (char *)NULL; - - if(localeStr == (char *)NULL) - localeStr = strdup(setlocale(LC_ALL, (const char *)NULL)); - - pEntry->name = pDb->name; - pEntry->description = - (char*)XpGetPrinterAttribute(pDb->name, "descriptor"); - pEntry->localeName = localeStr; - pEntry->rootWinId = WindowTable[pDb->screenNum]->drawable.id; -} - -/* - * GetPrinterListInfo fills in the XpDiListEntry struct pointed to by the - * parameter pEntry with the information regarding the printer specified - * by the name and nameLen parameters. The pointers placed in the - * XpDiListEntry structure MUST NOT be freed by the caller. They are - * pointers into existing long-lived databases. - * - */ -static Bool -GetPrinterListInfo( - XpDiListEntry *pEntry, - int nameLen, - char *name, - int localeLen, - char *locale) -{ - PrinterDbPtr pDb, pDb2; - - for(pDb = printerDb; pDb != (PrinterDbPtr)NULL; pDb = pDb->next) - { - if(strlen(pDb->name) == nameLen && !strncmp(pDb->name, name, nameLen)) - { - FillPrinterListEntry(pEntry, pDb, localeLen, locale); - return TRUE; - } - } - return FALSE; -} - -/* - * XpDiFreePrinterList is the approved method of releasing memory used - * for a printer list. - */ -void -XpDiFreePrinterList(XpDiListEntry **list) -{ - int i; - - for(i = 0; list[i] != (XpDiListEntry *)NULL; i++) - xfree(list[i]); - xfree(list); -} - -/* - * XpDiGetPrinterList returns a pointer to a NULL-terminated array of - * XpDiListEntry pointers. Each entry structure contains the name, - * description, root window, and locale of a printer. The call returns - * either a list of all printers configured on the server, or it returns - * the information for one specific printer depending on the values passed - * in. Non-NULL values passed in indicate that only the information for - * the one specific printer is desired, while NULL values indicate that - * the information for all printers is desired. - */ -XpDiListEntry ** -XpDiGetPrinterList( - int nameLen, - char *name, - int localeLen, - char *locale) -{ - XpDiListEntry **pList; - - if(!nameLen || name == (char *)NULL) - { - int i; - PrinterDbPtr pDb, pDb2; - - for(pDb = printerDb, i = 0; pDb != (PrinterDbPtr)NULL; - pDb = pDb->next, i++) - ; - - if((pList = (XpDiListEntry **)xalloc((i+1) * sizeof(XpDiListEntry *))) - == (XpDiListEntry **)NULL) - return pList; - - pList[i] = (XpDiListEntry *)NULL; - for(pDb = printerDb, i = 0; pDb != (PrinterDbPtr)NULL; - pDb = pDb->next, i++) - { - if((pList[i] = (XpDiListEntry *)xalloc(sizeof(XpDiListEntry)))== - (XpDiListEntry *)NULL) - { - XpDiFreePrinterList(pList); - return (XpDiListEntry **)NULL; - } - FillPrinterListEntry(pList[i], pDb, localeLen, locale); - } - } - else - { - if((pList = (XpDiListEntry **)xalloc(2 * sizeof(XpDiListEntry *))) == - (XpDiListEntry **)NULL) - return pList; - - if((pList[0] = (XpDiListEntry *)xalloc(sizeof(XpDiListEntry))) == - (XpDiListEntry *)NULL) - { - xfree(pList); - return (XpDiListEntry **)NULL; - } - pList[1] = (XpDiListEntry *)NULL; - if(GetPrinterListInfo(pList[0], nameLen, name, localeLen, locale) == - FALSE) - { - xfree(pList[0]); - pList[0] = (XpDiListEntry *)NULL; - } - } - return pList; -} - -WindowPtr -XpDiValidatePrinter(char *printerName, int printerNameLen) -{ - PrinterDbPtr pCurEntry; - WindowPtr pWin; - - for(pCurEntry = printerDb; - pCurEntry != (PrinterDbPtr)NULL; pCurEntry = pCurEntry->next) - { - if(strlen(pCurEntry->name) == printerNameLen && - !strncmp(pCurEntry->name, printerName, printerNameLen)) - return WindowTable[pCurEntry->screenNum]; - } - return (WindowPtr)NULL; -} - -/* - * XpDiGetDriverName takes a screen index and a printer name, and returns - * a pointer to the name of the driver to be used for the specified printer - * on the specified screen. - */ -char * -XpDiGetDriverName(int index, char *printerName) -{ - - PrinterDbPtr pCurEntry; - - for(pCurEntry = printerDb; - pCurEntry != (PrinterDbPtr)NULL; pCurEntry = pCurEntry->next) - { - if(pCurEntry->screenNum == index && - !strcmp(pCurEntry->name, printerName)) - return pCurEntry->driverName; - } - - return (char *)NULL; /* XXX Should we supply a default driverName? */ -} - diff --git a/nx-X11/programs/Xserver/Xprint/Oid.c b/nx-X11/programs/Xserver/Xprint/Oid.c deleted file mode 100644 index 7cb1230c7..000000000 --- a/nx-X11/programs/Xserver/Xprint/Oid.c +++ /dev/null @@ -1,3184 +0,0 @@ -/* $Xorg: Oid.c,v 1.3 2000/08/17 19:48:06 cpqbld Exp $ */ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "attributes.h" - -/* - * XpOidNotify value strings - */ -#define NOTIFY_EMAIL_STR "{{event-report-job-completed} electronic-mail}" -#define NOTIFY_NONE_STR "{}" - -#define SafeStrLen(s) ((s) ? strlen((s)) : 0) - -/* - * entry type for the object identifier string map - */ -typedef struct _XpOidStringMapEntry -{ - const char* string; - int length; - int msg_set; - int msg_number; - const char* default_message; - -} XpOidStringMapEntry; - -/* - * include the auto-generated static XpOidStringMap - */ -#include "OidStrs.h" - -/* - * XpOid static function declarations - */ -static XpOid XpOidParse(const char* value_string, - const char** ptr_return); -/* - * XpOidList static function declarations - */ -static XpOidList* XpOidListParse(const char* value_string, - const XpOidList* valid_oids, - const char** ptr_return, int i); - -/* - * XpOidList static function declarations - */ -static XpOidCardList* XpOidCardListParse(const char* value_string, - const XpOidCardList* valid_cards, - const char** ptr_return, int i); - -/* - * XpOidMediumSourceSize static function declarations - */ -static XpOidMediumSS* MediumSSParse(const char* value_string, - const XpOidList* valid_trays, - const XpOidList* valid_medium_sizes, - const char** ptr_return, int i); -static XpOidMediumContinuousSize* MediumContinuousSizeParse(const char*, - const char**); -static void MediumContinuousSizeDelete(XpOidMediumContinuousSize* me); -static XpOidMediumDiscreteSizeList* MediumDiscreteSizeListParse(const char*, - const XpOidList*, - const char**, - int i); -static void MediumDiscreteSizeListDelete(XpOidMediumDiscreteSizeList* list); - -static BOOL ParseArea(const char* value_string, - const char** ptr_return, - XpOidArea* area_return); -static BOOL ParseRealRange(const char* value_string, - const char** ptr_return, - XpOidRealRange* range_return); - -/* - * XpOidTrayMediumList static function declarations - */ -static XpOidTrayMediumList* TrayMediumListParse(const char* value_string, - const XpOidList* valid_trays, - const char** ptr_return, - int i); -static void TrayMediumListValidate(XpOidTrayMediumList* me, - const XpOidMediumSS* msss); - -/* - * XpOidDocFmt - */ -static BOOL XpOidDocFmtNext(XpOidDocFmt* doc_fmt, - const char* value_string, - const char** ptr_return); - -/* - * XpOidDocFmtListParse - */ -static XpOidDocFmtList* XpOidDocFmtListParse(const char* value_string, - const XpOidDocFmtList* valid_fmts, - const char** ptr_return, int i); - -/* - * misc. parsing static function declarations - */ -static BOOL ParseBoolValue(const char* value_string, - const char** ptr_return, - BOOL* bool_return); -static BOOL ParseRealValue(const char* value_string, - const char** ptr_return, - float* real_return); -static BOOL ParseSeqEnd( - const char* value_string, - const char** ptr_return); -static BOOL ParseSeqStart( - const char* value_string, - const char** ptr_return); -static BOOL ParseUnspecifiedValue( - const char* value_string, - const char** ptr_return); -static int SpanToken( - const char* string); -static int SpanWhitespace( - const char* string); - -/* - * String comparison function. - */ -#ifdef HAVE_STRCASECMP -# define StrnCaseCmp(s1, s2, len) strncasecmp(s1, s2, len) -#else -static int StrnCaseCmp(const char *s1, const char *s2, size_t len); -#endif - -/* - * ------------------------------------------------------------------------ - * Name: XpOidString - * - * Description: - * - * Obtain the string representation of an XpOid. - * - * Example: XpOidString(xpoid_copy_count) returns "copy-count". - * - * Return value: - * - * A const pointer to the string. - */ -const char* -XpOidString(XpOid xp_oid) -{ - /* - * XpOid enum values are index values into the string map - */ - return XpOidStringMap[xp_oid].string; -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidStringLength - * - * Description: - * - * Obtain the length of the string representation for a given - * XpOid. - * - * Return value: - * - * The string length in bytes. - * - */ -int -XpOidStringLength(XpOid xp_oid) -{ - /* - * XpOid enum values are index values into the string map - */ - return XpOidStringMap[xp_oid].length; -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidFromString - * - * Description: - * - * Obtains the XpOid given a string representation of an XpOid. - * - * Example: XpOidFromString("copy-count") returns 'xpoid_copy_count'. - * - * Return value: - * - * The XpOid if successful. 'xpoid_none' if the string pointed to by - * 'value is not recognized or if 'value' is NULL. - */ -XpOid -XpOidFromString(const char* value) -{ - if(value == (const char*)NULL) - return xpoid_none; - else - return XpOidParse(value, (const char**)NULL); -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidParse - * - * Description: - * - * Parse the next whitespace-delimited string from 'value_string' - * updating 'ptr_return' to point to the next unparsed location in - * 'value_string'. 'ptr_return' can be NULL. - * - * Return value: - * - * The corresponding XpOid for the parsed name string. - * A return value of xpoid_none is returned if the parsed name - * was not a valid oid or if no name was found. - * - */ -static XpOid -XpOidParse(const char* value_string, - const char** ptr_return) -{ - const char* ptr; - int length; - int i; - /* - * skip leading whitespace - */ - ptr = value_string + SpanWhitespace(value_string); - /* - * get the whitespace-delimited token length - */ - length = SpanToken(ptr); - /* - * match the oid string in the map - */ - for(i = 0; i < XpOidStringMapCount; i++) - if(length == XpOidStringMap[i].length) - if(strncmp(ptr, XpOidStringMap[i].string, length) == 0) - break; - if(i == XpOidStringMapCount) - i = xpoid_none; - /* - * update the return pointer and return - */ - if(ptr_return != (const char**)NULL) - *ptr_return = ptr+length; - return i; -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidListNew - * - * Description: - * - * Creates a new XpOidList initialized from a whitespace-delimited - * list of recognized string representations of oids. The returned - * list will contain only oids found within the passed 'valid_oids' - * XpOidList. - * - * Note: One may notice that in order to create an XpOidList with - * this function, an XpOidList is needed; the 'valid_oids' list - * is often an statically initialized structure. XpOidListInit - * can also be used. - * - * Return value: - * - * NULL if the passed 'value_string' is NULL. - * - * If the list indicated by 'value_string' is empty or contains only - * unrecognized oid string representations, a new XpOidList - * containing zero elements is returned. - * - * If 'valid_oids' is NULL all oids are considered valid. - * - */ -XpOidList* -XpOidListNew(const char* value_string, - const XpOidList* valid_oids) -{ - if(value_string == (const char*)NULL) - return (XpOidList*)NULL; - else - { - const char* ptr; - return XpOidListParse(value_string, valid_oids, &ptr, 0); - } -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidListDelete - * - * Description: - * - * Frees the memory allocated for 'list'. - * - * Return value: - * - * None. - * - */ -void -XpOidListDelete(XpOidList* list) -{ - if(list != (XpOidList*)NULL) - { - XpOidFree((char*)list->list); - XpOidFree((char*)list); - } -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidListParse - * - * Description: - * - * This function recursively parses the whitespace-delimited list of - * oid string representations passed via 'value_string'. Oids are - * only added to the resulting list if they are found within the - * passed 'valid_oids' XpOidList. - * - * 'ptr_return' points to a char* variable allocated by the - * caller, and is really only of use during recursion (upon return to - * the original caller, it will point to the end of value_string). - * - * 'value_string' and 'ptr_return' *cannot* be NULL. - * - * Return value: - * - * A newly allocated and initialized XpOidList. - * - * If the list indicated by 'value_string' is empty or contains only - * unrecognized oid string representations, a new XpOidList - * containing zero elements is returned. - * - * If 'valid_oids' is NULL all oids are considered valid. - * - */ -static XpOidList* -XpOidListParse(const char* value_string, - const XpOidList* valid_oids, - const char** ptr_return, - int i) -{ - XpOid oid; - XpOidList* list; - /* - * parse the next valid oid out of the value string - */ - ptr_return = &value_string; - while(1) - { - if(**ptr_return == '\0') - { - /* - * end of value string; stop parsing - */ - oid = xpoid_none; - break; - } - /* - * parse the next oid from the value - */ - oid = XpOidParse(*ptr_return, ptr_return); - if(xpoid_none == oid) - { - /* - * unrecognized oid; keep parsing - */ - continue; - } - if((const XpOidList*)NULL == valid_oids - || - XpOidListHasOid(valid_oids, oid)) - { - /* - * valid oid found; stop parsing - */ - break; - } - } - - if(oid == xpoid_none) - { - /* - * end of value string; allocate the list structure - */ - list = (XpOidList*)XpOidCalloc(1, sizeof(XpOidList)); - list->count = i; - list->list = (XpOid*)XpOidCalloc(i, sizeof(XpOid)); - } - else - { - /* - * recurse - */ - list = XpOidListParse(*ptr_return, valid_oids, ptr_return, i+1); - /* - * set the oid in the list - */ - list->list[i] = oid; - } - /* - * return - */ - return list; -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidListHasOid - * - * Description: - * - * Determines if 'oid' is an element of 'list'. - * - * Return value: - * - * xTrue if the oid is found in the list. - * - * xFalse if the oid is not in the list, or if 'list' is NULL. - * - */ -BOOL -XpOidListHasOid(const XpOidList* list, XpOid oid) -{ - int i; - if(list != (XpOidList*)NULL) - for(i = 0; i < list->count; i++) - if(list->list[i] == oid) - return xTrue; - return xFalse; -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidListGetIndex - * - * Description: - * - * Returns the array index of 'oid' in 'list' - * - * Return value: - * - * The index of 'oid' in list. - * - * -1 if the oid is not in the list, or if 'list' is NULL. - * - */ -int -XpOidListGetIndex(const XpOidList* list, XpOid oid) -{ - int i; - if(list != (XpOidList*)NULL) - for(i = 0; i < list->count; i++) - if(list->list[i] == oid) - return i; - return -1; -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidListString - * - * Description: - * - * Creates a string representation of an XpOidList structure. - * - * Return value: - * - * A newly allocated - * - */ -char* -XpOidListString(const XpOidList* me) -{ - int i; - int length; - char* str; - char* ptr; - /* - * allocate enough memory for the oid string representations, - * including intervening whitespace - */ - for(i = 0, length = 0; i < XpOidListCount(me); i++) - length += XpOidStringLength(XpOidListGetOid(me, i)) + 1; - str = XpOidMalloc(length+1); - /* - * format the list - */ - for(i = 0, ptr = str; i < XpOidListCount(me); i++) -#if defined(sun) && !defined(SVR4) - { - sprintf(ptr, "%s ", XpOidString(XpOidListGetOid(me, i))); - ptr += strlen(ptr); - } -#else - ptr += sprintf(ptr, "%s ", XpOidString(XpOidListGetOid(me, i))); -#endif - /* - * chop trailing whitespace or terminate empty string - */ - str[length] = '\0'; - /* - * return - */ - return str; -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidLinkedListNew - * - * Description: - * - * Creates a new instance of an empty XpOidLinkedList. - * - * Return value: - * - * The new XpOidLinkedList. - * - */ -XpOidLinkedList* -XpOidLinkedListNew() -{ - return (XpOidLinkedList*)XpOidCalloc(1, sizeof(XpOidLinkedList)); -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidLinkedListDelete - * - * Description: - * - * Frees the memory allocated for a XpOidLinkedList. - * - * Return value: - * - * None. - * - */ -void -XpOidLinkedListDelete(XpOidLinkedList* me) -{ - if(me != (XpOidLinkedList*)NULL) - { - while(me->head) - { - me->current = me->head; - me->head = me->current->next; - XpOidFree((char*)me->current); - } - XpOidFree((char*)me); - } -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidLinkedListGetOid - * - * Description: - * - * Retrieves the oid at position 'i' (zero-based) in the - * XpOidLinkedList 'me'. - * - * Return value: - * - * The oid at position 'i'. - * - * xpoid_none if the oid was not found, or the list is empty (or if - * the list contains xpoid_none at position 'i'). - */ -XpOid -XpOidLinkedListGetOid(XpOidLinkedList* me, int i) -{ - if(me == (XpOidLinkedList*)NULL || i < 0 || i >= me->count) - { - return xpoid_none; - } - else - { - me->current = me->head; - while(i--) me->current = me->current->next; - return me->current->oid; - } -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidLinkedListAddOid - * - * Description: - * - * Adds an oid to the end of an XpOidLinkedList. - * - * Return value: - * - * None. - * - */ -void -XpOidLinkedListAddOid(XpOidLinkedList* me, XpOid oid) -{ - me->current = (XpOidNode)XpOidCalloc(1, sizeof(struct XpOidNodeStruct)); - me->current->oid = oid; - ++me->count; - if(me->tail) - { - me->tail->next = me->current; - me->tail = me->current; - } - else - me->head = me->tail = me->current; -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidLinkedListGetIndex - * - * Description: - * - * Returns the position of an oid in a XpOidLinkedList. - * - * Return value: - * - * The zero-based position of 'oid' in the list. - * - * -1 if the oid is not in the list, or if 'me' is NULL. - * - */ -int -XpOidLinkedListGetIndex(XpOidLinkedList* me, XpOid oid) -{ - if((XpOidLinkedList*)NULL != me) - { - int i = 0; - me->current = me->head; - while(me->current) - if(me->current->oid == oid) - { - return i; - } - else - { - ++i; - me->current = me->current->next; - } - } - return -1; -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidLinkedListHasOid - * - * Description: - * - * Determines if an oid is an element of a XpOidLinkedList. - * - * Return value: - * - * xTrue if the oid is found in the list. - * - * xFalse if the oid is not in the list, or if 'me' is NULL. - */ -BOOL -XpOidLinkedListHasOid(XpOidLinkedList* me, - XpOid oid) -{ - if((XpOidLinkedList*)NULL != me) - { - me->current = me->head; - while(me->current) - if(me->current->oid == oid) - return xTrue; - else - me->current = me->current->next; - } - return xFalse; -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidLinkedListFirstOid - * - * Description: - * - * Positions the XpOidLinkedList 'current' pointer to the first entry - * in the list. - * - * Return value: - * - * The first oid in the list, or xpoid_none if the list NULL or - * empty. - */ -XpOid -XpOidLinkedListFirstOid(XpOidLinkedList* me) -{ - if((XpOidLinkedList*)NULL != me && (me->current = me->head)) - return me->current->oid; - else - return xpoid_none; -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidLinkedListNextOid - * - * Description: - * - * Positions the XpOidLinkedList 'current' pointer to the next entry - * in the list. - * - * Return value: - * - * The next oid, or xpoid_none if the end of the list has been - * reached. - */ -XpOid -XpOidLinkedListNextOid(XpOidLinkedList* me) -{ - if(me->current ? (me->current = me->current->next) : xFalse) - return me->current->oid; - else - return xpoid_none; -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidMediumSSNew - * - * Description: - * - * Creates a new XpOidMediumSS initialized from a string value - * specified using the medium-source-sizes syntax. See - * MediumSSParse() below for parsing details. - * - * Return value: - * - * NULL if the passed 'value_string' is NULL, or if a syntax error is - * encountered while parsing the medium-source-sizes value. - * - */ -XpOidMediumSS* -XpOidMediumSSNew(const char* value_string, - const XpOidList* valid_trays, - const XpOidList* valid_medium_sizes) -{ - if(value_string == (const char*)NULL) - return (XpOidMediumSS*)NULL; - else - { - const char* ptr = value_string + SpanWhitespace(value_string); - if(*ptr == '\0') - return (XpOidMediumSS*)NULL; - else - return MediumSSParse(ptr, valid_trays, valid_medium_sizes, - &ptr, 0); - } -} - -/* - * ------------------------------------------------------------------------ - * Name: MediumSSParse - * - * Description: - * - * 'ptr_return' *cannot* be NULL. - * - * - * Return value: - * - * - * - */ -static XpOidMediumSS* -MediumSSParse(const char* value_string, - const XpOidList* valid_trays, - const XpOidList* valid_medium_sizes, - const char** ptr_return, - int i) -{ - XpOidMediumSS* medium_ss; - XpOidMediumSourceSize mss; - /* - * check for the start of a new MediumSourceSize sequence - */ - if(ParseSeqStart(value_string, ptr_return)) - { - /* - * check for an unspecified tray value - */ - if(ParseUnspecifiedValue(*ptr_return, ptr_return)) - mss.input_tray = xpoid_unspecified; - else - { - const char* tray_str; - *ptr_return += SpanWhitespace(*ptr_return); - tray_str = *ptr_return; - /* - * parse out the input tray - */ - mss.input_tray = XpOidParse(*ptr_return, ptr_return); - if((const XpOidList*)NULL != valid_trays - && - !XpOidListHasOid(valid_trays, mss.input_tray) - ) - mss.input_tray = xpoid_none; - if(xpoid_none == mss.input_tray) - { - char* invalid_tray_str; - int len = *ptr_return - tray_str; - if(len > 0) - { - invalid_tray_str = XpOidMalloc(len+1); - strncpy(invalid_tray_str, tray_str, len); - invalid_tray_str[len] = '\0'; - ErrorF("%s\nInvalid tray (%s) found. Will attempt to continue parsing.\n", - XPMSG_WARN_MSS, invalid_tray_str); - XpOidFree(invalid_tray_str); - } - } - } - /* - * attempt to parse a Continuous MediumSize sequence - */ - mss.ms.continuous_size = - MediumContinuousSizeParse(*ptr_return, ptr_return); - if(mss.ms.continuous_size != (XpOidMediumContinuousSize*)NULL) - { - mss.mstag = XpOidMediumSS_CONTINUOUS; - } - else - { - /* - * not continuous, try Discrete MediumSize - */ - mss.ms.discrete = - MediumDiscreteSizeListParse(*ptr_return, valid_medium_sizes, - ptr_return, 0); - if(mss.ms.discrete == (XpOidMediumDiscreteSizeList*)NULL) - { - const char* tray_str; - /* - * syntax error (MediumDiscreteSizeListParse reports error) - */ - switch(mss.input_tray) - { - case xpoid_none: - tray_str = "an invalid"; - break; - case xpoid_unspecified: - tray_str = "default (tray specifier omitted)"; - break; - default: - tray_str = XpOidString(mss.input_tray); - break; - } - ErrorF("%s\nError occurred while parsing medium sizes for %s tray.\n", - XPMSG_WARN_MSS, tray_str); - return NULL; - } - mss.mstag = XpOidMediumSS_DISCRETE; - } - /* - * parse out the MediumSourceSize sequence end - */ - if(!ParseSeqEnd(*ptr_return, ptr_return)) - { - /* - * syntax error - */ - ErrorF("%s\nSequence End expected. Unparsed data: %s\n", - XPMSG_WARN_MSS, *ptr_return); - return NULL; - } - /* - * recurse to parse the next MediumSourceSize sequence - */ - medium_ss = MediumSSParse(*ptr_return, - valid_trays, valid_medium_sizes, - ptr_return, - xpoid_none == mss.input_tray ? i : i+1); - if(medium_ss == (XpOidMediumSS*)NULL - || - xpoid_none == mss.input_tray) - { - /* - * syntax error or invalid tray - clean up - */ - switch(mss.mstag) - { - case XpOidMediumSS_CONTINUOUS: - MediumContinuousSizeDelete(mss.ms.continuous_size); - break; - case XpOidMediumSS_DISCRETE: - MediumDiscreteSizeListDelete(mss.ms.discrete); - break; - } - if(medium_ss == (XpOidMediumSS*)NULL) - /* - * syntax error - return - */ - return NULL; - } - if(xpoid_none != mss.input_tray) - { - /* - * copy the current MediumSourceSize into the array - */ - memmove((medium_ss->mss)+i, &mss, sizeof(XpOidMediumSourceSize)); - } - } - else - { - /* - * MediumSourceSize sequence start not found - */ - if(**ptr_return == '\0') - { - if(0 == i) - { - ErrorF("%s\nNo valid trays found.\n", XPMSG_WARN_MSS); - return NULL; - } - /* - * end of value string; allocate the MediumSS structure - */ - medium_ss = (XpOidMediumSS*)XpOidCalloc(1, sizeof(XpOidMediumSS)); - medium_ss->count = i; - medium_ss->mss = (XpOidMediumSourceSize*) - XpOidCalloc(i, sizeof(XpOidMediumSourceSize)); - } - else - { - /* - * syntax error - */ - ErrorF("%s\nSequence Start expected.\nunparsed data: %s\n", - XPMSG_WARN_MSS, *ptr_return); - return NULL; - } - } - return medium_ss; -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidMediumSSDelete - * - * Description: - * - * - * - * Return value: - * - * - * - */ -void -XpOidMediumSSDelete(XpOidMediumSS* me) -{ - if(me != (XpOidMediumSS*)NULL) - { - int i; - for(i = 0; i < me->count; i++) - { - switch((me->mss)[i].mstag) - { - case XpOidMediumSS_CONTINUOUS: - MediumContinuousSizeDelete((me->mss)[i].ms.continuous_size); - break; - case XpOidMediumSS_DISCRETE: - MediumDiscreteSizeListDelete((me->mss)[i].ms.discrete); - break; - } - } - XpOidFree((char*)me); - } -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidMediumSSHasSize - * - * Description: - * - * - * - * Return value: - * - * - * - */ -BOOL -XpOidMediumSSHasSize(XpOidMediumSS* me, XpOid page_size) -{ - int i_mss, i_ds; - XpOidMediumDiscreteSizeList* ds_list; - - if(me != (XpOidMediumSS*)NULL && page_size != xpoid_none) - for(i_mss = 0; i_mss < me->count; i_mss++) - { - switch((me->mss)[i_mss].mstag) - { - case XpOidMediumSS_DISCRETE: - ds_list = (me->mss)[i_mss].ms.discrete; - for(i_ds = 0; i_ds < ds_list->count; i_ds++) - if(page_size == (ds_list->list)[i_ds].page_size) - return xTrue; - break; - - case XpOidMediumSS_CONTINUOUS: - /* - * unsupported - */ - break; - } - } - /* - * return - */ - return xFalse; -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidMediumSSString - * - * Description: - * - * Creates a string representation of an XpOidMediumSS structure. - * - * Return value: - * - * A newly allocated - * - */ -char* XpOidMediumSSString(const XpOidMediumSS* me) -{ - int itray, isize; - int valid_size_count; - int length; - char* str; - char* ptr; - XpOidMediumDiscreteSize* ds; - char buf[128]; - /* - * determine the size of the string representation - */ - for(itray = 0, length = 0; itray < XpOidMediumSSCount(me); itray++) - { - if(xpoid_none == me->mss[itray].input_tray - || - XpOidMediumSS_CONTINUOUS == me->mss[itray].mstag) - { - /* - * skip invalid tray or unsupported continuous size spec - */ - continue; - } - for(isize = 0, valid_size_count = 0; - isize < me->mss[itray].ms.discrete->count; - isize++) - { - ds = me->mss[itray].ms.discrete->list+isize; - if(ds->page_size == xpoid_none) - continue; - ++valid_size_count; - length += XpOidStringLength(ds->page_size); - length += ds->long_edge_feeds ? 4 : 5; /* "True" or "False" */ -#if defined(sun) && !defined(SVR4) - sprintf(buf, "{%.4f %.4f %.4f %.4f}", - ds->assured_reproduction_area.minimum_x, - ds->assured_reproduction_area.maximum_x, - ds->assured_reproduction_area.minimum_y, - ds->assured_reproduction_area.maximum_y); - length += strlen(buf); -#else - length += sprintf(buf, "{%.4f %.4f %.4f %.4f}", - ds->assured_reproduction_area.minimum_x, - ds->assured_reproduction_area.maximum_x, - ds->assured_reproduction_area.minimum_y, - ds->assured_reproduction_area.maximum_y); -#endif - length += 5; /* "{ } " */ - } - if(valid_size_count == 0) - { - /* - * no valid sizes, skip - */ - continue; - } - if(xpoid_unspecified == me->mss[itray].input_tray) - length += 2; /* "''" */ - else - length += XpOidStringLength(me->mss[itray].input_tray); - length += 4; /* "{ } " */ - } - /* - * allocate - */ - str = XpOidMalloc(length+1); - /* - * format - */ - for(itray = 0, ptr = str; itray < XpOidMediumSSCount(me); itray++) - { - if(xpoid_none == me->mss[itray].input_tray - || - XpOidMediumSS_CONTINUOUS == me->mss[itray].mstag) - { - /* - * skip invalid tray or unsupported continuous size spec - */ - continue; - } - /* - * check to ensure all of the specified sizes are valid - */ - for(isize = 0, valid_size_count = 0; - isize < me->mss[itray].ms.discrete->count; - isize++) - { - ds = me->mss[itray].ms.discrete->list+isize; - if(ds->page_size != xpoid_none) - ++valid_size_count; - } - if(valid_size_count == 0) - { - /* - * no valid sizes, skip - */ - continue; - } - - if(xpoid_unspecified == me->mss[itray].input_tray) - { -#if defined(sun) && !defined(SVR4) - sprintf(ptr, "{'' "); - ptr += strlen(ptr); -#else - ptr += sprintf(ptr, "{'' "); -#endif - } - else - { -#if defined(sun) && !defined(SVR4) - sprintf(ptr, "{%s ", XpOidString(me->mss[itray].input_tray)); - ptr += strlen(ptr); -#else - ptr += sprintf(ptr, "{%s ", - XpOidString(me->mss[itray].input_tray)); -#endif - } - for(isize = 0; isize < me->mss[itray].ms.discrete->count; isize++) - { - ds = me->mss[itray].ms.discrete->list+isize; - if(ds->page_size != xpoid_none) -#if defined(sun) && !defined(SVR4) - { - sprintf(ptr, "{%s %s {%.4f %.4f %.4f %.4f}} ", - XpOidString(ds->page_size), - ds->long_edge_feeds ? "True" : "False", - ds->assured_reproduction_area.minimum_x, - ds->assured_reproduction_area.maximum_x, - ds->assured_reproduction_area.minimum_y, - ds->assured_reproduction_area.maximum_y); - ptr += strlen(ptr); - } -#else - ptr += sprintf(ptr, "{%s %s {%.4f %.4f %.4f %.4f}} ", - XpOidString(ds->page_size), - ds->long_edge_feeds ? "True" : "False", - ds->assured_reproduction_area.minimum_x, - ds->assured_reproduction_area.maximum_x, - ds->assured_reproduction_area.minimum_y, - ds->assured_reproduction_area.maximum_y); -#endif - } -#if defined(sun) && !defined(SVR4) - sprintf(ptr, "} "); - ptr += strlen(ptr); -#else - ptr += sprintf(ptr, "} "); -#endif - } - /* - * chop trailing whitespace or terminate empty string - */ - str[length] = '\0'; - /* - * return - */ - return str; -} - -/* - * ------------------------------------------------------------------------ - * Name: MediumContinuousSizeParse - * - * Description: - * - * 'ptr_return' *cannot* be NULL. - * - * - * Return value: - * - * - * - */ -static XpOidMediumContinuousSize* -MediumContinuousSizeParse(const char* value_string, - const char** ptr_return) -{ - const char* first_nonws_ptr; - XpOidMediumContinuousSize* mcs = NULL; - /* - * skip leading whitespace - */ - first_nonws_ptr = value_string + SpanWhitespace(value_string); - /* - * parse out the MediumSize sequence start char - */ - if(!ParseSeqStart(first_nonws_ptr, ptr_return)) - goto MediumContinuousSizeParse_error; - /* - * peek ahead to see if it looks like we actually have a continuous - * size spec (looking for the sequence start char on the 1st range spec) - */ - if(!ParseSeqStart(*ptr_return, (const char**)NULL)) - goto MediumContinuousSizeParse_error; - /* - * Ok, let's go for it - */ - mcs = (XpOidMediumContinuousSize*) - XpOidCalloc(1, sizeof(XpOidMediumContinuousSize)); - /* - * "range across the feed direction" - */ - if(!ParseRealRange(*ptr_return, ptr_return, &mcs->range_across_feed)) - goto MediumContinuousSizeParse_error; - /* - * "increment across the feed direction" (optional, default 0) - */ - if(!ParseUnspecifiedValue(*ptr_return, ptr_return)) - if(!ParseRealValue(*ptr_return, ptr_return, - &mcs->increment_across_feed)) - goto MediumContinuousSizeParse_error; - /* - * "range in the feed direction" - */ - if(!ParseRealRange(*ptr_return, ptr_return, &mcs->range_in_feed)) - goto MediumContinuousSizeParse_error; - /* - * "increment in the feed direction" (optional, default 0) - */ - if(!ParseUnspecifiedValue(*ptr_return, ptr_return)) - if(!ParseRealValue(*ptr_return, ptr_return, - &mcs->increment_in_feed)) - goto MediumContinuousSizeParse_error; - /* - * "long edge feeds" flag (default TRUE) - */ - if(ParseUnspecifiedValue(*ptr_return, ptr_return)) - mcs->long_edge_feeds = xTrue; - else - if(!ParseBoolValue(*ptr_return, ptr_return, &mcs->long_edge_feeds)) - goto MediumContinuousSizeParse_error; - /* - * "generic assured reproduction area" - */ - if(!ParseArea(*ptr_return, ptr_return, &mcs->assured_reproduction_area)) - goto MediumContinuousSizeParse_error; - /* - * parse out the MediumSize sequence end character - */ - if(!ParseSeqEnd(*ptr_return, ptr_return)) - goto MediumContinuousSizeParse_error; - /* - * return - */ - return mcs; - - - MediumContinuousSizeParse_error: - /* - * syntax error - don't log since this function may be called - * as a lookahead - */ - *ptr_return = first_nonws_ptr; - XpOidFree((char*)mcs); - return NULL; -} - -/* - * ------------------------------------------------------------------------ - * Name: MediumContinuousSizeDelete - * - * Description: - * - * 'ptr_return' *cannot* be NULL. - * - * - * Return value: - * - * - * - */ -static void -MediumContinuousSizeDelete(XpOidMediumContinuousSize* me) -{ - XpOidFree((char*)me); -} - -/* - * ------------------------------------------------------------------------ - * Name: MediumDiscreteSizeListParse - * - * Description: - * - * 'ptr_return' *cannot* be NULL. - * - * Return value: - * - * - * - */ -static XpOidMediumDiscreteSizeList* -MediumDiscreteSizeListParse(const char* value_string, - const XpOidList* valid_medium_sizes, - const char** ptr_return, - int i) -{ - XpOidMediumDiscreteSizeList* list; - XpOidMediumDiscreteSize mds; - /* - * check for the start of a new MediumSize sequence - */ - if(ParseSeqStart(value_string, ptr_return)) - { - /* - * "page size" - */ - mds.page_size = XpOidParse(*ptr_return, ptr_return); - if((const XpOidList*)NULL != valid_medium_sizes - && - !XpOidListHasOid(valid_medium_sizes, mds.page_size) - ) - mds.page_size = xpoid_none; - /* - * "long edge feeds" flag (default TRUE) - */ - if(ParseUnspecifiedValue(*ptr_return, ptr_return)) - mds.long_edge_feeds = xTrue; - else - if(!ParseBoolValue(*ptr_return, ptr_return, - &mds.long_edge_feeds)) - { - /* - * syntax error - */ - ErrorF("%s\nBoolean expected.\nunparsed data: %s\n", - XPMSG_WARN_MSS, *ptr_return); - return (XpOidMediumDiscreteSizeList*)NULL; - } - /* - * "assured reproduction area" - */ - if(!ParseArea(*ptr_return, ptr_return, - &mds.assured_reproduction_area)) - { - /* - * syntax error - */ - ErrorF("%s\nArea specification error.\nunparsed data: %s\n", - XPMSG_WARN_MSS, *ptr_return); - return (XpOidMediumDiscreteSizeList*)NULL; - } - /* - * parse out the MediumSize sequence end character - */ - if(!ParseSeqEnd(*ptr_return, ptr_return)) - { - ErrorF("%s\nSequence End expected. Unparsed data: %s\n", - XPMSG_WARN_MSS, *ptr_return); - return (XpOidMediumDiscreteSizeList*)NULL; - } - /* - * recurse to parse the next Discrete MediumSize sequence - */ - if(mds.page_size == xpoid_none) - { - list = MediumDiscreteSizeListParse(*ptr_return, valid_medium_sizes, - ptr_return, i); - } - else - { - list = MediumDiscreteSizeListParse(*ptr_return, valid_medium_sizes, - ptr_return, i+1); - if(list != (XpOidMediumDiscreteSizeList*)NULL) - { - /* - * copy the current discrete MediumSize into the list - */ - memmove((list->list)+i, &mds, sizeof(XpOidMediumDiscreteSize)); - } - } - } - else - { - /* - * MediumSize sequence start not found; end of the discrete sizes - * list - */ - if(0 == i) - { - ErrorF("%s\nNo valid medium sizes found for tray.\n", - XPMSG_WARN_MSS); - return (XpOidMediumDiscreteSizeList*)NULL; - } - list = (XpOidMediumDiscreteSizeList*) - XpOidCalloc(1, sizeof(XpOidMediumDiscreteSizeList)); - list->count = i; - list->list = (XpOidMediumDiscreteSize*) - XpOidCalloc(i, sizeof(XpOidMediumDiscreteSize)); - } - return list; -} - -/* - * ------------------------------------------------------------------------ - * Name: MediumDiscreteSizeListDelete - * - * Description: - * - * - * - * Return value: - * - * - * - */ -static void -MediumDiscreteSizeListDelete(XpOidMediumDiscreteSizeList* list) -{ - if(list != (XpOidMediumDiscreteSizeList*)NULL) - { - XpOidFree((char*)list->list); - XpOidFree((char*)list); - } -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidTrayMediumListNew - * - * Description: - * - * Only need the valid trays; validation requires bumping up against - * msss using TrayMediumListValidate; this needs valid trays - * because of unspecified trays ion msss, but - * TrayMediumListValidate will take care of invalid sizes... - * - * Return value: - * - * - * - */ -XpOidTrayMediumList* -XpOidTrayMediumListNew(const char* value_string, - const XpOidList* valid_trays, - const XpOidMediumSS* msss) -{ - if(value_string == (const char*)NULL) - return (XpOidTrayMediumList*)NULL; - else - { - const char* ptr; - XpOidTrayMediumList* me; - me = TrayMediumListParse(value_string, valid_trays, &ptr, 0); - if((XpOidTrayMediumList*)NULL != me) - TrayMediumListValidate(me, msss); - return me; - } -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidTrayMediumListDelete - * - * Description: - * - * - * - * Return value: - * - * - * - */ -void -XpOidTrayMediumListDelete(XpOidTrayMediumList* list) -{ - if(list != (XpOidTrayMediumList*)NULL) - { - XpOidFree((char*)list->list); - XpOidFree((char*)list); - } -} - -/* - * ------------------------------------------------------------------------ - * Name: TrayMediumListParse - * - * Description: - * - * 'ptr_return' *cannot* be NULL. - * - * Return value: - * - * - * - */ -static XpOidTrayMediumList* -TrayMediumListParse(const char* value_string, - const XpOidList* valid_trays, - const char** ptr_return, int i) -{ - XpOidTrayMedium tm; - XpOidTrayMediumList* list; - /* - * check for the start of a new InputTrayMedium sequence - */ - if(ParseSeqStart(value_string, ptr_return)) - { - /* - * "input tray" - */ - tm.input_tray = XpOidParse(*ptr_return, ptr_return); - if((XpOidList*)NULL != valid_trays - && - !XpOidListHasOid(valid_trays, tm.input_tray) - ) - tm.input_tray = xpoid_none; - /* - * "medium" - */ - tm.medium = XpOidParse(*ptr_return, ptr_return); - /* - * parse out the InputTrayMedium sequence end character - */ - if(!ParseSeqEnd(*ptr_return, ptr_return)) - { - ErrorF("%s\n", XPMSG_WARN_ITM); - return NULL; - } - /* - * recurse to parse the next InputTrayMedium sequence - */ - list = TrayMediumListParse(*ptr_return, valid_trays, ptr_return, i+1); - if(list != (XpOidTrayMediumList*)NULL) - { - /* - * copy the current InputTrayMedium into the list - */ - memmove((list->list)+i, &tm, sizeof(XpOidTrayMedium)); - } - } - else - { - /* - * InputTrayMedium sequence start not found - */ - if(**ptr_return == '\0') - { - /* - * end of the list - */ - list = (XpOidTrayMediumList*) - XpOidCalloc(1, sizeof(XpOidTrayMediumList)); - list->count = i; - list->list = (XpOidTrayMedium*) - XpOidCalloc(i, sizeof(XpOidTrayMedium)); - } - else - { - /* - * syntax error - */ - ErrorF("%s\n", XPMSG_WARN_ITM); - return NULL; - } - } - /* - * return - */ - return list; -} - -/* - * ------------------------------------------------------------------------ - * Name: TrayMediumListValidate - * - * Description: - * - * Validate the input-trays-medium list based on a passed - * medium-source-sizes-supported structure. The validated - * input-trays-medium list will have the same number of entries upon - * return from this function. Invalid entries are indicated by - * setting the tray specification to xpoid_none. - * - * Return value: - * - * None. - * - */ -static void -TrayMediumListValidate(XpOidTrayMediumList* me, - const XpOidMediumSS* msss) -{ - int i_mss, i_ds, i_itm; - XpOidMediumDiscreteSizeList* ds_list; - int tray_count; - XpOid current_tray, current_medium; - XpOidMediumDiscreteSizeList* unspecified_tray_ds; - XpOidMediumDiscreteSizeList* tray_ds; - - if(msss == (XpOidMediumSS*)NULL - || - me == (XpOidTrayMediumList*)NULL) - { - return; - } - /* - * loop through the input trays medium list - */ - for(i_itm = 0; i_itm < XpOidTrayMediumListCount(me); i_itm++) - { - current_tray = XpOidTrayMediumListTray(me, i_itm); - if(current_tray == xpoid_none) - continue; - current_medium = XpOidTrayMediumListMedium(me, i_itm); - if(current_medium == xpoid_none) - { - /* - * no medium; invalidate this entry - */ - me->list[i_itm].input_tray = xpoid_none; - continue; - } - /* - * loop through the MediumSourceSizes, looking for an appropriate - * discrete sizes spec for the current tray - */ - unspecified_tray_ds = (XpOidMediumDiscreteSizeList*)NULL; - tray_ds = (XpOidMediumDiscreteSizeList*)NULL; - for(i_mss = 0; - i_mss < msss->count && - tray_ds == (XpOidMediumDiscreteSizeList*)NULL; - i_mss++) - { - switch((msss->mss)[i_mss].mstag) - { - case XpOidMediumSS_DISCRETE: - if((msss->mss)[i_mss].input_tray == current_tray) - tray_ds = (msss->mss)[i_mss].ms.discrete; - else if((msss->mss)[i_mss].input_tray == xpoid_unspecified) - unspecified_tray_ds = (msss->mss)[i_mss].ms.discrete; - break; - - case XpOidMediumSS_CONTINUOUS: - /* - * unsupported - */ - break; - } - } - /* - * if the tray was not matched, use the unspecified tray size - * list - */ - if(tray_ds == (XpOidMediumDiscreteSizeList*)NULL) - { - if(unspecified_tray_ds == (XpOidMediumDiscreteSizeList*)NULL) - { - /* - * not even an unspecified tray, invalidate this - * input-trays-medium entry. - */ - me->list[i_itm].input_tray = xpoid_none; - continue; - } - else - tray_ds = unspecified_tray_ds; - } - /* - * loop through the discrete sizes list, looking for a size that - * matches the medium for the current input tray - */ - for(i_ds = 0; i_ds < tray_ds->count; i_ds++) - { - /* - * check to see if the current input tray's medium size - * matches the current discrete size - * - * Note: in the CDEnext SI, medium identifiers coincide with - * medium-size identifiers. If the DP-Medium object is - * ever implemented, this check would need to be - * changed so that the input tray's medium size is - * obtained from the indicated Medium object, and not - * inferred from the medium identifier itself. - */ - if((tray_ds->list)[i_ds].page_size == current_medium) - { - /* - * The current input tray's medium size matches the - * current discrete medium size. - */ - break; - } - } - if(i_ds == tray_ds->count) - { - /* - * The current input tray's medium size was not found in the - * discrete size list; mark the input tray medium entry - * invalid - */ - me->list[i_itm].input_tray = xpoid_none; - } - - } -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidTrayMediumListString - * - * Description: - * - * Creates a string representation of an XpOidTrayMediumList structure. - * - * Return value: - * - * A newly allocated - * - */ -char* XpOidTrayMediumListString(const XpOidTrayMediumList* me) -{ - int i; - int length; - char* str; - char* ptr; - XpOid tray; - /* - * allocate enough memory for the string representation, - * including intervening delimiters and whitespace - */ - for(i = 0, length = 0; i < XpOidTrayMediumListCount(me); i++) - { - tray = XpOidTrayMediumListTray(me, i); - if(xpoid_none != tray) - { - length += XpOidStringLength(tray); - length += XpOidStringLength(XpOidTrayMediumListMedium(me, i)); - length += 4; - } - } - str = XpOidMalloc(length+1); - /* - * format the list - */ - for(i = 0, ptr = str; i < XpOidTrayMediumListCount(me); i++) - { - tray = XpOidTrayMediumListTray(me, i); - if(xpoid_none != tray) - { -#if defined(sun) && !defined(SVR4) - sprintf(ptr, "{%s %s} ", - XpOidString(tray), - XpOidString(XpOidTrayMediumListMedium(me, i))); - ptr += strlen(ptr); -#else - ptr += sprintf(ptr, "{%s %s} ", - XpOidString(tray), - XpOidString(XpOidTrayMediumListMedium(me, i))); -#endif - } - } - /* - * chop trailing whitespace or terminate empty string - */ - str[length] = '\0'; - /* - * return - */ - return str; -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidTrayMediumListHasTray - * - * Description: - * - * Determines if 'tray' is found in 'list'. - * - * Return value: - * - * xTrue if the tray is found in the list. - * - * xFalse if the tray is not in the list, or if 'list' is NULL. - * - */ -BOOL -XpOidTrayMediumListHasTray(const XpOidTrayMediumList* list, XpOid tray) -{ - int i; - if(list != (XpOidTrayMediumList*)NULL && tray != xpoid_none) - for(i = 0; i < list->count; i++) - if(XpOidTrayMediumListTray(list, i) == tray) - return xTrue; - return xFalse; -} - -/* - * ------------------------------------------------------------------------ - * Name: ParseArea - * - * Description: - * - * Skips leading whitespace and parses out and returns a XpOidArea. - * - * Return value: - * - * xTrue if the XpOidArea was successfully parsed. ptr_return is - * updated to point to location where the parsing ended. - * - * xFalse if a XpOidArea was not found; ptr_return is updated - * to point to the first non-whitespace char in value_string. - * - */ -static BOOL -ParseArea(const char* value_string, - const char** ptr_return, - XpOidArea* area_return) -{ - const char* first_nonws_ptr; - const char* ptr; - /* - * skip leading whitespace - */ - first_nonws_ptr = value_string + SpanWhitespace(value_string); - /* - * parse out the area sequence start - */ - if(!ParseSeqStart(first_nonws_ptr, &ptr)) - goto ParseArea_error; - /* - * parse the minimum x value - */ - if(!ParseRealValue(ptr, &ptr, - area_return ? &area_return->minimum_x : NULL)) - goto ParseArea_error; - /* - * parse the maximum x value - */ - if(!ParseRealValue(ptr, &ptr, - area_return ? &area_return->maximum_x : NULL)) - goto ParseArea_error; - /* - * parse the minimum y value - */ - if(!ParseRealValue(ptr, &ptr, - area_return ? &area_return->minimum_y : NULL)) - goto ParseArea_error; - /* - * parse the maximum y value - */ - if(!ParseRealValue(ptr, &ptr, - area_return ? &area_return->maximum_y : NULL)) - goto ParseArea_error; - /* - * parse out the area sequence end - */ - if(!ParseSeqEnd(ptr, &ptr)) - goto ParseArea_error; - /* - * update the return pointer - */ - if(ptr_return != (const char**)NULL) - *ptr_return = ptr; - /* - * return - */ - return xTrue; - - - ParseArea_error: - /* - * syntax error - */ - if(ptr_return != (const char**)NULL) - *ptr_return = first_nonws_ptr; - return xFalse; -} - -/* - * ------------------------------------------------------------------------ - * Name: ParseRealRange - * - * Description: - * - * Skips leading whitespace and parses out and returns a - * XpOidRealRange. - * - * Return value: - * - * xTrue if the XpOidRealRange was successfully - * parsed. ptr_return is updated to point to location where the - * parsing ended. - * - * xFalse if a XpOidRealRange was not found; ptr_return is - * updated to point to the first non-whitespace char in value_string. - * - */ -static BOOL -ParseRealRange(const char* value_string, - const char** ptr_return, - XpOidRealRange* range_return) -{ - const char* first_nonws_ptr; - const char* ptr; - /* - * skip leading whitespace - */ - first_nonws_ptr = value_string + SpanWhitespace(value_string); - /* - * parse out the range sequence start - */ - if(!ParseSeqStart(first_nonws_ptr, &ptr)) - goto ParseRealRange_error; - /* - * parse the lower bound - */ - if(!ParseRealValue(ptr, &ptr, - range_return ? &range_return->lower_bound : NULL)) - goto ParseRealRange_error; - /* - * parse the upper bound - */ - if(!ParseRealValue(ptr, &ptr, - range_return ? &range_return->upper_bound : NULL)) - goto ParseRealRange_error; - /* - * parse out the range sequence end - */ - if(!ParseSeqEnd(ptr, &ptr)) - goto ParseRealRange_error; - /* - * update the return pointer - */ - if(ptr_return != (const char**)NULL) - *ptr_return = ptr; - /* - * return - */ - return xTrue; - - - ParseRealRange_error: - /* - * syntax error - */ - if(ptr_return != (const char**)NULL) - *ptr_return = first_nonws_ptr; - return xFalse; -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidNotifyParse - * - * Description: - * - * - * Return value: - * - * - */ -XpOidNotify XpOidNotifyParse(const char* value_string) -{ - const char* ptr = value_string; - - if(value_string == (const char*)NULL) - return XPOID_NOTIFY_NONE; - /* - * look for an event handling profile sequence start - */ - if(!ParseSeqStart(value_string, &ptr)) - { - if('\0' == *ptr) - /* - * empty value is valid - */ - return XPOID_NOTIFY_NONE; - else - return XPOID_NOTIFY_UNSUPPORTED; - } - /* - * look for an event set sequence start - */ - if(!ParseSeqStart(ptr, &ptr)) - { - /* - * check for an empty event handling profile - */ - if(ParseSeqEnd(ptr, &ptr)) - { - ptr += SpanWhitespace(ptr); - if(*ptr == '\0') - /* - * valid empty event handling profile sequence - */ - return XPOID_NOTIFY_NONE; - } - return XPOID_NOTIFY_UNSUPPORTED; - } - /* - * the only event in the set should be report job completed - */ - if(xpoid_val_event_report_job_completed != XpOidParse(ptr, &ptr)) - return XPOID_NOTIFY_UNSUPPORTED; - /* - * event set sequence end - */ - if(!ParseSeqEnd(ptr, &ptr)) - return XPOID_NOTIFY_UNSUPPORTED; - /* - * delivery method of electronic mail - */ - if(xpoid_val_delivery_method_electronic_mail != XpOidParse(ptr, &ptr)) - return XPOID_NOTIFY_UNSUPPORTED; - /* - * event handling profile sequence end - */ - if(!ParseSeqEnd(ptr, &ptr)) - return XPOID_NOTIFY_UNSUPPORTED; - /* - * end of value - */ - ptr += SpanWhitespace(ptr); - if('\0' == *ptr) - /* - * valid supported notification profile - */ - return XPOID_NOTIFY_EMAIL; - else - return XPOID_NOTIFY_UNSUPPORTED; -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidNotifyString - * - * Description: - * - * - * Return value: - * - * - */ -const char* XpOidNotifyString(XpOidNotify notify) -{ - switch(notify) - { - case XPOID_NOTIFY_NONE: - return NOTIFY_NONE_STR; - case XPOID_NOTIFY_EMAIL: - return NOTIFY_EMAIL_STR; - case XPOID_NOTIFY_UNSUPPORTED: - return (const char *)NULL; - } - - ErrorF("XpOidNotifyString: Unsupported notify=%ld\n", (long)notify); - return (const char *)NULL; -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidDocFmtNew - * - * Description: - * - * - * Return value: - * - * - */ -XpOidDocFmt* -XpOidDocFmtNew(const char* value_string) -{ - XpOidDocFmt* doc_fmt; - const char* ptr; - - if((const char*)NULL == value_string) - return (XpOidDocFmt*)NULL; - ptr = value_string + SpanWhitespace(value_string); - if('\0' == *ptr) - return (XpOidDocFmt*)NULL; - /* - * get the document format from the value string - */ - doc_fmt = (XpOidDocFmt*)XpOidCalloc(1, sizeof(XpOidDocFmt)); - if(xTrue == XpOidDocFmtNext(doc_fmt, ptr, &ptr)) - { - /* - * verify that the document format is the only value specified - */ - ptr += SpanWhitespace(ptr); - if('\0' == *ptr) - /* - * valid document-format value - */ - return doc_fmt; - } - /* - * invalid - */ - XpOidDocFmtDelete(doc_fmt); - ErrorF("%s\n", XPMSG_WARN_DOC_FMT); - return (XpOidDocFmt*)NULL; -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidDocFmtDelete - * - * Description: - * - * - * Return value: - * - * - */ -void -XpOidDocFmtDelete(XpOidDocFmt* doc_fmt) -{ - if((XpOidDocFmt*)NULL != doc_fmt) - { - XpOidFree(doc_fmt->format); - XpOidFree(doc_fmt->variant); - XpOidFree(doc_fmt->version); - XpOidFree(doc_fmt); - } -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidDocFmtString - * - * Description: - * - * - * Return value: - * - * - */ -char* -XpOidDocFmtString(XpOidDocFmt* doc_fmt) -{ - if((XpOidDocFmt*)NULL != doc_fmt) - { - if((char*)NULL != doc_fmt->format) - { - char* str = XpOidMalloc(1+SafeStrLen(doc_fmt->format)+ - 1+SafeStrLen(doc_fmt->variant)+ - 1+SafeStrLen(doc_fmt->version)+ - 1+1); - sprintf(str, "{%s %s %s}", doc_fmt->format, - (char*)NULL != doc_fmt->variant ? doc_fmt->variant : "", - (char*)NULL != doc_fmt->version ? doc_fmt->version : ""); - return str; - } - } - return (char*)NULL; -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidDocFmtNext - * - * Description: - * - * Assumes non-NULL value string. - * - * Return value: - * - * - */ -static BOOL -XpOidDocFmtNext(XpOidDocFmt* doc_fmt, - const char* value_string, - const char** ptr_return) -{ - const char* ptr; - const char* first_nonws_ptr; - const char* format; - const char* variant; - const char* version; - int format_len; - int variant_len; - int version_len; - /* - * skip leading whitespace - */ - ptr = value_string + SpanWhitespace(value_string); - first_nonws_ptr = ptr; - /* - * sequence start - */ - if(!ParseSeqStart(ptr, &ptr)) - goto XpOidDocFmtNext_error; - /* - * skip whitepace to the start of the document format, and save the - * location - */ - ptr += SpanWhitespace(ptr); - format = ptr; - /* - * document format - */ - if(0 == (format_len = SpanToken(ptr))) - goto XpOidDocFmtNext_error; - ptr += format_len; - /* - * optional variant - */ - ptr += SpanWhitespace(ptr); - variant = ptr; - if(0 != (variant_len = SpanToken(ptr))) - { - ptr += variant_len; - /* - * optional version - */ - ptr += SpanWhitespace(ptr); - version = ptr; - version_len = SpanToken(ptr); - ptr += version_len; - } - else - version_len = 0; - /* - * sequence end - */ - if(!ParseSeqEnd(ptr, &ptr)) - goto XpOidDocFmtNext_error; - /* - * update return pointer - */ - if((const char**)NULL != ptr_return) - *ptr_return = ptr; - /* - * update the passed document format struct - */ - memset(doc_fmt, 0, sizeof(XpOidDocFmt)); - doc_fmt->format = XpOidMalloc(format_len+1); - strncpy(doc_fmt->format, format, format_len); - doc_fmt->format[format_len] = '\0'; - if(0 < variant_len) - { - doc_fmt->variant = XpOidMalloc(variant_len+1); - strncpy(doc_fmt->variant, variant, variant_len); - doc_fmt->variant[variant_len] = '\0'; - if(0 < version_len) - { - doc_fmt->version = XpOidMalloc(version_len+1); - strncpy(doc_fmt->version, version, version_len); - doc_fmt->version[version_len] = '\0'; - } - } - return xTrue; - - XpOidDocFmtNext_error: - if((const char**)NULL != ptr_return) - *ptr_return = first_nonws_ptr; - return xFalse; -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidDocFmtListNew - * - * Description: - * - * - * Return value: - * - * - */ -XpOidDocFmtList* -XpOidDocFmtListNew(const char* value_string, - const XpOidDocFmtList* valid_fmts) -{ - if((char*)NULL != value_string) - { - const char* ptr; - return XpOidDocFmtListParse(value_string, valid_fmts, &ptr, 0); - } - return (XpOidDocFmtList*)NULL; -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidDocFmtListDelete - * - * Description: - * - * - * Return value: - * - * - */ -void -XpOidDocFmtListDelete(XpOidDocFmtList* list) -{ - if((XpOidDocFmtList*)NULL != list) - { - int i; - for(i = 0; i < list->count; i++) - { - XpOidFree(list->list[i].format); - XpOidFree(list->list[i].variant); - XpOidFree(list->list[i].version); - } - XpOidFree(list->list); - XpOidFree(list); - } -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidDocFmtListString - * - * Description: - * - * Assumes the passed structure is valid. - * - * Return value: - * - * - */ -char* -XpOidDocFmtListString(const XpOidDocFmtList* list) -{ - if((XpOidDocFmtList*)NULL != list) - { - if(0 < list->count) - { - int i; - int str_len; - char* str; - char* ptr; - /* - * allocate the return string - */ - for(i = 0, str_len = 0; i < list->count; i++) - { - str_len += - 1 + SafeStrLen(list->list[i].format) + - 1 + SafeStrLen(list->list[i].variant) + - 1 + SafeStrLen(list->list[i].version) + 2; - } - str = XpOidMalloc(str_len+1); - /* - * print the list into the string and return it - */ - ptr = str; - for(i = 0; i < list->count; i++) - { - XpOidDocFmt* df = &list->list[i]; - -#if defined(sun) && !defined(SVR4) - sprintf(ptr, "{%s %s %s} ", - df->format, - (char*)NULL != df->variant ? df->variant : "", - (char*)NULL != df->version ? df->version : ""); - ptr += strlen(ptr); -#else - ptr += - sprintf(ptr, "{%s %s %s} ", - df->format, - (char*)NULL != df->variant ? df->variant : "", - (char*)NULL != df->version ? df->version : ""); -#endif - } - return str; - } - } - return (char*)NULL; -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidDocFmtListParse - * - * Description: - * - * Assumes the passed value_string and ptr_return are non-NULL. - * - * Return value: - * - * - */ -static XpOidDocFmtList* -XpOidDocFmtListParse(const char* value_string, - const XpOidDocFmtList* valid_fmts, - const char** ptr_return, - int i) -{ - XpOidDocFmt doc_fmt; - XpOidDocFmtList* list; - BOOL status; - /* - * get the next document-format from the value string, skipping - * values not found in the passed list of valid formats - */ - *ptr_return = value_string; - while((status = XpOidDocFmtNext(&doc_fmt, *ptr_return, ptr_return)) - && - (const XpOidDocFmtList*)NULL != valid_fmts - && - !XpOidDocFmtListHasFmt(valid_fmts, &doc_fmt) - ); - - if(xFalse == status) - { - if('\0' == **ptr_return) - { - if(0 == i) - { - /* - * empty value string - */ - return (XpOidDocFmtList*)NULL; - } - else - { - /* - * done parsing; allocate the list and return - */ - list = - (XpOidDocFmtList*)XpOidCalloc(1, sizeof(XpOidDocFmtList)); - list->count = i; - list->list = (XpOidDocFmt*)XpOidCalloc(i, sizeof(XpOidDocFmt)); - return list; - } - } - else - { - /* - * invalid document format - */ - ErrorF("%s\n", XPMSG_WARN_DOCFMT_LIST); - return (XpOidDocFmtList*)NULL; - } - } - else - { - /* - * recurse to parse remaining document formats - */ - list = XpOidDocFmtListParse(*ptr_return, valid_fmts, ptr_return, i+1); - if((XpOidDocFmtList*)NULL != list) - { - /* - * add this doc fmt to the list - */ - list->list[i].format = doc_fmt.format; - list->list[i].variant = doc_fmt.variant; - list->list[i].version = doc_fmt.version; - } - return list; - } -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidDocFmtListHasFmt - * - * Description: - * - * Assumes the passed structure is valid. - * - * Return value: - * - * - */ -BOOL -XpOidDocFmtListHasFmt(const XpOidDocFmtList* list, - const XpOidDocFmt* fmt) -{ - int i; - if(list != (XpOidDocFmtList*)NULL - && - fmt != (XpOidDocFmt*)NULL - && - fmt->format != (char*)NULL - ) - { - for(i = 0; i < list->count; i++) - { - /* - * formats must match - */ - if(strcmp(fmt->format, list->list[i].format) != 0) - continue; - /* - * variants must both be NULL or match - */ - if(fmt->variant == (char*)NULL) - { - if(list->list[i].variant == (char*)NULL) - return xTrue; - else - continue; - } - if(list->list[i].variant == (char*)NULL) - continue; - if(strcmp(fmt->variant, list->list[i].variant) != 0) - continue; - /* - * versions must both be NULL or match - */ - if(fmt->version == (char*)NULL) - { - if(list->list[i].version == (char*)NULL) - return xTrue; - else - continue; - } - if(list->list[i].version == (char*)NULL) - continue; - if(strcmp(fmt->version, list->list[i].version) == 0) - return xTrue; - } - } - return xFalse; -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidCardListNew - * - * Description: - * - * - * Return value: - * - * - */ -XpOidCardList* -XpOidCardListNew(const char* value_string, const XpOidCardList* valid_cards) -{ - if((const char*)NULL != value_string) - { - const char* ptr; - - return XpOidCardListParse(value_string, valid_cards, &ptr, 0); - } - else - return (XpOidCardList*)NULL; -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidCardListDelete - * - * Description: - * - * - * Return value: - * - * - */ -void -XpOidCardListDelete(XpOidCardList* list) -{ - if((XpOidCardList*)NULL != list) - { - XpOidFree(list->list); - XpOidFree(list); - } -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidCardListString - * - * Description: - * - * - * Return value: - * - * - */ -char* -XpOidCardListString(const XpOidCardList* list) -{ - if((XpOidCardList*)NULL != list) - { - char buf[48]; - int str_len; - char* str; - int i; - char* ptr; - /* - * allocate the output string - */ - for(i = 0, str_len = 0; i < list->count; i++) -#if defined(sun) && !defined(SVR4) - { - sprintf(buf, "%lu", list->list[i]) + 1; - str_len += strlen(buf); - } -#else - str_len += sprintf(buf, "%lu", list->list[i]) + 1; -#endif - str = XpOidMalloc(str_len+1); - /* - * write the list to the string - */ - for(i = 0, ptr = str; i < list->count; i++) -#if defined(sun) && !defined(SVR4) - { - sprintf(ptr, "%lu ", list->list[i]); - ptr += strlen(ptr); - } -#else - ptr += sprintf(ptr, "%lu ", list->list[i]); -#endif - return str; - } - else - return (char*)NULL; -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidCardListHasCard - * - * Description: - * - * Determines if 'card' is an element of 'list'. - * - * Return value: - * - * xTrue if the card is found in the list. - * - * xFalse if the card is not in the list, or if 'list' is NULL. - * - */ -BOOL -XpOidCardListHasCard(const XpOidCardList* list, unsigned long card) -{ - int i; - if(list != (XpOidCardList*)NULL) - for(i = 0; i < list->count; i++) - if(list->list[i] == card) - return xTrue; - return xFalse; -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidCardListParse - * - * Description: - * - * Assumes the passed value_string and ptr_return are non-NULL. - * - * Return value: - * - * - */ -static XpOidCardList* -XpOidCardListParse(const char* value_string, - const XpOidCardList* valid_cards, - const char** ptr_return, - int i) -{ - unsigned long card; - XpOidCardList* list; - BOOL status; - - /* - * get the next card from the value string, skipping values not - * found in the passed list of valid cards - */ - *ptr_return = value_string; - while((status = XpOidParseUnsignedValue(*ptr_return, ptr_return, &card)) - && - (const XpOidCardList*)NULL != valid_cards - && - !XpOidCardListHasCard(valid_cards, card) - ); - - if(xFalse == status) - { - if('\0' == **ptr_return) - { - if(0 == i) - { - /* - * empty value string - */ - return (XpOidCardList*)NULL; - } - else - { - /* - * done parsing; allocate the list and return - */ - list = (XpOidCardList*)XpOidCalloc(1, sizeof(XpOidCardList)); - list->count = i; - list->list = - (unsigned long*)XpOidCalloc(i, sizeof(unsigned long)); - return list; - } - } - else - { - /* - * parsing error - */ - ErrorF("%s\n", XPMSG_WARN_CARD_LIST); - return (XpOidCardList*)NULL; - } - } - else - { - /* - * recurse to parse remaining cardinal values - */ - list = XpOidCardListParse(*ptr_return, valid_cards, ptr_return, i+1); - if((XpOidCardList*)NULL != list) - { - /* - * add this value to the list - */ - list->list[i] = card; - } - return list; - } -} - -/* - * ------------------------------------------------------------------------ - * Name: ParseBoolValue - * - * Description: - * - * - * Return value: - * - * - */ -static BOOL -ParseBoolValue(const char* value_string, - const char** ptr_return, - BOOL* bool_return) -{ - const char* ptr; - int length; - BOOL status; - /* - * skip leading whitespace - */ - ptr = value_string + SpanWhitespace(value_string); - /* - * get the whitespace-delimited token length - */ - length = SpanToken(ptr); - /* - * determine if true or false or bad - */ - if(StrnCaseCmp(ptr, "TRUE", length) == 0) - { - if(bool_return != (BOOL*)NULL) - *bool_return = xTrue; - status = xTrue; - } - else if(StrnCaseCmp(ptr, "FALSE", length) == 0) - { - if(bool_return != (BOOL*)NULL) - *bool_return = xFalse; - status = xTrue; - } - else - { - /* - * syntax error - */ - status = xFalse; - } - /* - * update the return pointer and return - */ - if(ptr_return != (const char**)NULL) - *ptr_return = status ? ptr+length : ptr; - return status; -} - -/* - * ------------------------------------------------------------------------ - * Name: XpOidParseUnsignedValue - * - * Description: - * - * Skips leading whitespace and parses out and returns a unsigned number. - * - * Return value: - * - * xTrue if a unsigned number was successfully parsed. ptr_return is - * updated to point to location where the unsigned number parsing - * ended. - * - * xFalse if a unsigned number was not found; ptr_return is updated - * to point to the first non-whitespace char in value_string. - * - */ -BOOL -XpOidParseUnsignedValue(const char* value_string, - const char** ptr_return, - unsigned long* unsigned_return) -{ - long value; - BOOL status; - const char* first_nonws_ptr; - const char* ptr; - /* - * skip leading whitespace - */ - first_nonws_ptr = value_string + SpanWhitespace(value_string); - value = strtol(first_nonws_ptr, (char**)(&ptr), 0); - if(ptr == first_nonws_ptr || value < 0) - status = xFalse; - else - status = xTrue; - /* - * update return parms - */ - if(ptr_return != (const char**)NULL) - *ptr_return = ptr; - if(unsigned_return != (unsigned long*)NULL) - *unsigned_return = (unsigned long)value; - /* - * return - */ - return status; -} - -/* - * ------------------------------------------------------------------------ - * Name: ParseRealValue - * - * Description: - * - * Skips leading whitespace and parses out and returns a real number. - * - * Return value: - * - * xTrue if a real number was successfully parsed. ptr_return is - * updated to point to location where the real number parsing - * ended. - * - * xFalse if a real number was not found; ptr_return is updated - * to point to the first non-whitespace char in value_string. - * - */ -static BOOL -ParseRealValue(const char* value_string, - const char** ptr_return, - float* real_return) -{ - float real_value; - BOOL status; - const char* first_nonws_ptr; - const char* ptr; - /* - * skip leading whitespace - */ - first_nonws_ptr = value_string + SpanWhitespace(value_string); - real_value = (float)strtod(first_nonws_ptr, (char**)(&ptr)); - if(ptr == first_nonws_ptr) - status = xFalse; - else - status = xTrue; - /* - * update return parms - */ - if(ptr_return != (const char**)NULL) - *ptr_return = ptr; - if(real_return != (float*)NULL) - *real_return = real_value; - /* - * return - */ - return status; -} - -/* - * ------------------------------------------------------------------------ - * Name: ParseSeqEnd - * - * Description: - * - * Description: - * - * Skips leading whitespace and parses out the sequence end - * character '}'. - * - * Return value: - * - * xTrue if the sequence end character was parsed; ptr_return is - * updated to point to the first char following the sequence end - * character. - * - * xFalse if the sequence end character was not found; ptr_return is - * updated to point to the first non-whitespace char in value_string. - * - */ -static BOOL -ParseSeqEnd(const char* value_string, - const char** ptr_return) -{ - const char* ptr; - BOOL status; - /* - * skip leading whitespace - */ - ptr = value_string + SpanWhitespace(value_string); - /* - * parse out the sequence end character - */ - if(*ptr == '}') - { - status = xTrue; - ++ptr; - } - else - status = xFalse; - /* - * update the return pointer - */ - if(ptr_return != (const char**)NULL) - *ptr_return = ptr; - /* - * return - */ - return status; -} - -/* - * ------------------------------------------------------------------------ - * Name: ParseSeqStart - * - * Description: - * - * Skips leading whitespace and parses out the sequence start - * character '{'. - * - * Return value: - * - * xTrue if the sequence start character was parsed; ptr_return is - * updated to point to the first char following the sequence start - * character. - * - * xFalse if the sequence start character was not found; ptr_return is - * updated to point to the first non-whitespace char in value_string. - * - */ -static BOOL -ParseSeqStart(const char* value_string, - const char** ptr_return) -{ - const char* ptr; - BOOL status; - /* - * skip leading whitespace - */ - ptr = value_string + SpanWhitespace(value_string); - /* - * parse out the sequence start character - */ - if(*ptr == '{') - { - status = xTrue; - ++ptr; - } - else - status = xFalse; - /* - * update the return pointer - */ - if(ptr_return != (const char**)NULL) - *ptr_return = ptr; - /* - * return - */ - return status; -} - -/* - * ------------------------------------------------------------------------ - * Name: ParseUnspecifiedValue - * - * Description: - * - * Skips leading whitespace and parses out an unspecified optional - * value (i.e. matching '' or "" - skips all data between the set of - * quotes). - * - * Return value: - * - * xTrue if an unspecified value was parsed; ptr_return is updated to - * point to the first char following the trailing quote. - * - * xFalse if an unspecified value was not found; ptr_return is updated - * to point to the first non-whitespace char in value_string. - * - */ -static BOOL -ParseUnspecifiedValue(const char* value_string, - const char** ptr_return) -{ - BOOL status; - const char* ptr; - /* - * skip leading whitespace - */ - ptr = value_string + SpanWhitespace(value_string); - /* - * parse out an unspecified optional value ('' or "") - */ - if(*ptr == '\'' || *ptr == '"') - { - char delim[2]; - - if(ptr_return != (const char**)NULL) - { - delim[0] = *ptr; - delim[1] = '\0'; - /* - * skip over the matching delimiter - */ - ++ptr; - ptr += strcspn(ptr, delim); - if(*ptr != '\0') - ++ptr; - } - status = xTrue; - } - else - status = xFalse; - /* - * update the return pointer - */ - if(ptr_return != (const char**)NULL) - *ptr_return = ptr; - /* - * return - */ - return status; -} - -/* - * ------------------------------------------------------------------------ - * Name: SpanToken - * - * Description: - * - * Returns the length of the initial segment of the passed string - * that consists entirely of non-whitespace and non-sequence - * delimiter characters. - * - * - */ -static int -SpanToken(const char* string) -{ - const char* ptr; - for(ptr = string; - *ptr != '\0' && !isspace(*ptr) && *ptr != '{' && *ptr != '}'; - ++ptr); - return ptr - string; -} - -/* - * ------------------------------------------------------------------------ - * Name: SpanWhitespace - * - * Description: - * - * Returns the length of the initial segment of the passed string - * that consists entirely of whitespace characters. - * - * - */ -static int -SpanWhitespace(const char* string) -{ - const char* ptr; - for(ptr = string; *ptr != '\0' && isspace(*ptr); ++ptr); - return ptr - string; -} - -#ifndef HAVE_STRCASECMP -/* - * ------------------------------------------------------------------------ - * Name: StrnCaseCmp - * - * Description: - * - * Implements strncasecmp() for those platforms that need it. - * - * - */ -static int -StrnCaseCmp(const char *s1, const char *s2, size_t len) -{ - char c1, c2; - int result; - - while (len--) - { - c1 = *s1++; - c2 = *s2++; - result = tolower(c1) - tolower(c2); - - if (result != 0) - return result; - } - - return 0; -} -#endif diff --git a/nx-X11/programs/Xserver/Xprint/Oid.h b/nx-X11/programs/Xserver/Xprint/Oid.h deleted file mode 100644 index ba9dc77f3..000000000 --- a/nx-X11/programs/Xserver/Xprint/Oid.h +++ /dev/null @@ -1,294 +0,0 @@ -/* $Xorg: Oid.h,v 1.3 2000/08/17 19:48:06 cpqbld Exp $ */ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifndef _Xp_Oid_h -#define _Xp_Oid_h - -#include - -/* - * include the auto-generated XpOid enum definition - */ -#include "OidDefs.h" - -/* - * messages - */ -#define XPMSG_WARN_MSS "Syntax error parsing medium-source-sizes" -#define XPMSG_WARN_ITM "Syntax error parsing input-trays-medium" -#define XPMSG_WARN_DOC_FMT "Syntax error parsing document format" -#define XPMSG_WARN_DOCFMT_LIST "Syntax error parsing document format list" -#define XPMSG_WARN_CARD_LIST "Syntax error parsing cardinal list" - -/* - * macros for memory allocation - */ -#define XpOidMalloc(size) ((char*)Xalloc((unsigned long)(size))) -#define XpOidCalloc(count, size) \ - ((char*)Xcalloc((unsigned long)((count)*(size)))) -#define XpOidFree(mem) (Xfree((unsigned long*)(mem))) - -/* - * list of object identifiers - */ -typedef struct _XpOidList -{ - XpOid* list; - int count; -} XpOidList; - -/* - * linked list of object identifiers - */ -typedef struct XpOidNodeStruct -{ - XpOid oid; - struct XpOidNodeStruct* next; -} *XpOidNode; - -typedef struct _XpOidLinkedList -{ - XpOidNode head; - XpOidNode tail; - XpOidNode current; - int count; -} XpOidLinkedList; - -/* - * XpOidMediumSourceSize and related definitions - */ -typedef struct -{ - float minimum_x; - float maximum_x; - float minimum_y; - float maximum_y; -} XpOidArea; - -typedef struct -{ - float lower_bound; - float upper_bound; -} XpOidRealRange; - -typedef struct -{ - XpOidRealRange range_across_feed; - float increment_across_feed; - XpOidRealRange range_in_feed; - float increment_in_feed; - BOOL long_edge_feeds; - XpOidArea assured_reproduction_area; -} XpOidMediumContinuousSize; - -typedef struct -{ - XpOid page_size; - BOOL long_edge_feeds; - XpOidArea assured_reproduction_area; -} XpOidMediumDiscreteSize; - -typedef struct -{ - XpOidMediumDiscreteSize* list; - int count; -} XpOidMediumDiscreteSizeList; - -typedef struct -{ - XpOid input_tray; /* may be set to xpoid_none or xpoid_unspecified */ - enum { XpOidMediumSS_DISCRETE, XpOidMediumSS_CONTINUOUS } mstag; - union - { - XpOidMediumDiscreteSizeList* discrete; - XpOidMediumContinuousSize* continuous_size; - } ms; /* "ms" is short for medium-size */ - -} XpOidMediumSourceSize; - -typedef struct -{ - XpOidMediumSourceSize* mss; - int count; -} XpOidMediumSS; - - -typedef struct -{ - XpOid input_tray; /* may be set to xpoid_none */ - XpOid medium; -} XpOidTrayMedium; - -typedef struct -{ - XpOidTrayMedium* list; - int count; -} XpOidTrayMediumList; - -typedef enum { - XPOID_NOTIFY_UNSUPPORTED, - XPOID_NOTIFY_NONE, - XPOID_NOTIFY_EMAIL -} XpOidNotify; - -typedef struct -{ - unsigned long *list; - int count; -} XpOidCardList; - -typedef struct -{ - char* format; - char* variant; - char* version; -} XpOidDocFmt; - -typedef struct -{ - XpOidDocFmt* list; - int count; -} XpOidDocFmtList; - - -/* - * XpOid public methods - */ -const char* XpOidString(XpOid); -int XpOidStringLength(XpOid); -XpOid XpOidFromString(const char* value); -BOOL XpOidTrayMediumListHasTray(const XpOidTrayMediumList* list, XpOid tray); - -/* - * XpOidList public methods - */ -XpOidList* XpOidListNew(const char* value_string, - const XpOidList* valid_oids); -#define XpOidListInit(l, a, c) { (l)->list = (a); (l)->count = (c); } -void XpOidListDelete(XpOidList*); -#define XpOidListCount(l) ((l) ? (l)->count : 0) -#define XpOidListGetOid(l, i) ((l) ? (l)->list[(i)] : xpoid_none) -int XpOidListGetIndex(const XpOidList* list, XpOid oid); -BOOL XpOidListHasOid(const XpOidList* list, XpOid oid); -char* XpOidListString(const XpOidList*); - - -/* - * XpOidLinkedList public methods - */ -XpOidLinkedList* XpOidLinkedListNew(); -void XpOidLinkedListDelete(XpOidLinkedList*); -#define XpOidLinkedListCount(l) ((l) ? (l)->count : 0) -XpOid XpOidLinkedListGetOid(XpOidLinkedList* list, int i); -void XpOidLinkedListAddOid(XpOidLinkedList* list, XpOid oid); -int XpOidLinkedListGetIndex(XpOidLinkedList* list, XpOid oid); -BOOL XpOidLinkedListHasOid(XpOidLinkedList* list, - XpOid oid); -XpOid XpOidLinkedListFirstOid(XpOidLinkedList* list); -XpOid XpOidLinkedListNextOid(XpOidLinkedList* list); - -/* - * XpOidMediumSourceSize public methods - */ -XpOidMediumSS* XpOidMediumSSNew(const char* value_string, - const XpOidList* valid_trays, - const XpOidList* valid_medium_sizes); -void XpOidMediumSSDelete(XpOidMediumSS*); -#define XpOidMediumSSCount(me) ((me) ? (me)->count : 0) -BOOL XpOidMediumSSHasSize(XpOidMediumSS*, XpOid medium_size); -char* XpOidMediumSSString(const XpOidMediumSS*); - -/* - * XpOidTrayMediumList public methods - */ -XpOidTrayMediumList* XpOidTrayMediumListNew(const char* value_string, - const XpOidList* valid_trays, - const XpOidMediumSS* msss); -void XpOidTrayMediumListDelete(XpOidTrayMediumList* me); -#define XpOidTrayMediumListCount(me) ((me) ? (me)->count : 0) -#define XpOidTrayMediumListTray(me, i) \ - ((me) ? (me)->list[(i)].input_tray : xpoid_none) -#define XpOidTrayMediumListMedium(me, i) \ - ((me) ? (me)->list[(i)].medium : xpoid_none) -char* XpOidTrayMediumListString(const XpOidTrayMediumList*); - -/* - * XpOidNotify public methods - */ -XpOidNotify XpOidNotifyParse(const char* value_string); -const char* XpOidNotifyString(XpOidNotify notify); - -/* - * XpOidDocFmt public methods - */ -XpOidDocFmt* XpOidDocFmtNew(const char* value_string); -void XpOidDocFmtDelete(XpOidDocFmt*); -char* XpOidDocFmtString(XpOidDocFmt*); - -/* - * XpOidDocFmtList public methods - */ -XpOidDocFmtList* XpOidDocFmtListNew(const char* value_string, - const XpOidDocFmtList* valid_fmts); -void XpOidDocFmtListDelete(XpOidDocFmtList*); -char* XpOidDocFmtListString(const XpOidDocFmtList*); -#define XpOidDocFmtListCount(me) ((me) ? (me)->count : 0) -#define XpOidDocFmtListGetDocFmt(me, i) \ - ((me) ? &(me)->list[(i)] : (XpDocFmt*)NULL) -BOOL XpOidDocFmtListHasFmt(const XpOidDocFmtList* list, - const XpOidDocFmt* fmt); -/* - * XpOidCardList public methods - */ -XpOidCardList* XpOidCardListNew(const char* value_string, - const XpOidCardList* valid_cards); -#define XpOidCardListInit(l, a, c) { (l)->list = (a); (l)->count = (c); } -void XpOidCardListDelete(XpOidCardList*); -char* XpOidCardListString(const XpOidCardList*); -#define XpOidCardListCount(me) ((me) ? (me)->count : 0) -#define XpOidCardListGetCard(me, i) ((me) ? (me)->list[(i)] : 0) -BOOL XpOidCardListHasCard(const XpOidCardList*, unsigned long); - -/* - * misc parsing functions - */ -BOOL XpOidParseUnsignedValue(const char* value_string, - const char** ptr_return, - unsigned long* unsigned_return); - - -#endif /* _Xp_Oid_h - don't add anything after this line */ diff --git a/nx-X11/programs/Xserver/Xprint/OidDefs.h b/nx-X11/programs/Xserver/Xprint/OidDefs.h deleted file mode 100644 index 55b6568f0..000000000 --- a/nx-X11/programs/Xserver/Xprint/OidDefs.h +++ /dev/null @@ -1,171 +0,0 @@ -/* $Xorg: OidDefs.h,v 1.4 2001/03/14 18:45:13 pookie Exp $ */ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ -/* This is an automatically-generated file. Do not edit. */ - -typedef enum { - xpoid_none, - xpoid_unspecified, - xpoid_att_descriptor, - xpoid_att_content_orientation, - xpoid_att_copy_count, - xpoid_att_default_printer_resolution, - xpoid_att_default_input_tray, - xpoid_att_default_medium, - xpoid_att_document_format, - xpoid_att_plex, - xpoid_att_xp_listfonts_modes, - xpoid_att_job_name, - xpoid_att_job_owner, - xpoid_att_notification_profile, - xpoid_att_xp_setup_state, - xpoid_att_xp_spooler_command_options, - xpoid_att_content_orientations_supported, - xpoid_att_document_formats_supported, - xpoid_att_dt_pdm_command, - xpoid_att_input_trays_medium, - xpoid_att_medium_source_sizes_supported, - xpoid_att_plexes_supported, - xpoid_att_printer_model, - xpoid_att_printer_name, - xpoid_att_printer_resolutions_supported, - xpoid_att_xp_embedded_formats_supported, - xpoid_att_xp_listfonts_modes_supported, - xpoid_att_xp_page_attributes_supported, - xpoid_att_xp_raw_formats_supported, - xpoid_att_xp_setup_proviso, - xpoid_att_document_attributes_supported, - xpoid_att_job_attributes_supported, - xpoid_att_locale, - xpoid_att_multiple_documents_supported, - xpoid_att_available_compression, - xpoid_att_available_compressions_supported, - xpoid_val_content_orientation_portrait, - xpoid_val_content_orientation_landscape, - xpoid_val_content_orientation_reverse_portrait, - xpoid_val_content_orientation_reverse_landscape, - xpoid_val_medium_size_iso_a0, - xpoid_val_medium_size_iso_a1, - xpoid_val_medium_size_iso_a2, - xpoid_val_medium_size_iso_a3, - xpoid_val_medium_size_iso_a4, - xpoid_val_medium_size_iso_a5, - xpoid_val_medium_size_iso_a6, - xpoid_val_medium_size_iso_a7, - xpoid_val_medium_size_iso_a8, - xpoid_val_medium_size_iso_a9, - xpoid_val_medium_size_iso_a10, - xpoid_val_medium_size_iso_b0, - xpoid_val_medium_size_iso_b1, - xpoid_val_medium_size_iso_b2, - xpoid_val_medium_size_iso_b3, - xpoid_val_medium_size_iso_b4, - xpoid_val_medium_size_iso_b5, - xpoid_val_medium_size_iso_b6, - xpoid_val_medium_size_iso_b7, - xpoid_val_medium_size_iso_b8, - xpoid_val_medium_size_iso_b9, - xpoid_val_medium_size_iso_b10, - xpoid_val_medium_size_na_letter, - xpoid_val_medium_size_na_legal, - xpoid_val_medium_size_executive, - xpoid_val_medium_size_folio, - xpoid_val_medium_size_invoice, - xpoid_val_medium_size_ledger, - xpoid_val_medium_size_quarto, - xpoid_val_medium_size_iso_c3, - xpoid_val_medium_size_iso_c4, - xpoid_val_medium_size_iso_c5, - xpoid_val_medium_size_iso_c6, - xpoid_val_medium_size_iso_designated_long, - xpoid_val_medium_size_na_10x13_envelope, - xpoid_val_medium_size_na_9x12_envelope, - xpoid_val_medium_size_na_number_10_envelope, - xpoid_val_medium_size_na_7x9_envelope, - xpoid_val_medium_size_na_9x11_envelope, - xpoid_val_medium_size_na_10x14_envelope, - xpoid_val_medium_size_na_number_9_envelope, - xpoid_val_medium_size_na_6x9_envelope, - xpoid_val_medium_size_na_10x15_envelope, - xpoid_val_medium_size_monarch_envelope, - xpoid_val_medium_size_a, - xpoid_val_medium_size_b, - xpoid_val_medium_size_c, - xpoid_val_medium_size_d, - xpoid_val_medium_size_e, - xpoid_val_medium_size_jis_b0, - xpoid_val_medium_size_jis_b1, - xpoid_val_medium_size_jis_b2, - xpoid_val_medium_size_jis_b3, - xpoid_val_medium_size_jis_b4, - xpoid_val_medium_size_jis_b5, - xpoid_val_medium_size_jis_b6, - xpoid_val_medium_size_jis_b7, - xpoid_val_medium_size_jis_b8, - xpoid_val_medium_size_jis_b9, - xpoid_val_medium_size_jis_b10, - xpoid_val_medium_size_hp_2x_postcard, - xpoid_val_medium_size_hp_european_edp, - xpoid_val_medium_size_hp_mini, - xpoid_val_medium_size_hp_postcard, - xpoid_val_medium_size_hp_tabloid, - xpoid_val_medium_size_hp_us_edp, - xpoid_val_medium_size_hp_us_government_legal, - xpoid_val_medium_size_hp_us_government_letter, - xpoid_val_plex_simplex, - xpoid_val_plex_duplex, - xpoid_val_plex_tumble, - xpoid_val_input_tray_top, - xpoid_val_input_tray_middle, - xpoid_val_input_tray_bottom, - xpoid_val_input_tray_envelope, - xpoid_val_input_tray_manual, - xpoid_val_input_tray_large_capacity, - xpoid_val_input_tray_main, - xpoid_val_input_tray_side, - xpoid_val_event_report_job_completed, - xpoid_val_delivery_method_electronic_mail, - xpoid_val_xp_setup_mandatory, - xpoid_val_xp_setup_optional, - xpoid_val_xp_setup_ok, - xpoid_val_xp_setup_incomplete, - xpoid_val_xp_list_glyph_fonts, - xpoid_val_xp_list_internal_printer_fonts, - xpoid_val_available_compressions_0, - xpoid_val_available_compressions_01, - xpoid_val_available_compressions_02, - xpoid_val_available_compressions_03, - xpoid_val_available_compressions_012, - xpoid_val_available_compressions_013, - xpoid_val_available_compressions_023, - xpoid_val_available_compressions_0123 -} XpOid; diff --git a/nx-X11/programs/Xserver/Xprint/OidStrs.h b/nx-X11/programs/Xserver/Xprint/OidStrs.h deleted file mode 100644 index 1792a6e16..000000000 --- a/nx-X11/programs/Xserver/Xprint/OidStrs.h +++ /dev/null @@ -1,173 +0,0 @@ -/* $Xorg: OidStrs.h,v 1.4 2001/03/14 18:45:40 pookie Exp $ */ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ -/* This is an automatically-generated file. Do not edit. */ - -static int XpOidStringMapCount = 127; - -static const XpOidStringMapEntry XpOidStringMap[] = { - { "", 0 }, - { "", 0 }, - { "descriptor", 10 }, - { "content-orientation", 19 }, - { "copy-count", 10 }, - { "default-printer-resolution", 26 }, - { "default-input-tray", 18 }, - { "default-medium", 14 }, - { "document-format", 15 }, - { "plex", 4 }, - { "xp-listfonts-modes", 18 }, - { "job-name", 8 }, - { "job-owner", 9 }, - { "notification-profile", 20 }, - { "xp-setup-state", 14 }, - { "xp-spooler-command-options", 26 }, - { "content-orientations-supported", 30 }, - { "document-formats-supported", 26 }, - { "dt-pdm-command", 14 }, - { "input-trays-medium", 18 }, - { "medium-source-sizes-supported", 29 }, - { "plexes-supported", 16 }, - { "printer-model", 13 }, - { "printer-name", 12 }, - { "printer-resolutions-supported", 29 }, - { "xp-embedded-formats-supported", 29 }, - { "xp-listfonts-modes-supported", 28 }, - { "xp-page-attributes-supported", 28 }, - { "xp-raw-formats-supported", 24 }, - { "xp-setup-proviso", 16 }, - { "document-attributes-supported", 29 }, - { "job-attributes-supported", 24 }, - { "locale", 6 }, - { "multiple-documents-supported", 28 }, - { "available-compression", 21 }, - { "available-compressions-supported", 32 }, - { "portrait", 8 }, - { "landscape", 9 }, - { "reverse-portrait", 16 }, - { "reverse-landscape", 17 }, - { "iso-a0", 6 }, - { "iso-a1", 6 }, - { "iso-a2", 6 }, - { "iso-a3", 6 }, - { "iso-a4", 6 }, - { "iso-a5", 6 }, - { "iso-a6", 6 }, - { "iso-a7", 6 }, - { "iso-a8", 6 }, - { "iso-a9", 6 }, - { "iso-a10", 7 }, - { "iso-b0", 6 }, - { "iso-b1", 6 }, - { "iso-b2", 6 }, - { "iso-b3", 6 }, - { "iso-b4", 6 }, - { "iso-b5", 6 }, - { "iso-b6", 6 }, - { "iso-b7", 6 }, - { "iso-b8", 6 }, - { "iso-b9", 6 }, - { "iso-b10", 7 }, - { "na-letter", 9 }, - { "na-legal", 8 }, - { "executive", 9 }, - { "folio", 5 }, - { "invoice", 7 }, - { "ledger", 6 }, - { "quarto", 6 }, - { "iso-c3", 6 }, - { "iso-c4", 6 }, - { "iso-c5", 6 }, - { "iso-c6", 6 }, - { "iso-designated-long", 19 }, - { "na-10x13-envelope", 17 }, - { "na-9x12-envelope", 16 }, - { "na-number-10-envelope", 21 }, - { "na-7x9-envelope", 15 }, - { "na-9x11-envelope", 16 }, - { "na-10x14-envelope", 17 }, - { "na-number-9-envelope", 20 }, - { "na-6x9-envelope", 15 }, - { "na-10x15-envelope", 17 }, - { "monarch-envelope", 16 }, - { "a", 1 }, - { "b", 1 }, - { "c", 1 }, - { "d", 1 }, - { "e", 1 }, - { "jis-b0", 6 }, - { "jis-b1", 6 }, - { "jis-b2", 6 }, - { "jis-b3", 6 }, - { "jis-b4", 6 }, - { "jis-b5", 6 }, - { "jis-b6", 6 }, - { "jis-b7", 6 }, - { "jis-b8", 6 }, - { "jis-b9", 6 }, - { "jis-b10", 7 }, - { "hp-2x-postcard", 14 }, - { "hp-european-edp", 15 }, - { "hp-mini", 7 }, - { "hp-postcard", 11 }, - { "hp-tabloid", 10 }, - { "hp-us-edp", 9 }, - { "hp-us-government-legal", 22 }, - { "hp-us-government-letter", 23 }, - { "simplex", 7 }, - { "duplex", 6 }, - { "tumble", 6 }, - { "top", 3 }, - { "middle", 6 }, - { "bottom", 6 }, - { "envelope", 8 }, - { "manual", 6 }, - { "large-capacity", 14 }, - { "main", 4 }, - { "side", 4 }, - { "event-report-job-completed", 26 }, - { "electronic-mail", 15 }, - { "xp-setup-mandatory", 18 }, - { "xp-setup-optional", 17 }, - { "xp-setup-ok", 11 }, - { "xp-setup-incomplete", 19 }, - { "xp-list-glyph-fonts", 19 }, - { "xp-list-internal-printer-fonts", 30 }, - { "0", 1 }, - { "01", 2 }, - { "02", 2 }, - { "03", 2 }, - { "012", 3 }, - { "013", 3 }, - { "023", 3 }, - { "0123", 4 } -}; diff --git a/nx-X11/programs/Xserver/Xprint/Util.c b/nx-X11/programs/Xserver/Xprint/Util.c deleted file mode 100644 index 069595b9a..000000000 --- a/nx-X11/programs/Xserver/Xprint/Util.c +++ /dev/null @@ -1,372 +0,0 @@ -/* $Xorg: Util.c,v 1.3 2000/08/17 19:48:06 cpqbld Exp $ */ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ -/* $XFree86: xc/programs/Xserver/Xprint/Util.c,v 1.12 2001/08/01 00:44:45 tsi Exp $ */ - -/* To get the tempnam() prototype in */ -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#if defined(linux) && defined(__STRICT_ANSI__) -#undef __STRICT_ANSI__ -#endif - -#include /* for unistd.h and string.h */ -#include -#include -#include -#include "misc.h" -#include "dixstruct.h" - -#include - -#include "attributes.h" - -#define IN_FILE_STRING "%(InFile)%" -#define OUT_FILE_STRING "%(OutFile)%" - -/* - * ReplaceAnyString returns a string combining the input strings. - * It replaces all occurances of 'target' with the supplied - * 'replacement'. - * The original input string will generally be freed, - * and the caller is responsible for freeing whatever string is returned. - */ -char * -ReplaceAnyString( - char *string, - char *target, - char *replacement) -{ - char *pKeyString; - - if(replacement != (char *)NULL) - { - while((pKeyString = strstr(string, target)) != (char *)NULL) - { - char *newString; - - newString = (char *)xalloc(strlen(string) + strlen(replacement) - - strlen(target) + 1); - strncpy(newString, string, pKeyString - string); - newString[pKeyString - string] = '\0'; - strcat(newString, replacement); - strcat(newString, pKeyString + strlen(target)); - xfree(string); - string = newString; - } - } - - return string; -} - -/* - * ReplaceFileString returns a string combining the input strings. - * It replaces all occurances of IN_FILE_STRING with the supplied - * inFileName, and all occurances of OUT_FILE_STRING with the - * supplied outFileName. The original input string will generally be freed, - * and the caller is responsible for freeing whatever string is returned. - */ -char * -ReplaceFileString( - char *string, - char *inFileName, - char *outFileName) -{ - char *pKeyString, - *pInFileString = IN_FILE_STRING, - *pOutFileString = OUT_FILE_STRING; - - if(inFileName != (char *)NULL) - { - while((pKeyString = strstr(string, pInFileString)) != - (char *)NULL) - { - char *newString; - - newString = (char *)xalloc(strlen(string) + - strlen(inFileName) + 1); - strncpy(newString, string, pKeyString - string); - newString[pKeyString - string] = '\0'; - strcat(newString, inFileName); - strcat(newString, pKeyString + strlen(pInFileString)); - xfree(string); - string = newString; - } - } - - if(outFileName != (char *)NULL) - { - while((pKeyString = strstr(string, pOutFileString)) != - (char *)NULL) - { - char *newString; - - newString = (char *)xalloc(strlen(string) + - strlen(outFileName) + 1); - strncpy(newString, string, pKeyString - string); - newString[pKeyString - string] = '\0'; - strcat(newString, outFileName); - strcat(newString, pKeyString + strlen(pOutFileString)); - xfree(string); - string = newString; - } - } - return string; -} - - -/* - * TransferBytes reads numBytes of data from pSrcFile and writes them - * to pDstFile. It returns the number of bytes actually transfered, - * which will be numBytes if it's successful. Neither pSrcFile nor - * pDstFile are rewound or their pointers otherwise modified prior to - * beginning the transfer. - */ -int -TransferBytes( - FILE *pSrcFile, - FILE *pDstFile, - int numBytes) -{ - char buf[10240]; -#define BUF_SIZE (sizeof(buf)*sizeof(char)) - int bytesWritten = 0; - unsigned bytesToXfer; - - for(bytesToXfer = min(BUF_SIZE, (unsigned)numBytes); - bytesToXfer > 0; - bytesToXfer = min(BUF_SIZE, (unsigned)(numBytes - bytesWritten))) - { - if(fread((void *)buf, (size_t) 1, bytesToXfer, pSrcFile) < bytesToXfer) - return bytesWritten; - if(fwrite((void *)buf, (size_t) 1, bytesToXfer, pDstFile) < bytesToXfer) - return bytesWritten; - bytesWritten += bytesToXfer; - } - return bytesWritten; -} - -/* - * CopyContentsAndDelete - does the work of copying and deleting the - * pre, no, and post raster files as well as the raster file itself. - */ -Bool -CopyContentsAndDelete( - FILE **ppSrcFile, - char **pSrcFileName, - FILE *pDstFile) -{ - struct stat statBuf; - - if(stat(*pSrcFileName, &statBuf) < 0) - return FALSE; - rewind(*ppSrcFile); - if(TransferBytes(*ppSrcFile, pDstFile, - (int)statBuf.st_size) != (int)statBuf.st_size) - return FALSE; - fclose(*ppSrcFile); - *ppSrcFile = (FILE *)NULL; - unlink(*pSrcFileName); - xfree(*pSrcFileName); - *pSrcFileName = (char *)NULL; - - return TRUE; -} - - -#define QUADPAD(x) ((((x)+3)>>2)<<2) - -int -XpSendDocumentData( - ClientPtr client, - FILE *fp, - int fileLen, - int maxBufSize) -{ - xPrintGetDocumentDataReply *pRep; - int bytesWritten; - unsigned bytesToWrite; - int result = Success; - - if(client->clientGone) - return Success; - - pRep = (xPrintGetDocumentDataReply *)xalloc(sz_xPrintGetDocumentDataReply+ - QUADPAD(maxBufSize)); - - for(bytesToWrite = min(maxBufSize, fileLen), - bytesWritten = 0; - bytesToWrite > 0; - bytesToWrite = min(maxBufSize, fileLen - bytesWritten)) - { - pRep->type = X_Reply; - pRep->sequenceNumber = client->sequence; - pRep->length = (QUADPAD(bytesToWrite)) >> 2; - pRep->dataLen = bytesToWrite; - - if(fread((void *)(pRep + 1), 1, bytesToWrite, fp) < bytesToWrite) - { - result = BadAlloc; /* XXX poor error choice? */ - pRep->statusCode = 2; /* XXX Is this the right value??? */ - } - else - pRep->statusCode = 0; /* XXX Ignored??? */ - - pRep->finishedFlag = FALSE; - - if (client->swapped) { - int n; - long l; - - swaps(&pRep->sequenceNumber, n); - swapl(&pRep->length, l); - swapl(&pRep->statusCode, l); /* XXX Why are these longs??? */ - swapl(&pRep->finishedFlag, l); /* XXX Why are these longs??? */ - swapl(&pRep->dataLen, l); - } - - (void)WriteToClient(client, - sz_xPrintGetDocumentDataReply + bytesToWrite, - (char *)pRep); - bytesWritten += bytesToWrite; - } - - xfree(pRep); - return result; -} - -/* - * XpFinishDocData - send a DocumentData reply with the "finishedFlag" - * field set to TRUE. This routine should be called from the EndJob - * function of a driver after the driver has sent all required - * document data (presumably via XpSendDocumentData). - */ -int -XpFinishDocData( - ClientPtr client) -{ - xPrintGetDocumentDataReply rep; - - if(client->clientGone) - return Success; - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.dataLen = 0; - rep.finishedFlag = TRUE; - rep.statusCode = 0; - - if (client->swapped) { - int n; - long l; - - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, l); - swapl(&rep.statusCode, l); /* XXX Why are these longs??? */ - swapl(&rep.finishedFlag, l); /* XXX Why are these longs??? */ - swapl(&rep.dataLen, l); - } - - (void)WriteToClient(client, sz_xPrintGetDocumentDataReply, (char *)&rep); - return Success; -} - -#ifndef HAS_MKSTEMP -static -char *XpDirName(char *fname) -{ - char *fn, *ptr; - - fn = (char *)xalloc(strlen(fname) + 1); - if (fn) { - strcpy(fn, fname); - ptr = strrchr(fn, '/'); - if (!ptr) { - ptr = fn; - *ptr++ = '.'; - } else if (ptr == fn) - ptr++; - *ptr = '\0'; - } - return fn; -} -#endif - -Bool -XpOpenTmpFile( - char *mode, - char **fname, - FILE **stream) -{ -#ifndef HAS_MKSTEMP - char *fn = NULL; - - /* note that there is a small race condition here... */ - if (!(*fname = tempnam(NULL, NULL)) || - !(fn = XpDirName(*fname)) || - access(fn, W_OK) || - !(*stream = fopen(*fname, mode))) - - { - xfree(fn); - xfree(*fname); - *fname = NULL; - *stream = NULL; - return FALSE; - } - xfree(fn); -#else - int fd; - - *stream = NULL; - *fname = (char *)xalloc(14); - if (*fname == NULL) - return FALSE; - strcpy(*fname, "/tmp/xpXXXXXX"); - fd = mkstemp(*fname); - if (fd < 0) { - xfree(*fname); - *fname = NULL; - return FALSE; - } - *stream = fdopen(fd, mode); - if (stream == NULL) { - xfree(*fname); - *fname = NULL; - return FALSE; - } -#endif - return TRUE; -} diff --git a/nx-X11/programs/Xserver/Xprint/ValTree.c b/nx-X11/programs/Xserver/Xprint/ValTree.c deleted file mode 100644 index 6fa631617..000000000 --- a/nx-X11/programs/Xserver/Xprint/ValTree.c +++ /dev/null @@ -1,193 +0,0 @@ -/* $Xorg: ValTree.c,v 1.3 2000/08/17 19:48:06 cpqbld Exp $ */ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ -/* $XFree86$ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include "scrnintstr.h" -#include "validate.h" -#include "windowstr.h" -#include "mi.h" -#include "regionstr.h" -#include "mivalidate.h" - -/* - * XpValidateTree - a validateTree routine which ignores overlapping - * top-level windows when computing the clip lists for such windows. - * This can be used by any driver which maintains a separate memory - * store for each top-level window (with its respective children). - * If the pParent is not the root window, then miValidateTree - * is used unmodified. - * - * The strategy if pParent is the root is to save off the - * current values of pParent->firstChild and pParent->lastChild, - * replacing both with the single child of interest. We save off - * pChild->prevSib and pChild->nextSib, and replace them with NullWindow. - * We save off pParent->clipList, and replace it with - * pParent->winSize - pChild->winSize. We then call miValidateTree - * to do the needed ComputeClips on the pChild's heirarchy. - * pParent's clipList is then recomputed based on the sizes - * of its children, and the saved pointers are restored. - * The trees associated with the siblings of pChild must be descended - * and cleaned of any marks (i.e. the valdata pointer freed, and set to NULL), - * and pParent' AfterValidate structure's exposed field must be updated. - */ -/*ARGSUSED*/ -int -XpValidateTree (pParent, pChild, kind) - WindowPtr pParent; /* Parent to validate */ - WindowPtr pChild; /* First child of pParent that was - * affected */ - VTKind kind; /* What kind of configuration caused call */ -{ - RegionRec origPrntClip; /* orig clipList for parent */ - RegionRec childClip; /* The new borderClip for the current - * child */ - RegionRec tmpPrntClip; /* parent clipList - child borderClip */ - RegionRec exposed; /* For intermediate calculations */ - register ScreenPtr pScreen; - register WindowPtr pWin; - Bool overlap; - int viewvals; - Bool forward; - - WindowPtr origFirstChild, origLastChild, origPrevSib, origNextSib; - - /* - * If we're validating something other than a top-level window, - * then just invoke miValidateTree. - */ - if(pParent->parent != NullWindow) - return miValidateTree(pParent, pChild, kind); - - /* - * If it's a stack change of top levels then it's a no-op for - * this scheme, so we just clean up any marks on windows and return. - */ - if(kind == VTStack) - { - CleanMarks(pParent); - return 1; - } - - pScreen = pParent->drawable.pScreen; - if (pChild == NullWindow) - pChild = pParent->firstChild; - - /* Save off the existing window heirarchy */ - origFirstChild = pParent->firstChild; - origLastChild = pParent->lastChild; - origPrevSib = pChild->prevSib; - origNextSib = pChild->nextSib; - pParent->firstChild = pChild; - pParent->lastChild = pChild; - pChild->prevSib = NullWindow; - pChild->nextSib = NullWindow; - - /* - * Set pParent's clipList to be its winSize minus the pChild's - * borderSize. - */ - origPrntClip = pParent->clipList; - REGION_NULL(pScreen, &tmpPrntClip); - REGION_SUBRACT(pScreen, &tmpPrntClip, &pParent->winSize, - &pChild->borderSize); - pParent->clipList = tmpPrntClip; - - /* - * Call miValidateTree on the pruned tree. - */ - (void) miValidateTree(pParent, pChild, kind); - - /* Restore the saved heirarchy */ - pChild->prevSib = origPrevSib; - pChild->nextSib = origNextSib; - pParent->firstChild = origFirstChild; - pParent->lastChild = origLastChild; - - /* - * Compute pParent's clipList by taking its winSize and subracting - * the borderSize of each of its children. - */ - for(pWin = pParent->firstChild, - REGION_COPY(pScreen, &pParent->clipList, &pParent->winSize); - pWin != NullWindow; - pWin = pWin->nextSib) - { - REGION_SUBTRACT(pScreen, &pParent->clipList, &pParent->clipList, - &pWin->borderSize); - } - - /* - * Compute pParent's AfterValidate structure by subracting the original - * clipList from the newly computed clipList. - */ - REGION_NULL(pScreen, &pParent->valdata->after.exposed); - REGION_SUBTRACT(pScreen, &pParent->valdata->after.exposed, - &pParent->clipList, &origPrntClip); - - /* - * Remove the marks from all but pParent and pChild's heirarchy. - * i.e. from all of pChild's siblings and their children. - */ - for(pWin = pParent->firstChild; pWin != NullWindow; pWin = pWin->nextSib) - { - WindowPtr pCurChild = pWin; - - if(pCurChild == pChild) - continue; - - while (1) - { - if(pCurChild->valdata) - { - xfree(pCurChild->valdata); - pCurChild->valdata = (ValidatePtr)NULL; - } - - if (pCurChild->firstChild) - { - pCurChild = pCurChild->firstChild; - continue; - } - while (!pCurChild->nextSib && (pCurChild != pWin)) - pCurChild = pCurChild->parent; - if (pCurChild == pWin) - break; - pCurChild = pCurChild->nextSib; - } - } -} diff --git a/nx-X11/programs/Xserver/Xprint/Xprt.html b/nx-X11/programs/Xserver/Xprint/Xprt.html deleted file mode 100644 index f84a3c134..000000000 --- a/nx-X11/programs/Xserver/Xprint/Xprt.html +++ /dev/null @@ -1,115 +0,0 @@ -Xprt

Name

Xprt — Print server for X Version 11

Synopsis

Xprt [-ac] [-audit level] [-pn] [-fp fontpath] [-XpFile file] [-XpSpoolerType spoolername] [:display]

DESCRIPTION

Xprt is the Xprint print server - for version 11 of the X Window system for non display devices - such as printers and fax machines.

Xprint is an advanced printing system which enables X11 - applications to use devices like printers, FAX or create - documents in formats like PostScript, PCL or PDF. It may be used by - clients such as mozilla. -

Xprint is a very flexible, extensible, scaleable, client/server - print system based on ISO 10175 (and some other specs) and the X11 - rendering protocol. - Using Xprint an application can search, query and use devices like - printers, FAX machines or create documents in formats like PDF. - In particular, an application can seek a printer, query supported - attributes (like paper size, trays, fonts etc.), configure the printer - device to match it's needs and print on it like on any other X device - reusing parts of the code which is used for the video card Xserver. -

USAGE

- Although Xprt may be invoked from the command line, it is - preferable to run it as a daemon via the init script - /etc/init.d/xprint (where this script exists). -

Client programs such as mozilla will require environment - variable ${XPSERVERLIST} to be set, identifying the - "display" on which Xprt is running. This variable may be set - for all users via /etc/profile (or similar), using - /etc/init.d/xprint get_xpserverlist: -

export XPSERVERLIST=`/etc/init.d/xprint get_xpserverlist`

OPTIONS

Many of Xprt's command line options are shared in common - with the usual X servers (see Xserver(1x)). - Commonly used options include:

:display

The X server runs on the given display. If multiple X - servers are to run simultaneously on a host, each must - have a unique display number. Note that the standard X - server (for video displays) typically runs on display - :0. If /etc/init.d/xprint is used - to invoke Xprt, it may be configured to automatically assign an available - display number.

-ac

disables host-based access control mechanisms. Enables access - by any host, and permits any host to modify the access control - list. Use with extreme caution. This option exists primarily - for running test suites remotely.

-audit level

sets the audit trail level. The default level is 1, meaning - only connection rejections are reported. Level 2 additionally - reports all successful connections and disconnects. Level 4 - enables messages from the SECURITY extension, if present, - including generation and revocation of authorizations and - violations of the security policy. Level 0 turns off the audit - trail. Audit lines are sent as standard error output.

-fp fontpath

sets the search path for fonts. This path is a comma - separated list of directories which Xprt searches for - font databases.

-pn

permits the server to continue running if it fails to - establish all of its well-known sockets (connection - points for clients), but establishes at least - one.

-XpFile file

Sets an altername Xprinters file (see section FILES).

-XpSpoolerType spoolername

- Defines the spooler system to be used for print job spooling. - Supported values in xprint.mozdev.org release 009 are: -

aix
aix4
bsd
osf
solaris
sysv
uxp
cups
lprng
other
none

- (multiple values can be specified, seperated by ':', the first active spooler will be chosen). - The default value is platform-specific and can be obtained via -

Xprt -h

. -

ENVIRONMENT

- The following environment variables are recognized by the X print server - (environment variables recognized by Xprint clients are described in - Xprint(7)): - -

${XPCONFIGDIR}

This environment variable points to the root - of the Xprint server configuration directory hierarchy. - If the variable is not defined, the default - path is be assumed. The default path may be - /usr/X11R6/lib/X11/xserver/, - /usr/lib/X11/xserver/, - /usr/share/Xprint/xserver/ or - /usr/openwin/server/etc/XpConfig, depending on the - system, and may be configured in /etc/init.d/xprint.

${LANG}

- This environment variable selects the locale settings used by the Xprint server. - Xprt allows language-specific settings (stored in ${XPCONFIGDIR}/${LANG}/print/) - which will override the default settings (stored in ${XPCONFIGDIR}/C/print/). - If ${LANG} is not set "C" is assumed. -

FILES

${XPCONFIGDIR}/${LANG}/print/Xprinters, ${XPCONFIGDIR}/C/print/Xprinters

- `Xprinters' is the top most configuration file. It tells - Xprt which specific printer names (e.g. mylaser) should - be supported, and whether lpstat(1) or other commands - should be used to automatically supplement the list of - printers. -

${XPCONFIGDIR}/${LANG}/print/attributes/printer, ${XPCONFIGDIR}/C/print/attributes/printer

- The `printer' file maps printer names to model - configurations (see `model-config' below). For example, - "mylaser" could be mapped to a "HPDJ1600C", and all other - arbitrary printers could be mapped to a default, such as - "HPLJ4SI". When depending on lpstat(1) in the Xprinters - file, setting up defaults in `printer' becomes all the - more important. -

${XPCONFIGDIR}/${LANG}/print/attributes/document, ${XPCONFIGDIR}/C/print/attributes/document

- The `document' file specifies the initial document values - for any print jobs. For example, which paper tray to - use, what default resolution, etc. -

${XPCONFIGDIR}/${LANG}/print/attributes/job, ${XPCONFIGDIR}/C/print/attributes/job

- The `job' file specifies the initial job values for any - print jobs. For example, "notification-profile" can be - set so that when a print job is successfully sent to a - printer, e-mail is sent to the user. -

${XPCONFIGDIR}/C/print/models/PSdefault/model-config, ${XPCONFIGDIR}/C/print/models/PSdefault/fonts/fonts.dir, ${XPCONFIGDIR}/C/print/models/PSdefault/fonts/9nb00051.pmf, ${XPCONFIGDIR}/C/print/models/PSdefault/fonts/9nb00093.pmf

- The `model-config' file has attributes that describe the - printer model's capabilities and default settings. - Printer model fonts may also be present. The model-config - file also identifies the print ddx driver to be used. - - For each printer model supported, a complete hierarchy of - files should exist. In most cases, these files do not - need to be modified. -

${XPCONFIGDIR}/C/print/ddx-config/raster/pdf, ${XPCONFIGDIR}/C/print/ddx-config/raster/pcl, ${XPCONFIGDIR}/C/print/ddx-config/raster/postscript

- The print ddx drivers can have highly specific - configuration files to control their behavior. In most - cases, these files do not need to be modified. -

SEE ALSO

Xprint(7), X11(7), xplsprinters(1x), xprehashprinterlist(1x), xphelloworld(1x), xpxmhelloworld(1x), xpawhelloworld(1x), xpxthelloworld(1x), xpsimplehelloworld(1x), Xserver(1x), libXp(3x), libXprintUtils(3x), libXprintAppUtils(3x), XmPrintShell(3x), XawPrintShell(3x), Xprint FAQ (http://xprint.mozdev.org/docs/Xprint_FAQ.html), Xprint main site (http://xprint.mozdev.org/)

AUTHORS

- This manual page was written by - Drew Parsons and - Roland Mainz , - with some help from the man page at - http://www.sins.com.au/unix/manpages/Xprt.html and the XFree86 - man page for Xserver(1). -

diff --git a/nx-X11/programs/Xserver/Xprint/Xprt.man b/nx-X11/programs/Xserver/Xprint/Xprt.man deleted file mode 100644 index 7599a1344..000000000 --- a/nx-X11/programs/Xserver/Xprint/Xprt.man +++ /dev/null @@ -1,196 +0,0 @@ -.\" -*- coding: us-ascii -*- -.TH Xprt __appmansuffix__ "25 November 2004" -.SH NAME -Xprt \- Print server for X Version 11 -.SH SYNOPSIS -.ad l -\fBXprt\fR \kx -.if (\nxu > (\n(.lu / 2)) .nr x (\n(.lu / 5) -'in \n(.iu+\nxu -[\fB\-ac\fR] [\fB\-audit \fBlevel\fR\fR] [\fB\-pn\fR] [\fB\-fp \fBfontpath\fR\fR] [\fB\-XpFile \fBfile\fR\fR] [\fB\-XpSpoolerType \fBspoolername\fR\fR] [\fB:\fBdisplay\fR\fR] -'in \n(.iu-\nxu -.ad b -.SH DESCRIPTION -Xprt is the Xprint print server -for version 11 of the X Window system for non display devices -such as printers and fax machines. -.PP -Xprint is an advanced printing system which enables X11 -applications to use devices like printers, FAX or create -documents in formats like PostScript, PCL or PDF. It may be used by -clients such as mozilla. -.PP -Xprint is a very flexible, extensible, scaleable, client/server -print system based on ISO 10175 (and some other specs) and the X11 -rendering protocol. -Using Xprint an application can search, query and use devices like -printers, FAX machines or create documents in formats like PDF. -In particular, an application can seek a printer, query supported -attributes (like paper size, trays, fonts etc.), configure the printer -device to match it's needs and print on it like on any other X device -reusing parts of the code which is used for the video card Xserver. -.SH USAGE -Although Xprt may be invoked from the command line, it is -preferable to run it as a daemon via the init script -\fB/etc/init.d/xprint\fR (where this script exists). -.PP -Client programs such as mozilla will require environment -variable \fB${XPSERVERLIST}\fR to be set, identifying the -"display" on which Xprt is running. This variable may be set -for all users via \fB/etc/profile\fR (or similar), using -\fB/etc/init.d/xprint get_xpserverlist\fR: - -.nf -export XPSERVERLIST=`/etc/init.d/xprint get_xpserverlist` -.fi - -.SH OPTIONS -Many of Xprt's command line options are shared in common -with the usual X servers (see \fBXserver\fR(__appmansuffix__)). -Commonly used options include: -.TP -\fB:\fIdisplay\fB\fR -The X server runs on the given display. If multiple X -servers are to run simultaneously on a host, each must -have a unique display number. Note that the standard X -server (for video displays) typically runs on display -:0. If \fB/etc/init.d/xprint\fR is used -to invoke Xprt, it may be configured to automatically assign an available -display number. -.TP -\fB\-ac\fR -disables host-based access control mechanisms. Enables access -by any host, and permits any host to modify the access control -list. Use with extreme caution. This option exists primarily -for running test suites remotely. -.TP -\fB\-audit \fIlevel\fB\fR -sets the audit trail level. The default level is 1, meaning -only connection rejections are reported. Level 2 additionally -reports all successful connections and disconnects. Level 4 -enables messages from the SECURITY extension, if present, -including generation and revocation of authorizations and -violations of the security policy. Level 0 turns off the audit -trail. Audit lines are sent as standard error output. -.TP -\fB\-fp \fIfontpath\fB\fR -sets the search path for fonts. This path is a comma -separated list of directories which Xprt searches for -font databases. -.TP -\fB\-pn\fR -permits the server to continue running if it fails to -establish all of its well-known sockets (connection -points for clients), but establishes at least -one. -.TP -\fB\-XpFile \fIfile\fB\fR -Sets an altername Xprinters file (see section FILES). -.TP -\fB\-XpSpoolerType \fIspoolername\fB\fR -Defines the spooler system to be used for print job spooling. -Supported values in xprint.mozdev.org release 009 are: - -aix - -aix4 - -bsd - -osf - -solaris - -sysv - -uxp - -cups - -lprng - -other - -none - -(multiple values can be specified, seperated by ':', the first active spooler will be chosen). -The default value is platform-specific and can be obtained via - -.nf -Xprt \-h -.fi - -\&. -.SH ENVIRONMENT -The following environment variables are recognized by the X print server -(environment variables recognized by Xprint clients are described in -\fBXprint\fR(__miscmansuffix__)): -.TP -\fB${XPCONFIGDIR}\fR -This environment variable points to the root -of the Xprint server configuration directory hierarchy. -If the variable is not defined, the default -path is be assumed. The default path may be -\fB/usr/X11R6/lib/X11/xserver/\fR, -\fB/usr/lib/X11/xserver/\fR, -\fB/usr/share/Xprint/xserver/\fR or -\fB/usr/openwin/server/etc/XpConfig\fR, depending on the -system, and may be configured in \fB/etc/init.d/xprint\fR. -.TP -\fB${LANG}\fR -This environment variable selects the locale settings used by the Xprint server. -Xprt allows language-specific settings (stored in \fB${XPCONFIGDIR}/${LANG}/print/\fR) -which will override the default settings (stored in \fB${XPCONFIGDIR}/C/print/\fR). -If \fB${LANG}\fR is not set "C" is assumed. -.PP -.SH FILES -.TP -\fB${XPCONFIGDIR}/${LANG}/print/Xprinters\fR, \fB${XPCONFIGDIR}/C/print/Xprinters\fR -`Xprinters' is the top most configuration file. It tells -Xprt which specific printer names (e.g. mylaser) should -be supported, and whether \fBlpstat\fR(1) or other commands -should be used to automatically supplement the list of -printers. -.TP -\fB${XPCONFIGDIR}/${LANG}/print/attributes/printer\fR, \fB${XPCONFIGDIR}/C/print/attributes/printer\fR -The `printer' file maps printer names to model -configurations (see `model-config' below). For example, -"mylaser" could be mapped to a "HPDJ1600C", and all other -arbitrary printers could be mapped to a default, such as -"HPLJ4SI". When depending on \fBlpstat\fR(1) in the Xprinters -file, setting up defaults in `printer' becomes all the -more important. -.TP -\fB${XPCONFIGDIR}/${LANG}/print/attributes/document\fR, \fB${XPCONFIGDIR}/C/print/attributes/document\fR -The `document' file specifies the initial document values -for any print jobs. For example, which paper tray to -use, what default resolution, etc. -.TP -\fB${XPCONFIGDIR}/${LANG}/print/attributes/job\fR, \fB${XPCONFIGDIR}/C/print/attributes/job\fR -The `job' file specifies the initial job values for any -print jobs. For example, "notification-profile" can be -set so that when a print job is successfully sent to a -printer, e-mail is sent to the user. -.TP -\fB${XPCONFIGDIR}/C/print/models/PSdefault/model\-config\fR, \fB${XPCONFIGDIR}/C/print/models/PSdefault/fonts/fonts.dir\fR, \fB${XPCONFIGDIR}/C/print/models/PSdefault/fonts/9nb00051.pmf\fR, \fB${XPCONFIGDIR}/C/print/models/PSdefault/fonts/9nb00093.pmf\fR -The `model-config' file has attributes that describe the -printer model's capabilities and default settings. -Printer model fonts may also be present. The model-config -file also identifies the print ddx driver to be used. -For each printer model supported, a complete hierarchy of -files should exist. In most cases, these files do not -need to be modified. -.TP -\fB${XPCONFIGDIR}/C/print/ddx\-config/raster/pdf\fR, \fB${XPCONFIGDIR}/C/print/ddx\-config/raster/pcl\fR, \fB${XPCONFIGDIR}/C/print/ddx\-config/raster/postscript\fR -The print ddx drivers can have highly specific -configuration files to control their behavior. In most -cases, these files do not need to be modified. -.SH "SEE ALSO" -\fBXprint\fR(__miscmansuffix__), \fBX11\fR(__miscmansuffix__), \fBxplsprinters\fR(__appmansuffix__), \fBxprehashprinterlist\fR(__appmansuffix__), \fBxphelloworld\fR(__appmansuffix__), \fBxpxmhelloworld\fR(__appmansuffix__), \fBxpawhelloworld\fR(__appmansuffix__), \fBxpxthelloworld\fR(__appmansuffix__), \fBxpsimplehelloworld\fR(__appmansuffix__), \fBXserver\fR(__appmansuffix__), \fBlibXp\fR(__libmansuffix__), \fBlibXprintUtils\fR(__libmansuffix__), \fBlibXprintAppUtils\fR(__libmansuffix__), \fBXmPrintShell\fR(__libmansuffix__), \fBXawPrintShell\fR(__libmansuffix__), Xprint FAQ (http://xprint.mozdev.org/docs/Xprint_FAQ.html), Xprint main site (http://xprint.mozdev.org/) -.SH AUTHORS -This manual page was written by -Drew Parsons and -Roland Mainz , -with some help from the man page at -http://www.sins.com.au/unix/manpages/Xprt.html and the XFree86 -man page for \fBXserver\fR(1). diff --git a/nx-X11/programs/Xserver/Xprint/Xprt.sgml b/nx-X11/programs/Xserver/Xprint/Xprt.sgml deleted file mode 100644 index 0ffa39fcb..000000000 --- a/nx-X11/programs/Xserver/Xprint/Xprt.sgml +++ /dev/null @@ -1,371 +0,0 @@ - - - - - - - Xprt - __appmansuffix__ - - - Xprt - - Print server for X Version 11 - - - - Xprt - - - - - - - - - - - - - - - - - - - DESCRIPTION - - Xprt is the Xprint print server - for version 11 of the X Window system for non display devices - such as printers and fax machines. - - Xprint is an advanced printing system which enables X11 - applications to use devices like printers, FAX or create - documents in formats like PostScript, PCL or PDF. It may be used by - clients such as mozilla. - - - Xprint is a very flexible, extensible, scaleable, client/server - print system based on ISO 10175 (and some other specs) and the X11 - rendering protocol. - Using Xprint an application can search, query and use devices like - printers, FAX machines or create documents in formats like PDF. - In particular, an application can seek a printer, query supported - attributes (like paper size, trays, fonts etc.), configure the printer - device to match it's needs and print on it like on any other X device - reusing parts of the code which is used for the video card Xserver. - - - - - USAGE - - - Although Xprt may be invoked from the command line, it is - preferable to run it as a daemon via the init script - /etc/init.d/xprint (where this script exists). - - - Client programs such as mozilla will require environment - variable ${XPSERVERLIST} to be set, identifying the - "display" on which Xprt is running. This variable may be set - for all users via /etc/profile (or similar), using - /etc/init.d/xprint get_xpserverlist: - - export XPSERVERLIST=`/etc/init.d/xprint get_xpserverlist` - - - - - - OPTIONS - - Many of Xprt's command line options are shared in common - with the usual X servers (see Xserver__appmansuffix__). - Commonly used options include: - - - - - - - The X server runs on the given display. If multiple X - servers are to run simultaneously on a host, each must - have a unique display number. Note that the standard X - server (for video displays) typically runs on display - :0. If /etc/init.d/xprint is used - to invoke Xprt, it may be configured to automatically assign an available - display number. - - - - - - - disables host-based access control mechanisms. Enables access - by any host, and permits any host to modify the access control - list. Use with extreme caution. This option exists primarily - for running test suites remotely. - - - - - - - sets the audit trail level. The default level is 1, meaning - only connection rejections are reported. Level 2 additionally - reports all successful connections and disconnects. Level 4 - enables messages from the SECURITY extension, if present, - including generation and revocation of authorizations and - violations of the security policy. Level 0 turns off the audit - trail. Audit lines are sent as standard error output. - - - - - - - sets the search path for fonts. This path is a comma - separated list of directories which Xprt searches for - font databases. - - - - - - - permits the server to continue running if it fails to - establish all of its well-known sockets (connection - points for clients), but establishes at least - one. - - - - - - - - Sets an altername Xprinters file (see section FILES). - - - - - - - - Defines the spooler system to be used for print job spooling. - Supported values in xprint.mozdev.org release 009 are: - - aix - aix4 - bsd - osf - solaris - sysv - uxp - cups - lprng - other - none - - (multiple values can be specified, seperated by ':', the first active spooler will be chosen). - The default value is platform-specific and can be obtained via - Xprt -h. - - - - - - - - ENVIRONMENT - - The following environment variables are recognized by the X print server - (environment variables recognized by Xprint clients are described in - Xprint__miscmansuffix__): - - - - ${XPCONFIGDIR} - - This environment variable points to the root - of the Xprint server configuration directory hierarchy. - If the variable is not defined, the default - path is be assumed. The default path may be - /usr/X11R6/lib/X11/xserver/, - /usr/lib/X11/xserver/, - /usr/share/Xprint/xserver/ or - /usr/openwin/server/etc/XpConfig, depending on the - system, and may be configured in /etc/init.d/xprint. - - - - - ${LANG} - - - This environment variable selects the locale settings used by the Xprint server. - Xprt allows language-specific settings (stored in ${XPCONFIGDIR}/${LANG}/print/) - which will override the default settings (stored in ${XPCONFIGDIR}/C/print/). - If ${LANG} is not set "C" is assumed. - - - - - - - - - FILES - - - - ${XPCONFIGDIR}/${LANG}/print/Xprinters - ${XPCONFIGDIR}/C/print/Xprinters - - - `Xprinters' is the top most configuration file. It tells - Xprt which specific printer names (e.g. mylaser) should - be supported, and whether lpstat1 or other commands - should be used to automatically supplement the list of - printers. - - - - - - ${XPCONFIGDIR}/${LANG}/print/attributes/printer - ${XPCONFIGDIR}/C/print/attributes/printer - - - The `printer' file maps printer names to model - configurations (see `model-config' below). For example, - "mylaser" could be mapped to a "HPDJ1600C", and all other - arbitrary printers could be mapped to a default, such as - "HPLJ4SI". When depending on lpstat1 in the Xprinters - file, setting up defaults in `printer' becomes all the - more important. - - - - - - ${XPCONFIGDIR}/${LANG}/print/attributes/document - ${XPCONFIGDIR}/C/print/attributes/document - - - The `document' file specifies the initial document values - for any print jobs. For example, which paper tray to - use, what default resolution, etc. - - - - - - ${XPCONFIGDIR}/${LANG}/print/attributes/job - ${XPCONFIGDIR}/C/print/attributes/job - - - The `job' file specifies the initial job values for any - print jobs. For example, "notification-profile" can be - set so that when a print job is successfully sent to a - printer, e-mail is sent to the user. - - - - - - ${XPCONFIGDIR}/C/print/models/PSdefault/model-config - ${XPCONFIGDIR}/C/print/models/PSdefault/fonts/fonts.dir - ${XPCONFIGDIR}/C/print/models/PSdefault/fonts/9nb00051.pmf - ${XPCONFIGDIR}/C/print/models/PSdefault/fonts/9nb00093.pmf - - - - The `model-config' file has attributes that describe the - printer model's capabilities and default settings. - Printer model fonts may also be present. The model-config - file also identifies the print ddx driver to be used. - - For each printer model supported, a complete hierarchy of - files should exist. In most cases, these files do not - need to be modified. - - - - - - ${XPCONFIGDIR}/C/print/ddx-config/raster/pdf - ${XPCONFIGDIR}/C/print/ddx-config/raster/pcl - ${XPCONFIGDIR}/C/print/ddx-config/raster/postscript - - - - The print ddx drivers can have highly specific - configuration files to control their behavior. In most - cases, these files do not need to be modified. - - - - - - - - - SEE ALSO - - - - - - - Xprint__miscmansuffix__ - X11__miscmansuffix__ - xplsprinters__appmansuffix__ - xprehashprinterlist__appmansuffix__ - xphelloworld__appmansuffix__ - xpxmhelloworld__appmansuffix__ - xpawhelloworld__appmansuffix__ - xpxthelloworld__appmansuffix__ - xpsimplehelloworld__appmansuffix__ - Xserver__appmansuffix__ - - - libXp__libmansuffix__ - libXprintUtils__libmansuffix__ - libXprintAppUtils__libmansuffix__ - XmPrintShell__libmansuffix__ - XawPrintShell__libmansuffix__ - Xprint FAQ (http://xprint.mozdev.org/docs/Xprint_FAQ.html) - Xprint main site (http://xprint.mozdev.org/) - - - - - - AUTHORS - - This manual page was written by - Drew Parsons dparsons@debian.org and - Roland Mainz roland.mainz@nrubsig.org, - with some help from the man page at - http://www.sins.com.au/unix/manpages/Xprt.html and the XFree86 - man page for Xserver1. - - - - - - diff --git a/nx-X11/programs/Xserver/Xprint/attributes.c b/nx-X11/programs/Xserver/Xprint/attributes.c deleted file mode 100644 index 60f6803a3..000000000 --- a/nx-X11/programs/Xserver/Xprint/attributes.c +++ /dev/null @@ -1,1740 +0,0 @@ -/* $Xorg: attributes.c,v 1.3 2000/08/17 19:48:07 cpqbld Exp $ */ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ -/******************************************************************* -** -** ********************************************************* -** * -** * File: attributes.c -** * -** * Contents: -** * Implementation of the attribute store for Xp. -** * -** * Copyright: Copyright 1995 Hewlett-Packard Company -** * -** ********************************************************* -** -********************************************************************/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if (defined(sun) && defined(SVR4)) || defined(__SCO__) || defined(__UNIXWARE__) -#include -#endif -#include "scrnintstr.h" - -#include - -#include "attributes.h" - -#include -#include - -#include "spooler.h" - -#ifndef MIN -#define MIN(a,b) (((a)<(b))?(a):(b)) -#endif -#ifndef MAX -#define MAX(a,b) (((a)>(b))?(a):(b)) -#endif - - -static XrmDatabase CopyDb(XrmDatabase inDb); - -extern XrmDatabase XpSpoolerGetServerAttributes(void); - -static int attrGeneration = 0; - -typedef struct { - XrmDatabase *pDb; - char *qualifier; - char *modelId; -} DbEnumStruct; - -typedef struct { - char *stringDb; - int nextPos; - int space; -} StringDbStruct; - -typedef struct _printerAttrs { - struct _printerAttrs *next; - char *name; - char *qualifier; - XrmDatabase printerAttrs; - XrmDatabase docAttrs; - XrmDatabase jobAttrs; -} PrAttrs, *PrAttrPtr; - -static PrAttrPtr attrList = (PrAttrPtr)NULL; - -typedef struct _systemAttrs { - XrmDatabase doc; - XrmDatabase job; - XrmDatabase printers; - XrmDatabase server; -} SysAttrs, *SysAttrsPtr; - -SysAttrs systemAttributes; - -/* - * attrCtxtPrivIndex hold the attribute store's context private index. - * This index is allocated at the time the attribute store is initialized. - */ -static int attrCtxtPrivIndex; - -/* - * The ContextAttrs structure descibes the context private space reserved - * by the attribute store. - */ -typedef struct _contextAttrs { - XrmDatabase printerAttrs; - XrmDatabase docAttrs; - XrmDatabase jobAttrs; - XrmDatabase pageAttrs; -} ContextAttrs, *ContextAttrPtr; - -/* - * XPDIR is relative to (i.e. is a subdir of) XPRINTDIR/$LANG. - */ -static const char XPDIR[] = "/print"; -/* - * The following files/directories define or are within subdirectories of the - * above-defined XPDIR. - */ -static const char XPPRINTERATTRFILE[] = "/attributes/printer"; -static const char XPJOBATTRFILE[] = "/attributes/job"; -static const char XPDOCATTRFILE[] = "/attributes/document"; -static const char XPMODELDIR[] = "/models"; - -static char NULL_STRING[] = "\0"; - -/* - * XpGetConfigDirBase returns a string containing the path name of the base - * where the print server configuration directory is localed. - */ -static -char *XpGetConfigDirBase() -{ - char *configDir; - - /* - * If the XPCONFIGDIR environment variable is not set, then use the - * compile-time constant XPRINTDIR. XPRINTDIR is passed in on the - * compile command line, and is defined in $(TOP)/config/cf/Project.tmpl. - */ - if((configDir = getenv("XPCONFIGDIR")) == (char *)NULL) - configDir = XPRINTDIR; - - return configDir; -} - -/* - * XpGetConfigDir returns a string containing the path name of the print - * server configuration directory. If the useLocale parameter is False - * the it returns the path to the "/C" directory. If the useLocale - * parameter is True it returns the path to the directory associated with - * $LANG. It makes no attempt to ensure that the directory actually exists. - */ -char * -XpGetConfigDir(Bool useLocale) -{ - char *dirName, *langName, *langDir, *configDir; - Bool freeLangDir = False; - - if(useLocale == False) langDir = "/C"; - else - { - langName = getenv("LC_ALL"); - if (langName == NULL) { - langName = getenv("LANG"); - } - - if(langName == (char *)NULL) - return (char *)NULL; - else - { - if(strcmp(langName, "C") == 0) - return (char *)NULL; - langDir = (char *)xalloc(strlen(langName) + 2); - sprintf(langDir, "/%s", langName); - freeLangDir = True; - } - } - - configDir = XpGetConfigDirBase(); - - dirName = (char *)xalloc(strlen(configDir) + strlen(XPDIR) + - strlen(langDir) + 1); - sprintf(dirName, "%s%s%s", configDir, langDir, XPDIR); - - if(freeLangDir == True) - xfree(langDir); - - return dirName; -} - -/* - * GetMergedDatabase reads and merges xrmdb files from the top-level printer - * config directory, and from the directory associated with the current - * locale (if other than the top-level). - */ -static XrmDatabase -GetMergedDatabase(const char *attrName) -{ - char *dirName, *fileName; - XrmDatabase db; - - if((dirName = XpGetConfigDir(False)) == (char *)NULL) - return (XrmDatabase)NULL; - if((fileName = (char *)xalloc(strlen(dirName) + strlen(attrName) + 1)) == - (char *)NULL) - return (XrmDatabase)NULL; - sprintf(fileName, "%s%s", dirName, attrName); - db = XrmGetFileDatabase(fileName); - xfree(fileName); - xfree(dirName); - - if((dirName = XpGetConfigDir(True)) == (char *)NULL) - return db; - if((fileName = (char *)xalloc(strlen(dirName) + strlen(attrName) + 1)) == - (char *)NULL) - return db; - sprintf(fileName, "%s%s", dirName, attrName); - (void)XrmCombineFileDatabase(fileName, &db, True); - xfree(fileName); - xfree(dirName); - - return db; -} - -/* - * BuildSystemAttributes reads the on-disk configuration files for printers, - * initial job, and initial document attributes. The resulting xrm - * databases are then dissected as needed for each printer. - * It also allocates a contextPrivate space for the attributes, - * reserving space to store pointers to the attribute stores for - * the context. - */ -static void -BuildSystemAttributes(void) -{ - if(systemAttributes.printers != (XrmDatabase)NULL) - XrmDestroyDatabase(systemAttributes.printers); - systemAttributes.printers = GetMergedDatabase(XPPRINTERATTRFILE); - if(systemAttributes.job != (XrmDatabase)NULL) - XrmDestroyDatabase(systemAttributes.job); - systemAttributes.job = GetMergedDatabase(XPJOBATTRFILE); - if(systemAttributes.doc != (XrmDatabase)NULL) - XrmDestroyDatabase(systemAttributes.doc); - systemAttributes.doc = GetMergedDatabase(XPDOCATTRFILE); - if(systemAttributes.server != (XrmDatabase)NULL) - XrmDestroyDatabase(systemAttributes.server); - systemAttributes.server = XpSpoolerGetServerAttributes(); - return; -} - -/* - * AddDbEntry is called by XrmEnumerateDatabase, and adds the supplied - * database entry to the database pointed to within the "DbEnumStruct" - * passed as the client_data (aka "closure"). - */ -static Bool -AddDbEntry( - XrmDatabase *sourceDB, - XrmBindingList bindings, - XrmQuarkList quarks, - XrmRepresentation *type, - XrmValue *value, - XPointer client_data) -{ - DbEnumStruct *pEnumStruct = (DbEnumStruct *)client_data; - XrmName xrm_name[5]; - XrmClass xrm_class[5]; - XrmBinding xrm_bind[3]; - XrmValue realVal; - XrmRepresentation rep_type; - - xrm_name[0] = XrmStringToQuark (pEnumStruct->qualifier); - xrm_class[0] = XrmStringToQuark (pEnumStruct->modelId); - - for(;*quarks; quarks++) - xrm_name[1] = xrm_class[1] = *quarks; - - xrm_name[2] = (XrmQuark)NULL; - xrm_class[2] = (XrmQuark)NULL; - - if(XrmQGetResource (*sourceDB, xrm_name, xrm_class, &rep_type, &realVal)) - { - xrm_bind[0] = XrmBindLoosely; - - xrm_name[0] = xrm_name[1]; - xrm_name[1] = NULLQUARK; - - XrmQPutStringResource(pEnumStruct->pDb, xrm_bind, xrm_name, - (char *)realVal.addr); - } - - return FALSE; -} - -/* - * BuildPrinterAttrs - builds and returns an XrmDatabase for the printer - * of the specified name/qualifier, if we have enough information. - * If we don't have a model-config - * file, then just enumerate the systemAttributes->printers database, - * otherwise read in the model-config database and merge into it the - * systemAttributes->printers database. This database is then enumerated - * with the printer qualifier (and the model name as class if we have it), and - * the resulting elements are stored into the database for this particular - * printer. - */ -static XrmDatabase -BuildPrinterAttrs( - char *printerName, - char *qualifierName) -{ - XrmDatabase printerDB = (XrmDatabase)NULL; - - if(systemAttributes.printers != (XrmDatabase)NULL) - { - char *dirName, *fileName; - XrmDatabase modelDB = (XrmDatabase)NULL; - XrmName xrm_name[5], xrm_class[2]; - XrmRepresentation rep_type; - XrmValue value; - DbEnumStruct enumStruct; - Bool freeModelDB = False; - /* - * Build the initial db based on the model-config files - */ - xrm_name[0] = XrmStringToQuark (qualifierName); - xrm_name[1] = XrmStringToQuark ("xp-model-identifier"); - xrm_name[2] = (XrmQuark)NULL; - XrmQGetResource (systemAttributes.printers, xrm_name, xrm_name, - &rep_type, &value); - - if(value.addr != (XPointer)NULL) - { - fileName = (char *)xalloc(strlen(XPMODELDIR) + - strlen((char *)value.addr) + - strlen("model-config") + 3); - sprintf(fileName, "%s/%s/%s", XPMODELDIR, value.addr, - "model-config"); - modelDB = GetMergedDatabase(fileName); - xfree(fileName); - if(modelDB != (XrmDatabase)NULL) - { - XrmDatabase tempDB = (XrmDatabase)NULL; - /* - * have to make a temp copy because MergeDatabase destroys - * the "source" database. Merge in the printers DB - */ - tempDB = CopyDb(systemAttributes.printers); - XrmMergeDatabases(tempDB, &modelDB); - freeModelDB = True; - } - } - - /* - * Check to see if we knew the name AND found a database file - */ - if(modelDB == (XrmDatabase)NULL) - modelDB = systemAttributes.printers; - - xrm_name[0] = XrmStringToQuark (qualifierName); - xrm_name[1] = (XrmQuark)NULL; - xrm_class[0] = XrmStringToQuark((char *)value.addr); - xrm_class[1] = (XrmQuark)NULL; - enumStruct.pDb = &printerDB; - enumStruct.qualifier = (char *)qualifierName; - enumStruct.modelId = (char *)value.addr; - XrmEnumerateDatabase(modelDB, xrm_name, xrm_class, XrmEnumAllLevels, - AddDbEntry, (XPointer) &enumStruct); - - if(freeModelDB == True) XrmDestroyDatabase(modelDB); - } - XrmPutStringResource(&printerDB, "*printer-name", printerName); - XrmPutStringResource(&printerDB, "*qualifier", qualifierName); - return printerDB; -} - -/* - * BuildABase - builds an XrmDatabase by enumerating the supplied sourceBase - * database for elements relevant for the printer named by printerName, - * and deriving a class for printerName from the model declared in the - * systemAttributes.printers database. If no model is defined for this - * printer then the printerName is used as the class as well. - * - * This is used to build the initial value document and initial value - * job attribute databases for each printer by searching the system - * level doc and job databases. - */ -static XrmDatabase -BuildABase( - char *printerName, - char *qualifierName, - XrmDatabase sourceBase) -{ - XrmDatabase builtDB = (XrmDatabase)NULL; - - if(sourceBase != (XrmDatabase)NULL) - { - XrmName xrm_name[5], xrm_class[2]; - XrmRepresentation rep_type; - XrmValue value; - DbEnumStruct enumStruct; - - /* - * Retrieve the model name for use as the class. - */ - xrm_name[0] = XrmStringToQuark (printerName); - xrm_name[1] = XrmStringToQuark ("xp-model-identifier"); - xrm_name[2] = (XrmQuark)NULL; - XrmQGetResource (systemAttributes.printers, xrm_name, xrm_name, - &rep_type, &value); - /* - * if we have a model name then use it as the class, otherwise - * just use the printer name as the class as well as the name. - */ - if(value.addr != (XPointer)NULL) - xrm_class[0] = XrmStringToQuark((char *)value.addr); - else - xrm_class[0] = xrm_name[0]; - xrm_class[1] = (XrmQuark)NULL; - - xrm_name[1] = (XrmQuark)NULL; - - enumStruct.pDb = &builtDB; - enumStruct.qualifier = (char *)qualifierName; - enumStruct.modelId = (char *)value.addr; - XrmEnumerateDatabase(sourceBase, xrm_name, xrm_class, XrmEnumAllLevels, - AddDbEntry, (XPointer) &enumStruct); - } - - XrmPutStringResource(&builtDB, "*qualifier", qualifierName); - - return builtDB; -} - -/* - * FreeAttrList is called upon server recycle, and frees the printer - * databases stored in the global attrList. - */ -static void -FreeAttrList(void) -{ - PrAttrPtr pAttr, pNext; - - for(pAttr = attrList, pNext = attrList; - pAttr != (PrAttrPtr)NULL; - pAttr = pNext) - { - pNext = pAttr->next; - if(pAttr->printerAttrs != (XrmDatabase)NULL) - XrmDestroyDatabase(pAttr->printerAttrs); - if(pAttr->docAttrs != (XrmDatabase)NULL) - XrmDestroyDatabase(pAttr->docAttrs); - if(pAttr->jobAttrs != (XrmDatabase)NULL) - XrmDestroyDatabase(pAttr->jobAttrs); - xfree(pAttr->name); - xfree(pAttr->qualifier); - xfree(pAttr); - } - attrList = (PrAttrPtr)NULL; -} - -/* - * XpRehashAttributes - frees the per-printer attribute list and - * calls BuildSystemAttributes to rebuild the overall attribute - * store. It is expected that a caller of this will follow it - * by calling XpBuildAttributeStore for a new list of printers. - */ -int -XpRehashAttributes(void) -{ - if(attrList != (PrAttrPtr)NULL) - FreeAttrList(); - BuildSystemAttributes(); - return Success; -} - -/* - * XpBuildAttributeStore - creates the attribute database associated - * with the specified printer. The first time this is called it - * calls BuildSystemAttributes to create the system-level databases. - */ -void -XpBuildAttributeStore( - char *printerName, - char *qualifierName) -{ - PrAttrPtr pAttr; - - if((pAttr = (PrAttrPtr)xalloc(sizeof(PrAttrs))) == (PrAttrPtr)NULL) - return; - - if(attrGeneration != serverGeneration) - { - if(attrList != (PrAttrPtr)NULL) - FreeAttrList(); - attrCtxtPrivIndex = XpAllocateContextPrivateIndex(); - XpAllocateContextPrivate(attrCtxtPrivIndex, sizeof(ContextAttrs)); - BuildSystemAttributes(); - - attrGeneration = serverGeneration; - } - - if(attrList == (PrAttrPtr)NULL) - { - pAttr->next = (PrAttrPtr)NULL; - attrList = pAttr; - } - else - { - pAttr->next = attrList; - attrList = pAttr; - } - - pAttr->name = strdup(printerName); - pAttr->qualifier = strdup(qualifierName); - pAttr->printerAttrs = BuildPrinterAttrs(printerName, qualifierName); - pAttr->docAttrs = BuildABase(printerName, qualifierName, - systemAttributes.doc); - pAttr->jobAttrs = BuildABase(printerName, qualifierName, - systemAttributes.job); -} - - -static Bool -StoreEntry( - XrmDatabase *sourceDB, - XrmBindingList bindings, - XrmQuarkList quarks, - XrmRepresentation *type, - XrmValue *value, - XPointer client_data) -{ - XrmDatabase *outDb = (XrmDatabase *)client_data; - - XrmQPutStringResource(outDb, bindings, quarks, (char *)value->addr); - - return FALSE; -} - -/* - * XpCopyDb - makes a copy of the specified XrmDatabase and returns - * the copy. - */ -static XrmDatabase -CopyDb(XrmDatabase inDb) -{ - XrmDatabase outDb = (XrmDatabase)NULL; - XrmQuark empty = NULLQUARK; - - (void)XrmEnumerateDatabase(inDb, &empty, &empty, XrmEnumAllLevels, - StoreEntry, (XPointer) &outDb); - return outDb; -} - -/* - * XpInitAttributes - initializes the attribute store for the specified - * context. It does this by making copies of the printer, doc, and job - * attributes databases for the printer associated with the context. - */ -void -XpInitAttributes(XpContextPtr pContext) -{ - ContextAttrPtr pCtxtAttrs; - PrAttrPtr pPrAttr = attrList; - - /* Initialize all the pointers to NULL */ - pCtxtAttrs = (ContextAttrPtr)pContext->devPrivates[attrCtxtPrivIndex].ptr; - (void)memset((void *)pCtxtAttrs, 0, (size_t) sizeof(ContextAttrs)); - - for(pPrAttr = attrList; pPrAttr != (PrAttrPtr)NULL; pPrAttr = pPrAttr->next) - if(!strcmp(pPrAttr->name, pContext->printerName)) break; - - if(pPrAttr != (PrAttrPtr)NULL) - { - pCtxtAttrs->printerAttrs = CopyDb(pPrAttr->printerAttrs); - pCtxtAttrs->docAttrs = CopyDb(pPrAttr->docAttrs); - pCtxtAttrs->jobAttrs = CopyDb(pPrAttr->jobAttrs); - } -} - -void -XpDestroyAttributes( - XpContextPtr pContext) -{ - ContextAttrPtr pCtxtAttrs; - - pCtxtAttrs = (ContextAttrPtr)pContext->devPrivates[attrCtxtPrivIndex].ptr; - - if(pCtxtAttrs->printerAttrs != (XrmDatabase)NULL) - XrmDestroyDatabase(pCtxtAttrs->printerAttrs); - if(pCtxtAttrs->docAttrs != (XrmDatabase)NULL) - XrmDestroyDatabase(pCtxtAttrs->docAttrs); - if(pCtxtAttrs->jobAttrs != (XrmDatabase)NULL) - XrmDestroyDatabase(pCtxtAttrs->jobAttrs); - if(pCtxtAttrs->pageAttrs != (XrmDatabase)NULL) - XrmDestroyDatabase(pCtxtAttrs->pageAttrs); -} - -/* - * XpGetOneAttribute returns the string value of the specified attribute - * in the specified class for the specified print context. If the attribute - * doesn't exist in the database for this context, or if the class database - * doesn't exist for this context, then NULL is returned. The caller must - * not free the returned string, as the returned pointer points into the - * database. This function can also return a value from the server attributes, - * in which case the pContext parameter is ignored. - */ -char * -XpGetOneAttribute( - XpContextPtr pContext, - XPAttributes class, - char *attributeName) -{ - ContextAttrPtr pCtxtAttrs; - XrmDatabase db = (XrmDatabase)NULL; - char *retVal; - XrmName xrm_name[3]; - XrmRepresentation rep_type; - XrmValue value; - - if(class == XPServerAttr) - { - if(systemAttributes.server == (XrmDatabase)NULL) - return NULL_STRING; - - xrm_name[0] = XrmStringToQuark (attributeName); - xrm_name[1] = (XrmQuark)NULL; - XrmQGetResource(systemAttributes.server, xrm_name, xrm_name, - &rep_type, &value); - - if(value.addr == (char *)NULL) - return NULL_STRING; - return (char *)value.addr; - } - else - { - pCtxtAttrs=(ContextAttrPtr)pContext->devPrivates[attrCtxtPrivIndex].ptr; - switch(class) - { - case XPPrinterAttr: - db = pCtxtAttrs->printerAttrs; - break; - case XPDocAttr: - db = pCtxtAttrs->docAttrs; - break; - case XPJobAttr: - db = pCtxtAttrs->jobAttrs; - break; - case XPPageAttr: - db = pCtxtAttrs->pageAttrs; - break; - default: - break; - } - } - if(db == (XrmDatabase)NULL) - return NULL_STRING; - - xrm_name[0] = XrmStringToQuark ("qualifier"); - xrm_name[1] = (XrmQuark)NULL; - XrmQGetResource(db, xrm_name, xrm_name, &rep_type, &value); - - xrm_name[0] = XrmStringToQuark (value.addr); - xrm_name[1] = XrmStringToQuark (attributeName); - xrm_name[2] = (XrmQuark)NULL; - if(XrmQGetResource(db, xrm_name, xrm_name, &rep_type, &value)) - return (char *)value.addr; - else - return NULL_STRING; -} - -/* - * XpPutOneAttribute updates one attribute for the specified - * context and class. This function is intended for use by the attribute - * validation module which updates the XrmDatabases directly. This - * function does not recognize XPServerAttr. - */ -void -XpPutOneAttribute( - XpContextPtr pContext, - XPAttributes class, - const char* attributeName, - const char* value) -{ - ContextAttrPtr pCtxtAttrs; - XrmDatabase db; - XrmBinding bindings[1]; - XrmQuark quarks[2]; - - pCtxtAttrs = (ContextAttrPtr)pContext->devPrivates[attrCtxtPrivIndex].ptr; - switch(class) - { - case XPPrinterAttr: - db = pCtxtAttrs->printerAttrs; - break; - case XPDocAttr: - db = pCtxtAttrs->docAttrs; - break; - case XPJobAttr: - db = pCtxtAttrs->jobAttrs; - break; - case XPPageAttr: - db = pCtxtAttrs->pageAttrs; - break; - default: - return; - } - bindings[0] = XrmBindLoosely; - quarks[0] = XrmStringToQuark(attributeName); - quarks[1] = (XrmQuark)NULL; - XrmQPutStringResource(&db, bindings, quarks, value ? value : ""); -} - - - -/******************************************************************************* - * - * The following routines: ExpandSpace, PutString, PutByte, and AppendEntry - * form the functional core of the GetAttributes routine. Xrm does not - * supply a routine to form a string database from an XrmDatabase, except - * by writing the database to a file. This code avoids the file system - * overhead, but is a bit clunky in its memory management. - * - ******************************************************************************/ - -/* - * ExpandSpace expands the memory allocated for the string database in - * the StringDbStruct passed in, and updates the "space" field of the - * struct to indicate the new amount of space available. - */ -static Bool -ExpandSpace( - StringDbStruct *pStr) -{ - char *newSpace; - - if((newSpace = (char *)xrealloc(pStr->stringDb, pStr->nextPos + pStr->space - + 1024)) == (char *)NULL) - return False; - pStr->space += 1024; - pStr->stringDb = newSpace; - return True; -} - -/* - * PutString puts the contents of a null-terminated string into the string - * database in the StringDbStruct passed in. If there is insufficient room - * for the string, ExpandSpace is called, and the nextPos and space fields - * are updated. - */ -static void -PutString( - StringDbStruct *pStr, - char *pString) -{ - int len = strlen(pString); - - if(len >= pStr->space) - if(!ExpandSpace(pStr)) - return; - strcpy(&pStr->stringDb[pStr->nextPos], pString); - pStr->nextPos += len; - pStr->space -= len; -} - -/* - * PutByte puts a single byte value in to the string database in the passed-in - * StringDbStruct. ExpandSpace is called if there is insufficient room for - * the byte, and the nextPos and space fields are updated. - */ -static void -PutByte( - StringDbStruct *pStr, - char byte) -{ - if(pStr->space <= 1) - if(!ExpandSpace(pStr)) - return; - pStr->stringDb[pStr->nextPos] = byte; - pStr->nextPos++; - pStr->space--; -} - -#define XrmQString XrmPermStringToQuark("String") - -/* - * AppendEntry is called by XrmEnumerateDatabase, and serves to append - * a database entry onto a string database. The passed-in "closure" - * struct contains a pointer to the string, and a count of the remaining - * bytes. If there are insufficient remaining bytes then the struct - * is realloced, and the count of the space remaining is updated. - * Database elements of types other than String are ignored! - * This code is based directly on that in "DumpEntry" in Xrm.c. - */ -static Bool -AppendEntry( - XrmDatabase *db, - XrmBindingList bindings, - XrmQuarkList quarks, - XrmRepresentation *type, - XrmValuePtr value, - XPointer data) -{ - StringDbStruct *pEnumStr = (StringDbStruct *)data; - Bool firstNameSeen; - unsigned int i; - char *s, c; - - if (*type != XrmQString) - return False; - - for (firstNameSeen = False; *quarks; bindings++, quarks++) { - if (*bindings == XrmBindLoosely) { - PutString(pEnumStr, "*"); - } else if (firstNameSeen) { - PutString(pEnumStr, "."); - } - firstNameSeen = True; - PutString(pEnumStr, XrmQuarkToString(*quarks)); - } - s = value->addr; - i = value->size; - PutString(pEnumStr, ":\t"); - if(i) i--; - - if (i && (*s == ' ' || *s == '\t')) - PutByte(pEnumStr, '\\'); /* preserve leading whitespace */ - - while (i--) { - c = *s++; - if (c == '\n') { - if (i) - PutString(pEnumStr, "\\n\\\n"); - else - PutString(pEnumStr, "\\n"); - } else if (c == '\\') - PutString(pEnumStr, "\\\\"); - else if ((c < ' ' && c != '\t') || - ((unsigned char)c >= 0x7f && (unsigned char)c < 0xa0)) - { - char temp[4]; - (void) sprintf(temp, "\\%03o", (unsigned char)c); - PutString(pEnumStr, temp); - } - else - PutByte(pEnumStr, c); - } - PutByte(pEnumStr, '\n'); - pEnumStr->stringDb[pEnumStr->nextPos] = (char)'\0'; - return False; -} - -/* - * XpGetAttributes returns a string database version of the Xrm database - * for the specified context and class. This function can also return the - * contents of the server attributes, in which case the pContext parameter - * is ignored. - * - * The caller is responsible for freeing the returned string, - * unlike XpGetOneAttribute, where the caller must not free the string. - */ -char * -XpGetAttributes( - XpContextPtr pContext, - XPAttributes class) -{ - ContextAttrPtr pCtxtAttrs; - XrmDatabase db = (XrmDatabase)NULL; - char *retVal; - StringDbStruct enumStruct; - XrmQuark empty = NULLQUARK; - - if(class == XPServerAttr) - db = systemAttributes.server; - else - { - pCtxtAttrs=(ContextAttrPtr)pContext->devPrivates[attrCtxtPrivIndex].ptr; - switch(class) - { - case XPServerAttr: - db = systemAttributes.server; - break; - case XPPrinterAttr: - db = pCtxtAttrs->printerAttrs; - break; - case XPDocAttr: - db = pCtxtAttrs->docAttrs; - break; - case XPJobAttr: - db = pCtxtAttrs->jobAttrs; - break; - case XPPageAttr: - db = pCtxtAttrs->pageAttrs; - break; - default: - break; - } - } - if(db == (XrmDatabase)NULL) - { - char *retval = (char *)xalloc(1); - retval[0] = (char)'\0'; - return retval; - } - - if((enumStruct.stringDb = (char *)xalloc(1024)) == (char *)NULL) - return (char *)NULL; - enumStruct.stringDb[0] = (char)'\0'; - enumStruct.nextPos = 0; - enumStruct.space = 1024; - (void)XrmEnumerateDatabase(db, &empty, &empty, XrmEnumAllLevels, - AppendEntry, (XPointer) &enumStruct); - - return enumStruct.stringDb; -} - -int -XpAugmentAttributes( - XpContextPtr pContext, - XPAttributes class, - char *attributes) -{ - XrmDatabase db; - ContextAttrPtr pCtxtAttrs; - - db = XrmGetStringDatabase(attributes); - if(db == (XrmDatabase)NULL) return BadAlloc; - - pCtxtAttrs = (ContextAttrPtr)pContext->devPrivates[attrCtxtPrivIndex].ptr; - switch(class) - { - case XPPrinterAttr: - XrmMergeDatabases(db, &pCtxtAttrs->printerAttrs); - break; - case XPDocAttr: - XrmMergeDatabases(db, &pCtxtAttrs->docAttrs); - break; - case XPJobAttr: - XrmMergeDatabases(db, &pCtxtAttrs->jobAttrs); - break; - case XPPageAttr: - XrmMergeDatabases(db, &pCtxtAttrs->pageAttrs); - break; - default: - break; - } - return Success; -} - -/* - * XpSetAttributes - sets the attribute stores for a specified context. - */ -int -XpSetAttributes( - XpContextPtr pContext, - XPAttributes class, - char *attributes) -{ - XrmDatabase db; - ContextAttrPtr pCtxtAttrs; - - db = XrmGetStringDatabase(attributes); - if(db == (XrmDatabase)NULL) return BadAlloc; - - pCtxtAttrs=(ContextAttrPtr)pContext->devPrivates[attrCtxtPrivIndex].ptr; - switch(class) - { - case XPPrinterAttr: - if(pCtxtAttrs->printerAttrs != (XrmDatabase)NULL) - XrmDestroyDatabase(pCtxtAttrs->printerAttrs); - pCtxtAttrs->printerAttrs = db; - break; - case XPDocAttr: - if(pCtxtAttrs->docAttrs != (XrmDatabase)NULL) - XrmDestroyDatabase(pCtxtAttrs->docAttrs); - pCtxtAttrs->docAttrs = db; - break; - case XPJobAttr: - if(pCtxtAttrs->jobAttrs != (XrmDatabase)NULL) - XrmDestroyDatabase(pCtxtAttrs->jobAttrs); - pCtxtAttrs->jobAttrs = db; - break; - case XPPageAttr: - if(pCtxtAttrs->pageAttrs != (XrmDatabase)NULL) - XrmDestroyDatabase(pCtxtAttrs->pageAttrs); - pCtxtAttrs->pageAttrs = db; - break; - default: - break; - } - return Success; -} - -void -XpAddPrinterAttribute( - char *printerName, - char *printerQualifier, - char *attributeName, - char *attributeValue) -{ - PrAttrPtr pAttr; - - for(pAttr = attrList; pAttr != (PrAttrPtr)NULL; pAttr = pAttr->next) - { - if(!strcmp(printerQualifier, pAttr->qualifier)) - { - XrmPutStringResource(&pAttr->printerAttrs, attributeName, - attributeValue); - break; - } - } -} - -const char * -XpGetPrinterAttribute(const char *printerName, - const char *attribute) -{ - PrAttrPtr pAttr; - XrmValue value; - char *type; - - for(pAttr = attrList; pAttr != (PrAttrPtr)NULL; pAttr = pAttr->next) - { - if(!strcmp(printerName, pAttr->qualifier)) - { - char *attrStr; - - attrStr = (char *)xalloc(strlen(printerName) + strlen(attribute) + - 2); - sprintf(attrStr, "%s.%s", printerName, attribute); - XrmGetResource(pAttr->printerAttrs, attrStr, attrStr, - &type, &value); - xfree(attrStr); - break; - } - } - if(value.addr != (XPointer)NULL && strlen(value.addr) != 0) - return value.addr; - else - return ""; -} - -/******************************************************************************* - * - * The following routines are not attribute routines, but are rather - * spooler interface functions. They should presumably move to - * a SpoolerIf.c of some similarly named file. - * - ******************************************************************************/ -#include - -static char serverAttrStr[] = "*document-attributes-supported: copy-count\n\ -*job-attributes-supported: job-name job-owner\ - notification-profile xp-spooler-command-options\n\ -*multiple-documents-supported: False"; - -XrmDatabase -XpSpoolerGetServerAttributes(void) -{ - char *totalAttrs, *localeName; - XrmDatabase db; - - localeName = setlocale(LC_CTYPE, (char *)NULL); - if(!localeName || strlen(localeName) == 0) - localeName = "C"; - - if((totalAttrs = (char *)xalloc(strlen(serverAttrStr) + strlen(localeName) - + 11)) == (char *)NULL) - return (XrmDatabase)NULL; - sprintf(totalAttrs, "%s\n%s\t%s", serverAttrStr, "*locale:", localeName); - - db = XrmGetStringDatabase(totalAttrs); - xfree(totalAttrs); - return db; -} - -/* - * Tailf() works similar to "/bin/tail -f fd_in >fd_out" until - * the process |child| terminates (the child status is - * returned in |child_status|). - * This function is used to copy the stdout/stderr output of a - * child to fd_out until the child terminates. - */ -static -void Tailf(int fd_in, int fd_out, pid_t child, int *child_status) -{ - char b[256]; - ssize_t sz; - Bool childDone = FALSE; - struct timeval timeout; - long fpos = 0; /* XXX: this is not correct for largefile support */ - - timeout.tv_sec = 0; - timeout.tv_usec = 100000; - - for(;;) - { - /* Check whether the child is still alive or not */ - if (waitpid(child, child_status, WNOHANG) == child) - childDone = TRUE; - - /* Copy traffic from |fd_in| to |fd_out| - * (Note we have to use |pread()| here to avoid race conditions - * between a child process writing to the same file using the - * same file pointer (|dup(2)| and |fork(2)| just duplicate the - * file handle but not the pointer)). - */ - while ((sz = pread(fd_in, b, sizeof(b), fpos)) > 0) - { - fpos += sz; - write(fd_out, b, sz); - } - - if (childDone) - break; - - (void)select(0, NULL, NULL, NULL, &timeout); - } -} - -/* - * SendFileToCommand takes three character pointers - the file name, - * the command to execute, - * and the "argv" style NULL-terminated vector of arguments for the command. - * The command is exec'd, and the file contents are sent to the command - * via stdin. - * - * WARNING: This function will try to adopt the userId of the supplied - * user name prior to exec'ing the supplied command. - */ -static void -SendFileToCommand( - XpContextPtr pContext, - char *fileName, - char *pCommand, - char **argVector, - char *userName) -{ - pid_t childPid; - int pipefd[2]; - int status; - struct stat statBuf; - FILE *fp, *outPipe; - FILE *resFp; /* output from launched command */ - int resfd; - - resFp = tmpfile(); - if (resFp == NULL) - { - ErrorF("SendFileToCommand: Cannot open temporary file for command output\n"); - return; - } - resfd = fileno(resFp); - - if(pipe(pipefd)) - { - ErrorF("SendFileToCommand: Cannot open pipe\n"); - fclose(resFp); - return; - } - - if(stat(fileName, &statBuf) < 0 || (int)statBuf.st_size == 0) - { - close(pipefd[0]); - close(pipefd[1]); - fclose(resFp); - return; - } - - fp = fopen(fileName, "r"); - if(fp == (FILE *)NULL) - { - ErrorF("SendFileToCommand: Cannot open scratch spool file '%s'\n", fileName); - close(pipefd[0]); - close(pipefd[1]); - fclose(resFp); - return; - } - - if((childPid = fork()) == 0) - { - close(pipefd[1]); - - /* Replace current stdin with input from the pipe */ - close(STDIN_FILENO); - dup(pipefd[0]); - close(pipefd[0]); - - /* Close current stdout and redirect it to resfd */ - close(STDOUT_FILENO); - dup(resfd); - - /* Close current stderr and redirect it to resfd - * (valgrind may not like that, in this case simply start it using - * % valgrind 50>/dev/tty --logfile-fd=50 ./Xprt ... #) - */ - close(STDERR_FILENO); - dup(resfd); - - fclose(resFp); - - /* - * If a user name is specified, try to set our uid to match that - * user name. This is to allow e.g. a banner page to show the - * name of the printing user rather than the user who started - * the print server. - */ - if(userName) - { - uid_t myUid; - - if((myUid = geteuid()) == (uid_t)0) - { - struct passwd *pPasswd; - - if((pPasswd = getpwnam(userName))) - { - if (setgid((gid_t)pPasswd->pw_gid) != 0) - perror("SendFileToCommand: setgid() failure."); - - if (initgroups(userName, (gid_t)pPasswd->pw_gid) != 0) - perror("SendFileToCommand: initgroups() failure."); - - if (setuid((uid_t)pPasswd->pw_uid) != 0) - perror("SendFileToCommand: setuid() failure."); - } - } - } - /* return BadAlloc? */ - if (execv(pCommand, argVector) == -1) { - FatalError("unable to exec '%s'", pCommand); - } - } - else - { - (void) close(pipefd[0]); - - outPipe = fdopen(pipefd[1], "w"); - (void) TransferBytes(fp, outPipe, (int)statBuf.st_size); - - (void) fclose(outPipe); - (void) fclose(fp); - - /* Wait for spooler child (and send all it's output to stderr) */ - Tailf(resfd, STDERR_FILENO, childPid, &status); - - if (status != EXIT_SUCCESS) - { - ErrorF("SendFileToCommand: spooler command returned non-zero status %d.\n", status); - } - - /* Store "xp-spooler-command-results" XPJobAttr that the - * client can fetch it on demand */ - if ((fstat(resfd, &statBuf) >= 0) && (statBuf.st_size >= 0)) - { - long bufSize; - char *buf; - - bufSize = statBuf.st_size; - - /* Clamp buffer size to 4MB to prevent that we allocate giant - * buffers if the spooler goes mad and spams it's stdout/stderr - * channel. */ - bufSize = MIN(bufSize, 4*1024*1024); - - buf = xalloc(bufSize+1); - if (buf != NULL) - { - bufSize = pread(resfd, buf, bufSize, 0); - buf[bufSize]='\0'; - - /* XXX: This should be converted from local multibyte encoding to - * Compound Text encoding first */ - XpPutOneAttribute(pContext, XPJobAttr, "xp-spooler-command-results", buf); - - xfree(buf); - } - } - else - { - ErrorF("SendFileToCommand: fstat() failed.\n"); - } - - fclose(resFp); - } - return; -} - -/* - * ReplaceAllKeywords causes all the predefined keywords (e.g. %options%) - * to be replaced with the appropriate values derived from the attribute - * store for the supplied print context. The ReplaceAnyString utility - * routine is used to perform the actual replacements. - */ - -static char * -ReplaceAllKeywords( - XpContextPtr pContext, - char *command) -{ - char *cmdOpt; - - cmdOpt = XpGetOneAttribute(pContext, XPPrinterAttr, - "xp-spooler-printer-name"); - if(cmdOpt != (char *)NULL && strlen(cmdOpt) != 0) - command = ReplaceAnyString(command, "%printer-name%", cmdOpt); - else - command = ReplaceAnyString(command, "%printer-name%", - pContext->printerName); - - cmdOpt = XpGetOneAttribute(pContext, XPDocAttr, "copy-count"); - if(cmdOpt != (char *)NULL && strlen(cmdOpt) != 0) - command = ReplaceAnyString(command, "%copy-count%", cmdOpt); - else - command = ReplaceAnyString(command, "%copy-count%", "1"); - - cmdOpt = XpGetOneAttribute(pContext, XPJobAttr, "job-name"); - if(cmdOpt != (char *)NULL && strlen(cmdOpt) != 0) - command = ReplaceAnyString(command, "%job-name%", cmdOpt); - else - command = ReplaceAnyString(command, "%job-name%", ""); - - cmdOpt = XpGetOneAttribute(pContext, XPJobAttr, "job-owner"); - if(cmdOpt != (char *)NULL && strlen(cmdOpt) != 0) - command = ReplaceAnyString(command, "%job-owner%", cmdOpt); - else - command = ReplaceAnyString(command, "%job-owner%", ""); - - cmdOpt = XpGetOneAttribute(pContext, XPJobAttr, - "xp-spooler-command-options"); - if(cmdOpt != (char *)NULL && strlen(cmdOpt) != 0) - command = ReplaceAnyString(command, "%options%", cmdOpt); - else - command = ReplaceAnyString(command, "%options%", ""); - - /* New in xprint.mozdev.org release 007 - replace "%xpconfigdir%" with - * location of $XPCONFIGDIR */ - command = ReplaceAnyString(command, "%xpconfigdir%", XpGetConfigDirBase()); - - return command; -} - -#ifdef __QNX__ -#define toascii( c ) ((unsigned)(c) & 0x007f) -#endif - -#if defined(CSRG_BASED) || \ - defined(linux) || \ - defined(__CYGWIN__) || \ - (defined(sun) && !defined(SVR4)) || \ - (defined(SVR4) && !defined(sun) && !defined(__UNIXWARE__)) || \ - defined(__UNIXOS2__) || \ - defined(ISC) || \ - defined(Lynx) || \ - defined(__QNX__) || \ - defined(__DARWIN__) -#define iswspace(c) (isascii(c) && isspace(toascii(c))) -#endif - -/* - * GetToken - takes in a string and returns a malloc'd copy of the - * first non-white-space sequence of characters in the string. - * It returns the number of _bytes_ (NOT characters) parsed through - * the inStr to get to the end of the returned token. - */ -static int -GetToken( - char *inStr, - char **outStr) -{ - size_t mbCurMax = MB_CUR_MAX; - wchar_t curChar; - int i, numBytes, byteLen = strlen(inStr); - char *tok; - - /* - * read through any leading white space. - */ - for(i = 0, numBytes = 0; i < byteLen; i += numBytes) - { - numBytes = mbtowc(&curChar, &inStr[i], mbCurMax); - if(!iswspace(curChar)) - break; - } - tok = inStr + i; - - /* - * find the end of the token. - */ - byteLen = strlen(tok); - for(i = 0, numBytes = 0; i < byteLen; i += numBytes) - { - numBytes = mbtowc(&curChar, &tok[i], mbCurMax); - if(iswspace(curChar)) - break; - } - - if((*outStr = (char *)xalloc(i + 1)) == (char *)NULL) - return 0; - strncpy(*outStr, tok, i); - (*outStr)[i] = (char)'\0'; - return (tok + i) - inStr; -} - -static void -FreeVector( - char **vector) -{ - int i; - - if(vector == (char **)NULL) return; - - for(i = 0; vector[i] != (char *)NULL; i++) - xfree(vector[i]); - xfree(vector); -} - - -/* - * AddVector appends the pAddition arg vector to the pTarget arg vector. - * If the pTarget cannot be realloc'd, then pTarget is set to NULL. - */ -static void -AddVector( - char ***pTarget, - char **pAddition) -{ - int numTarget, numAdd, i; - - for(numTarget = 0; (*pTarget)[numTarget] != (char *)NULL; numTarget++) - ; - for(numAdd = 0; pAddition[numAdd] != (char *)NULL; numAdd++) - ; - - *pTarget = (char **)xrealloc((void *)*pTarget, (numTarget + numAdd + 1) * - sizeof(char *)); - if(*pTarget == (char **)NULL) - return; - for(i = 0; i < numAdd; i++) - (*pTarget)[numTarget + i] = pAddition[i]; - - (*pTarget)[numTarget + numAdd] = (char *)NULL; -} - -static char ** -BuildArgVector( - char *argString, - XpContextPtr pContext) -{ - char **pVector; - char *curTok; - int numChars, i; - static int beenHere = 0; /* prevent recursion on embedded %options% - */ - - pVector = (char **)xalloc(sizeof(char *)); - pVector[0] = (char *)NULL; - for(i = 0; (numChars = GetToken(argString, &curTok)) != 0; - i++, argString += numChars) - { - if(beenHere || strcmp(curTok, "%options%")) - { - if(curTok[0] == (char)'\0') - { - xfree(curTok); - } - else - { - pVector = (char **)xrealloc((void *)pVector, - (i + 2)*sizeof(char *)); - if(pVector == (char **)NULL) - return (char **)NULL; - pVector[i] = curTok; - pVector[i + 1] = (char *)NULL; - } - } - else if(!beenHere) - { - char **optionsVec; - - curTok = ReplaceAllKeywords(pContext, curTok); - beenHere = 1; - optionsVec = BuildArgVector(curTok, pContext); - xfree(curTok); - beenHere = 0; - AddVector(&pVector, optionsVec); - xfree(optionsVec); - } - } - if(numChars == 0 && curTok != (char *)NULL) - xfree(curTok); - return pVector; -} - -/* - * VectorizeCommand takes a string and breaks it into a command name and - * an array of character pointers suitable for handing to execv. The - * array is NULL-terminated. - * The returned char * is the command name, and should be freed when no - * longer needed. The array elements returned in the pVector parameter - * should be individually freed, and the array itself should also be - * freed when no longer needed. - */ -static char * -VectorizeCommand( - char *command, - char ***pVector, - XpContextPtr pContext) -{ - char *cmdName, *curTok; - int i, numChars; - - if(command == (char *)NULL) - return (char *)NULL; - - numChars = GetToken(command, &cmdName); - - if(cmdName == (char *)NULL) - return (char *)NULL; - - /* Mangle the command name, too... */ - cmdName = ReplaceAllKeywords(pContext, cmdName); - - if(cmdName == (char *)NULL) - return (char *)NULL; - - *pVector = BuildArgVector(command, pContext); - - return cmdName; -} - -int -XpSubmitJob(fileName, pContext) - char *fileName; - XpContextPtr pContext; -{ - char **vector, *cmdNam, *cmdOpt, *command, *userName; - int i; - - command = XpGetOneAttribute(pContext, XPPrinterAttr, "xp-spooler-command"); - if(command == (char *)NULL || strlen(command) == 0) - { - if( spooler_type ) - { - command = strdup(spooler_type->spool_command); - } - else - { - ErrorF("XpSubmitJob: No default spool command defined.\n"); - } - } - else - { - command = strdup(command); - } - if(command == (char *)NULL) - { - ErrorF("XpSubmitJob: No spooler command found, cannot submit job.\n"); - return BadAlloc; - } - - cmdNam = VectorizeCommand(command, &vector, pContext); - xfree(command); - - if(cmdNam == (char *)NULL) - return BadAlloc; - - for(i = 0; vector[i] != (char *)NULL; i++) - { - vector[i] = ReplaceAllKeywords(pContext, vector[i]); - if(vector[i] == (char *)NULL) - { - xfree(cmdNam); - for(i = 0; vector[i] != (char *)NULL; i++) - xfree(vector[i]); - xfree(vector); - return BadAlloc; - } - } - - userName = XpGetOneAttribute(pContext, XPJobAttr, "job-owner"); - if(userName != (char *)NULL && strlen(userName) == 0) - userName = (char *)NULL; - - SendFileToCommand(pContext, fileName, cmdNam, vector, userName); - - FreeVector(vector); - xfree(cmdNam); - - return Success; -} - -/* - * SearchInputTrays() - * - * Given a tray, return the medium in the tray. Conversely, given a - * medium, return a tray in which it can be found. In either case, - * return NULL if the given tray or medium cannot be found. - */ -#define TRAY 0 -#define MEDIUM 1 - -static char * -SearchInputTrays(XpContextPtr pCon, - int which, - char *val) -{ - char *inputTraysMedium, tray[80], medium[80], *copy; - char *pS, *pE, *pLast; - - inputTraysMedium = XpGetOneAttribute( pCon, XPPrinterAttr, - "input-trays-medium" ); - - copy = strdup( inputTraysMedium ); - pS = copy; - pLast = copy + strlen( copy ); - - while( pS < pLast ) - { - while( *pS && *pS != '{' ) - pS++; - - pE = ++pS; - while( *pE && *pE != '}' ) - pE++; - *pE = '\0'; - - sscanf( pS, "%s %s", tray, medium ); - - if( which == MEDIUM && !strcmp( val, medium ) ) - { - xfree( copy ); - return strdup( tray ); - } - - if( which == TRAY && !strcmp( val, tray ) ) - { - xfree( copy ); - return strdup( medium ); - } - - pS = pE + 1; - } - - xfree( copy ); - return strdup( NULL_STRING ); -} - -/* - * XpGetTrayMediumFromContext() - * - * Given a print context, hit the input-trays-medium, - * default-input-tray and default-medium attributes to find the - * appropriate tray to use, and the medium in that tray. - */ -void -XpGetTrayMediumFromContext(XpContextPtr pCon, - char **medium, - char **tray) -{ - char *defMedium, *defTray; - char *t, *m; - char *pS, *pE, *pLast; - - defMedium = XpGetOneAttribute( pCon, XPPageAttr, - "default-medium" ); - if( *defMedium == '\0' ) - defMedium = XpGetOneAttribute( pCon, XPDocAttr, - "default-medium" ); - - defTray = XpGetOneAttribute( pCon, XPPageAttr, - "default-input-tray" ); - if( *defTray == '\0' ) - defTray = XpGetOneAttribute( pCon, XPDocAttr, - "default-input-tray" ); - - /* - * First, check to see if the default tray has the default medium - * installed. This is the ideal case. - */ - m = SearchInputTrays( pCon, TRAY, defTray ); - if( !strcmp( m, defMedium ) ) - { - xfree( m ); - *tray = strdup( defTray ); - *medium = strdup( defMedium ); - return; - } - - /* - * If the default tray doesn't have the default medium, search for - * a tray which has the default medium. - */ - t = SearchInputTrays( pCon, MEDIUM, defMedium ); - if( t ) - { - *tray = t; - *medium = strdup( defMedium ); - return; - } - - /* - * If all else fails, just return the default tray, and whatever - * medium happens to be there. Note that we simply return - * whatever is in the attribute store. Any further correction is - * left up to the DDX driver. - */ - *tray = strdup( defTray ); - *medium = m; - xfree( t ); -} diff --git a/nx-X11/programs/Xserver/Xprint/attributes.h b/nx-X11/programs/Xserver/Xprint/attributes.h deleted file mode 100644 index 40df4fd0b..000000000 --- a/nx-X11/programs/Xserver/Xprint/attributes.h +++ /dev/null @@ -1,131 +0,0 @@ -/* $Xorg: attributes.h,v 1.4 2001/03/14 18:42:44 pookie Exp $ */ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifndef _Xp_attributes_h -#define _Xp_attributes_h 1 - -#include "scrnintstr.h" -#include "AttrValid.h" - -#define BFuncArgs int ndx, ScreenPtr pScreen, int argc, char **argv -typedef Bool (*pBFunc)(BFuncArgs); - -#define VFuncArgs char *name, XpValidatePoolsRec *pValRec, float *width, float *height, int *res -typedef void (*pVFunc)(VFuncArgs); - -/* - * attributes.c - */ -void XpInitAttributes(XpContextPtr pContext); -void XpBuildAttributeStore(char *printerName, - char *qualifierName); -void XpAddPrinterAttribute(char *printerName, - char *printerQualifier, - char *attributeName, - char *attributeValue); -void XpDestroyAttributes(XpContextPtr pContext); -char *XpGetConfigDir(Bool useLocale); -char *XpGetOneAttribute(XpContextPtr pContext, - XPAttributes class, - char *attributeName); -void XpPutOneAttribute(XpContextPtr pContext, - XPAttributes class, - const char* attributeName, - const char* value); -int XpRehashAttributes(void); -char *XpGetAttributes(XpContextPtr pContext, - XPAttributes class); -int XpAugmentAttributes(XpContextPtr pContext, - XPAttributes class, - char *attributes); -int XpSetAttributes(XpContextPtr pContext, - XPAttributes class, - char *attributes); -const char *XpGetPrinterAttribute(const char *printerName, - const char *attribute); -void XpGetTrayMediumFromContext(XpContextPtr pCon, - char **medium, - char **tray); -int XpSubmitJob(char *fileName, XpContextPtr pContext); - -/* - * mediaSizes.c - */ -int XpGetResolution(XpContextPtr pContext); -XpOid XpGetContentOrientation(XpContextPtr pContext); -XpOid XpGetAvailableCompression(XpContextPtr pContext); -XpOid XpGetPlex(XpContextPtr pContext); -XpOid XpGetPageSize(XpContextPtr pContext, - XpOid* pTray, - const XpOidMediumSS* msss); -void XpGetMediumMillimeters(XpOid page_size, - float *width, - float *height); -void XpGetMediumDimensions(XpContextPtr pContext, - unsigned short *width, - unsigned short *height); -void XpGetReproductionArea(XpContextPtr pContext, - xRectangle *pRect); -void XpGetMaxWidthHeightRes(const char *printer_name, - const XpValidatePoolsRec* vpr, - float *width, - float *height, - int* resolution); - -/* Util.c */ -char *ReplaceAnyString(char *string, - char *target, - char *replacement); -char *ReplaceFileString(char *string, - char *inFileName, - char *outFileName); -int TransferBytes(FILE *pSrcFile, - FILE *pDstFile, - int numBytes); -Bool CopyContentsAndDelete(FILE **ppSrcFile, - char **pSrcFileName, - FILE *pDstFile); -int XpSendDocumentData(ClientPtr client, - FILE *fp, - int fileLen, - int maxBufSize); -int XpFinishDocData(ClientPtr client); -Bool XpOpenTmpFile(char *mode, - char **fname, - FILE **stream); - -#endif /* _Xp_attributes_h */ diff --git a/nx-X11/programs/Xserver/Xprint/ddxInit.c b/nx-X11/programs/Xserver/Xprint/ddxInit.c deleted file mode 100644 index be16a3799..000000000 --- a/nx-X11/programs/Xserver/Xprint/ddxInit.c +++ /dev/null @@ -1,397 +0,0 @@ -/* $Xorg: ddxInit.c,v 1.3 2000/08/17 19:48:07 cpqbld Exp $ */ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include -#include "windowstr.h" -#include "servermd.h" -#include "DiPrint.h" - -/*- - *----------------------------------------------------------------------- - * InitOutput -- - * If this is built as a print-only server, then we must supply - * an InitOutput routine. If a normal server's real ddx InitOutput - * is used, then it should call PrinterInitOutput if it so desires. - * The ddx-level hook is needed to allow the printer stuff to - * create additional screens. An extension can't reliably do - * this for two reasons: - * - * 1) If InitOutput doesn't create any screens, then main() - * exits before calling InitExtensions(). - * - * 2) Other extensions may rely on knowing about all screens - * when they initialize, and we can't guarantee the order - * of extension initialization. - * - * Results: - * ScreenInfo filled in, and PrinterInitOutput is called to create - * the screens associated with printers. - * - * Side Effects: - * None - * - *----------------------------------------------------------------------- - */ - -void -InitOutput( - ScreenInfo *pScreenInfo, - int argc, - char **argv) - -{ - int i; - - pScreenInfo->imageByteOrder = IMAGE_BYTE_ORDER; - pScreenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT; - pScreenInfo->bitmapScanlinePad = BITMAP_SCANLINE_PAD; - pScreenInfo->bitmapBitOrder = BITMAP_BIT_ORDER; - - pScreenInfo->numPixmapFormats = 0; /* get them in PrinterInitOutput */ - screenInfo.numVideoScreens = 0; -} - -static void -BellProc( - int volume, - DeviceIntPtr pDev) -{ - return; -} - -static void -KeyControlProc( - DeviceIntPtr pDev, - KeybdCtrl *ctrl) -{ - return; -} - -static KeySym printKeyMap[256]; -static CARD8 printModMap[256]; - -static int -KeyboardProc( - DevicePtr pKbd, - int what, - int argc, - char *argv[]) -{ - KeySymsRec keySyms; - - keySyms.minKeyCode = 8; - keySyms.maxKeyCode = 8; - keySyms.mapWidth = 1; - keySyms.map = printKeyMap; - - switch(what) - { - case DEVICE_INIT: - InitKeyboardDeviceStruct(pKbd, &keySyms, printModMap, - (BellProcPtr)BellProc, - KeyControlProc); - break; - case DEVICE_ON: - break; - case DEVICE_OFF: - break; - case DEVICE_CLOSE: - break; - } - return Success; -} - -#include "../mi/mipointer.h" -static int -PointerProc( - DevicePtr pPtr, - int what, - int argc, - char *argv[]) -{ -#define NUM_BUTTONS 1 - CARD8 map[NUM_BUTTONS]; - - switch(what) - { - case DEVICE_INIT: - { - map[0] = 0; - InitPointerDeviceStruct(pPtr, map, NUM_BUTTONS, - miPointerGetMotionEvents, - (PtrCtrlProcPtr)_XpVoidNoop, - miPointerGetMotionBufferSize()); - break; - } - case DEVICE_ON: - break; - case DEVICE_OFF: - break; - case DEVICE_CLOSE: - break; - } - return Success; -} - -void -InitInput( - int argc, - char **argv) -{ - DevicePtr ptr, kbd; - - ptr = AddInputDevice((DeviceProc)PointerProc, TRUE); - kbd = AddInputDevice((DeviceProc)KeyboardProc, TRUE); - RegisterPointerDevice(ptr); - RegisterKeyboardDevice(kbd); - return; -} - - -Bool -LegalModifier( - unsigned int key, - DevicePtr dev) -{ - return TRUE; -} - -void -ProcessInputEvents(void) -{ -} - -#ifdef __DARWIN__ -#include "micmap.h" - -void GlxExtensionInit(void); -void GlxWrapInitVisuals(miInitVisualsProcPtr *procPtr); - -void -DarwinHandleGUI(int argc, char *argv[]) -{ -} - -void DarwinGlxExtensionInit(void) -{ - GlxExtensionInit(); -} - -void DarwinGlxWrapInitVisuals( - miInitVisualsProcPtr *procPtr) -{ - GlxWrapInitVisuals(procPtr); -} -#endif - -#ifdef DDXOSINIT -void -OsVendorInit(void) -{ -} -#endif - -#ifdef DDXOSFATALERROR -void -OsVendorFatalError(void) -{ -} -#endif - -void -ddxBeforeReset(void) -{ - return; -} - -#ifdef DDXTIME -CARD32 -GetTimeInMillis(void) -{ - struct timeval tp; - - X_GETTIMEOFDAY(&tp); - return(tp.tv_sec * 1000) + (tp.tv_usec / 1000); -} -#endif - -/* ddxInitGlobals - called by |InitGlobals| from os/util.c */ -void ddxInitGlobals(void) -{ - PrinterInitGlobals(); -} - -/**************************************** -* ddxUseMsg() -* -* Called my usemsg from os/utils/c -* -*****************************************/ - -void ddxUseMsg(void) -{ -} - -void AbortDDX (void) -{ -} - -void ddxGiveUp(void) /* Called by GiveUp() */ -{ -} - -int -ddxProcessArgument ( - int argc, - char *argv[], - int i) -{ - return(0); -} - -#ifdef XINPUT - -#include -#include -#include "XIstubs.h" - -extern int BadDevice; - -int -ChangePointerDevice ( - DeviceIntPtr old_dev, - DeviceIntPtr new_dev, - unsigned char x, - unsigned char y) -{ - return (BadDevice); -} - -int -ChangeDeviceControl ( - register ClientPtr client, - DeviceIntPtr dev, - xDeviceCtl *control) -{ - return BadMatch; -} - -void -OpenInputDevice ( - DeviceIntPtr dev, - ClientPtr client, - int *status) -{ - return; -} - -void -AddOtherInputDevices (void) -{ - return; -} - -void -CloseInputDevice ( - DeviceIntPtr dev, - ClientPtr client) -{ - return; -} - -int -ChangeKeyboardDevice ( - DeviceIntPtr old_dev, - DeviceIntPtr new_dev) -{ - return (Success); -} - -int -SetDeviceMode ( - register ClientPtr client, - DeviceIntPtr dev, - int mode) -{ - return BadMatch; -} - -int -SetDeviceValuators ( - register ClientPtr client, - DeviceIntPtr dev, - int *valuators, - int first_valuator, - int num_valuators) -{ - return BadMatch; -} - - -#endif /* XINPUT */ - -#ifdef XTESTEXT1 - -void -XTestJumpPointer(int x, int y, int dev) -{ - return; -} - -void -XTestGetPointerPos(int x, int y) -{ - return; -} - -void -XTestGenerateEvent(int dev, int keycode, int keystate, int x, int y) -{ - return; -} - -#endif /* XTESTEXT1 */ - -#ifdef AIXV3 -/* - * This is just to get the server to link on AIX, where some bits - * that should be in os/ are instead in hw/ibm. - */ -int SelectWaitTime = 10000; /* usec */ -#endif diff --git a/nx-X11/programs/Xserver/Xprint/etc/Imakefile b/nx-X11/programs/Xserver/Xprint/etc/Imakefile deleted file mode 100644 index 6a6e02a29..000000000 --- a/nx-X11/programs/Xserver/Xprint/etc/Imakefile +++ /dev/null @@ -1,24 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.1 2002/10/31 14:42:52 gisburn Exp $ -#define IHaveSubdirs -#define PassCDebugFlags CDEBUGFLAGS="$(CDEBUGFLAGS)" - -XCOMM Check if OS has /etc/profile.d/ -XCOMM Note that Debian Linux does not have /etc/profile.d/ -#ifndef HasEtcProfileDir -# ifdef LinuxArchitecture -# if (LinuxDistribution != LinuxDebian) || BuildFullXprintDistrib -# define HasEtcProfileDir YES -# endif -# else -# define HasEtcProfileDir NO -# endif -#endif - -#if HasEtcProfileDir -SUBDIRS = init.d profile.d Xsession.d -#else -SUBDIRS = init.d Xsession.d -#endif - -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) diff --git a/nx-X11/programs/Xserver/Xprint/etc/Xsession.d/Imakefile b/nx-X11/programs/Xserver/Xprint/etc/Xsession.d/Imakefile deleted file mode 100644 index 55a07175e..000000000 --- a/nx-X11/programs/Xserver/Xprint/etc/Xsession.d/Imakefile +++ /dev/null @@ -1,24 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.1 2003/01/25 14:42:52 gisburn Exp $ - -#if NothingOutsideProjectRoot -#define EtcDir ProjectRoot/etc -#else -#define EtcDir /etc -#endif - -ETCDIR = EtcDir - -all:: - -XCOMM Install glue for Xprint on Solaris/CDE1.x and CDE on AIX -#if (defined(SunArchitecture) && (OSMajorVersion > 4)) || defined(IBMArchitecture) -InstallNamedProg(cde_xsessiond_xprint.sh,0018.xprint,/usr/dt/config/Xsession.d) -#endif - -XCOMM Install xdm startup glue for Xprint on Linux. Note that not all Linux -XCOMM platforms have /etc/X11/Xsession.d/ and/or /etc/X11/xinit/xinitrc.d -XCOMM (see http://xprint.freedesktop.org/cgi-bin/bugzilla/show_bug.cgi?id=182) -#if defined(LinuxDistribution) -InstallNamedProg(cde_xsessiond_xprint.sh,92xprint-xpserverlist.sh,$(ETCDIR)/X11/Xsession.d) -InstallNamedProg(cde_xsessiond_xprint.sh,92xprint-xpserverlist.sh,$(ETCDIR)/X11/xinit/xinitrc.d) -#endif diff --git a/nx-X11/programs/Xserver/Xprint/etc/Xsession.d/cde_xsessiond_xprint.sh b/nx-X11/programs/Xserver/Xprint/etc/Xsession.d/cde_xsessiond_xprint.sh deleted file mode 100644 index 3fb6bba7c..000000000 --- a/nx-X11/programs/Xserver/Xprint/etc/Xsession.d/cde_xsessiond_xprint.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -##################################################################### -### File: 0018.xprint -### -### Default Location: /usr/dt/config/Xsession.d/ -### -### Purpose: Setup Xprint env vars -### -### Description: This script is invoked by means of the Xsession file -### at user login. -### -### Invoked by: /usr/dt/bin/Xsession -### -### (c) Copyright 2003-2004 Roland Mainz -### -### please send bugfixes or comments to http://xprint.mozdev.org/ -### -##################################################################### - - -# -# Obtain list of Xprint servers -# - -if [ -f "/etc/init.d/xprint" ] ; then - XPSERVERLIST="`/bin/sh /etc/init.d/xprint get_xpserverlist`" - export XPSERVERLIST -fi - -########################## eof ##################### diff --git a/nx-X11/programs/Xserver/Xprint/etc/init.d/Imakefile b/nx-X11/programs/Xserver/Xprint/etc/init.d/Imakefile deleted file mode 100644 index dedefb199..000000000 --- a/nx-X11/programs/Xserver/Xprint/etc/init.d/Imakefile +++ /dev/null @@ -1,97 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.2 2003/01/20 17:02:01 gisburn Exp $ - -all:: xprint - -#if BuildGISWxprintglue -XPCUSTOMGLUE=GISWxprintglue -#elif BuildGISWxprint -XPCUSTOMGLUE = GISWxprint -#elif BuildDebianXprintPackage -XPCUSTOMGLUE = DebianGlue -#else -XPCUSTOMGLUE = default -#endif - -#if defined(SunArchitecture) -OS_DEFINES = -DOS_SOLARIS -#elif defined(LinuxArchitecture) -OS_DEFINES = -DOS_LINUX -#elif defined(AIXArchitecture) -OS_DEFINES = -DOS_AIX -#else -OS_DEFINES = -#endif - -#if NothingOutsideProjectRoot -#define EtcDir ProjectRoot/etc -#else -#define EtcDir /etc -#endif - -ETCDIR = EtcDir - -MakeScriptFromCpp(xprint, -DDEF_XPCUSTOMGLUE=$(XPCUSTOMGLUE) $(OS_DEFINES) -DProjectRoot=$(PROJECTROOT)) - -#if defined(FreeBSDArchitecture) -InstallNamedProg(xprint,xprint,$(PROJECTROOT)/etc/rc.d) -#else -XCOMM Solaris, Linux, etc. -InstallNamedProg(xprint,xprint,$(ETCDIR)/init.d) -#endif - -XCOMM Create startup/shutdown links in /etc/init.d/ for Solaris -#if defined(SunArchitecture) && (OSMajorVersion > 4) - -#define InstallStartupLink(rcdir,script,linkname) \ - MakeDir($(DESTDIR)$(ETCDIR)/rcdir) ; \ - RemoveFile($(DESTDIR)$(ETCDIR)/rcdir/linkname) ; \ - ln -s ../init.d/script $(DESTDIR)$(ETCDIR)/rcdir/linkname - -install:: - InstallStartupLink(rc0.d,xprint,K38xprint) - InstallStartupLink(rc1.d,xprint,K38xprint) - InstallStartupLink(rc2.d,xprint,S81xprint) - InstallStartupLink(rcS.d,xprint,K38xprint) -#endif /* defined(SunArchitecture) && (OSMajorVersion > 4) */ - -XCOMM Create startup/shutdown links in /etc/init.d/ for Linux -#if defined(LinuxDistribution) -# if (LinuxDistribution == LinuxSuSE) || \ - (LinuxDistribution == LinuxDebian) || \ - (LinuxDistribution == LinuxUnknown) -XCOMM SuSE Linux(-like) - -#define InstallStartupLink(rcdir,script,linkname) \ - MakeDir($(DESTDIR)$(ETCDIR)/rc.d/rcdir) ; \ - ln -sf ../script $(DESTDIR)$(ETCDIR)/rc.d/rcdir/linkname - -install:: - echo "# Installing /etc/init.d links for SuSE Linux(-like)" - InstallStartupLink(rc2.d,xprint,K21xprint) - InstallStartupLink(rc2.d,xprint,S21xprint) - InstallStartupLink(rc3.d,xprint,K21xprint) - InstallStartupLink(rc3.d,xprint,S21xprint) - InstallStartupLink(rc5.d,xprint,K21xprint) - InstallStartupLink(rc5.d,xprint,S21xprint) -# elif LinuxDistribution == LinuxRedHat -XCOMM RedHat Linux(-like) - -#define InstallStartupLink(rcdir,script,linkname) \ - MakeDir($(DESTDIR)$(ETCDIR)/rcdir) ; \ - ln -sf ../init.d/script $(DESTDIR)$(ETCDIR)/rcdir/linkname - -install:: - echo "# Installing /etc/init.d links for RedHat Linux(-like)" - InstallStartupLink(rc0.d,xprint,K61xprint) - InstallStartupLink(rc1.d,xprint,K61xprint) - InstallStartupLink(rc2.d,xprint,S61xprint) - InstallStartupLink(rc3.d,xprint,S61xprint) - InstallStartupLink(rc4.d,xprint,S61xprint) - InstallStartupLink(rc5.d,xprint,S61xprint) - InstallStartupLink(rc6.d,xprint,K61xprint) -# else -install:: - echo "WARNING: No links for /etc/init.d/xprint set." -# endif /* LinuxDistribution == * */ -#endif /* defined(LinuxArchitecture) */ - diff --git a/nx-X11/programs/Xserver/Xprint/etc/init.d/xprint.cpp b/nx-X11/programs/Xserver/Xprint/etc/init.d/xprint.cpp deleted file mode 100644 index dbfd1e139..000000000 --- a/nx-X11/programs/Xserver/Xprint/etc/init.d/xprint.cpp +++ /dev/null @@ -1,1277 +0,0 @@ -XCOMM!/bin/sh -XCOMM -XCOMM Copyright 2002-2004 by Roland Mainz . -XCOMM -XCOMM This script manages the Xprint server side - -XCOMM Basic support for IRIX-style "chkconfig" -XCOMM chkconfig: 2345 61 61 -XCOMM description: Startup/shutdown script for Xprint server(s) - -XCOMM Basic support for the Linux Standard Base Specification 1.0.0 -XCOMM (Note: The Should-Start/Stop lines are there so that this works in the -XCOMM future, when the LSB adopts these. The X-UnitedLinux lines are there -XCOMM so that it works right now.) -XCOMM## BEGIN INIT INFO -XCOMM Provides: xprint -XCOMM Required-Start: $local_fs $remote_fs $syslog $network -XCOMM Required-Stop: $local_fs $remote_fs $syslog -XCOMM Should-Start: cups lpd xfs -XCOMM Should-Stop: cups lpd xfs -XCOMM X-UnitedLinux-Should-Start: cups lpd xfs -XCOMM X-UnitedLinux-Should-Stop: cups lpd xfs -XCOMM Default-Start: 3 5 -XCOMM Default-Stop: 0 1 2 6 -XCOMM Description: Startup/shutdown script for Xprint server(s) -XCOMM## END INIT INFO - -#undef sun -#undef unix - -XCOMM########################################################################### -XCOMM -XCOMM This script has three main tasks: -XCOMM 1. Start Xprint servers ("Xprt") at boot time. -XCOMM 2. Shutdown Xprint servers when the machine is being shut down. -XCOMM 3. Query the list of available printers. -XCOMM -XCOMM Additional tasks are: -XCOMM 4. Restart ('restart'|'force-reload') and conditional restart -XCOMM ('condrestart'/'try-restart') for Linux support -XCOMM 5. Wrapping of application call with setting XPSERVERLIST ('wrapper') -XCOMM -XCOMM Usage: -XCOMM - Start Xprint server(s) manually: -XCOMM % /etc/init.d/xprint start -XCOMM -XCOMM - Stop Xprint server(s) manually: -XCOMM % /etc/init.d/xprint stop -XCOMM -XCOMM - Populate $XPSERVERLIST env var (for example as part of a global -XCOMM login script like /etc/profile or per-user login scripts like -XCOMM $HOME/.profile (sh/ksh/bash)) -XCOMM % XPSERVERLIST="`/etc/init.d/xprint get_xpserverlist`" -XCOMM % export XPSERVERLIST -XCOMM -XCOMM Installation: -XCOMM Copy this script to /etc/init.d/xprint and make sure that it is -XCOMM executable. If your installation is LSB-compliant, then run -XCOMM % /usr/lib/lsb/install_initd /etc/init.d/xprint -XCOMM to start the service on startup. Otherwise, manually create links -XCOMM to the matching run levels. -XCOMM Examples: -XCOMM - Solaris 2.7/2.8/2.9: -XCOMM % cp xprint /etc/init.d/xprint -XCOMM % chmod a+rx /etc/init.d/xprint -XCOMM % ln /etc/init.d/xprint /etc/rc0.d/K38xprint -XCOMM % ln /etc/init.d/xprint /etc/rc1.d/K38xprint -XCOMM % ln /etc/init.d/xprint /etc/rc2.d/S81xprint -XCOMM % ln /etc/init.d/xprint /etc/rcS.d/K38xprint -XCOMM -XCOMM - SuSE Linux 7.3 -XCOMM % cp xprint /etc/init.d/xprint -XCOMM % chmod a+rx /etc/init.d/xprint -XCOMM % ln -s ../xprint /etc/init.d/rc3.d/K13xprint -XCOMM % ln -s ../xprint /etc/init.d/rc3.d/S12xprint -XCOMM % ln -s ../xprint /etc/init.d/rc5.d/K13xprint -XCOMM % ln -s ../xprint /etc/init.d/rc5.d/S12xprint -XCOMM % ln -s ../xprint /etc/init.d/rc2.d/K13xprint -XCOMM % ln -s ../xprint /etc/init.d/rc2.d/S12xprint -XCOMM -XCOMM - SuSE Linux 6.4: -XCOMM % cp xprint /sbin/init.d/xprint -XCOMM % chmod a+rx /sbin/init.d/xprint -XCOMM % ln -s ../xprint /sbin/init.d/rc2.d/K20xprint -XCOMM % ln -s ../xprint /sbin/init.d/rc2.d/S20xprint -XCOMM % ln -s ../xprint /sbin/init.d/rc3.d/K20xprint -XCOMM % ln -s ../xprint /sbin/init.d/rc3.d/S20xprint -XCOMM -XCOMM Notes: -XCOMM - The Xprint servers must be started _after_ the print -XCOMM spooler or the server(s) may refuse to start -XCOMM - The script should be readable by all users to ensure that they -XCOMM can use the "get_xpserverlist"-option -XCOMM -XCOMM Custom configuration: -XCOMM - Edit the function setup_config() in this script to match your needs -XCOMM -XCOMM Known bugs/ToDo/Notes: -XCOMM - The shell script assumes that a Xserver can be reached via -XCOMM "hostname:displaynum" where "hostname" is obtained from -XCOMM "/usr/bin/hostname". It may happen that a kernel firewall -XCOMM blocks an X connection on the same host (e.g. client && Xserver -XCOMM are running on the same host). -XCOMM Suggested fix: Fix the firewall config. -XCOMM Suggested workaround: Edit this script and replace the use of -XCOMM /usr/bin/hostname with "echo 'localhost'". -XCOMM -XCOMM########################################################################### -XCOMM - - -XCOMM########################################################################### - -fatal_error() -{ - echo "${0}: ## FATAL ERROR: ${1}" 1>&2 - exit 1 -} - -error_echo() -{ - echo "${0}: ## ERROR: ${1}" 1>&2 -} - -warning_echo() -{ - echo "${0}: ## WARNING: ${1}" 1>&2 -} - -verbose_echo() -{ - echo "${0}: ${1}" -} - -msg() -{ - echo "${1}" -} - -XCOMM########################################################################### - -#ifndef OS_LINUX -XCOMM Force use of a POSIX conformant sh -XCOMM (Solaris /sbin/sh is plain Bourne shell) -[ "$1" != "posix_sh_forced" -a -x /bin/ksh ] && exec /bin/ksh "$0" posix_sh_forced "$@" -[ "$1" != "posix_sh_forced" -a -x /bin/bash ] && exec /bin/bash --norc --noprofile "$0" posix_sh_forced "$@" -[ "$1" != "posix_sh_forced" -a -x /usr/local/bin/ksh ] && exec /usr/local/bin/ksh "$0" posix_sh_forced "$@" -[ "$1" != "posix_sh_forced" -a -x /usr/local/bin/bash ] && exec /usr/local/bin/bash --norc --noprofile "$0" posix_sh_forced "$@" -if [ "$1" != "posix_sh_forced" ] ; then - echo "${0}: ## FATAL ERROR: No POSIX-shell found." 1>&2 - exit 1 -fi - -shift # Drop "posix_sh_forced" -#endif /* !OS_LINUX */ - -XCOMM#debug -XCOMM set -x - -XCOMM Change current dir to a location which is writeable by everyone -cd /tmp - -XCOMM Clear some environment variables -unset TEMP TMPDIR SCREENDIR - -XCOMM Set search path for commands -export PATH=/usr/bin:/bin:/usr/sbin:/sbin -#ifdef OS_SOLARIS -export PATH=/usr/xpg4/bin:${PATH} -#endif - -XCOMM# Try to figure-out where X11 was installed -#if defined(OS_SOLARIS) -XPROJECTROOT=/usr/openwin -export OPENWINHOME=/usr/openwin -#elif defined(OS_AIX) -XPROJECTROOT=/usr/lpp/X11 -#else -#if defined(ProjectRoot) -[ -d ProjectRoot/bin ] && XPROJECTROOT=ProjectRoot -#endif -[ -d /usr/X11/bin ] && XPROJECTROOT=/usr/X11 -[ -d /usr/X11R6/bin ] && XPROJECTROOT=/usr/X11R6 -#endif -XPCUSTOMGLUE=DEF_XPCUSTOMGLUE # This is used for customizing this script -export XPROJECTROOT XPCUSTOMGLUE - -if [ -z "${XPROJECTROOT}" ] ; then - fatal_error "Unknown XProjectRoot." -fi - -XCOMM Set the location of the Xprt binary we want to use. -XPRT_BIN="${XPROJECTROOT}/bin/Xprt" - -XCOMM Set the location of the global file where we store the locations -XCOMM of the system-wide servers -if [ -d /var/run ] ; then - XP_GLOBAL_SERVERS=/var/run/Xprint_servers -else - XP_GLOBAL_SERVERS=/tmp/.Xprint_servers -fi - -XCOMM ${LOGNAME} will not work if user su'ed into another account -export CURRLOGNAME="$(id -u -n)" - -XCOMM Set location where we want to store the list of Xprint servers managed -XCOMM by this user -XCOMM - If we start as "root" use the global file -XCOMM - If we start as normal user use a per-user file - -if [ "${CURRLOGNAME}" != "root" -a "${CURRLOGNAME}" != "" ] ; then - XP_PER_USER_SERVERS="/tmp/.Xprint_servers_${CURRLOGNAME}" - XP_SERVERS="${XP_PER_USER_SERVERS}" -else - XP_SERVERS="${XP_GLOBAL_SERVERS}" -fi - -XCOMM Set umask that owner can r/w all files and everyone else can read them -umask 022 - -XCOMM Bump limit for per-process open files to ensure that Xprt can open many many fonts -ulimit -n 1024 - -XCOMM########################################################################### - -XCOMM Get list of fonts for a given display -get_fontlist_from_display() -{ - ${XPROJECTROOT}/bin/xset -display "${1}" q | - awk "/Font Path:/ { i=1 ; next } i==1 { print \$0 ; i=0 }" | - fontpath2fontlist -} - -XCOMM Get list from a fontserver config -get_fontlist_from_xfs_config() -{ - if [ ! -r "${1}" ] ; then - return 0 - fi - - ( - cat "${1}" | - while read -r i ; do - for val in $i; do - case $val in - \#*) break ;; - ?*=*) key="${val%%=*}" ;; - =*) key="${tok}" ;; - *) [ "${key}" = "catalogue" -a "${tok}" != "" ] && echo "${tok}" ;; - esac - tok="${val#*=}" - done - done - ) | tr "," "\n" | fontpath2fontlist -} - -get_fontlist_from_all_xfs_configs() -{ - get_fontlist_from_xfs_config "/etc/openwin/fs/fontserver.cfg" - get_fontlist_from_xfs_config "/usr/openwin/lib/X11/fontserver.cfg" - get_fontlist_from_xfs_config "/etc/X11/fs-xtt/config" - get_fontlist_from_xfs_config "/etc/X11/fs/config" - get_fontlist_from_xfs_config "/etc/X11/xfs/config" - get_fontlist_from_xfs_config "${XPROJECTROOT}/lib/X11/fs/config" -} - -get_fontlist_from_xf86config() -{ - srcxconf="" - - XCOMM see xorg.conf(5x) manual page for the list of locations used here - [ "${srcxconf}" = "" -a -f "/etc/X11/xorg.conf" ] && srcxconf="/etc/X11/xorg.conf" - [ "${srcxconf}" = "" -a -f "/usr/X11R6/etc/X11/xorg.conf" ] && srcxconf="/usr/X11R6/etc/X11/xorg.conf" - [ "${srcxconf}" = "" -a -f "/etc/X11/xorg.conf-4" ] && srcxconf="/etc/X11/xorg.conf-4" - [ "${srcxconf}" = "" -a -f "/etc/X11/xorg.conf" ] && srcxconf="/etc/X11/xorg.conf" - [ "${srcxconf}" = "" -a -f "/etc/xorg.conf" ] && srcxconf="/etc/xorg.conf" - [ "${srcxconf}" = "" -a -f "/usr/X11R6/etc/X11/xorg.conf.${hostname}" ] && srcxconf="/usr/X11R6/etc/X11/xorg.conf.${hostname}" - [ "${srcxconf}" = "" -a -f "/usr/X11R6/etc/X11/xorg.conf-4" ] && srcxconf="/usr/X11R6/etc/X11/xorg.conf-4" - [ "${srcxconf}" = "" -a -f "/usr/X11R6/etc/X11/xorg.conf" ] && srcxconf="/usr/X11R6/etc/X11/xorg.conf" - [ "${srcxconf}" = "" -a -f "/usr/X11R6/lib/X11/xorg.conf.${hostname}" ] && srcxconf="/usr/X11R6/lib/X11/xorg.conf.${hostname}" - [ "${srcxconf}" = "" -a -f "/usr/X11R6/lib/X11/xorg.conf-4" ] && srcxconf="/usr/X11R6/lib/X11/xorg.conf-4" - [ "${srcxconf}" = "" -a -f "/usr/X11R6/lib/X11/xorg.conf" ] && srcxconf="/usr/X11R6/lib/X11/xorg.conf" - - XCOMM Xfree86 locations - [ "${srcxconf}" = "" -a -f "/etc/X11/XF86Config-4" ] && srcxconf="/etc/X11/XF86Config-4" - [ "${srcxconf}" = "" -a -f "/etc/X11/XF86Config" ] && srcxconf="/etc/X11/XF86Config" - - - if [ "${srcxconf}" = "" ] ; then - return 0 - fi - - currsection="" - cat "${srcxconf}" | - while read i1 i2 i3 i4 ; do - # Strip "\"" from I2 - i2="${i2#\"}" ; i2="${i2%\"}" - - case "${i1}" in - \#*) - continue - ;; - 'Section') - currsection="${i2}" - ;; - 'EndSection') - currsection="" - ;; - 'FontPath') - [ "$currsection" = "Files" ] && echo "${i2%:unscaled}" - ;; - esac - done | egrep -v -i "tcp/|tcp4/|tcp6/|unix/" - - return 0 -} - -get_fontlist_from_defoma() -{ - # Include Debian defoma font directory where relevant - if [ -d "/var/lib/defoma/x-ttcidfont-conf.d/dirs" ] ; then - find "/var/lib/defoma/x-ttcidfont-conf.d/dirs" -name fonts.dir | - while read i ; do echo "${i%/fonts.dir}" ; done - fi -} - -XCOMM Get list of system fonts -get_system_fontlist() -{ -#if defined(OS_SOLARIS) - ## List the standard X11 fonts - # echo "${XPROJECTROOT}/lib/X11/fonts/F3/" - # echo "${XPROJECTROOT}/lib/X11/fonts/F3bitmaps/" - echo "${XPROJECTROOT}/lib/X11/fonts/Type1/" - echo "${XPROJECTROOT}/lib/X11/fonts/Type1/outline/" - # We cannot use /usr/openwin/lib/X11/fonts/Type1/sun/ - see - # http://xprint.mozdev.org/bugs/show_bug.cgi?id=5726 - # ("Xprint doesn't start under Solaris 2.9 due *.ps files in /usr/openwin/lib/X11/fonts/Type1/sun/fonts.dir") - #echo "${XPROJECTROOT}/lib/X11/fonts/Type1/sun/" - echo "${XPROJECTROOT}/lib/X11/fonts/TrueType/" - echo "${XPROJECTROOT}/lib/X11/fonts/Speedo/" - echo "${XPROJECTROOT}/lib/X11/fonts/misc/" - echo "${XPROJECTROOT}/lib/X11/fonts/75dpi/" - echo "${XPROJECTROOT}/lib/X11/fonts/100dpi/" - - ## List all fonts in all locales installed on this machine - cat /usr/openwin/lib/locale/''*/OWfontpath | tr "," "\n" | sort -u -#elif defined(OS_LINUX) - ( - get_fontlist_from_defoma - - get_fontlist_from_xf86config - - # Getting font paths from XFS is mainly required for compatibilty to RedHat - get_fontlist_from_all_xfs_configs - - ## List all fonts in all locales installed on this machine - ( - [ -d "/usr/share/fonts" ] && find /usr/share/fonts -name fonts.dir - find "${XPROJECTROOT}/lib/X11/fonts" -name fonts.dir - ) | - while read i ; do echo "${i%/fonts.dir}" ; done - ) | sort -u -#else - ## List the standard X11 fonts - # (AIX should be handled like Solaris but I did not found a way to - # enumerate all fonts in all installed locales without scanning the - # dirs manually) - echo "${XPROJECTROOT}/lib/X11/fonts/Type1/" - echo "${XPROJECTROOT}/lib/X11/fonts/TrueType/" - echo "${XPROJECTROOT}/lib/X11/fonts/TTF/" - echo "${XPROJECTROOT}/lib/X11/fonts/Speedo/" - echo "${XPROJECTROOT}/lib/X11/fonts/misc/" - echo "${XPROJECTROOT}/lib/X11/fonts/75dpi/" - echo "${XPROJECTROOT}/lib/X11/fonts/100dpi/" - echo "${XPROJECTROOT}/lib/X11/fonts/" -#endif -} - -XCOMM Filter fonts per given extended regular expressions -XCOMM (and make sure we filter any model-config fonts - they are managed by Xprt internally) -filter_fontlist() -{ - egrep -- "${1}" | fgrep -v "/models/" | egrep -v -- "${2}" -} - -XCOMM Filter font paths with unsupported font types -XCOMM (such as CID fonts) -filter_unsupported_fonts() -{ - egrep -v -i "/cid(/$|$)|/csl(/$|$)" -} - -XCOMM Validate fontpath -XCOMM Only return valid font path entries (note that these entries may -XCOMM include non-file stuff like font server references) -validate_fontlist() -{ - while read i ; do - case "${i}" in - # Check if font path entry is a font server... - tcp/''*|tcp4/''*|tcp6/''*|unix/''*) - echo "${i}" - ;; - # ... if not check if the path is accessible - # and has a valid "fonts.dir" index - *) - [ -f "${i}/fonts.dir" ] && echo "${i}" - ;; - esac - done -} - -XCOMM Build a comma-seperated list of fonts (font path) from a list of fonts -fontlist2fontpath() -{ - fp="" - read fp; - while read i ; do - fp="${fp},${i}" - done - - echo "$fp" -} - -XCOMM Build a list (one item per line) of fonts from a font path -fontpath2fontlist() -{ - while read i ; do - echo "${i}" | tr "," "\n" - done -} - -XCOMM Sort scaleable fonts (PS Type1 and TrueType) first in a font list -sort_scaleable_fonts_first() -{ - i="$(fontlist2fontpath)" - # First list PS Type1 fonts... - echo "${i}" | fontpath2fontlist | fgrep "/Type1" - # ... then TrueType fonts ... - echo "${i}" | fontpath2fontlist | egrep -i "/TrueType|/TT(/$|$)|/TTF(/$|$)" - # ... then all others - echo "${i}" | fontpath2fontlist | egrep -v -i "/Type1|/TrueType|/TT(/$|$)|/TTF(/$|$)" -} - -XCOMM Check if a X display is used by a Xserver or not -XCOMM Known bugs: -XCOMM - there is no way in plain bourne shell or bash (see comment about ksh93 -XCOMM below) to test if a Xserver sits only on a socket and not on a pipe -XCOMM - some Xserver's don't cleanup their stuff in /tmp on exit which may end -XCOMM in the problem that we don't detect possible free display numbers -XCOMM (one problem is that only ksh93 can do stuff like -XCOMM "cat "${lastdisplaynumreturned_store}" - return 0 - fi - done - - # Using "magic" value of 189 here due lack of a better solution - echo "189" - echo "189" >"${lastdisplaynumreturned_store}" - return 0 -} - -XCOMM Check if a process exists or not -pexists() -{ - [ "$1" = "" ] && return 1; - - # Use of /proc would be better but not all platforms (like AIX) have procfs - [ "$(ps -p $1 | fgrep $1)" != "" ] && return 0; - return 1 -} - -XCOMM Check if there is a spooler running... -is_spooler_running() -{ - # This covers Linux lpd, CUPS, Solaris and AIX 4.x - but what about - # AIX 5.x, HP-UX and IRIX ? - - [ "$(ps -A | egrep 'lpd|lpsched|cupsd|qdaemon' | fgrep -v 'grep')" != "" ] && return 0; - return 1 -} - -XCOMM Wait until the spooler system has been started (but not more than 30secs) -wait_for_print_spooler() -{ - for i in 1 2 3 4 5 6 7 8 9 10 ; do - is_spooler_running && return 0; - sleep 3 - done - - return 0 -} - -lock_server_registry() -{ - lock_counter=0 # counts in 1/100s - waiting_for_lock_msg_send="false" - while ! mkdir "${XP_SERVERS}.lock" 2>/dev/null ; do - # print notice after 2 seconds - if [ ${lock_counter} -gt 200 -a "${waiting_for_lock_msg_send}" != "true" ] ; then - echo "${0}: waiting for lock(=${XP_SERVERS}.lock)..." - waiting_for_lock_msg_send="true" - fi - - # tread the lock as "broken" after 20 seconds - if [ ${lock_counter} -gt 2000 ] ; then - echo "${0}: WARNING: lock timeout for lock(=${XP_SERVERS}.lock)." - return 0 - fi - - if [ -x /bin/usleep ] ; then - /bin/usleep 200000 - lock_counter=$((${lock_counter} + 20)) # 20/100s - else - sleep 1 - lock_counter=$((${lock_counter} + 100)) # 100/100s - fi - done -} - -unlock_server_registry() -{ - rmdir "${XP_SERVERS}.lock" -} - -XCOMM Kill dead registry locks (silently!) -kill_dead_registry_locks() -{ - rm -Rf "${XP_SERVERS}.lock" -} - -XCOMM Start Xprint servers -start_servers() -{ - # Write registry "intro" ... - lock_server_registry - echo "# Xprint server list" >>"${XP_SERVERS}" - echo "# File is for private use for ${0}." >>"${XP_SERVERS}" - echo "# Do not edit, rely on the content or file format." >>"${XP_SERVERS}" - unlock_server_registry - - hostname="$(hostname)" - - default_fontpath="$(get_system_fontlist | fontlist2fontpath)" - default_fontpath_acceptpattern=".*"; - default_fontpath_rejectpattern="_No_Match_"; # Match nothing - - curr=0 - while [ $curr -lt $num_xpstart ] ; do - if [ "${xpstart_remote_server[$curr]}" != "" ] ; then - # Remote Xprt, just put the entry into the registry - lock_server_registry - echo "display=${xpstart_remote_server[$curr]}" >>"${XP_SERVERS}" - unlock_server_registry - else - # Run block in seperate process to avoid that changes to the - # xpstart_* variables affect the next cycle - ( - # Use defaults if there are no special options - [ "${xpstart_fontpath[$curr]}" = "" ] && xpstart_fontpath[$curr]="${default_fontpath}"; - [ "${xpstart_fontpath_acceptpattern[$curr]}" = "" ] && xpstart_fontpath_acceptpattern[$curr]="$default_fontpath_acceptpattern"; - [ "${xpstart_fontpath_rejectpattern[$curr]}" = "" ] && xpstart_fontpath_rejectpattern[$curr]="$default_fontpath_rejectpattern"; - [ "${xpstart_displayid[$curr]}" = "" ] && xpstart_displayid[$curr]="$(FindFreeXDisplayNum)" - [ "${xpstart_logger[$curr]}" = "" ] && xpstart_logger[$curr]="logger -p lpr.notice -t Xprt_${xpstart_displayid[$curr]}"; - [ "${xpstart_logfile[$curr]}" = "" ] && xpstart_logfile[$curr]="/dev/null"; - [ "${xpstart_xprt_binary[$curr]}" = "" ] && xpstart_xprt_binary[$curr]="${XPRT_BIN}"; - if [ "${xpstart_xprt_binary[$curr]}" = "/usr/openwin/bin/Xprt" -o "$(uname -s)" = "SunOS" ] ; then - # Solaris /usr/openwin/bin/Xprt does not support "-nolisten tcp" - # yet nor is it possible to run a Xserver on a unix socket only - # in Solaris since access to the unix domain sockets in - # /tmp/.X11-pipe and /tmp/.X11-unix is restricted to applications - # with group-id "root" (e.g. the Xprt server would need to be - # setgid "root" that plain users can start it listening on a unix - # socket only) - [ "${xpstart_options[$curr]}" = "" ] && xpstart_options[$curr]="-ac -pn" - else - [ "${xpstart_options[$curr]}" = "" ] && xpstart_options[$curr]="-ac -pn -nolisten tcp" - fi - - # Check if the Xprt binary is available - if [ ! -x "${xpstart_xprt_binary[$curr]}" ] ; then - error_echo "Can't find \"${xpstart_xprt_binary[$curr]}\"." - exit 1 # exit block - fi - - # Verify and set location of font encodings directory file - if [ "${xpstart_font_encodings_dir[$curr]}" = "" ] ; then - if [ -f "${XPROJECTROOT}/lib/X11/fonts/xf86encodings/encodings.dir" ] ; then - xpstart_font_encodings_dir[$curr]="${XPROJECTROOT}/lib/X11/fonts/xf86encodings/encodings.dir" - else - xpstart_font_encodings_dir[$curr]="${XPROJECTROOT}/lib/X11/fonts/encodings/encodings.dir"; - fi - fi - - unset FONT_ENCODINGS_DIRECTORY - if [ ! -f "${xpstart_font_encodings_dir[$curr]}" ] ; then - warning_echo "Can't find \"${xpstart_font_encodings_dir[$curr]}\", TrueType font support may not work." - fi - - export FONT_ENCODINGS_DIRECTORY="${xpstart_font_encodings_dir[$curr]}" - - # Generate font path (containing only valid font path elements) - # from input font path and filter expressions - curr_fp=$(echo "${xpstart_fontpath[$curr]}" | - fontpath2fontlist | - filter_fontlist "${xpstart_fontpath_acceptpattern[$curr]}" "${xpstart_fontpath_rejectpattern[$curr]}" | - filter_unsupported_fonts | - sort_scaleable_fonts_first | - validate_fontlist | - fontlist2fontpath) - - # Set Xserver auditing level option - unset curr_audit - if [ "${xpstart_auditlevel[$curr]}" != "" ] ; then - curr_audit="-audit ${xpstart_auditlevel[$curr]}" - fi - - # Set Xprt -XpFile option - unset curr_xpfile - if [ "${xpstart_xpfile[$curr]}" != "" ] ; then - curr_xpfile="-XpFile ${xpstart_xpfile[$curr]}" - fi - - # Set custom XPCONFIGDIR (if there is one) - unset XPCONFIGDIR - if [ "${xpstart_xpconfigdir[$curr]}" != "" ] ; then - export XPCONFIGDIR="${xpstart_xpconfigdir[$curr]}" - fi - - # If someone uses "-nolisten tcp" make sure we do not add a hostname to force local transport - if [ "$(echo "${xpstart_options[$curr]}" | egrep "nolisten.*tcp")" != "" ] ; then - xp_display=":${xpstart_displayid[$curr]}" - else - xp_display="${hostname}:${xpstart_displayid[$curr]}" - fi - - ( - ( - "${xpstart_xprt_binary[$curr]}" \ - ${xpstart_options[$curr]} \ - ${curr_xpfile} ${curr_audit} \ - -fp ${curr_fp} \ - :${xpstart_displayid[$curr]} & - server_pid="$!" - - # Append the new server to the registry - lock_server_registry - echo "display=${xp_display} display_id=${xpstart_displayid[$curr]} pid=${server_pid}" >>"${XP_SERVERS}" - unlock_server_registry - - wait - echo "Xprint server pid=${server_pid} done, exitcode=$?." - - # Remove the dead server from the registry - # (only if the registry still exists - if /etc/init.d/xprint stop" gets called the registry - # will be removed - and we should not re-create it afterwards...) - lock_server_registry - if [ -f "${XP_SERVERS}" ] ; then - x="$(cat "${XP_SERVERS}")" # Store content of file "${XP_SERVERS}" in var "x" - echo "${x}" | fgrep -v "display_id=${xpstart_displayid[$curr]} pid=${server_pid}" >"${XP_SERVERS}" - fi - unlock_server_registry - ) 2>&1 | while read i ; do echo "$i" | tee -a "${xpstart_logfile[$curr]}" | ${xpstart_logger[$curr]} ; done - ) & - ) - fi - - curr=$(($curr + 1)) - done - - # Remove tmp. file created by |FindFreeXDisplayNum()| - rm -f "${lastdisplaynumreturned_store}" - - # Done. - lock_server_registry - echo "# EOF." >>"${XP_SERVERS}" - unlock_server_registry - return 0 -} - - -XCOMM Convenience function to check setup and start Xprt server(s) -do_start() -{ - if [ -f "${XP_SERVERS}" ] ; then - numservers="$(do_get_xpserverlist | wc -l)" - if [ ${numservers} -gt 0 ] ; then - verbose_echo "Xprint servers are already running." - return 0 - else - verbose_echo "Old server registry found, cleaning-up..." - do_stop - fi - fi - - # Check if we can write the registry file - touch "${XP_SERVERS}" 2>/dev/null - if [ ! -f "${XP_SERVERS}" ] ; then - error_echo "Cannot create \"${XP_SERVERS}\"." - # exit code 4 = user had insufficient privilege (LSB) - exit 4 - fi - - if ! setup_config ; then - error_echo "setup_config failed." - exit 1 - fi - - # Provide two paths here - one which simply starts the Xprt servers, - # assuming that there is a print spooler already running (or that - # ${XPCONFIG}/C/print/Xprinters provides static print queue entries - # (like for the PSspooldir print model)) and a 2nd path which - # explicitly checks if the print queue daemons are running - if true ; then - msg "Starting Xprint servers: Xprt." - start_servers - else - # Continue in the background if there is no spooler running yet (that - # we don't hold off the boot process nor run in a possible race-condition - # when /etc/init.d/lpd was not called yet but the runlevel script waits - # for us to finish first ... - if is_spooler_running ; then - msg "Starting Xprint servers: Xprt." - start_servers - else - msg "Starting Xprint servers (in the background): Xprt." - (wait_for_print_spooler ; start_servers) & - sleep 5 - fi - fi - - if [ "${CURRLOGNAME}" = "root" -a -d /var/lock/subsys/ ] ; then - touch /var/lock/subsys/xprint - fi -} - -XCOMM Convenience function to stop Xprt server(s) -do_stop() -{ - msg "Stopping Xprint servers: Xprt." - - lock_server_registry - if [ -f "${XP_SERVERS}" ] ; then - reglist="$(cat "${XP_SERVERS}")" - rm -f "${XP_SERVERS}" - fi - unlock_server_registry - - if [ "${reglist}" != "" ] ; then - echo "${reglist}" | - grep "^display=.*:.* pid=[0-9]*$" | - while read i ; do - ( - eval ${i} - if pexists ${pid} ; then - kill ${pid} - fi - - # Remove the X sockets/pipes which are not in use anymore - # (It would be better if the Xservers would cleanup this - # automatically, but most Xservers do not do that... ;-( - # Note that this will not work on Solaris where applications - # must run with groupid="root" if they want to write into - # /tmp/.X11-unix/ and/or /tmp/.X11-pipe/) - if [ "${display_id}" != "" ] ; then - rm -f "/tmp/.X${display_id}-lock" 2>/dev/null - rm -f "/tmp/.X11-unix/X${display_id}" 2>/dev/null - rm -f "/tmp/.X11-pipe/X${display_id}" 2>/dev/null - fi - ) - done - fi - - if [ "${CURRLOGNAME}" = "root" -a -d /var/lock/subsys/ ] ; then - rm -f /var/lock/subsys/xprint - fi - - # Remove any outstanding (dead) locks and cleanup - rm -f "${XP_SERVERS}" - kill_dead_registry_locks -} - -XCOMM Convenience function to obtain a list of available Xprint servers -do_get_xpserverlist() -{ - if [ -f "${XP_PER_USER_SERVERS}" -o -f "${XP_GLOBAL_SERVERS}" ] ; then - xpserverlist=$( - # Enumerate both per-user and global servers (in that order) - ( - [ -f "${XP_PER_USER_SERVERS}" ] && cat "${XP_PER_USER_SERVERS}" - [ -f "${XP_GLOBAL_SERVERS}" ] && cat "${XP_GLOBAL_SERVERS}" - ) | - egrep "^display=.*:.* pid=[0-9]*$|^display=.*:[0-9]*$" | - while read i ; do - ( - pid="none" - eval ${i} - # Check if the Xprt process exists (if possible) - if [ "$pid" != "none" ] ; then - if pexists ${pid} ; then - echo ${display} - fi - else - echo ${display} - fi - ) - done | tr "\n" " " - ) - # Only produce output if we have some entries... - [ "${xpserverlist}" != "" ] && echo "${xpserverlist}" - fi -} - -do_restart() -{ - msg "Restarting Xprint server(s): Xprt." - do_stop - sleep 1 - do_start -} - -do_diag() -{ - echo "##### Diag start $(date)." - - # General info - echo "## General info start." - ( - echo "PATH=\"${PATH}\"" - echo "TZ=\"${TZ}\"" - echo "LANG=\"${LANG}\"" - echo "uname -a=\"$(uname -a)\"" - echo "uname -s=\"$(uname -s)\"" - echo "uname -p=\"$(uname -p)\"" - echo "uname -i=\"$(uname -i)\"" - echo "uname -m=\"$(uname -m)\"" - echo "has /etc/SuSE-release ... $([ -f "/etc/SuSE-release" ] && echo "yes" || echo "no")" - echo "has /etc/redhat-release ... $([ -f "/etc/redhat-release" ] && echo "yes" || echo "no")" - echo "has /etc/debian_version ... $([ -f "/etc/debian_version" ] && echo "yes" || echo "no")" - echo "how many Xprt servers are running ...$(ps -ef | fgrep Xprt | fgrep -v "grep" | wc -l)" - ) 2>&1 | while read i ; do echo " $i" ; done - echo "## General info end." - - # Testing font paths - echo "## Testing font paths start." - ( - get_system_fontlist | - filter_unsupported_fonts | - sort_scaleable_fonts_first | - validate_fontlist | while read d ; do - echo "#### Testing \"${d}\" ..." - if [ ! -d "$d" ] ; then - echo "# Error: $d does not exists." - continue - fi - if [ ! -r "$d" ] ; then - echo "# Error: $d not readable." - continue - fi - if [ ! -f "${d}/fonts.dir" ] ; then - echo "# Error: ${d}/fonts.dir not found." - continue - else - if [ ! -r "${d}/fonts.dir" ] ; then - echo "# Error: ${d}/fonts.dir not readable." - continue - fi - fi - if [ -f "${d}/fonts.alias" ] ; then - if [ ! -r "${d}/fonts.alias" ] ; then - echo "# Error: ${d}/fonts.alias not readable." - fi - fi - - if [ "$(cat "${d}/fonts.dir" | fgrep 'cursor')" != "" ] ; then - echo "${d}/fonts.dir has cursor font." - fi - if [ "$(cat "${d}/fonts.dir" | fgrep 'fixed')" != "" ] ; then - echo "${d}/fonts.dir has fixed font." - fi - - if [ -r "${d}/fonts.alias" ] ; then - if [ "$(cat "${d}/fonts.alias" | fgrep 'cursor')" != "" ] ; then - echo "${d}/fonts.alias has cursor font." - fi - if [ "$(cat "${d}/fonts.alias" | fgrep 'fixed')" != "" ] ; then - echo "${d}/fonts.alias has fixed font." - fi - fi - - linenum=0 - cat "${d}/fonts.dir" | while read i1 i2 i3 i4 ; do - linenum=$((${linenum} + 1)) - [ ${linenum} -eq 1 ] && continue - - if [ ! -f "${d}/${i1}" ] ; then - echo "ERROR: ${d}/fonts.dir line ${linenum} has non-exististant font \"${i1}\" (=\"${i1} ${i2} ${i3} ${i4}\")" - fi - done - done - ) 2>&1 | while read i ; do echo " $i" ; done - echo "## Testing font paths end." - - echo "##### Diag End $(date)." -} - -XCOMM Set platform-defaults for setup_config() -setup_config_defaults() -{ - curr_num_xpstart="${1}" - - #### Defaults for Linux/Solaris - # Start Xprt using builtin XPCONFIGDIR at a free display numer - # (Solaris(=SunOS5.x)'s /usr/openwin/bin/Xprt supports TrueType fonts, - # therefore we don't need to filter them) - xpstart_fontpath[${curr_num_xpstart}]=""; - xpstart_fontpath_acceptpattern[${curr_num_xpstart}]=".*"; - xpstart_fontpath_rejectpattern[${curr_num_xpstart}]="/Speedo|/F3bitmaps|/F3"; - xpstart_displayid[${curr_num_xpstart}]=""; - xpstart_xpconfigdir[${curr_num_xpstart}]=""; - xpstart_xpfile[${curr_num_xpstart}]=""; - xpstart_auditlevel[${curr_num_xpstart}]="4"; - xpstart_options[${curr_num_xpstart}]=""; - xpstart_logger[${curr_num_xpstart}]=""; - # Check whether we have /dev/stderr (needed for old AIX + old Debian) - if [ -w "/dev/stderr" ] ; then - xpstart_logfile[${curr_num_xpstart}]="/dev/stderr"; - else - xpstart_logfile[${curr_num_xpstart}]="/dev/tty"; - fi - xpstart_xprt_binary[${curr_num_xpstart}]=""; - - # Custom rules for the GISWxprintglue package on Solaris - # (which uses Solaris's /usr/openwin/bin/Xprt but a custom config) - if [ "${XPCUSTOMGLUE}" = "GISWxprintglue" ] ; then - xpstart_xpconfigdir[${curr_num_xpstart}]="/opt/GISWxprintglue/server/etc/XpConfig" - xpstart_xprt_binary[${curr_num_xpstart}]="/usr/openwin/bin/Xprt" - fi - # Custom rules for the GISWxprint package on Solaris - # (which uses both it's own Xprt and a custom config) - if [ "${XPCUSTOMGLUE}" = "GISWxprint" ] ; then - xpstart_xpconfigdir[${curr_num_xpstart}]="/opt/GISWxprint/server/etc/XpConfig" - xpstart_xprt_binary[${curr_num_xpstart}]="/opt/GISWxprint/bin/Xprt" - xpstart_font_encodings_dir[${curr_num_xpstart}]="/opt/GISWxprint/lib/X11/fonts/encodings/encodings.dir" - fi - - ####################################################### - ### - ### Debian Xprint package default configuration - ### - if [ "${XPCUSTOMGLUE}" = "DebianGlue" ] ; then - # Set XPCONFIGDIR=/usr/share/Xprint/xserver - xpstart_xpconfigdir[${curr_num_xpstart}]="/usr/share/Xprint/xserver"; - - # Use fixed display ID (":64"), or else all client programs will have to be - # restarted simply to update XPSERVERLIST to the latest ID when upgrading, - # which would be a nightmare. - xpstart_displayid[${curr_num_xpstart}]=64; - - # Do not send any messages to console - xpstart_logfile[${curr_num_xpstart}]="/dev/null"; - - # By default use binary provided by Debian's "xprt-xprintorg" package - # (=/usr/bin/Xprt), otherwise leave blank (e.g. use script's default - # (=/usr/X11R6/bin/Xprt)) - if [ -x "/usr/bin/Xprt" ] ; then - xpstart_xprt_binary[${curr_num_xpstart}]="/usr/bin/Xprt"; - fi - fi - ### - ### End Debian default configuration - ### - ####################################################### -} - -fetch_etc_initd_xprint_envvars() -{ - curr_num_xpstart="${1}" - - ## Process some $ETC_INITD_XPRINT_* vars after all which may be used by - # a user to override the hardcoded values here when starting Xprt per-user - # (a more flexible way is to provide an own setup config script in - # "~./Xprint_per_user_startup" - see above) - if [ "${ETC_INITD_XPRINT_XPRT_PATH}" != "" ] ; then - xpstart_xprt_binary[${curr_num_xpstart}]="${ETC_INITD_XPRINT_XPRT_PATH}" - fi - if [ "${ETC_INITD_XPRINT_XPCONFIGDIR}" != "" ] ; then - xpstart_xpconfigdir[${curr_num_xpstart}]="${ETC_INITD_XPRINT_XPCONFIGDIR}" - fi - if [ "${ETC_INITD_XPRINT_XPFILE}" != "" ] ; then - xpstart_xpfile[${curr_num_xpstart}]="${ETC_INITD_XPRINT_XPFILE}" - fi - if [ "${ETC_INITD_XPRINT_LOGFILE}" != "" ] ; then - xpstart_logfile[${curr_num_xpstart}]="${ETC_INITD_XPRINT_LOGFILE}" - fi - if [ "${ETC_INITD_XPRINT_DISPLAYID}" != "" ] ; then - xpstart_displayid[${curr_num_xpstart}]="${ETC_INITD_XPRINT_DISPLAYID}" - fi - if [ "${ETC_INITD_XPRINT_FONTPATH}" != "" ] ; then - xpstart_fontpath[${curr_num_xpstart}]="${ETC_INITD_XPRINT_FONTPATH}" - fi - if [ "${ETC_INITD_XPRINT_XPRT_OPTIONS}" != "" ] ; then - xpstart_options[${curr_num_xpstart}]="${ETC_INITD_XPRINT_XPRT_OPTIONS}" - fi - if [ "${ETC_INITD_XPRINT_AUDITLEVEL}" != "" ] ; then - xpstart_auditlevel[${curr_num_xpstart}]="${ETC_INITD_XPRINT_AUDITLEVEL}" - fi - if [ "${ETC_INITD_XPRINT_XF86ENCODINGSDIR}" != "" ] ; then - xpstart_font_encodings_dir[${curr_num_xpstart}]="${ETC_INITD_XPRINT_XF86ENCODINGSDIR}" - fi -} - -XCOMM########################################################################### -XCOMM setup_config() sets the configuration parameters used to start one -XCOMM or more Xprint servers ("Xprt"). -XCOMM The following variables are used: -XCOMM - "num_xpstart" - number of servers to start -XCOMM - "xpstart_fontpath[index]" - custom font path. Leave blank if you want -XCOMM the platform-specific default -XCOMM - "xpstart_fontpath_acceptpattern[index]" - extended regular expression -XCOMM (see egrep(1)) used to filter the font path - items only pass this -XCOMM filter if they match the pattern (leave blank if you want to filter -XCOMM nothing) -XCOMM - "xpstart_fontpath_rejectpattern[index]" - extended regular expression -XCOMM (see egrep(1)) used to filter the font path - items only pass this -XCOMM filter if they do not match the pattern (leave blank if you want to -XCOMM filter nothing) -XCOMM - "xpstart_font_encodings_dir[index]" - location of "encodings.dir". -XCOMM Leave blank to use the default. -XCOMM - "xpstart_displayid[index]" - display id to use for the Xprint server -XCOMM (leave blank to choose the next available free display id) -XCOMM - "xpstart_xpconfigdir[index]" - value for custom XPCONFIGDIR (leave blank -XCOMM if you don not want that that XPCONFIGDIR is set at Xprt startup) -XCOMM - "xpstart_xpfile[index]" - value used for Xprt's "-XpFile" option (leave -XCOMM blank if you do not want to set this option) -XCOMM - "xpstart_auditlevel[index]" - set Xserver auditing level (leave blank to -XCOMM use no auditing) -XCOMM - "xpstart_options[index]" - set further Xprt options (leave blank to set -XCOMM no further options) -XCOMM - "xpstart_logger[index]" - utility which gets stderr/stdout messages from -XCOMM Xprt and sends them to a logging daemon. Leave blank to use /usr/bin/logger -XCOMM to send such messages to the lpr.notice syslog) -XCOMM - "xpstart_logfile[index]" - log file to append stderr/stdout messages from -XCOMM Xprt to. Leave blank to send messages to /dev/null -XCOMM - "xpstart_xprt_binary[index]" - set custom Xprt binary (leave blank to use -XCOMM the platform-specifc default) -setup_config() -{ - num_xpstart=0; - - if [ "${ETC_INITD_XPRINT_CUSTOM_SETUP_CONFIG}" != "" ] ; then - user_cfg="${ETC_INITD_XPRINT_CUSTOM_SETUP_CONFIG}" - else - user_cfg="${HOME}/.Xprint_per_user_startup" - fi - - # Source per-user ~/.Xprint_per_user_startup file if there is one - # (and do not use the script's defaults below) - if [ -r "${user_cfg}" ] ; then - # Define API version which should be checked by ${HOME}/.Xprint_per_user_startup - # ${HOME}/.Xprint_per_user_startup should bail-out if the version differ - etc_initd_xprint_api_version=2 - - # Source per-user settings script - . "${user_cfg}" - - # done with setting the config for per-user Xprt instances - return 0; - else - # Use /etc/init.d/xprint's builtin config - # Each entry should start with |setup_config_defaults| to pull the - # platform defaults and finish with |num_xpstart=$(($num_xpstart + 1))| - # to end the entry - - # Set platform-defaults - setup_config_defaults "${num_xpstart}" - - ## -- snip -- - - # Admins can put their stuff "in" here... - - ## -- snip -- - - # Override script's builtin values with those a user may set via the - # $ETC_INIITD_XPRINT_* env vars - fetch_etc_initd_xprint_envvars "${num_xpstart}" - - num_xpstart=$((${num_xpstart} + 1)) - - return 0; - fi - - #### Sample 1: - # # Start Xprt on a free display ID with custom XPCONFIGDIR and without - # # Speedo and TrueType fonts - # xpstart_fontpath_rejectpattern[$num_xpstart]="/Speedo|/TrueType|/TT(/$|$)|/TTF(/$|$)"; - # xpstart_xpconfigdir[$num_xpstart]="/home/gisburn/cwork/Xprint/Xprt_config/XpConfig"; - # xpstart_auditlevel[$num_xpstart]="4"; - # xpstart_options[$num_xpstart]="-ac -pn"; - #num_xpstart=$(($num_xpstart + 1)) - - - #### Sample 2: - # # Start Xprt without TrueType fonts on a display 55 with custom - # # XPCONFIGDIR - # xpstart_fontpath_rejectpattern[$num_xpstart]="/TrueType|/TT(/$|$)|/TTF(/$|$)"; - # xpstart_displayid[$num_xpstart]=55; - # xpstart_xpconfigdir[$num_xpstart]="/home/gisburn/cwork/Xprint/Xprt_config/XpConfig"; - # xpstart_auditlevel[$num_xpstart]=4; - # xpstart_options[$num_xpstart]="-ac -pn"; - #num_xpstart=$(($num_xpstart + 1)) - - #### Sample 3: - # # Start Xprt without TrueType fonts on a display 56 with custom - # # XPCONFIGDIR and alternate "Xprinters" file - # xpstart_fontpath_rejectpattern[$num_xpstart]="/TrueType|/TT(/$|$)|/TTF(/$|$)"; - # xpstart_displayid[$num_xpstart]=56; - # xpstart_xpconfigdir[$num_xpstart]="/etc/XpConfig/default"; - # xpstart_xpfile[$num_xpstart]="/etc/XpConfig/default/Xprinters_test2" - # xpstart_auditlevel[$num_xpstart]="4"; - # xpstart_options[$num_xpstart]="-ac -pn"; - # xpstart_xprt_binary[$num_xpstart]=""; - #num_xpstart=$(($num_xpstart + 1)) - - #### Sample 4: - # # Start Xprt with Solaris ISO-8859-7 (greek(="el") locale) fonts on - # # display 57 - # xpstart_fontpath[$num_xpstart]="/usr/openwin/lib/locale/iso_8859_7/X11/fonts/75dpi,/usr/openwin/lib/locale/iso_8859_7/X11/fonts/Type1,/usr/openwin/lib/X11/fonts/misc/"; - # xpstart_fontpath_acceptpattern[$num_xpstart]=""; - # xpstart_fontpath_rejectpattern[$num_xpstart]="_No_Match_"; - # xpstart_displayid[$num_xpstart]="57"; - # xpstart_auditlevel[$num_xpstart]="4"; - # xpstart_options[$num_xpstart]="-ac -pn"; - #num_xpstart=$(($num_xpstart + 1)) - - #### Sample 5: - # # Start Xprt with the font list of an existing Xserver (excluding Speedo fonts) on - # # display 58 - # # Note that this only works within a X session. At system boot time - # # there will be no $DISPLAY to fetch the information from!! - # xpstart_fontpath[$num_xpstart]="$(get_fontlist_from_display ${DISPLAY} | fontlist2fontpath)"; - # xpstart_fontpath_acceptpattern[$num_xpstart]=""; - # xpstart_fontpath_rejectpattern[$num_xpstart]=""; - # xpstart_displayid[$num_xpstart]="58"; - # xpstart_xpconfigdir[$num_xpstart]=""; - # xpstart_auditlevel[$num_xpstart]="4"; - # xpstart_options[$num_xpstart]="-ac -pn"; - # xpstart_xprt_binary[$num_xpstart]=""; - #num_xpstart=$(($num_xpstart + 1)) - - #### Sample 6: - # # List remote Xprt's here - # # (note that there is no test to check whether these DISPLAYs are valid!) - # xpstart_remote_server[$num_xpstart]="sera:12" ; num_xpstart=$(($num_xpstart + 1)) - # xpstart_remote_server[$num_xpstart]="gandalf:19" ; num_xpstart=$(($num_xpstart + 1)) -} - -XCOMM########################################################################### - -XCOMM Main -case "$1" in - ## Start Xprint servers - 'start') - do_start - ;; - - ## Stop Xprint servers - # Note that this does _not_ kill Xprt instances started using this script - # by non-root users - 'stop') - do_stop - ;; - - ## Restart Xprint servers - 'restart'|'force-reload') - do_restart - ;; - - ## Reload configuration without stopping and restarting - 'reload') - # not supported - msg "reload not supported, use 'restart' or 'force-reload'" - exit 3 - ;; - - ## Restart Xprint only if it is already running - 'condrestart'|'try-restart') - # only restart if it is already running - [ -f /var/lock/subsys/xprint ] && do_restart || : - ;; - - ## Get list of all Xprint servers for this user - # (incl. per-user and system-wide instances) - 'get_xpserverlist') - do_get_xpserverlist - ;; - - ## Get status of Xprint servers, RedHat-style - 'status') - x="$(do_get_xpserverlist)" - if [ "${x}" != "" ] ; then - msg "Xprint (${x}) is running..." - exit 0 - else - msg "Xprint is stopped" - exit 3 - fi - ;; - - ## Wrapper - 'wrapper') - cmd="${2}" - [ "${cmd}" = "" ] && fatal_error "No command given." - shift ; shift - export XPSERVERLIST="$(do_get_xpserverlist)" - [ "${XPSERVERLIST}" = "" ] && fatal_error "No Xprint servers found." - exec "${cmd}" "$@" - ;; - - ## Wrapper for "xplsprinters" - 'lsprinters') - [ "${ETC_INITD_XPRINT_XPLSPRINTERS_PATH}" != "" ] && cmd="${ETC_INITD_XPRINT_XPLSPRINTERS_PATH}" - [ "${cmd}" = "" -a "${XPCUSTOMGLUE}" = "GISWxprintglue" ] && cmd="/opt/GISWxprintglue/bin/xplsprinters" - [ "${cmd}" = "" -a "${XPCUSTOMGLUE}" = "GISWxprint" ] && cmd="/opt/GISWxprint/bin/xplsprinters" - [ "${cmd}" = "" -a "${XPROJECTROOT}" != "" ] && cmd="${XPROJECTROOT}/bin/xplsprinters" - [ "${cmd}" = "" ] && cmd="xplsprinters" - - shift - export XPSERVERLIST="$(do_get_xpserverlist)" - [ "${XPSERVERLIST}" = "" ] && fatal_error "No Xprint servers found." - exec "${cmd}" "$@" - ;; - - ## Diagnostics - 'diag') - do_diag - ;; - - ## Print usage - *) - msg "Usage: $0 { start | stop | restart | reload | force-reload | status | condrestart | try-restart | wrapper | lsprinters | get_xpserverlist | diag }" - exit 2 -esac -exit 0 - -XCOMM EOF. diff --git a/nx-X11/programs/Xserver/Xprint/etc/profile.d/Imakefile b/nx-X11/programs/Xserver/Xprint/etc/profile.d/Imakefile deleted file mode 100644 index a70824c8d..000000000 --- a/nx-X11/programs/Xserver/Xprint/etc/profile.d/Imakefile +++ /dev/null @@ -1,14 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.1 2002/10/31 14:42:52 gisburn Exp $ - -#if NothingOutsideProjectRoot -#define EtcDir ProjectRoot/etc -#else -#define EtcDir /etc -#endif - -ETCDIR = EtcDir - -all:: - -InstallNamedProg(xprint.csh,xprint.csh,$(ETCDIR)/profile.d) -InstallNamedProg(xprint.sh,xprint.sh,$(ETCDIR)/profile.d) diff --git a/nx-X11/programs/Xserver/Xprint/etc/profile.d/xprint.csh b/nx-X11/programs/Xserver/Xprint/etc/profile.d/xprint.csh deleted file mode 100644 index 7cc675840..000000000 --- a/nx-X11/programs/Xserver/Xprint/etc/profile.d/xprint.csh +++ /dev/null @@ -1,16 +0,0 @@ -# -# /etc/profile.d/xprint.csh -# -# Copyright (c) 2002-2004 by Roland Mainz -# please send bugfixes or comments to http://xprint.mozdev.org/ - - -# -# Obtain list of Xprint servers -# - -if ( -f /etc/init.d/xprint ) then - setenv XPSERVERLIST "`/bin/sh /etc/init.d/xprint get_xpserverlist`" -endif - -# /etc/profile.d/xprint.csh ends here. diff --git a/nx-X11/programs/Xserver/Xprint/etc/profile.d/xprint.sh b/nx-X11/programs/Xserver/Xprint/etc/profile.d/xprint.sh deleted file mode 100644 index b5b46c1e7..000000000 --- a/nx-X11/programs/Xserver/Xprint/etc/profile.d/xprint.sh +++ /dev/null @@ -1,16 +0,0 @@ -# -# /etc/profile.d/xprint.sh -# -# Copyright (c) 2002-2004 by Roland Mainz -# please send bugfixes or comments to http://xprint.mozdev.org/ - -# -# Obtain list of Xprint servers -# - -if [ -f "/etc/init.d/xprint" ] ; then - XPSERVERLIST="`/bin/sh /etc/init.d/xprint get_xpserverlist`" - export XPSERVERLIST -fi - -# /etc/profile.d/xprint.sh ends here. diff --git a/nx-X11/programs/Xserver/Xprint/mediaSizes.c b/nx-X11/programs/Xserver/Xprint/mediaSizes.c deleted file mode 100644 index 7f582199d..000000000 --- a/nx-X11/programs/Xserver/Xprint/mediaSizes.c +++ /dev/null @@ -1,783 +0,0 @@ -/* $Xorg: mediaSizes.c,v 1.4 2001/03/14 18:44:37 pookie Exp $ */ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ -/******************************************************************* -** -** ********************************************************* -** * -** * File: mediaSizes.c -** * -** * Contents: -** * Routines to return the sizes associated -** * with particular media and particular printers. -** * -** * Created: 2/19/96 -** * -** * Copyright: Copyright 1993,1995 Hewlett-Packard Company -** * -** ********************************************************* -** -********************************************************************/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include -#include - -#include -#include "dixstruct.h" -#include "screenint.h" -#include "misc.h" -#include "scrnintstr.h" -#include - -#include "DiPrint.h" -#include "attributes.h" - -typedef struct { - XpOid page_size; - float width; - float height; -} PageDimensionsRec; - -static PageDimensionsRec PageDimensions[] = -{ - {xpoid_val_medium_size_na_letter, 215.9, 279.4}, - {xpoid_val_medium_size_na_legal, 215.9, 355.6}, - {xpoid_val_medium_size_executive, 184.15, 266.7}, - {xpoid_val_medium_size_folio, 210.82, 330.2}, - {xpoid_val_medium_size_invoice, 139.7, 215.9}, - {xpoid_val_medium_size_ledger, 279.4, 431.8}, - {xpoid_val_medium_size_quarto, 215.9, 275.082}, - {xpoid_val_medium_size_a, 215.9, 279.4}, - {xpoid_val_medium_size_b, 279.4, 431.8}, - {xpoid_val_medium_size_c, 431.8, 558.8}, - {xpoid_val_medium_size_d, 558.8, 863.6}, - {xpoid_val_medium_size_e, 863.6, 1117.6}, - {xpoid_val_medium_size_na_6x9_envelope, 152.4, 228.6}, - {xpoid_val_medium_size_na_10x15_envelope, 254, 381}, - {xpoid_val_medium_size_monarch_envelope, 98.298, 190.5}, - {xpoid_val_medium_size_na_10x13_envelope, 254, 330.2}, - {xpoid_val_medium_size_na_9x12_envelope, 228.6, 304.8}, - {xpoid_val_medium_size_na_number_10_envelope, 104.775, 241.3}, - {xpoid_val_medium_size_na_7x9_envelope, 177.8, 228.6}, - {xpoid_val_medium_size_na_9x11_envelope, 228.6, 279.4}, - {xpoid_val_medium_size_na_10x14_envelope, 254, 355.6}, - {xpoid_val_medium_size_na_number_9_envelope, 98.425, 225.425}, - {xpoid_val_medium_size_iso_a0, 841, 1189}, - {xpoid_val_medium_size_iso_a1, 594, 841}, - {xpoid_val_medium_size_iso_a2, 420, 594}, - {xpoid_val_medium_size_iso_a3, 297, 420}, - {xpoid_val_medium_size_iso_a4, 210, 297}, - {xpoid_val_medium_size_iso_a5, 148, 210}, - {xpoid_val_medium_size_iso_a6, 105, 148}, - {xpoid_val_medium_size_iso_a7, 74, 105}, - {xpoid_val_medium_size_iso_a8, 52, 74}, - {xpoid_val_medium_size_iso_a9, 37, 52}, - {xpoid_val_medium_size_iso_a10, 26, 37}, - {xpoid_val_medium_size_iso_b0, 1000, 1414}, - {xpoid_val_medium_size_iso_b1, 707, 1000}, - {xpoid_val_medium_size_iso_b2, 500, 707}, - {xpoid_val_medium_size_iso_b3, 353, 500}, - {xpoid_val_medium_size_iso_b4, 250, 353}, - {xpoid_val_medium_size_iso_b5, 176, 250}, - {xpoid_val_medium_size_iso_b6, 125, 176}, - {xpoid_val_medium_size_iso_b7, 88, 125}, - {xpoid_val_medium_size_iso_b8, 62, 88}, - {xpoid_val_medium_size_iso_b9, 44, 62}, - {xpoid_val_medium_size_iso_b10, 31, 44}, - {xpoid_val_medium_size_jis_b0, 1030, 1456}, - {xpoid_val_medium_size_jis_b1, 728, 1030}, - {xpoid_val_medium_size_jis_b2, 515, 728}, - {xpoid_val_medium_size_jis_b3, 364, 515}, - {xpoid_val_medium_size_jis_b4, 257, 364}, - {xpoid_val_medium_size_jis_b5, 182, 257}, - {xpoid_val_medium_size_jis_b6, 128, 182}, - {xpoid_val_medium_size_jis_b7, 91, 128}, - {xpoid_val_medium_size_jis_b8, 64, 91}, - {xpoid_val_medium_size_jis_b9, 45, 64}, - {xpoid_val_medium_size_jis_b10, 32, 45}, - {xpoid_val_medium_size_hp_2x_postcard, 148, 200}, - {xpoid_val_medium_size_hp_european_edp, 304.8, 355.6}, - {xpoid_val_medium_size_hp_mini, 139.7, 215.9}, - {xpoid_val_medium_size_hp_postcard, 100, 148}, - {xpoid_val_medium_size_hp_tabloid, 279.4, 431.8}, - {xpoid_val_medium_size_hp_us_edp, 279.4, 355.6}, - {xpoid_val_medium_size_hp_us_government_legal, 203.2, 330.2}, - {xpoid_val_medium_size_hp_us_government_letter, 203.2, 254}, - {xpoid_val_medium_size_iso_c3, 324, 458}, - {xpoid_val_medium_size_iso_c4, 229, 324}, - {xpoid_val_medium_size_iso_c5, 162, 229}, - {xpoid_val_medium_size_iso_c6, 114, 162}, - {xpoid_val_medium_size_iso_designated_long, 110, 220} -}; - -/* - * XpGetResolution returns an integer representing the printer resolution - * in dots-per-inch for the specified print context. - * - * Note: This routine assumes the values found in the passed context's - * attributes pools have been validated. - */ -int -XpGetResolution( - XpContextPtr pContext) -{ - unsigned long resolution; - - resolution = XpGetCardAttr(pContext, XPPageAttr, - xpoid_att_default_printer_resolution, - (XpOidCardList*)NULL); - if(0 == resolution) - resolution = XpGetCardAttr(pContext, XPDocAttr, - xpoid_att_default_printer_resolution, - (XpOidCardList*)NULL); - if(0 == resolution) - { - XpOidCardList* resolutions_supported; - /* - * default-printer-resolution not specified; default to 1st entry - * in printer-resolutions-supported. - */ - resolutions_supported = - XpGetCardListAttr(pContext, XPPrinterAttr, - xpoid_att_printer_resolutions_supported, - (XpOidCardList*)NULL); - resolution = XpOidCardListGetCard(resolutions_supported, 0); - XpOidCardListDelete(resolutions_supported); - } - return (int)resolution; -} - -/* - * XpGetContentOrientation determines the content-orientation as - * determined by the passed context. The page and document pools are - * queried in turn for a specified content-orientation attribute. If none - * is found the first content-orientation in the - * content-orientations-supported printer attribute is taken as the - * default. - * - * Note: This routine assumes the values found in the passed context's - * attributes pools have been validated. - */ -XpOid -XpGetContentOrientation( - XpContextPtr pContext) -{ - XpOid orientation; - - orientation = XpGetOidAttr(pContext, XPPageAttr, - xpoid_att_content_orientation, - (XpOidList*)NULL); - if(xpoid_none == orientation) - orientation = XpGetOidAttr(pContext, XPDocAttr, - xpoid_att_content_orientation, - (XpOidList*)NULL); - if(xpoid_none == orientation) - { - XpOidList* content_orientations_supported; - - content_orientations_supported = - XpGetListAttr(pContext, XPPrinterAttr, - xpoid_att_content_orientations_supported, - (XpOidList*)NULL); - orientation = XpOidListGetOid(content_orientations_supported, 0); - XpOidListDelete(content_orientations_supported); - } - return orientation; -} - -/* - * XpGetAvailableCompression determines the available-compression as - * determined by the passed context. The page and document pools are - * queried in turn for a specified content-orientation attribute. If none - * is found the first available-compression in the - * avaiable-compressions-supported printer attribute is taken as the - * default. - * - * Note: This routine assumes the values found in the passed context's - * attributes pools have been validated. - */ -XpOid -XpGetAvailableCompression( - XpContextPtr pContext) -{ - XpOid compression; - - compression = XpGetOidAttr(pContext, XPPageAttr, - xpoid_att_available_compression, - (XpOidList*)NULL); - if(xpoid_none == compression) - compression = XpGetOidAttr(pContext, XPDocAttr, - xpoid_att_available_compression, - (XpOidList*)NULL); - if(xpoid_none == compression) - { - XpOidList* available_compressions_supported; - - available_compressions_supported = - XpGetListAttr(pContext, XPPrinterAttr, - xpoid_att_available_compressions_supported, - (XpOidList*)NULL); - compression = XpOidListGetOid(available_compressions_supported, 0); - XpOidListDelete(available_compressions_supported); - } - return compression; -} - -/* - * XpGetPlex determines the plex as determined by the passed context. The page - * and document pools are queried in turn for a specified plex attribute. If - * none is found the first plex in the plexes-supported printer attribute is - * taken as the default. - * - * Note: This routine assumes the values found in the passed context's - * attributes pools have been validated. - */ -XpOid -XpGetPlex( - XpContextPtr pContext) -{ - XpOid plex; - - plex = XpGetOidAttr(pContext, XPPageAttr, xpoid_att_plex, - (XpOidList*)NULL); - if(xpoid_none == plex) - plex = XpGetOidAttr(pContext, XPDocAttr, xpoid_att_plex, - (XpOidList*)NULL); - if(xpoid_none == plex) - { - XpOidList* plexes_supported; - - plexes_supported = - XpGetListAttr(pContext, XPPrinterAttr, - xpoid_att_plexes_supported, - (XpOidList*)NULL); - plex = XpOidListGetOid(plexes_supported, 0); - XpOidListDelete(plexes_supported); - } - return plex; -} - -/* - * XpGetPageSize returns the XpOid of the current page size (medium names - * are page sizes in this implementation) as indicated by the passed - * context. - * - * The relevant input-tray is returned in pTray. This parm must not be - * NULL. If the input-tray is not indicated or irrelevant, xpoid_none - * will be returned. - * - * This function optionally takes a XpOidMediumSS representation of the - * medium-source-sizes-supported attribute in order to avoid parsing the - * string value twice for calling functions that need to parse m-s-s-s - * anyway (e.g. XpGetReproductionArea). If the caller has no other reason - * to parse medium-source-sizes-supported, it is recommended that NULL be - * passed. This function will obtain medium-source-sizes-supported if it - * needs to. - * - * Note: This routine assumes the values found in the passed context's - * attributes pools have been validated. - */ -XpOid -XpGetPageSize(XpContextPtr pContext, - XpOid* pTray, - const XpOidMediumSS* msss) -{ - XpOid medium; - /* - * check to see if default-medium is specified - */ - medium = XpGetOidAttr(pContext, XPPageAttr, xpoid_att_default_medium, - (const XpOidList*)NULL); - if(medium == xpoid_none) - { - /* - * default-medium not in page pool; try the document pool - */ - medium = XpGetOidAttr(pContext, XPDocAttr, xpoid_att_default_medium, - (const XpOidList*)NULL); - } - if(medium == xpoid_none) - { - /* - * default-medium not specified; try default-input-tray - */ - *pTray = XpGetOidAttr(pContext, XPPageAttr, - xpoid_att_default_input_tray, - (const XpOidList*)NULL); - if(*pTray == xpoid_none) - { - /* - * default-input-tray not in page pool; try the document pool - */ - *pTray = XpGetOidAttr(pContext, XPDocAttr, - xpoid_att_default_input_tray, - (const XpOidList*)NULL); - } - if(*pTray != xpoid_none) - { - /* - * default-input-tray found; get corresponding medium from - * input-trays-medium - */ - XpOidTrayMediumList* input_trays_medium; - int i; - - input_trays_medium = - XpGetTrayMediumListAttr(pContext, XPPrinterAttr, - xpoid_att_input_trays_medium, - (const XpOidList*)NULL, - (const XpOidMediumSS*)NULL); - for(i = 0; i < XpOidTrayMediumListCount(input_trays_medium); i++) - { - if(*pTray == XpOidTrayMediumListTray(input_trays_medium, i)) - { - medium = XpOidTrayMediumListMedium(input_trays_medium, i); - break; - } - } - XpOidTrayMediumListDelete(input_trays_medium); - } - } - else - *pTray = xpoid_none; - - if(medium == xpoid_none) - { - XpOidMediumSS* local_msss = (XpOidMediumSS*)NULL; - int i_mss, i_ds; - XpOidMediumDiscreteSizeList* ds_list; - /* - * no medium specified; use 1st page size found in - * medium-source-sizes-supported - */ - if((XpOidMediumSS*)NULL == msss) - msss = local_msss = - XpGetMediumSSAttr(pContext, XPPrinterAttr, - xpoid_att_medium_source_sizes_supported, - (const XpOidList*)NULL, - (const XpOidList*)NULL); - for(i_mss = 0; - i_mss < XpOidMediumSSCount(msss) && xpoid_none == medium; - i_mss++) - { - if(XpOidMediumSS_DISCRETE == (msss->mss)[i_mss].mstag - && - xpoid_none != (msss->mss)[i_mss].input_tray) - { - ds_list = (msss->mss)[i_mss].ms.discrete; - for(i_ds = 0; i_ds < ds_list->count; i_ds++) - { - if(xpoid_none != (ds_list->list)[i_ds].page_size) - { - medium = (ds_list->list)[i_ds].page_size; - break; - } - } - } - } - XpOidMediumSSDelete(local_msss); - } - return medium; -} - -/* - * XpGetMediumMillimeters returns into the supplied float pointers the - * width and height in millimeters of the passed page size identifier. - */ -void -XpGetMediumMillimeters( - XpOid page_size, - float *width, /* return */ - float *height) /* return */ -{ - int i; - - *width = *height = 0; - for(i = 0; i < XpNumber(PageDimensions); i++) - { - if(page_size == PageDimensions[i].page_size) - { - *width = PageDimensions[i].width; - *height = PageDimensions[i].height; - return; - } - } -} - -/* - * Converts a millimeter specification into pixels given a resolution in - * DPI. - */ -static float -MmToPixels(float mm, int resolution) -{ - float f; - - f = mm * resolution; - f /= 25.4; - return f; -} - -/* - * XpGetMediumDimensions returns into the supplied short pointers the - * width and height in pixels of the medium associated with the specified - * print context. It obtains the page size associated with the current - * medium by calling XpGetPageSize. It passes XpGetMediumMillimeters the - * page size, and converts the returned millimeter dimensions into pixels - * using the resolution returned by XpGetResolution. - * - * Note: This routine assumes the values found in the passed context's - * attributes pools have been validated. - */ -void -XpGetMediumDimensions( - XpContextPtr pContext, - unsigned short *width, /* return */ - unsigned short *height) /* return */ -{ - XpOid page_size; - XpOid tray; - XpOid orientation; - - int resolution; - float w_mm, h_mm; - - page_size = XpGetPageSize(pContext, &tray, (XpOidMediumSS*)NULL); - if(page_size == xpoid_none) - { - /* - * fail-safe: if the pools have been validated, this defaulting logic - * isn't needed. - */ - page_size = xpoid_val_medium_size_na_letter; - } - XpGetMediumMillimeters(page_size, &w_mm, &h_mm); - resolution = XpGetResolution(pContext); - orientation = XpGetContentOrientation(pContext); - switch(orientation) - { - case xpoid_val_content_orientation_landscape: - case xpoid_val_content_orientation_reverse_landscape: - /* - * transpose width and height - */ - *height = MmToPixels(w_mm, resolution); - *width = MmToPixels(h_mm, resolution); - break; - - default: - *width = MmToPixels(w_mm, resolution); - *height = MmToPixels(h_mm, resolution); - break; - } -} - -/* - * XRectangleFromXpOidArea converts an XpOidArea area specification - * into an XRectangle. The passed resolution is used to convert from - * millimeters (XpOidArea) into pixels (XRectangle). - */ -static void -XRectangleFromXpOidArea( - xRectangle *pRect, - const XpOidArea* repro, - int resolution, - XpOid orientation) -{ - switch(orientation) - { - case xpoid_val_content_orientation_landscape: - case xpoid_val_content_orientation_reverse_landscape: - /* - * transpose x and y, width and height - */ - pRect->y = MmToPixels(repro->minimum_x, resolution); - pRect->x = MmToPixels(repro->minimum_y, resolution); - pRect->height = - MmToPixels(repro->maximum_x - repro->minimum_x, resolution); - pRect->width = - MmToPixels(repro->maximum_y - repro->minimum_y, resolution); - break; - - default: - pRect->x = MmToPixels(repro->minimum_x, resolution); - pRect->y = MmToPixels(repro->minimum_y, resolution); - pRect->width = - MmToPixels(repro->maximum_x - repro->minimum_x, resolution); - pRect->height = - MmToPixels(repro->maximum_y - repro->minimum_y, resolution); - break; - } -} - -/* - * XpGetReproductionArea queries the current pool attribute values in - * order to determine the reproduction area for the currently selected - * medium. - * - * First the current page size (equivalent to current medium) and tray - * (if specified) is retrieved via XpGetPageSize. The value of the - * medium-source-sizes-supported attribute is interrogated until a matching - * entry for the current page size and tray is found. The reproduction - * area defined for the current entry is converted into an XRectangle - * using XRectangleFromXpOidArea and returned to the caller. - * - * Note: This routine assumes the values found in the passed context's - * attributes pools have been validated. - */ -void -XpGetReproductionArea(XpContextPtr pContext, - xRectangle *pRect) -{ - XpOid page_size; - XpOid tray; - XpOidMediumSS* msss; - int i_mss, i_ds; - XpOidMediumDiscreteSizeList* ds_list; - XpOidArea* repro; - BOOL done; - int resolution; - XpOid orientation; - /* - * find the appropriate assured reproduction area for the current - * tray and page size in the medium-source-sizes-supported attribute. - */ - msss = XpGetMediumSSAttr(pContext, XPPrinterAttr, - xpoid_att_medium_source_sizes_supported, - (const XpOidList*)NULL, - (const XpOidList*)NULL); - page_size = XpGetPageSize(pContext, &tray, msss); - resolution = XpGetResolution(pContext); - orientation = XpGetContentOrientation(pContext); - - memset(pRect, 0, sizeof(xRectangle)); - - if(xpoid_none == tray) - { - /* - * no tray specified; use 1st matching page size - */ - for(i_mss = 0, done = xFalse; - i_mss < XpOidMediumSSCount(msss) && !done; - i_mss++) - { - if(XpOidMediumSS_DISCRETE == (msss->mss)[i_mss].mstag - && - xpoid_none != (msss->mss)[i_mss].input_tray) - { - ds_list = (msss->mss)[i_mss].ms.discrete; - for(i_ds = 0; i_ds < ds_list->count; i_ds++) - { - if(page_size == (ds_list->list)[i_ds].page_size) - { - repro = - &(ds_list->list)[i_ds].assured_reproduction_area; - XRectangleFromXpOidArea(pRect, repro, - resolution, orientation); - done = xTrue; - break; - } - } - } - } - } - else - { - /* - * tray && page size specified; find matching entry - */ - for(i_mss = 0, done = xFalse; - i_mss < XpOidMediumSSCount(msss) && !done; - i_mss++) - { - if(XpOidMediumSS_DISCRETE == (msss->mss)[i_mss].mstag - && - xpoid_none != (msss->mss)[i_mss].input_tray - && - (tray == (msss->mss)[i_mss].input_tray - || - xpoid_unspecified == (msss->mss)[i_mss].input_tray) - ) - { - ds_list = (msss->mss)[i_mss].ms.discrete; - for(i_ds = 0; i_ds < ds_list->count; i_ds++) - { - if(page_size == (ds_list->list)[i_ds].page_size) - { - repro = - &(ds_list->list)[i_ds].assured_reproduction_area; - XRectangleFromXpOidArea(pRect, repro, - resolution, orientation); - if(xpoid_unspecified != (msss->mss)[i_mss].input_tray) - { - /* - * exact match on tray takes precendence over - * unspecified tray entry in m-s-s-s - */ - done = xTrue; - } - break; - } - } - } - } - } - XpOidMediumSSDelete(msss); -} - -/* - * XpGetMaxWidthHeightRes returns into the supplied width and height - * unsigned short pointers the dimensions in millimeters of the largest - * supported media for a specific printer. It looks at the - * medium-source-sizes-supported attribute (if it exists) to determine - * the list of possible media, and calls XpGetMediumMillimeters to get the - * dimensions for each medium. If the m-s-s-s attribute is not defined, - * then the dimensions for the na-letter medium is returned. - * - * This function also returns the largest resolution in DPI defined in - * printer-resolutions-supported. If printer-resolutions-supported is not - * specified, the default is obtained from the passed XpValidatePoolsRec. - * - * The passed XpValidatePoolsRec is also used to determine valid values - * when parsing attribute values. - */ -void -XpGetMaxWidthHeightRes( - const char *printer_name, - const XpValidatePoolsRec* vpr, - float *width, - float *height, - int* resolution) -{ - const char* value; - const char* attr_str; - XpOidMediumSS* pool_msss; - const XpOidMediumSS* msss; - int i_mss, i_ds; - XpOidMediumDiscreteSizeList* ds_list; - float w, h; - XpOidCardList* pool_resolutions_supported; - const XpOidCardList* resolutions_supported; - int i; - int res; - /* - * get the max medium width and height - */ - attr_str = XpOidString(xpoid_att_medium_source_sizes_supported); - value = XpGetPrinterAttribute(printer_name, attr_str); - pool_msss = XpOidMediumSSNew(value, - vpr->valid_input_trays, - vpr->valid_medium_sizes); - if(0 == XpOidMediumSSCount(pool_msss)) - msss = XpGetDefaultMediumSS(); - else - msss = pool_msss; - *width = *height = 0; - for(i_mss = 0; i_mss < XpOidMediumSSCount(msss); i_mss++) - { - if(XpOidMediumSS_DISCRETE == (msss->mss)[i_mss].mstag - && - xpoid_none != (msss->mss)[i_mss].input_tray) - { - ds_list = (msss->mss)[i_mss].ms.discrete; - for(i_ds = 0; i_ds < ds_list->count; i_ds++) - { - if(xpoid_none != (ds_list->list)[i_ds].page_size) - { - XpGetMediumMillimeters((ds_list->list)[i_ds].page_size, - &w, &h); - if(w > *width) *width = w; - if(h > *height) *height = h; - } - } - } - } - XpOidMediumSSDelete(pool_msss); - /* - * get the maximum resolution - */ - attr_str = XpOidString(xpoid_att_printer_resolutions_supported); - value = XpGetPrinterAttribute(printer_name, attr_str); - pool_resolutions_supported = - XpOidCardListNew(value, vpr->valid_printer_resolutions_supported); - if(0 == XpOidCardListCount(pool_resolutions_supported)) - resolutions_supported = vpr->default_printer_resolutions_supported; - else - resolutions_supported = pool_resolutions_supported; - *resolution = 0; - for(i = 0; i < XpOidCardListCount(resolutions_supported); i++) - { - res = XpOidCardListGetCard(resolutions_supported, i); - if(res > *resolution) *resolution = res; - } - XpOidCardListDelete(pool_resolutions_supported); -} - -FontResolutionPtr -XpGetClientResolutions(client, num) - ClientPtr client; - int *num; -{ - static struct _FontResolution res; - int resolution = XpGetResolution(XpContextOfClient(client)); - - res.x_resolution = resolution; - res.y_resolution = resolution; - - res.point_size = 120; - - *num = 1; - - return &res; -} - - -void XpSetFontResFunc(client) - ClientPtr client; -{ - client->fontResFunc = XpGetClientResolutions; -} - - -void XpUnsetFontResFunc(client) - ClientPtr client; -{ - client->fontResFunc = NULL; -} diff --git a/nx-X11/programs/Xserver/Xprint/pcl-mono/Imakefile b/nx-X11/programs/Xserver/Xprint/pcl-mono/Imakefile deleted file mode 100644 index 30d577772..000000000 --- a/nx-X11/programs/Xserver/Xprint/pcl-mono/Imakefile +++ /dev/null @@ -1,6 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:48:09 cpqbld Exp $ -#define PclDriver -DXP_PCL_MONO -#define LinkDirectory ../pcl - -#include "../pcl/Imakefile" - diff --git a/nx-X11/programs/Xserver/Xprint/pcl/Imakefile b/nx-X11/programs/Xserver/Xprint/pcl/Imakefile deleted file mode 100644 index 310ae9e20..000000000 --- a/nx-X11/programs/Xserver/Xprint/pcl/Imakefile +++ /dev/null @@ -1,76 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:48:07 cpqbld Exp $ - - - - -XCOMM $XFree86: xc/programs/Xserver/Xprint/pcl/Imakefile,v 1.7 2001/08/01 00:44:45 tsi Exp $ - -#include - -#ifndef PixelSize -#define PixelSize 8 -#endif - -#ifdef PclDriver -PCL_DRIVER = PclDriver -#else -PCL_DRIVER = -DXP_PCL_COLOR -#endif - -SRCS1 = PclInit.c PclMisc.c PclWindow.c PclFonts.c PclPrint.c \ - PclArea.c PclArc.c PclGC.c PclLine.c PclPixel.c PclPolygon.c \ - PclSpans.c PclText.c PclCursor.c PclAttr.c PclPixmap.c PclSFonts.c \ - PclColor.c PclAttVal.c - -OBJS1 = PclInit.o PclMisc.o PclWindow.o PclFonts.o PclPrint.o \ - PclArea.o PclArc.o PclGC.o PclLine.o PclPixel.o PclPolygon.o \ - PclSpans.o PclText.o PclCursor.o PclAttr.o PclPixmap.o PclSFonts.o \ - PclColor.o PclAttVal.o - -SRCS = $(SRCS1) - -OBJS = $(OBJS1) - -DEFINES = -DPSZ=PixelSize $(PCL_DRIVER) -UXFree86LOADER -D_XP_PRINT_SERVER_ - - INCLUDES = -I. -I$(XINCLUDESRC) -I.. -I$(LIBSRC) \ - -I../../include -I$(TOP)/include \ - -I$(TOP)/include/extensions -I$(TOP)/include/fonts \ - -I../../mi -I../../mfb -I../../cfb - - LINTLIBS = ../../dix/llib-ldix.ln ../../os/llib-los.ln \ - ../../mfb/llib-lmfb.ln ../../mi/llib-lmi.ln \ - ../../cfb/llib-lcfb.ln - -NormalLibraryObjectRule() - -NormalLibraryTarget(pcl,$(OBJS)) -NormalLintTarget($(SRCS1) $(SRCS2)) -#ifdef LinkDirectory -LinkSourceFile(Pcl.h,LinkDirectory) -LinkSourceFile(Pclmap.h,LinkDirectory) -LinkSourceFile(PclDef.h,LinkDirectory) -LinkSourceFile(PclSFonts.h,LinkDirectory) - -LinkSourceFile(PclArc.c,LinkDirectory) -LinkSourceFile(PclArea.c,LinkDirectory) -LinkSourceFile(PclAttr.c,LinkDirectory) -LinkSourceFile(PclAttVal.c,LinkDirectory) -LinkSourceFile(PclColor.c,LinkDirectory) -LinkSourceFile(PclCursor.c,LinkDirectory) -LinkSourceFile(PclFonts.c,LinkDirectory) -LinkSourceFile(PclGC.c,LinkDirectory) -LinkSourceFile(PclInit.c,LinkDirectory) -LinkSourceFile(PclLine.c,LinkDirectory) -LinkSourceFile(PclMisc.c,LinkDirectory) -LinkSourceFile(PclPixel.c,LinkDirectory) -LinkSourceFile(PclPixmap.c,LinkDirectory) -LinkSourceFile(PclPolygon.c,LinkDirectory) -LinkSourceFile(PclPrint.c,LinkDirectory) -LinkSourceFile(PclSFonts.c,LinkDirectory) -LinkSourceFile(PclSpans.c,LinkDirectory) -LinkSourceFile(PclText.c,LinkDirectory) -LinkSourceFile(PclWindow.c,LinkDirectory) -#endif - -DependTarget() diff --git a/nx-X11/programs/Xserver/Xprint/pcl/Pcl.h b/nx-X11/programs/Xserver/Xprint/pcl/Pcl.h deleted file mode 100644 index bb1f52b2c..000000000 --- a/nx-X11/programs/Xserver/Xprint/pcl/Pcl.h +++ /dev/null @@ -1,625 +0,0 @@ -/* $Xorg: Pcl.h,v 1.3 2000/08/17 19:48:07 cpqbld Exp $ */ -/******************************************************************* -** -** ********************************************************* -** * -** * File: Pcl.h -** * -** * Contents: defines and includes for the Pcl driver -** * for a printing X server. -** * -** * Created: 1/30/95 -** * -** ********************************************************* -** -********************************************************************/ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ -/* $XFree86: xc/programs/Xserver/Xprint/pcl/Pcl.h,v 1.12 2001/12/21 21:02:05 dawes Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifndef _PCL_H_ -#define _PCL_H_ - -#include -#include "scrnintstr.h" - -#include "PclDef.h" -#include "Pclmap.h" -#include "PclSFonts.h" - -#include -#include - -#include "regionstr.h" -#include -#include "dixfontstr.h" -#include "gcstruct.h" - -/* - * Some sleazes to force the XrmDB stuff into the server - */ -#ifndef HAVE_XPointer -typedef char *XPointer; -#endif -#define Status int -#define True 1 -#define False 0 -#include "misc.h" -#include -#include -#include "attributes.h" - -/****** - * externally visible variables from PclInit.c - ******/ -extern int PclScreenPrivateIndex, PclWindowPrivateIndex; -extern int PclContextPrivateIndex; -extern int PclPixmapPrivateIndex; -extern int PclGCPrivateIndex; - -/****** - * externally visible variables from PclAttVal.c - ******/ -extern XpValidatePoolsRec PclValidatePoolsRec; - -/* - * This structure defines a mapping from an X colormap ID to a list of - * print contexts which use the colormap. - */ -typedef struct _pclcontextlist { - XpContextPtr context; - struct _pclcontextlist *next; -} PclContextList, *PclContextListPtr; - -typedef struct _pclcmaptocontexts { - long colormapId; - PclContextListPtr contexts; - struct _pclcmaptocontexts *next; -} PclCmapToContexts; - -typedef struct { - PclCmapToContexts *colormaps; - CloseScreenProcPtr CloseScreen; -} PclScreenPrivRec, *PclScreenPrivPtr; - -/* - * This structure defines a mapping from an X colormap ID to a PCL - * palette ID. - */ -typedef struct _palettemap { - long colormapId; - int paletteId; - int downloaded; - struct _palettemap *next; -} PclPaletteMap, *PclPaletteMapPtr; - -typedef struct { - char *jobFileName; - FILE *pJobFile; - char *pageFileName; - FILE *pPageFile; - GC lastGC; - unsigned char *dash; - int validGC; - ClientPtr getDocClient; - int getDocBufSize; - PclSoftFontInfoPtr pSoftFontInfo; - PclPaletteMapPtr palettes; - int currentPalette; - int nextPaletteId; - PclPaletteMap staticGrayPalette; - PclPaletteMap trueColorPalette; - PclPaletteMap specialTrueColorPalette; - unsigned char *ctbl; - int ctbldim; - int isRaw; -#ifdef XP_PCL_LJ3 - unsigned int fcount; - unsigned int fcount_max; - char *figures; -#endif /* XP_PCL_LJ3 */ -} PclContextPrivRec, *PclContextPrivPtr; - -typedef struct { - int validContext; - XpContextPtr context; -} PclWindowPrivRec, *PclWindowPrivPtr; - -typedef struct { - unsigned long stippleFg, stippleBg; -} PclGCPrivRec, *PclGCPrivPtr; - -typedef struct { - XpContextPtr context; - char *tempFileName; - FILE *tempFile; - GC lastGC; - int validGC; -} PclPixmapPrivRec, *PclPixmapPrivPtr; - -/****** - * Defined functions - ******/ -#define SEND_PCL(f,c) fwrite( c, sizeof( char ), strlen( c ), f ) -#define SEND_PCL_COUNT(f,c,n) fwrite( c, sizeof( char ), n, f ) - -#ifndef XP_PCL_LJ3 -#define SAVE_PCL(f,p,c) SEND_PCL(f,c) -#define SAVE_PCL_COUNT(f,p,c,n) SEND_PCL_COUNT(f,c,n) -#define MACRO_START(f,p) SEND_PCL(f, "\033&f1Y\033&f0X") -#define MACRO_END(f) SEND_PCL(f, "\033&f1X") -#else -#define SAVE_PCL(f,p,c) PclSpoolFigs(p, c, strlen(c)) -#define SAVE_PCL_COUNT(f,p,c,n) PclSpoolFigs(p, c, n) -#define MACRO_START(f,p) p->fcount = 0 -#define MACRO_END(f) /* do nothing */ -#endif /* XP_PCL_LJ3 */ - -#define MIN(a,b) (((a)<(b))?(a):(b)) -#ifndef MAX -#define MAX(a,b) (((a)>(b))?(a):(b)) -#endif - -/****** - * Functions in PclArc.c - ******/ -extern void PclPolyArc( - DrawablePtr pDrawable, - GCPtr pGC, - int nArcs, - xArc *pArcs); -extern void PclPolyFillArc( - DrawablePtr pDrawable, - GCPtr pGC, - int nArcs, - xArc *pArcs); - -/****** - * Functions in PclArea.c - ******/ -extern void PclPutImage( - DrawablePtr pDrawable, - GCPtr pGC, - int depth, - int x, - int y, - int w, - int h, - int leftPad, - int format, - char *pImage); -extern RegionPtr PclCopyArea( - DrawablePtr pSrc, - DrawablePtr pDst, - GCPtr pGC, - int srcx, - int srcy, - int width, - int height, - int dstx, - int dsty); -RegionPtr PclCopyPlane( - DrawablePtr pSrc, - DrawablePtr pDst, - GCPtr pGC, - int srcx, - int srcy, - int width, - int height, - int dstx, - int dsty, - unsigned long plane); - - -/****** - * Functions in PclAttr.c - ******/ -extern char *PclGetAttributes( - XpContextPtr pCon, - XPAttributes pool ); -extern char *PclGetOneAttribute( - XpContextPtr pCon, - XPAttributes pool, - char *attr ); -extern int PclAugmentAttributes( - XpContextPtr pCon, - XPAttributes pool, - char *attrs ); -extern int PclSetAttributes( - XpContextPtr pCon, - XPAttributes pool, - char *attrs ); - -/****** - * Functions in PclColor.c - ******/ -extern Bool PclCreateDefColormap(ScreenPtr pScreen); -extern Bool PclCreateColormap(ColormapPtr pColor); -extern void PclDestroyColormap(ColormapPtr pColor); -extern void PclInstallColormap(ColormapPtr pColor); -extern void PclUninstallColormap(ColormapPtr pColor); -extern int PclListInstalledColormaps(ScreenPtr pScreen, - XID *pCmapList); -extern void PclStoreColors(ColormapPtr pColor, - int ndef, - xColorItem *pdefs); -extern void PclResolveColor(unsigned short *pRed, - unsigned short *pGreen, - unsigned short *pBlue, - VisualPtr pVisual); -extern int PclUpdateColormap(DrawablePtr pDrawable, - XpContextPtr pCon, - GCPtr gc, - FILE *outFile); -extern void PclLookUp(ColormapPtr cmap, - PclContextPrivPtr cPriv, - unsigned short *r, - unsigned short *g, - unsigned short *b); -extern PclPaletteMapPtr PclFindPaletteMap(PclContextPrivPtr cPriv, - ColormapPtr cmap, - GCPtr gc); -extern unsigned char *PclReadMap(char *, int *); - - -/****** - * Functions in PclCursor.c - ******/ -extern void PclConstrainCursor( - ScreenPtr pScreen, - BoxPtr pBox); -extern void PclCursorLimits( - ScreenPtr pScreen, - CursorPtr pCursor, - BoxPtr pHotBox, - BoxPtr pTopLeftbox); -extern Bool PclDisplayCursor( - ScreenPtr pScreen, - CursorPtr pCursor); -extern Bool PclRealizeCursor( - ScreenPtr pScreen, - CursorPtr pCursor); -extern Bool PclUnrealizeCursor( - ScreenPtr pScreen, - CursorPtr pCursor); -extern void PclRecolorCursor( - ScreenPtr pScreen, - CursorPtr pCursor, - Bool displayed); -extern Bool PclSetCursorPosition( - ScreenPtr pScreen, - int x, - int y, - Bool generateEvent); - -/****** - * Functions in PclSFonts.c - ******/ -extern void -PclDownloadSoftFont8( - FILE *fp, - PclSoftFontInfoPtr pSoftFontInfo, - PclFontHead8Ptr pfh, - PclCharDataPtr pcd, - unsigned char *code); -extern void PclDownloadSoftFont16( - FILE *fp, - PclSoftFontInfoPtr pSoftFontInfo, - PclFontHead16Ptr pfh, - PclCharDataPtr pcd, - unsigned char row, - unsigned char col); -extern PclSoftFontInfoPtr PclCreateSoftFontInfo(void); -extern void PclDestroySoftFontInfo( - PclSoftFontInfoPtr pSoftFontInfo ); - -/****** - * Functions in PclGC.c - ******/ -extern Bool PclCreateGC(GCPtr pGC); -extern void PclDestroyGC(GCPtr pGC); -extern int PclUpdateDrawableGC( - GCPtr pGC, - DrawablePtr pDrawable, - FILE **outFile); -extern void PclValidateGC( - GCPtr pGC, - unsigned long changes, - DrawablePtr pDrawable); -extern void PclSetDrawablePrivateStuff( - DrawablePtr pDrawable, - GC gc ); -extern int PclGetDrawablePrivateStuff( - DrawablePtr pDrawable, - GC *gc, - unsigned long *valid, - FILE **file ); -extern void PclSetDrawablePrivateGC( - DrawablePtr pDrawable, - GC gc); -extern void PclComputeCompositeClip( - GCPtr pGC, - DrawablePtr pDrawable); - -/****** - * Functions in PclInit.c - ******/ -extern Bool PclCloseScreen( - int index, - ScreenPtr pScreen); -extern Bool InitializeColorPclDriver( - int ndx, - ScreenPtr pScreen, - int argc, - char **argv); -extern Bool InitializeMonoPclDriver( - int ndx, - ScreenPtr pScreen, - int argc, - char **argv); -extern Bool InitializeLj3PclDriver( - int ndx, - ScreenPtr pScreen, - int argc, - char **argv); -extern XpContextPtr PclGetContextFromWindow( WindowPtr win ); - -/****** - * Functions in PclLine.c - ******/ -extern void PclPolyLine( - DrawablePtr pDrawable, - GCPtr pGC, - int mode, - int nPoints, - xPoint *pPoints); -extern void PclPolySegment( - DrawablePtr pDrawable, - GCPtr pGC, - int nSegments, - xSegment *pSegments); - -/****** - * Functions in PclMisc.c - ******/ -extern void PclQueryBestSize( - int class, - short *pwidth, - short *pheight, - ScreenPtr pScreen); -extern char *GetPropString(WindowPtr pWin, char *propName); -extern int SystemCmd(char *cmdStr); -extern int PclGetMediumDimensions( - XpContextPtr pCon, - CARD16 *pWidth, - CARD16 *pHeight); -extern int PclGetReproducibleArea( - XpContextPtr pCon, - xRectangle *pRect); -extern void PclSendData( - FILE *outFile, - PclContextPrivPtr pConPriv, - BoxPtr pbox, - int nbox, - double ratio); - -/****** - * Functions in PclPixel.c - ******/ -extern void PclPolyPoint( - DrawablePtr pDrawable, - GCPtr pGC, - int mode, - int nPoints, - xPoint *pPoints); -extern void PclPushPixels( - GCPtr pGC, - PixmapPtr pBitmap, - DrawablePtr pDrawable, - int width, - int height, - int x, - int y); - -/****** - * Functions in PclPixmap.c - ******/ -extern PixmapPtr PclCreatePixmap( - ScreenPtr pScreen, - int width, - int height, - int depth); -extern Bool PclDestroyPixmap(PixmapPtr pPixmap); - -/****** - * Functions in PclPolygon.c - ******/ -extern void PclPolyRectangle( - DrawablePtr pDrawable, - GCPtr pGC, - int nRects, - xRectangle *pRects); -extern void PclFillPolygon( - DrawablePtr pDrawable, - GCPtr pGC, - int shape, - int mode, - int nPoints, - DDXPointPtr pPoints); -extern void PclPolyFillRect( - DrawablePtr pDrawable, - GCPtr pGC, - int nRects, - xRectangle *pRects); - -/****** - * Functions in PclSpans.c - ******/ -extern void PclFillSpans( - DrawablePtr pDrawable, - GCPtr pGC, - int nSpans, - DDXPointPtr pPoints, - int *pWidths, - int fSorted); -extern void PclSetSpans( - DrawablePtr pDrawable, - GCPtr pGC, - char *pSrc, - DDXPointPtr pPoints, - int *pWidths, - int nSpans, - int fSorted); - -/****** - * Functions in PclText.c - ******/ -extern int PclPolyText8( - DrawablePtr pDrawable, - GCPtr pGC, - int x, - int y, - int count, - char *string); -extern int PclPolyText16( - DrawablePtr pDrawable, - GCPtr pGC, - int x, - int y, - int count, - unsigned short *string); -extern void PclImageText8( - DrawablePtr pDrawable, - GCPtr pGC, - int x, - int y, - int count, - char *string); -extern void PclImageText16( - DrawablePtr pDrawable, - GCPtr pGC, - int x, - int y, - int count, - unsigned short *string); -extern void PclImageGlyphBlt( - DrawablePtr pDrawable, - GCPtr pGC, - int x, - int y, - unsigned int nGlyphs, - CharInfoPtr *pCharInfo, - pointer pGlyphBase); -extern void PclPolyGlyphBlt( - DrawablePtr pDrawable, - GCPtr pGC, - int x, - int y, - unsigned int nGlyphs, - CharInfoPtr *pCharInfo, - pointer pGlyphBase); - -/****** - * Functions in PclWindow.c - ******/ -extern Bool PclCreateWindow(register WindowPtr pWin); -extern Bool PclDestroyWindow(WindowPtr pWin); -extern Bool PclMapWindow(WindowPtr pWindow); -extern Bool PclPositionWindow( - register WindowPtr pWin, - int x, - int y); -extern Bool PclUnmapWindow(WindowPtr pWindow); -extern void PclCopyWindow( - WindowPtr pWin, - DDXPointRec ptOldOrg, - RegionPtr prgnSrc); -extern Bool PclChangeWindowAttributes( - register WindowPtr pWin, - register unsigned long mask); -extern void PclPaintWindow( - WindowPtr pWin, - RegionPtr pRegion, - int what); - -/****** - * Functions in PclFonts.c - ******/ -extern Bool PclRealizeFont( - ScreenPtr pscr, - FontPtr pFont); -extern Bool PclUnrealizeFont( - ScreenPtr pscr, - FontPtr pFont); - -/****** - * Functions in PclPrint.c - ******/ -extern int PclStartJob( - XpContextPtr pCon, - Bool sendClientData, - ClientPtr client); -extern int PclEndJob( - XpContextPtr pCon, - Bool cancel); -extern int PclStartPage( - XpContextPtr pCon, - WindowPtr pWin); -extern int PclEndPage( - XpContextPtr pCon, - WindowPtr pWin); -extern int PclStartDoc(XpContextPtr pCon, - XPDocumentType type); -extern int PclEndDoc( - XpContextPtr pCon, - Bool cancel); -extern int PclDocumentData( - XpContextPtr pCon, - DrawablePtr pDraw, - char *pData, - int len_data, - char *pFmt, - int len_fmt, - char *pOpt, - int len_opt, - ClientPtr client); -extern int PclGetDocumentData( - XpContextPtr pCon, - ClientPtr client, - int maxBufferSize); - - -#endif /* _PCL_H_ */ diff --git a/nx-X11/programs/Xserver/Xprint/pcl/PclArc.c b/nx-X11/programs/Xserver/Xprint/pcl/PclArc.c deleted file mode 100644 index d675e1699..000000000 --- a/nx-X11/programs/Xserver/Xprint/pcl/PclArc.c +++ /dev/null @@ -1,270 +0,0 @@ -/* $Xorg: PclArc.c,v 1.3 2000/08/17 19:48:07 cpqbld Exp $ */ -/******************************************************************* -** -** ********************************************************* -** * -** * File: PclArc.c -** * -** * Contents: -** * Arc-drawing code for the PCL DDX driver -** * -** * Created: 10/23/95 -** * -** ********************************************************* -** -********************************************************************/ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ - -/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclArc.c,v 1.4 1999/12/13 02:12:53 robin Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include - -#include "Pcl.h" -#include "gcstruct.h" -#include "windowstr.h" -#include "attributes.h" - -static void -PclDoArc( - DrawablePtr pDrawable, - GCPtr pGC, - int nArcs, - xArc *pArcs, - void (*DoIt)(FILE *, PclContextPrivPtr, double, double, xArc)) -{ - char t[80]; - FILE *outFile; - int nbox, i; - BoxPtr pbox; - BoxRec r; - RegionPtr drawRegion, region, transClip; - short fudge; - int xoffset, yoffset; - XpContextPtr pCon; - PclContextPrivPtr pConPriv; - xRectangle repro; - - if( PclUpdateDrawableGC( pGC, pDrawable, &outFile ) == FALSE ) - return; - - fudge = 3 * pGC->lineWidth; - - pCon = PclGetContextFromWindow( (WindowPtr) pDrawable ); - pConPriv = (PclContextPrivPtr) - pCon->devPrivates[PclContextPrivateIndex].ptr; - XpGetReproductionArea( pCon, &repro ); - - /* - * Generate the PCL code to draw the collection of arcs, by - * defining it as a macro which uses the HP-GL/2 arc drawing - * function. - */ - - xoffset = pDrawable->x; - yoffset = pDrawable->y; - - for( i = 0; i < nArcs; i++ ) - { - xArc Arc = pArcs[i]; - double b, X, Y, ratio; - double angle1; - - MACRO_START( outFile, pConPriv ); - SAVE_PCL( outFile, pConPriv, "\033%0B" ); - - /* Calculate the start of the arc */ - if( ( Arc.angle1 / 64 ) % 360 == 90 ) - { - X = 0; - Y = -Arc.height / 2.0; - } - else if( ( Arc.angle1 / 64 ) % 360 == 270 ) - { - X = 0; - Y = Arc.height / 2.0; - } - else - { - /* Convert the angle to radians */ - angle1 = ( Arc.angle1 / 64.0 ) * 3.141592654 / 180.0; - - b = (Arc.height / 2.0); - X = b * cos( angle1 ); - Y = -b * sin( angle1 ); - } - - /* Change the coordinate system to scale the ellipse */ - ratio = (double)Arc.height / (double)Arc.width; - - sprintf( t, "SC%.2f,%.2f,%d,%d;", - (repro.x - Arc.width / 2 - xoffset - Arc.x) * ratio, - (repro.x - Arc.width / 2 - xoffset - Arc.x + - repro.width) * ratio, - repro.y - Arc.height / 2 - yoffset - Arc.y + repro.height, - repro.y - Arc.height / 2 - yoffset - Arc.y); - SAVE_PCL( outFile, pConPriv, t ); - - DoIt( outFile, pConPriv, X, Y, Arc ); - - /* Build the bounding box */ - r.x1 = -Arc.width / 2 - fudge; - r.y1 = -Arc.height / 2 - fudge; - r.x2 = Arc.width / 2 + fudge; - r.y2 = Arc.height / 2 + fudge; - drawRegion = REGION_CREATE( pGC->pScreen, &r, 0 ); - - SAVE_PCL( outFile, pConPriv, "\033%0A" ); - MACRO_END( outFile ); - - /* - * Intersect the bounding box with the clip region. - */ - region = REGION_CREATE( pGC->pScreen, NULL, 0 ); - transClip = REGION_CREATE( pGC->pScreen, NULL, 0 ); - REGION_COPY( pGC->pScreen, transClip, pGC->pCompositeClip ); - REGION_TRANSLATE( pGC->pScreen, transClip, - -(xoffset + Arc.x + Arc.width / 2), - -(yoffset + Arc.y + Arc.height / 2) ); - REGION_INTERSECT( pGC->pScreen, region, drawRegion, transClip ); - - /* - * For each rectangle in the clip region, set the HP-GL/2 "input - * window" and render the collection of arcs to it. - */ - pbox = REGION_RECTS( region ); - nbox = REGION_NUM_RECTS( region ); - - PclSendData(outFile, pConPriv, pbox, nbox, ratio); - - /* - * Restore the coordinate system - */ - sprintf( t, "\033%%0BSC%d,%d,%d,%d;\033%%0A", repro.x, - repro.x + repro.width, repro.y + repro.height, - repro.y ); - SEND_PCL( outFile, t ); - - /* - * Clean up the temporary regions - */ - REGION_DESTROY( pGC->pScreen, drawRegion ); - REGION_DESTROY( pGC->pScreen, region ); - REGION_DESTROY( pGC->pScreen, transClip ); - } -} - -/* - * Draw a simple non-filled arc, centered on the origin and starting - * at the given point. - */ -static void -DrawArc(FILE *outFile, - PclContextPrivPtr pConPriv, - double X, - double Y, - xArc A) -{ - char t[80]; - - sprintf( t, "PU%d,%d;PD;AA0,0,%.2f;", (int)X, (int)Y, - (float)A.angle2 / -64.0 ); - SAVE_PCL(outFile, pConPriv, t); -} - -void -PclPolyArc( - DrawablePtr pDrawable, - GCPtr pGC, - int nArcs, - xArc *pArcs) -{ - PclDoArc( pDrawable, pGC, nArcs, pArcs, DrawArc ); -} - -/* - * Draw a filled wedge, from the origin, to the given point, through - * the appropriate angle, and back to the origin. - */ -static void -DoWedge(FILE *outFile, - PclContextPrivPtr pConPriv, - double X, - double Y, - xArc A) -{ - char t[80]; - - sprintf( t, "PU0,0;WG%.2f,%.2f,%.2f;", sqrt( X * X + Y * Y ), - (float)A.angle1 / -64.0, - (float)A.angle2 / -64.0 ); - SAVE_PCL(outFile, pConPriv, t); -} - -static void -DoChord(FILE *outFile, - PclContextPrivPtr pConPriv, - double X, - double Y, - xArc A) -{ - char t[80]; - - sprintf( t, "PU%d,%d;PM0;AA0,0,%.2f;PA%d,%d;PM2;FP;", (int)X, (int)Y, - (float)A.angle2 / -64.0 , (int)X, (int)Y ); - SAVE_PCL(outFile, pConPriv, t); -} - - -void -PclPolyFillArc( - DrawablePtr pDrawable, - GCPtr pGC, - int nArcs, - xArc *pArcs) -{ - switch( pGC->arcMode ) - { - case ArcChord: - PclDoArc( pDrawable, pGC, nArcs, pArcs, DoChord ); - break; - case ArcPieSlice: - PclDoArc( pDrawable, pGC, nArcs, pArcs, DoWedge ); - break; - } -} diff --git a/nx-X11/programs/Xserver/Xprint/pcl/PclArea.c b/nx-X11/programs/Xserver/Xprint/pcl/PclArea.c deleted file mode 100644 index cfed7c866..000000000 --- a/nx-X11/programs/Xserver/Xprint/pcl/PclArea.c +++ /dev/null @@ -1,486 +0,0 @@ -/* $Xorg: PclArea.c,v 1.3 2000/08/17 19:48:07 cpqbld Exp $ */ -/******************************************************************* -** -** ********************************************************* -** * -** * File: PclArea.c -** * -** * Contents: -** * Image and Area functions for the PCL DDX driver -** * -** * Created: 10/23/95 -** * -** ********************************************************* -** -********************************************************************/ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ -/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclArea.c,v 1.8 2001/01/17 22:36:30 dawes Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include -#include "Pcl.h" -#include "pixmapstr.h" -#include "region.h" - -#include "cfb.h" -#if 1 -#include "cfb32.h" -#endif - -void -PclPutImage(DrawablePtr pDrawable, - GCPtr pGC, - int depth, - int x, - int y, - int w, - int h, - int leftPad, - int format, - char *pImage) -{ - PixmapPtr pPixmap; - unsigned long oldFg, oldBg; - XID gcv[3]; - unsigned long oldPlanemask; - unsigned long i; - long bytesPer; - - if( ( w == 0 ) || ( h == 0 ) ) - return; - - if( format != XYPixmap ) - { - pPixmap = GetScratchPixmapHeader( pDrawable->pScreen, - w+leftPad, h, depth, - BitsPerPixel( depth ), - PixmapBytePad( w + leftPad, - depth ), (pointer)pImage ); - if( !pPixmap ) - return; - - if( format == ZPixmap ) - (void)(*pGC->ops->CopyArea)( (DrawablePtr)pPixmap, pDrawable, pGC, - leftPad, 0, w, h, x, y ); - else - (void)(*pGC->ops->CopyPlane)( (DrawablePtr)pPixmap, pDrawable, pGC, - leftPad, 0, w, h, x, y, 1 ); - FreeScratchPixmapHeader( pPixmap ); - } - else - { - pPixmap = GetScratchPixmapHeader( pDrawable->pScreen, - w+leftPad, h, depth, - BitsPerPixel( depth ), - PixmapBytePad( w + leftPad, - depth ), (pointer)pImage ); - - if( !pPixmap ) - return; - - depth = pGC->depth; - oldPlanemask = pGC->planemask; - oldFg = pGC->fgPixel; - oldBg = pGC->bgPixel; - gcv[0] = ~0L; - gcv[1] = 0; - DoChangeGC( pGC, GCForeground | GCBackground, gcv, 0 ); - bytesPer = (long)h * BitmapBytePad( w + leftPad ); - - for( i = 1 << (depth-1); i != 0; i >>= 1, pImage += bytesPer ) - { - if( i & oldPlanemask ) - { - gcv[0] = i; - DoChangeGC( pGC, GCPlaneMask, gcv, 0 ); - ValidateGC( pDrawable, pGC ); - if (pPixmap->drawable.depth <= 8 ) - cfbPutImage( (DrawablePtr)pPixmap, pGC, 1, x, y, w, h, - leftPad, XYBitmap, pImage ); - else if (pPixmap->drawable.depth <= 32 ) - cfb32PutImage( (DrawablePtr)pPixmap, pGC, 1, x, y, w, h, - leftPad, XYBitmap, pImage ); - } - } - gcv[0] = oldPlanemask; - gcv[1] = oldFg; - gcv[2] = oldBg; - DoChangeGC( pGC, GCPlaneMask | GCForeground | GCBackground, - gcv, 0 ); - - PclCopyArea( (DrawablePtr)pPixmap, pDrawable, pGC, leftPad, - 0, w, h, x, y ); - FreeScratchPixmapHeader( pPixmap ); - } -} - -/* - * PclMonoPixmapFragment() - * - * Given a 1-bit-deep pixmap, send the appropriate part of it to the - * output file as a PCL raster graphics command. - */ -static void -PclMonoPixmapFragment(FILE *outFile, - PixmapPtr pix, - short x1, - short y1, - short x2, - short y2, - short dstx, - short dsty) -{ - char *bits, t[80], *row; - int h, w, i; - - /* - * Create a storage area large enough to hold the entire pixmap, - * then use mfbGetImage to get the appropriate bits. - */ - h = y2 - y1; - w = BitmapBytePad( x2 - x1 ); - - bits = (char *)xalloc( h * w ); - mfbGetImage( (DrawablePtr)pix, x1, y1, x2 - x1, h, - XYPixmap, ~0, bits ); - - /* - * Move the cursor to the appropriate place on the page. We have - * to jump into HP-GL/2 to do this correctly, then go back to PCL - * for the actual drawing. - */ - sprintf( t, "\033%%0BPU%d,%d;\033%%1A", dstx, dsty ); - SEND_PCL( outFile, t ); - - /* - * Now, wrap the raster in the appropriate PCL code. Right now, - * it's going to go down the wire without any compression. That - * will have to be good enough for the sample implementation. - */ - sprintf( t, "\033*t300R\033*r%dT\033*r%dS\033*r1A\033*b0M", - h, x2 - x1 ); - SEND_PCL( outFile, t ); - - sprintf( t, "\033*b%dW", w ); - for( row = bits, i = 0; i <= h; i++, row += w ) - { - SEND_PCL( outFile, t ); - SEND_PCL_COUNT( outFile, row, w ); - } - - SEND_PCL( outFile, "\033*rC" ); - - /* - * Clean things up a bit - */ - xfree( bits ); -} - -static void -PclColorPixmapFragment(FILE *outFile, - PixmapPtr pix, - short x1, - short y1, - short x2, - short y2, - short dstx, - short dsty) -{ - char *bits, t[80], *row; - int h, w, i; - - /* - * Create a storage area large enough to hold the entire pixmap, - * then use cfbGetImage to get the appropriate bits. - */ - h = y2 - y1; - w = PixmapBytePad( x2 - x1, pix->drawable.depth ); - - bits = (char *)xalloc( h * w ); - if (pix->drawable.depth <= 8) - cfbGetImage( (DrawablePtr)pix, x1, y1, x2 - x1, h, - ZPixmap, ~0, bits ); - else if (pix->drawable.depth <= 32) - cfb32GetImage( (DrawablePtr)pix, x1, y1, x2 - x1, h, - ZPixmap, ~0, bits ); - - /* - * Move the cursor to the appropriate place on the page. We have - * to jump into HP-GL/2 to do this correctly, then go back to PCL - * for the actual drawing. - */ - sprintf( t, "\033%%0BPU%d,%d;\033%%1A", dstx, dsty ); - SEND_PCL( outFile, t ); - - /* - * Now, wrap the raster in the appropriate PCL code. Right now, - * it's going to go down the wire without any compression. That - * will have to be good enough for the sample implementation. - */ - sprintf( t, "\033*t300R\033*r%dt%ds1A\033*b0M", - h, x2 - x1 ); - SEND_PCL( outFile, t ); - - sprintf( t, "\033*b%dW", w ); - for( row = bits, i = 0; i < h; i++, row += w ) - { - SEND_PCL( outFile, t ); - SEND_PCL_COUNT( outFile, row, w ); - } - - SEND_PCL( outFile, "\033*rC" ); - - /* - * Clean things up a bit - */ - xfree( bits ); -} - -RegionPtr -PclCopyArea(DrawablePtr pSrc, - DrawablePtr pDst, - GCPtr pGC, - int srcx, - int srcy, - int width, - int height, - int dstx, - int dsty) -{ - PixmapPtr pixSrc = (PixmapPtr)pSrc; -/* - FILE *srcFile; - GC srcGC; -*/ - FILE *dstFile; - GC dstGC; - unsigned long valid; - RegionPtr drawRegion, region, whole, ret; - BoxRec box; - BoxPtr prect; - int nrect; - void (*doFragment)(FILE *, PixmapPtr, short, short, short, short, - short, short ); - - /* - * Since we don't store any information on a per-window basis, we - * can't copy from a window. - */ - if( pSrc->type == DRAWABLE_WINDOW ) - return NULL; - - /* - * If we're copying from a pixmap to a pixmap, we just use the - * mfb/cfb code to do the work. - */ - if( pDst->type == DRAWABLE_PIXMAP ) - { - if( pSrc->depth == 1 ) - return mfbCopyArea( pSrc, pDst, pGC, srcx, srcy, width, - height, dstx, dsty ); - else if( pSrc->depth <= 8 ) - return cfbCopyArea( pSrc, pDst, pGC, srcx, srcy, width, - height, dstx, dsty ); - else if( pSrc->depth <= 32 ) - return cfb32CopyArea( pSrc, pDst, pGC, srcx, srcy, width, - height, dstx, dsty ); - } - -/* - PclGetDrawablePrivateStuff( pSrc, &srcGC, &valid, &srcFile ); -*/ - PclGetDrawablePrivateStuff( pDst, &dstGC, &valid, &dstFile ); - - /* - * If we're copying to a window, we have to do some actual - * drawing, instead of just handing it off to mfb or cfb. Start - * by determining the region that will be drawn. - */ - box.x1 = srcx; - box.y1 = srcy; - box.x2 = srcx + width; - box.y2 = srcy + height; - drawRegion = REGION_CREATE( pGC->pScreen, &box, 0 ); - REGION_TRANSLATE( pGC->pScreen, drawRegion, dstx, dsty ); - - region = REGION_CREATE( pGC->pScreen, NULL, 0 ); - REGION_INTERSECT( pGC->pScreen, region, drawRegion, pGC->pCompositeClip ); - - /* - * Now select the operation to be performed on each box in the - * region. - */ - if( pSrc->depth == 1 ) - doFragment = PclMonoPixmapFragment; - else - doFragment = PclColorPixmapFragment; - - /* - * Actually draw each section of the bitmap. - */ - nrect = REGION_NUM_RECTS( region ); - prect = REGION_RECTS( region ); - - while( nrect ) - { - (*doFragment)( dstFile, (PixmapPtr)pSrc, prect->x1 - dstx, - prect->y1 - dsty, prect->x2 - dstx, - prect->y2 - dsty, prect->x1, prect->y1 ); - - nrect--; - prect++; - } - - /* - * Update the destination's GC to the source's GC. - */ -/* - PclSetDrawablePrivateGC( pDst, srcGC ); -*/ - - /* - * Determine the region that needs to be returned. This is the - * region of the source that falls outside the boundary of the - * pixmap. - */ - box.x1 = 0; - box.y1 = 0; - box.x2 = pixSrc->drawable.width; - box.y2 = pixSrc->drawable.height; - whole = REGION_CREATE( pGC->pScreen, &box, 0 ); - ret = REGION_CREATE( pGC->pScreen, NULL, 0 ); - - REGION_TRANSLATE( pGC->pScreen, drawRegion, -dstx, -dsty ); - REGION_SUBTRACT( pGC->pScreen, ret, drawRegion, whole ); - - /* - * Clean up the regions - */ - REGION_DESTROY( pGC->pScreen, drawRegion ); - REGION_DESTROY( pGC->pScreen, region ); - REGION_DESTROY( pGC->pScreen, whole ); - - if( REGION_NOTEMPTY( pGC->pScreen, ret ) ) - return ret; - else - { - REGION_DESTROY( pGC->pScreen, ret ); - return NULL; - } -} - -RegionPtr -PclCopyPlane(DrawablePtr pSrc, - DrawablePtr pDst, - GCPtr pGC, - int srcx, - int srcy, - int width, - int height, - int dstx, - int dsty, - unsigned long plane) -{ - RegionPtr reg; - GCPtr scratchGC; - PixmapPtr scratchPix; - - /* - * Since we don't store PCL on a per-window basis, there's no good - * way to copy from a window. - */ - if( pSrc->type == DRAWABLE_WINDOW ) - return NULL; - - /* - * Copying from a pixmap to a pixmap is already implemented by - * mfb/cfb. - */ - if( pSrc->type == DRAWABLE_PIXMAP && - pDst->type == DRAWABLE_PIXMAP ) - { - if( pDst->depth == 1 ) - return mfbCopyPlane( pSrc, pDst, pGC, srcx, srcy, width, - height, dstx, dsty, plane ); - else if( pDst->depth <= 8 ) - return cfbCopyPlane( pSrc, pDst, pGC, srcx, srcy, width, - height, dstx, dsty, plane ); - else if( pDst->depth <= 32 ) - return cfb32CopyPlane( pSrc, pDst, pGC, srcx, srcy, width, - height, dstx, dsty, plane ); - } - - /* - * We can use the mfb/cfbCopyPlane function to do the work of grabbing - * the plane and converting it to the desired visual. Once that's - * done, we already know how to do a CopyArea. - */ - scratchPix = (*pDst->pScreen->CreatePixmap)( pDst->pScreen, width, - height, pDst->depth ); - - scratchGC = GetScratchGC( pDst->depth, pDst->pScreen ); - CopyGC( pGC, scratchGC, ~0L ); - - if( pDst->depth == 1 ) - { - mfbValidateGC( scratchGC, ~0L, (DrawablePtr)scratchPix ); - mfbCopyPlane( pSrc, (DrawablePtr)scratchPix, scratchGC, - srcx, srcy, width, height, 0, 0, plane ); - } - else if( pDst->depth <= 8 ) - { - cfbValidateGC( scratchGC, ~0L, (DrawablePtr)scratchPix ); - cfbCopyPlane( pSrc, (DrawablePtr)scratchPix, scratchGC, - srcx, srcy, width, height, 0, 0, plane ); - } - else if( pDst->depth <= 32 ) - { - cfb32ValidateGC( scratchGC, ~0L, (DrawablePtr)scratchPix ); - cfb32CopyPlane( pSrc, (DrawablePtr)scratchPix, scratchGC, - srcx, srcy, width, height, 0, 0, plane ); - } - - reg = PclCopyArea( (DrawablePtr)scratchPix, pDst, pGC, 0, 0, width, - height, dstx, dsty ); - - FreeScratchGC( scratchGC ); - - (*pDst->pScreen->DestroyPixmap)( scratchPix ); - - return reg; -} diff --git a/nx-X11/programs/Xserver/Xprint/pcl/PclAttVal.c b/nx-X11/programs/Xserver/Xprint/pcl/PclAttVal.c deleted file mode 100644 index adbd197fd..000000000 --- a/nx-X11/programs/Xserver/Xprint/pcl/PclAttVal.c +++ /dev/null @@ -1,207 +0,0 @@ -/* - * $Xorg: PclAttVal.c,v 1.3 2000/08/17 19:48:07 cpqbld Exp $ - */ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "Pcl.h" -#include "AttrValid.h" - -/* - * define valid values and defaults for Printer pool - */ -static XpOid ValidContentOrientationsOids[] = { - xpoid_val_content_orientation_portrait, - xpoid_val_content_orientation_landscape, - xpoid_val_content_orientation_reverse_portrait, - xpoid_val_content_orientation_reverse_landscape -}; -static XpOidList ValidContentOrientations = { - ValidContentOrientationsOids, XpNumber(ValidContentOrientationsOids) -}; - -static XpOid DefaultContentOrientationsOids[] = { - xpoid_val_content_orientation_portrait, - xpoid_val_content_orientation_landscape -}; -static XpOidList DefaultContentOrientations = { - DefaultContentOrientationsOids, XpNumber(DefaultContentOrientationsOids) -}; - -static XpOid ValidPlexesOids[] = { - xpoid_val_plex_simplex, xpoid_val_plex_duplex, xpoid_val_plex_tumble -}; -static XpOidList ValidPlexes = { - ValidPlexesOids, XpNumber(ValidPlexesOids) -}; - -static XpOid DefaultPlexesOids[] = { - xpoid_val_plex_simplex -}; -static XpOidList DefaultPlexes = { - DefaultPlexesOids, XpNumber(DefaultPlexesOids) -}; - -static unsigned long ValidPrinterResolutionsCards[] = { - 300 -}; -static XpOidCardList ValidPrinterResolutions = { - ValidPrinterResolutionsCards, XpNumber(ValidPrinterResolutionsCards) -}; - -static unsigned long DefaultPrinterResolutionsCards[] = { - 300 -}; -static XpOidCardList DefaultPrinterResolutions = { - DefaultPrinterResolutionsCards, XpNumber(DefaultPrinterResolutionsCards) -}; - -static XpOid ValidListfontsModesOids[] = { - xpoid_val_xp_list_internal_printer_fonts, xpoid_val_xp_list_glyph_fonts -}; -static XpOidList ValidListfontsModes = { - ValidListfontsModesOids, XpNumber(ValidListfontsModesOids) -}; - -static XpOid DefaultListfontsModesOids[] = { - xpoid_val_xp_list_glyph_fonts -}; -static XpOidList DefaultListfontsModes = { - DefaultListfontsModesOids, XpNumber(DefaultListfontsModesOids) -}; - -static XpOid ValidSetupProvisoOids[] = { - xpoid_val_xp_setup_mandatory, xpoid_val_xp_setup_optional -}; -static XpOidList ValidSetupProviso = { - - - ValidSetupProvisoOids, XpNumber(ValidSetupProvisoOids) -}; - -static XpOidDocFmt ValidDocFormatsSupportedFmts[] = { - { "PCL", "5", NULL }, -}; -static XpOidDocFmtList ValidDocFormatsSupported = { - ValidDocFormatsSupportedFmts, XpNumber(ValidDocFormatsSupportedFmts) -}; - -static XpOidDocFmt DefaultDocFormatsSupportedFmts[] = { - { "PCL", "5", NULL } -}; -static XpOidDocFmtList DefaultDocFormatsSupported = { - DefaultDocFormatsSupportedFmts, XpNumber(DefaultDocFormatsSupportedFmts) -}; - -static XpOidDocFmt ValidEmbeddedFormatsSupportedFmts[] = { - { "HPGL", "2", NULL }, -}; -static XpOidDocFmtList ValidEmbeddedFormatsSupported = { - ValidEmbeddedFormatsSupportedFmts, XpNumber(ValidEmbeddedFormatsSupportedFmts) -}; - -static XpOidDocFmt DefaultEmbeddedFormatsSupportedFmts[] = { - { "HPGL", "2", NULL } -}; -static XpOidDocFmtList DefaultEmbeddedFormatsSupported = { - DefaultEmbeddedFormatsSupportedFmts, XpNumber(DefaultEmbeddedFormatsSupportedFmts) -}; - -static XpOidDocFmt ValidRawFormatsSupportedFmts[] = { - { "PCL", "5", NULL }, - { "Postscript", "2", NULL }, - { "ASCII", NULL, NULL } - -}; -static XpOidDocFmtList ValidRawFormatsSupported = { - ValidRawFormatsSupportedFmts, XpNumber(ValidRawFormatsSupportedFmts) -}; - -static XpOidDocFmt DefaultRawFormatsSupportedFmts[] = { - { "PCL", "5", NULL } -}; -static XpOidDocFmtList DefaultRawFormatsSupported = { - DefaultRawFormatsSupportedFmts, XpNumber(DefaultRawFormatsSupportedFmts) -}; - -static XpOid ValidInputTraysOids[] = { - xpoid_val_input_tray_manual, - xpoid_val_input_tray_main, - xpoid_val_input_tray_envelope, - xpoid_val_input_tray_large_capacity, - xpoid_val_input_tray_bottom -}; -static XpOidList ValidInputTrays = { - ValidInputTraysOids, XpNumber(ValidInputTraysOids) -}; - -static XpOid ValidMediumSizesOids[] = { - xpoid_val_medium_size_iso_a3, - xpoid_val_medium_size_iso_a4, - xpoid_val_medium_size_na_letter, - xpoid_val_medium_size_na_legal, - xpoid_val_medium_size_executive, - xpoid_val_medium_size_ledger, - xpoid_val_medium_size_iso_c5, - xpoid_val_medium_size_iso_designated_long, - xpoid_val_medium_size_na_number_10_envelope, - xpoid_val_medium_size_monarch_envelope, - xpoid_val_medium_size_jis_b5, -}; -static XpOidList ValidMediumSizes = { - ValidMediumSizesOids, XpNumber(ValidMediumSizesOids) -}; - -static XpOidDocFmt DefaultDocumentFormat = { - "PCL", "5", NULL -}; - - -/* - * init struct for XpValidate*Pool - */ -XpValidatePoolsRec PclValidatePoolsRec = { - &ValidContentOrientations, &DefaultContentOrientations, - &ValidDocFormatsSupported, &DefaultDocFormatsSupported, - &ValidInputTrays, &ValidMediumSizes, - &ValidPlexes, &DefaultPlexes, - &ValidPrinterResolutions, &DefaultPrinterResolutions, - &ValidEmbeddedFormatsSupported, &DefaultEmbeddedFormatsSupported, - &ValidListfontsModes, &DefaultListfontsModes, - &ValidRawFormatsSupported, &DefaultRawFormatsSupported, - &ValidSetupProviso, - &DefaultDocumentFormat -}; diff --git a/nx-X11/programs/Xserver/Xprint/pcl/PclAttr.c b/nx-X11/programs/Xserver/Xprint/pcl/PclAttr.c deleted file mode 100644 index 3cde053f1..000000000 --- a/nx-X11/programs/Xserver/Xprint/pcl/PclAttr.c +++ /dev/null @@ -1,87 +0,0 @@ -/* $Xorg: PclAttr.c,v 1.3 2000/08/17 19:48:07 cpqbld Exp $ */ -/******************************************************************* -** -** ********************************************************* -** * -** * File: PclAttr.c -** * -** * Contents: -** * Attribute-handling functions for the PCL driver -** * -** * Created: 2/2/96 -** * -** ********************************************************* -** -********************************************************************/ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "Pcl.h" -#include "attributes.h" - -char * -PclGetAttributes( - XpContextPtr pCon, - XPAttributes pool ) -{ - return XpGetAttributes( pCon, pool ); -} - -char * -PclGetOneAttribute( - XpContextPtr pCon, - XPAttributes pool, - char *attr ) -{ - return XpGetOneAttribute( pCon, pool, attr ); -} -int -PclAugmentAttributes( - XpContextPtr pCon, - XPAttributes pool, - char *attrs ) -{ - return XpAugmentAttributes( pCon, pool, attrs ); -} - -int -PclSetAttributes( - XpContextPtr pCon, - XPAttributes pool, - char *attrs ) -{ - return XpSetAttributes( pCon, pool, attrs ); -} diff --git a/nx-X11/programs/Xserver/Xprint/pcl/PclColor.c b/nx-X11/programs/Xserver/Xprint/pcl/PclColor.c deleted file mode 100644 index 72c7e3f99..000000000 --- a/nx-X11/programs/Xserver/Xprint/pcl/PclColor.c +++ /dev/null @@ -1,851 +0,0 @@ -/* $Xorg: PclColor.c,v 1.3 2000/08/17 19:48:07 cpqbld Exp $ */ -/******************************************************************* -** -** ********************************************************* -** * -** * File: PclColorInit.c -** * -** * Contents: -** * Colormap handing code of Pcl driver for the -** * print server. -** * -** * Created: 4/8/96 -** * -** ********************************************************* -** -********************************************************************/ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ -/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclColor.c,v 1.9tsi Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include -#include -#include - -#include "colormapst.h" -#include "windowstr.h" -#include "resource.h" - -#include "Pcl.h" -#include "cfb.h" - -static void lookup(unsigned char *src, - unsigned char *dst, - int num, - unsigned char *map, - int dim); -static void trilinear(unsigned char *p, - unsigned char *out, - unsigned char *d, - int dim, - unsigned char def); - - -/* - * This seems to be (and is) a duplication of effort; one would think - * that cfbCreateDefColormap would be sufficient. It almost is. The - * only change made in this function is that the black and white pixels - * are allocated with three separate variables for red, green and blue - * values, instead of the single variable in cfbCreateDefColormap. The - * single variable leads to the one value being corrected by - * ResolveColor three times, which leads to incorrect colors. - */ - -Bool -PclCreateDefColormap(ScreenPtr pScreen) -{ - unsigned short wp_red = ~0, wp_green = ~0, wp_blue = ~0; - unsigned short bp_red = 0, bp_green = 0, bp_blue = 0; - VisualPtr pVisual; - ColormapPtr cmap; - Pixel wp, bp; - - for (pVisual = pScreen->visuals; - pVisual->vid != pScreen->rootVisual; - pVisual++) - ; - - if (CreateColormap(pScreen->defColormap, pScreen, pVisual, &cmap, - (pVisual->class & DynamicClass) ? AllocNone : AllocAll, - 0) - != Success) - return FALSE; - wp = pScreen->whitePixel; - bp = pScreen->blackPixel; - if ((AllocColor(cmap, &wp_red, &wp_green, &wp_blue, &wp, 0) != - Success) || - (AllocColor(cmap, &bp_red, &bp_green, &bp_blue, &bp, 0) != - Success)) - return FALSE; - - pScreen->whitePixel = wp; - pScreen->blackPixel = bp; - - (*pScreen->InstallColormap)(cmap); - return TRUE; -} - -/* - * Add colormap to list of colormaps on screen - */ -Bool -PclCreateColormap(ColormapPtr pColor) -{ - PclCmapToContexts *new; - PclScreenPrivPtr sPriv; - - sPriv = (PclScreenPrivPtr)pColor->pScreen - ->devPrivates[PclScreenPrivateIndex].ptr; - - /* - * Use existing code to initialize the values in the colormap - */ - cfbInitializeColormap( pColor ); - - /* - * Set up the mapping between the color map and the context - */ - new = (PclCmapToContexts *)xalloc( sizeof( PclCmapToContexts ) ); - - if( new ) - { - new->colormapId = pColor->mid; - new->contexts = NULL; - new->next = sPriv->colormaps; - sPriv->colormaps = new; - - return TRUE; - } - else - return FALSE; -} - -void -PclDestroyColormap(ColormapPtr pColor) -{ - PclScreenPrivPtr sPriv; - PclCmapToContexts *pCmap, *tCmap = 0; - PclContextListPtr con, tCon; - PclContextPrivPtr cPriv; - PclPaletteMapPtr pPal; - char t[80]; - - /* - * At DestroyContext time, colormaps may be destroyed twice, so if the - * pointer is NULL, just crash out. - */ - if( !pColor ) - return; - - /* - * Find the colormap <-> contexts mapping - */ - sPriv = (PclScreenPrivPtr)pColor->pScreen - ->devPrivates[PclScreenPrivateIndex].ptr; - pCmap = sPriv->colormaps; - while( pCmap ) - { - if( pCmap->colormapId == pColor->mid ) - break; - tCmap = pCmap; - pCmap = pCmap->next; - } - - /* - * For each context, delete the palette in the printer and - * free the mapping. - */ - if( pCmap ) - { - con = pCmap->contexts; - while( con ) - { - cPriv = con->context->devPrivates[PclContextPrivateIndex].ptr; - - pPal = cPriv->palettes; - while( pPal ) - { - if( pPal->colormapId == pColor->mid ) - break; - pPal = pPal->next; - } - - if( cPriv->pPageFile ) - { - sprintf( t, "\033&p%dI\033*p2C", pPal->paletteId ); - SEND_PCL( cPriv->pPageFile, t ); - } - - tCon = con; - con = con->next; - xfree( tCon ); - } - - /* - * Delete the colormap<->contexts mapping - */ - if( sPriv->colormaps == pCmap ) - /* Delete from the front */ - sPriv->colormaps = pCmap->next; - else - /* Delete from the middle */ - tCmap->next = pCmap->next; - free( pCmap ); - } -} - -void -PclInstallColormap(ColormapPtr pColor) -{ -} - -void -PclUninstallColormap(ColormapPtr pColor) -{ -} - -int -PclListInstalledColormaps(ScreenPtr pScreen, - XID *pCmapList) -{ - return 0; -} - -void -PclStoreColors(ColormapPtr pColor, - int ndef, - xColorItem *pdefs) -{ - PclCmapToContexts *p; - PclScreenPrivPtr sPriv; - PclContextListPtr con; - PclContextPrivPtr cPriv; - PclPaletteMapPtr pMap; - char t[80]; - int i; - - sPriv = (PclScreenPrivPtr)pColor->pScreen - ->devPrivates[PclScreenPrivateIndex].ptr; - p = sPriv->colormaps; - while( p ) - { - if( p->colormapId == pColor->mid ) - break; - p = p->next; - } - - if( p ) - { - con = p->contexts; - while( con ) - { - /* - * For each context, get the palette ID and update the - * appropriate palette. - */ - cPriv = con->context - ->devPrivates[PclContextPrivateIndex].ptr; - pMap = PclFindPaletteMap( cPriv, pColor, NULL ); - - /* - * Update the palette - */ - sprintf( t, "\033&p%dS", pMap->paletteId ); - SEND_PCL( cPriv->pPageFile, t ); - - if( pColor->class == PseudoColor ) - { - unsigned short r, g, b; - unsigned int pID; - for( i = 0; i < ndef; i++ ) - { - pID = pdefs[i].pixel; - if ( pColor->red[i].fShared ) - { - r = pColor->red[pID].co.shco.red->color; - g = pColor->red[pID].co.shco.green->color; - b = pColor->red[pID].co.shco.blue->color; - } - else - { - r = pColor->red[pID].co.local.red; - g = pColor->red[pID].co.local.green; - b = pColor->red[pID].co.local.blue; - } - - if( pdefs[i].flags & DoRed ) - r = pdefs[i].red; - if( pdefs[i].flags & DoGreen ) - g = pdefs[i].green; - if( pdefs[i].flags & DoBlue ) - b = pdefs[i].blue; - PclLookUp(pColor, cPriv, &r, &g, &b); - sprintf( t, "\033*v%ua%ub%uc%dI", r, g, b, pID); - SEND_PCL( cPriv->pPageFile, t ); - } - } - - sprintf( t, "\033&p%dS", cPriv->currentPalette ); - SEND_PCL( cPriv->pPageFile, t ); - - con = con->next; - } - } -} - -void -PclResolveColor(unsigned short *pRed, - unsigned short *pGreen, - unsigned short *pBlue, - VisualPtr pVisual) -{ - /* - * We need to map the X color range of [0,65535] to the PCL color - * range of [0,32767]. - */ - *pRed >>= 1; - *pGreen >>= 1; - *pBlue >>= 1; -} - -PclPaletteMapPtr -PclFindPaletteMap(PclContextPrivPtr cPriv, - ColormapPtr cmap, - GCPtr gc) -{ - PclPaletteMapPtr p = cPriv->palettes, new; - - /* - * If the colormap is static, grab one of the special palettes. If we come - * into this from StoreColors, there will be no GC, but by definition we're - * looking at a dynamic color map, so the special colors will not be - * needed. - */ - if( gc ) - { - if( cmap->pVisual->class == StaticGray ) - return &( cPriv->staticGrayPalette ); - else if( cmap->pVisual->class == TrueColor ) - { - if( gc->fillStyle == FillTiled && !( gc->tileIsPixel ) ) - return &( cPriv->specialTrueColorPalette ); - else - return &( cPriv->trueColorPalette ); - } - } - - - /* Look for the colormap ID <-> palette ID mapping */ - while( p ) - { - if( p->colormapId == cmap->mid ) - return p; - p = p->next; - } - - /* If the colormap isn't already there, make an entry for it */ - new = (PclPaletteMapPtr)xalloc( sizeof( PclPaletteMap ) ); - new->colormapId = cmap->mid; - new->paletteId = cPriv->nextPaletteId++; - new->downloaded = 0; - new->next = cPriv->palettes; - cPriv->palettes = new; - return new; -} - -int -PclUpdateColormap(DrawablePtr pDrawable, - XpContextPtr pCon, - GCPtr gc, - FILE *outFile) -{ - PclScreenPrivPtr sPriv; - - PclContextPrivPtr cPriv; - PclPaletteMapPtr pMap; - PclCmapToContexts *pCmap; - PclContextListPtr new; - char t[80]; - Colormap c; - ColormapPtr cmap; - WindowPtr win = (WindowPtr)pDrawable; - unsigned short r, g, b, rr, gg, bb; - int i; - - cPriv = pCon->devPrivates[PclContextPrivateIndex].ptr; - - c = wColormap( win ); - cmap = (ColormapPtr)LookupIDByType( c, RT_COLORMAP ); - pMap = PclFindPaletteMap( cPriv, cmap, gc ); - - if( cPriv->currentPalette == pMap->paletteId ) - /* - * If the requested colormap is already active, nothing needs to - * be done. - */ - return FALSE; - - /* - * Now we activate the palette in the printer - */ - sprintf( t, "\033&p%dS", pMap->paletteId ); - SEND_PCL( outFile, t ); - cPriv->currentPalette = pMap->paletteId; - - if( pMap->downloaded == 0 ) - /* - * If the requested colormap has not been downloaded to the - * printer, we need to do that before activating it. - */ - { - /* - * Add the colormap to the screen-level colormap<->context mapping. - */ - sPriv = (PclScreenPrivPtr)cmap->pScreen - ->devPrivates[PclScreenPrivateIndex].ptr; - pCmap = sPriv->colormaps; - while( pCmap && ( pCmap->colormapId != cmap->mid ) ) - pCmap = pCmap->next; - new = (PclContextListPtr)xalloc( sizeof( PclContextList ) ); - new->context = pCon; - new->next = pCmap->contexts; - pCmap->contexts = new; - - /* - * XXX Download the colormap - */ - if( cmap->class == StaticGray ) - { -#ifdef XP_PCL_COLOR - sprintf( t, "\033*v18W%c%c%c%c%c%c", 0, 1, 1, 1, 1, 1 ); - SEND_PCL_COUNT( cPriv->pPageFile, t, 12 ); - - /* Send the white reference point... */ - sprintf( t, "%c%c%c%c%c%c", 0x7f, 0xff, 0x7f, 0xff, - 0x7f, 0xff ); - SEND_PCL_COUNT( cPriv->pPageFile, t, 6 ); - - /* ... and the black reference point */ - sprintf( t, "%c%c%c%c%c%c", 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00 ); - SEND_PCL_COUNT( cPriv->pPageFile, t, 6 ); - - /* Now program the two colors */ - sprintf( t, "\033*v0a0b0c%ldI", (long) cmap->pScreen->blackPixel ); - SEND_PCL( cPriv->pPageFile, t ); - sprintf( t, "\033*v32767a32767b32767c%ldI", - (long) cmap->pScreen->whitePixel ); - SEND_PCL( cPriv->pPageFile, t ); -#endif /* XP_PCL_COLOR */ - } - else if( cmap->class == PseudoColor ) - { - sprintf( t, - "\033*v18W%c%c%c%c%c%c", - 0, 1, cmap->pVisual->nplanes, 16, 16, 16 ); - SEND_PCL_COUNT( cPriv->pPageFile, t, 12 ); - - /* Send the white reference point... */ - if ( cPriv->ctbl != NULL ) - sprintf( t, "%c%c%c%c%c%c", 0x00, 0xff, 0x00, 0xff, - 0x00, 0xff ); - else - sprintf( t, "%c%c%c%c%c%c", 0x7f, 0xff, 0x7f, 0xff, - 0x7f, 0xff ); - SEND_PCL_COUNT( cPriv->pPageFile, t, 6 ); - - /* ... and the black reference point */ - sprintf( t, "%c%c%c%c%c%c", 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00 ); - SEND_PCL_COUNT( cPriv->pPageFile, t, 6 ); - - for(i = 0; i < cmap->pVisual->ColormapEntries; i++ ) - { - if( cmap->red[i].fShared ) - { - r = cmap->red[i].co.shco.red->color; - g = cmap->red[i].co.shco.green->color; - b = cmap->red[i].co.shco.blue->color; - } - else - { - r = cmap->red[i].co.local.red; - g = cmap->red[i].co.local.green; - b = cmap->red[i].co.local.blue; - } - PclLookUp(cmap, cPriv, &r, &g, &b); - sprintf( t, "\033*v%ua%ub%uc%dI", r, g, b, i ); - SEND_PCL( outFile, t ); - } - } - else if( cmap->class == TrueColor ) - { - unsigned short lim; - - if( gc->fillStyle == FillTiled && !( gc->tileIsPixel ) ) - { - if( cPriv->ctbl != NULL ) - { - /* Send the "special" colormap for 24-bit fills */ - sprintf( t, "\033*v18W%c%c%c%c%c%c", 0, 1, - 8, - cmap->pVisual->bitsPerRGBValue, - cmap->pVisual->bitsPerRGBValue, - cmap->pVisual->bitsPerRGBValue ); - SEND_PCL_COUNT( cPriv->pPageFile, t, 12 ); - - /* Send the white reference point... */ - sprintf( t, "%c%c%c%c%c%c", - 0x00, 0xff, - 0x00, 0xff, - 0x00, 0xff ); - SEND_PCL_COUNT( cPriv->pPageFile, t, 6 ); - - /* ... and the black reference point */ - sprintf( t, "%c%c%c%c%c%c", - 0x00, 0x00, - 0x00, 0x00, - 0x00, 0x00 ); - SEND_PCL_COUNT( cPriv->pPageFile, t, 6 ); - - /* Now send the color entries, RRRGGGBB */ - i=0; - for( r = 0; r < 8; r++ ) - for( g = 0; g < 8; g ++ ) - for( b = 0; b < 4; b++ ) - { - rr = (r * 0xff)/7; - gg = (g * 0xff)/7; - bb = (b * 0xff)/3; - PclLookUp(cmap, cPriv, &rr, &gg, &bb); - sprintf( t, "\033*v%ua%ub%uc%dI", - rr, gg, bb, i ); - SEND_PCL( outFile, t ); - i++; - } - } - else - { - /* Send the "special" colormap for 24-bit fills */ - sprintf( t, "\033*v18W%c%c%c%c%c%c", 0, 1, - 8, - cmap->pVisual->bitsPerRGBValue, - cmap->pVisual->bitsPerRGBValue, - cmap->pVisual->bitsPerRGBValue ); - SEND_PCL_COUNT( cPriv->pPageFile, t, 12 ); - - /* Send the white reference point... */ - sprintf( t, "%c%c%c%c%c%c", - 0x00, 0x07, - 0x00, 0x07, - 0x00, 0x03 ); - SEND_PCL_COUNT( cPriv->pPageFile, t, 6 ); - - /* ... and the black reference point */ - sprintf( t, "%c%c%c%c%c%c", - 0x00, 0x00, - 0x00, 0x00, - 0x00, 0x00 ); - SEND_PCL_COUNT( cPriv->pPageFile, t, 6 ); - - /* Now send the color entries, RRRGGGBB */ - i=0; - for( r = 0; r < 8; r++ ) - for( g = 0; g < 8; g ++ ) - for( b = 0; b < 4; b++ ) - { - sprintf( t, "\033*v%ua%ub%uc%dI", - r, g, b, i ); - SEND_PCL( outFile, t ); - i++; - } - } - - } - else - { - lim = (1 << cmap->pVisual->bitsPerRGBValue) - 1; - - /* Send the "special" colormap for 24-bit fills */ - sprintf( t, "\033*v18W%c%c%c%c%c%c", 0, 3, - cmap->pVisual->nplanes, - cmap->pVisual->bitsPerRGBValue, - cmap->pVisual->bitsPerRGBValue, - cmap->pVisual->bitsPerRGBValue ); - SEND_PCL_COUNT( cPriv->pPageFile, t, 12 ); - - /* Send the white reference point... */ - sprintf( t, "%c%c%c%c%c%c", - (lim >> 8) & 0xff, lim & 0xff, - (lim >> 8) & 0xff, lim & 0xff, - (lim >> 8) & 0xff, lim & 0xff); - SEND_PCL_COUNT( cPriv->pPageFile, t, 6 ); - - /* ... and the black reference point */ - sprintf( t, "%c%c%c%c%c%c", 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00 ); - SEND_PCL_COUNT( cPriv->pPageFile, t, 6 ); - } - - } - pMap->downloaded = 1; - } - return TRUE; - -} - -void PclLookUp( - ColormapPtr cmap, - PclContextPrivPtr cPriv, - unsigned short *r, - unsigned short *g, - unsigned short *b -) -{ - unsigned char cdata[3]; - - if( cmap->class == PseudoColor ) - { - if( cPriv->ctbl != NULL ) - { - cdata[0] = *r >> 8; - cdata[1] = *g >> 8; - cdata[2] = *b >> 8; - lookup(cdata, cdata, 1, cPriv->ctbl, cPriv->ctbldim); - *r = cdata[0]; - *g = cdata[1]; - *b = cdata[2]; - } - else - { - *r >>= 1; - *g >>= 1; - *b >>= 1; - } - } - else if( cmap->class == TrueColor ) - { - if( cPriv->ctbl != NULL ) - { - cdata[0] = *r; - cdata[1] = *g; - cdata[2] = *b; - lookup(cdata, cdata, 1, cPriv->ctbl, cPriv->ctbldim); - *r = cdata[0]; - *g = cdata[1]; - *b = cdata[2]; - } - } - return; -} - -unsigned char *PclReadMap(char *name, int *dim) -{ - FILE *fp; - unsigned char *data; - long size; - - if ((fp=fopen(name, "r")) == NULL) { - return(NULL); - } - - fseek(fp, 0, SEEK_END); - size = ftell(fp); - - /* Could do this with a lookup table, if the constraint is that the - 3 map dimensions must be equal. */ - switch (size) { - case 8*8*8*3: - *dim = 8; - break; - case 16*16*16*3: - *dim = 16; - break; - case 17*17*17*3: - *dim = 17; - break; - case 65*65*65*3: - *dim = 65; - break; - default: - fclose(fp); - return(NULL); - } - - if ((data = (unsigned char *) xalloc(sizeof(char) * size)) == NULL) { - fclose(fp); - return(NULL); - } - - fseek(fp, 0, SEEK_SET); - - if (fread(data, sizeof(char), size, fp) != (unsigned) size) { - fclose(fp); - free(data); - return(NULL); - } - - fclose(fp); - return(data); -} - -/************************************************************************ - * - * Here is the mapper. - * - ************************************************************************/ - -#define SCL(x) ((x)*(dim-1)/255) -/* Interleaved-map lookup */ -static void lookup(unsigned char *src, unsigned char *dst, int num, unsigned char *map, int dim) -{ - int i; - -#define _INTERPOLATE -#ifndef _INTERPOLATE - unsigned char *p1, *p2, *p3; - - for (i=0; i>8)) - -static void trilinear(unsigned char *p, unsigned char *out, unsigned char *d, int dim, unsigned char def) -{ -#define DENS(X, Y, Z, ch) d[((X*dim+Y)*dim+Z)*3+ch] - - int x0, y0, z0, - x1, y1, z1, - i; - unsigned char *dp, - fx, fy, fz, - d000, d001, d010, d011, - d100, d101, d110, d111, - dx00, dx01, dx10, dx11, - dxy0, dxy1; - float scale; - - scale = 255.0 / (dim-1); - - x0 = p[0] / scale; - y0 = p[1] / scale; - z0 = p[2] / scale; - - /* Fractions should range from 0-1.0 (fixed point 8-256) */ - fx = (((int) (p[0] - x0 * scale)) << 8) / 255; - fy = (((int) (p[1] - y0 * scale)) << 8) / 255; - fz = (((int) (p[2] - z0 * scale)) << 8) / 255; - - x1 = x0 + 1; - y1 = y0 + 1; - z1 = z0 + 1; - - for (i=0; i<3; i++) { - - if (x0 >= 0 && x1 < dim && - y0 >= 0 && y1 < dim && - z0 >= 0 && z1 < dim) { - dp = &DENS(x0, y0, z0, i); - d000 = dp[0]; - d100 = dp[3]; - dp += dim*3; - d010 = dp[0]; - d110 = dp[3]; - dp += dim*dim*3; - d011 = dp[0]; - d111 = dp[3]; - dp -= dim*3; - d001 = dp[0]; - d101 = dp[3]; - } else { -# define INRANGE(X, Y, Z) \ - ((X) >= 0 && (X) < dim && \ - (Y) >= 0 && (Y) < dim && \ - (Z) >= 0 && (Z) < dim) - - d000 = INRANGE(x0, y0, z0) ? DENS(x0, y0, z0, i) : def; - d001 = INRANGE(x0, y0, z1) ? DENS(x0, y0, z1, i) : def; - d010 = INRANGE(x0, y1, z0) ? DENS(x0, y1, z0, i) : def; - d011 = INRANGE(x0, y1, z1) ? DENS(x0, y1, z1, i) : def; - - d100 = INRANGE(x1, y0, z0) ? DENS(x1, y0, z0, i) : def; - d101 = INRANGE(x1, y0, z1) ? DENS(x1, y0, z1, i) : def; - d110 = INRANGE(x1, y1, z0) ? DENS(x1, y1, z0, i) : def; - d111 = INRANGE(x1, y1, z1) ? DENS(x1, y1, z1, i) : def; - } - - dx00 = LERP(fx, d000, d100); - dx01 = LERP(fx, d001, d101); - dx10 = LERP(fx, d010, d110); - dx11 = LERP(fx, d011, d111); - - dxy0 = LERP(fy, dx00, dx10); - dxy1 = LERP(fy, dx01, dx11); - - out[i] = LERP(fz, dxy0, dxy1); - } -} - diff --git a/nx-X11/programs/Xserver/Xprint/pcl/PclCursor.c b/nx-X11/programs/Xserver/Xprint/pcl/PclCursor.c deleted file mode 100644 index f50c355e9..000000000 --- a/nx-X11/programs/Xserver/Xprint/pcl/PclCursor.c +++ /dev/null @@ -1,115 +0,0 @@ -/* $Xorg: PclCursor.c,v 1.3 2000/08/17 19:48:08 cpqbld Exp $ */ -/******************************************************************* -** -** ********************************************************* -** * -** * File: PclCursor.c -** * -** * Contents: -** * Cursor-handling code for the PCL DDX driver -** * -** * Created: 1/18/96 -** * -** ********************************************************* -** -********************************************************************/ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ -/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclCursor.c,v 1.3 1999/12/16 02:26:27 robin Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include - -#include "Pcl.h" -#include "gcstruct.h" -#include "windowstr.h" - -void -PclConstrainCursor( - ScreenPtr pScreen, - BoxPtr pBox) -{ -} - -void -PclCursorLimits( - ScreenPtr pScreen, - CursorPtr pCursor, - BoxPtr pHotBox, - BoxPtr pTopLeftBox) -{ -} - -Bool -PclDisplayCursor( - ScreenPtr pScreen, - CursorPtr pCursor) -{ - return True; -} - -Bool -PclRealizeCursor( - ScreenPtr pScreen, - CursorPtr pCursor) -{ - return True; -} - -Bool -PclUnrealizeCursor( - ScreenPtr pScreen, - CursorPtr pCursor) -{ - return True; -} - -void -PclRecolorCursor( - ScreenPtr pScreen, - CursorPtr pCursor, - Bool displayed) -{ -} - -Bool -PclSetCursorPosition( - ScreenPtr pScreen, - int x, - int y, - Bool generateEvent) -{ - return True; -} diff --git a/nx-X11/programs/Xserver/Xprint/pcl/PclDef.h b/nx-X11/programs/Xserver/Xprint/pcl/PclDef.h deleted file mode 100644 index 275bd63ec..000000000 --- a/nx-X11/programs/Xserver/Xprint/pcl/PclDef.h +++ /dev/null @@ -1,68 +0,0 @@ -/* $Xorg: PclDef.h,v 1.3 2000/08/17 19:48:08 cpqbld Exp $ */ -/******************************************************************* -** -** ********************************************************* -** * -** * File: PclDef.h -** * -** * Contents: extran defines and includes for the Pcl driver -** * for a printing X server. -** * -** * Created: 7/31/95 -** * -** ********************************************************* -** -********************************************************************/ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifndef _PCLDEF_H_ -#define _PCLDEF_H_ - -#define DT_PRINT_JOB_HEADER "DT_PRINT_JOB_HEADER" -#define DT_PRINT_JOB_TRAILER "DT_PRINT_JOB_TRAILER" -#define DT_PRINT_JOB_COMMAND "DT_PRINT_JOB_COMMAND" -#define DT_PRINT_JOB_EXEC_COMMAND "DT_PRINT_JOB_EXEC_COMMAND" -#define DT_PRINT_JOB_EXEC_OPTIONS "DT_PRINT_JOB_EXEC_OPTION" -#define DT_PRINT_PAGE_HEADER "DT_PRINT_PAGE_HEADER" -#define DT_PRINT_PAGE_TRAILER "DT_PRINT_PAGE_TRAILER" -#define DT_PRINT_PAGE_COMMAND "DT_PRINT_PAGE_COMMAND" - -#define DT_IN_FILE_STRING "%(InFile)%" -#define DT_OUT_FILE_STRING "%(OutFile)%" -#define DT_ALLOWED_COMMANDS_FILE "printCommands" - -#endif /* _PCLDEF_H_ */ diff --git a/nx-X11/programs/Xserver/Xprint/pcl/PclFonts.c b/nx-X11/programs/Xserver/Xprint/pcl/PclFonts.c deleted file mode 100644 index 591435faa..000000000 --- a/nx-X11/programs/Xserver/Xprint/pcl/PclFonts.c +++ /dev/null @@ -1,74 +0,0 @@ -/* $Xorg: PclFonts.c,v 1.3 2000/08/17 19:48:08 cpqbld Exp $ */ -/******************************************************************* -** -** ********************************************************* -** * -** * File: PclFonts.c -** * -** * Contents: -** * Font code for Pcl driver. -** * -** * Created: 2/03/95 -** * -** ********************************************************* -** -********************************************************************/ -/* $XFree86$ */ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "regionstr.h" -#include -#include "dixfontstr.h" -#include "scrnintstr.h" - -#include "Pcl.h" - -Bool -PclRealizeFont( - ScreenPtr pscr, - FontPtr pFont) -{ - return TRUE; -} - -Bool -PclUnrealizeFont( - ScreenPtr pscr, - FontPtr pFont) -{ - return TRUE; -} diff --git a/nx-X11/programs/Xserver/Xprint/pcl/PclGC.c b/nx-X11/programs/Xserver/Xprint/pcl/PclGC.c deleted file mode 100644 index 83ebb47e1..000000000 --- a/nx-X11/programs/Xserver/Xprint/pcl/PclGC.c +++ /dev/null @@ -1,1046 +0,0 @@ -/* $Xorg: PclGC.c,v 1.4 2000/08/17 19:48:08 cpqbld Exp $ */ -/******************************************************************* -** -** ********************************************************* -** * -** * File: PclGC.c -** * -** * Contents: -** * Graphics Context handling for the PCL driver -** * -** * Created: 10/11/95 -** * -** ********************************************************* -** -********************************************************************/ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ -/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclGC.c,v 1.9 2001/01/19 18:34:28 dawes Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "gcstruct.h" - -#include "Pcl.h" -#include "pixmapstr.h" -#include "colormapst.h" -#include "windowstr.h" -#include "cfb.h" -#include "cfb32.h" -#include "migc.h" -#include "scrnintstr.h" -#include "resource.h" - -static GCOps PclGCOps = -{ - PclFillSpans, - PclSetSpans, - PclPutImage, - PclCopyArea, - PclCopyPlane, - PclPolyPoint, - PclPolyLine, - PclPolySegment, - PclPolyRectangle, - PclPolyArc, - PclFillPolygon, - PclPolyFillRect, - PclPolyFillArc, - PclPolyText8, - PclPolyText16, - PclImageText8, - PclImageText16, - PclImageGlyphBlt, - PclPolyGlyphBlt, - PclPushPixels -#ifdef NEED_LINEHELPER - ,NULL -#endif -} -; - - -static GCFuncs PclGCFuncs = -{ - PclValidateGC, - miChangeGC, - miCopyGC, - PclDestroyGC, - miChangeClip, - miDestroyClip, - miCopyClip, -} -; - -Bool -PclCreateGC(GCPtr pGC) -{ - if( pGC->depth == 1 ) - { - if( mfbCreateGC( pGC ) == FALSE ) - return FALSE; - } - else if( pGC->depth <= 32 ) - { -#if PSZ == 8 - if( cfbCreateGC( pGC ) == FALSE ) -#else - if( cfb32CreateGC( pGC ) == FALSE ) -#endif - return FALSE; - } - else - return FALSE; - - pGC->clientClip = NULL; - pGC->clientClipType = CT_NONE; - - pGC->ops = &PclGCOps; - pGC->funcs = &PclGCFuncs; - - return TRUE; -} - -void -PclDestroyGC(GCPtr pGC) -{ - /* Handle the mfb and cfb, which share a GC private struct */ - miDestroyGC( pGC ); -} - - -int -PclGetDrawablePrivateStuff( - DrawablePtr pDrawable, - GC *gc, - unsigned long *valid, - FILE **file) -{ - XpContextPtr pCon; - PclContextPrivPtr cPriv; - - switch( pDrawable->type ) - { - case DRAWABLE_PIXMAP: - /* - * If we ever get here, something is wrong. - */ - return FALSE; - - case DRAWABLE_WINDOW: - pCon = PclGetContextFromWindow( (WindowPtr)pDrawable ); - - if( pCon == NULL ) - return FALSE; - else - { - cPriv = pCon->devPrivates[PclContextPrivateIndex].ptr; - *gc = cPriv->lastGC; - *valid = cPriv->validGC; - *file = cPriv->pPageFile; - return TRUE; - } - - default: - return FALSE; - } -} - -void -PclSetDrawablePrivateGC( - DrawablePtr pDrawable, - GC gc) -{ - PixmapPtr pix; - XpContextPtr pCon; - PclPixmapPrivPtr pixPriv; - PclContextPrivPtr pPriv; - int i; - - switch( pDrawable->type ) - { - case DRAWABLE_PIXMAP: - pix = (PixmapPtr)pDrawable; - pixPriv = pix->devPrivates[PclPixmapPrivateIndex].ptr; - - pixPriv->lastGC = gc; - pixPriv->validGC = 1; - break; - - case DRAWABLE_WINDOW: - pCon = PclGetContextFromWindow( (WindowPtr)pDrawable ); - pPriv = ((PclContextPrivPtr) - (pCon->devPrivates[PclContextPrivateIndex].ptr)); - - pPriv->validGC = 1; - pPriv->lastGC = gc; - - /* - * Store the dash list separately, to avoid having it freed - * out from under us. - */ - if( pPriv->dash != NULL ) - xfree( pPriv->dash ); - if( gc.numInDashList != 0 ) - { - pPriv->dash = (unsigned char *)xalloc( sizeof( unsigned char ) - * gc.numInDashList ); - for( i = 0; i < gc.numInDashList; i++ ) - pPriv->dash[i] = gc.dash[i]; - } - else - pPriv->dash = NULL; - - - /* - * Store the dash list separately, to avoid having it freed - * out from under us. - */ - if( pPriv->dash != NULL ) - xfree( pPriv->dash ); - if( gc.numInDashList != 0 ) - { - pPriv->dash = (unsigned char *)xalloc( sizeof( unsigned char ) - * gc.numInDashList ); - for( i = 0; i < gc.numInDashList; i++ ) - pPriv->dash[i] = gc.dash[i]; - } - else - pPriv->dash = NULL; - - break; - } -} - -static void -PclSendPattern(char *bits, - int sz, - int depth, - int h, - int w, - int patNum, - FILE *outFile) -{ - char t[80], *row, *mod; - int w2; - int i, j; - - SEND_PCL( outFile, "\033%0A" ); - - if( depth == 1 ) - { - /* Each row must be word-aligned */ - w2 = ( w / 8 ) + ( ( w%8 ) ? 1 : 0 ); -/* - if( w2 % 2 ) - w2++; -*/ - - sprintf( t, "\033*c%dg%dW", patNum, h * w2 + 8 ); - SEND_PCL( outFile, t ); - - sprintf( t, "%c%c%c%c%c%c%c%c", 0, 0, 1, 0, h>>8, h&0xff, w>>8, - w&0xff ); - SEND_PCL_COUNT( outFile, t, 8 ); - - for( row = bits, i = 0; i < h; i++, row += BitmapBytePad( w ) ) - SEND_PCL_COUNT( outFile, row, w2 ); - } - else if( depth == 8 ) - { - w2 = ( w % 2 ) ? w + 1 : w; - - sprintf( t, "\033*c%dg%dW", patNum, h * w2 + 8 ); - SEND_PCL( outFile, t ); - - sprintf( t, "%c%c%c%c%c%c%c%c", 1, 0, 8, 0, h>>8, h&0xff, - w>>8, w&0xff ); - SEND_PCL_COUNT( outFile, t, 8 ); - - for( row = bits, i = 0; i < h; i++, - row += PixmapBytePad( w, 8 ) ) - SEND_PCL_COUNT( outFile, row, w2 ); - } - else - { - w2 = ( w % 2 ) ? w + 1 : w; - - sprintf( t, "\033*c%dg%dW", patNum, h * w2 + 8 ); - SEND_PCL( outFile, t ); - - sprintf( t, "%c%c%c%c%c%c%c%c", 1, 0, 8, 0, h>>8, h&0xff, - w>>8, w&0xff ); - SEND_PCL_COUNT( outFile, t, 8 ); - - mod = (char *)xalloc( w2 ); - - for( row = bits, i = 0; i < h; i++, - row += PixmapBytePad( w, 24 ) ) - { - char r, g, b; - for( j = 0; j < w2; j++ ) { - r = ((row[j*4+1] >> 5) & 0x7) << 5; - g = ((row[j*4+2] >> 5) & 0x7) << 2; - b = ((row[j*4+3] >> 6) & 0x3); - mod[j] = r | g | b; - } - SEND_PCL_COUNT( outFile, mod, w2 ); - } - - xfree( mod ); - } - - SEND_PCL( outFile, "\033%0B" ); -} - -int -PclUpdateDrawableGC( - GCPtr pGC, - DrawablePtr pDrawable, - FILE **outFile) -{ - Mask changeMask = 0; - GC dGC; - unsigned long valid; - int i; - XpContextPtr pCon; - PclContextPrivPtr cPriv; - PclGCPrivPtr gcPriv = (PclGCPrivPtr) - (pGC->devPrivates[PclGCPrivateIndex].ptr); - - if( !PclGetDrawablePrivateStuff( pDrawable, &dGC, &valid, outFile ) ) - return FALSE; - - pCon = PclGetContextFromWindow( (WindowPtr)pDrawable ); - cPriv = pCon->devPrivates[PclContextPrivateIndex].ptr; - - /* - * Here's where we update the colormap. Since there can be - * different colormaps installed on each window, we need to check - * before each drawing request that the correct palette is active in - * the printer. This is as good a place as any. - */ - if( !PclUpdateColormap( pDrawable, pCon, pGC, *outFile ) ) - return FALSE; - - /* - * If the drawable's last GC is NULL, this means that this is - * the first time the drawable is being used. Therefore, we need - * to emit PCL for all the GC fields. - */ - if( valid == 0 ) - changeMask = ~0; - - /* - * If we have two different GC structures, there is no alternative - * but to scan through them both to determine the changeMask. - */ - else - { - if( dGC.alu != pGC->alu ) - changeMask |= GCFunction; - if( dGC.fgPixel != pGC->fgPixel ) - changeMask |= GCForeground; - if( dGC.bgPixel != pGC->bgPixel ) - changeMask |= GCBackground; - if( dGC.lineWidth != pGC->lineWidth ) - changeMask |= GCLineWidth; - if( dGC.lineStyle != pGC->lineStyle ) - changeMask |= GCLineStyle; - if( dGC.capStyle != pGC->capStyle ) - changeMask |= GCCapStyle; - if( dGC.joinStyle != pGC->joinStyle ) - changeMask |= GCJoinStyle; - if( dGC.fillStyle != pGC->fillStyle ) - changeMask |= GCFillStyle; - if( dGC.tile.pixmap != pGC->tile.pixmap ) - changeMask |= GCTile; - if( dGC.stipple != pGC->stipple ) - changeMask |= GCStipple; - if( dGC.patOrg.x != pGC->patOrg.x ) - changeMask |= GCTileStipXOrigin; - if( dGC.patOrg.y != pGC->patOrg.y ) - changeMask |= GCTileStipYOrigin; - - if( dGC.numInDashList == pGC->numInDashList ) - { - for( i = 0; i < dGC.numInDashList; i++ ) - if( cPriv->dash[i] != pGC->dash[i] ) - { - changeMask |= GCDashList; - break; - } - } - else - changeMask |= GCDashList; - } - - /* - * Once the changeMask has been determined, we scan it and emit - * the appropriate PCL code to set the drawing attributes. - */ - - /* Must be in HP-GL/2 mode to set attributes */ - SEND_PCL( *outFile, "\033%0B" ); - - if( changeMask & GCFunction ) - { -#ifdef XP_PCL_COLOR - - if( pGC->alu == GXclear ) - SEND_PCL( *outFile, "SP0;" ); - else - SEND_PCL( *outFile, "SP1;" ); -#else - if( pGC->alu == GXclear ) - SEND_PCL( *outFile, "SP0;" ); - else - SEND_PCL( *outFile, "SP1;" ); -#endif /* XP_PCL_COLOR */ - } - -#if 0 - if( changeMask & GCFunction ) - { - int rop = -1; - char t[10]; - - switch( pGC->alu ) - { - case GXclear: - rop = 1; - break; - case GXand: - rop = 136; - break; - case GXandReverse: - rop = 68; - break; - case GXcopy: - rop = 204; - break; - case GXandInverted: - rop = 34; - break; - case GXnoop: - rop = 170; - break; - case GXxor: - rop = 238; - break; - case GXor: - rop = 238; - break; - case GXnor: - rop = 17; - break; - case GXequiv: - rop = 153; - break; - case GXinvert: - rop = 85; - break; - case GXorReverse: - rop = 221; - break; - case GXcopyInverted: - rop = 51; - break; - case GXorInverted: - rop = 187; - break; - case GXnand: - rop = 119; - break; - case GXset: - rop = 0; - break; - } - if( rop != -1 ) - { - sprintf( t, "MC1,%d;", rop ); - SEND_PCL( *outFile, t ); -#endif - - if( changeMask & GCForeground ) - switch( pGC->fgPixel ) - { - case 1: - SEND_PCL( *outFile, "SP1;" ); - break; - default: - SEND_PCL( *outFile, "SP0;" ); - break; - } - - if( changeMask & GCForeground ) - { -#ifdef XP_PCL_COLOR - ColormapPtr cmap; - Colormap c; - char t[40]; - - c = wColormap( ((WindowPtr)pDrawable) ); - cmap = (ColormapPtr)LookupIDByType( c, RT_COLORMAP ); - - if( cmap->class == TrueColor ) - { - if( pGC->fillStyle != FillTiled || pGC->tileIsPixel ) { - unsigned short r, g, b; - - r = (pGC->fgPixel & cmap->pVisual->redMask) - >> (cmap->pVisual->offsetRed ); - g = (pGC->fgPixel & cmap->pVisual->greenMask) - >> (cmap->pVisual->offsetGreen); - b = (pGC->fgPixel & cmap->pVisual->blueMask) - >> (cmap->pVisual->offsetBlue); - - PclLookUp(cmap, cPriv, &r, &g, &b); - sprintf( t, "\033%%0A\033*v%ua%ub%uc0I\033%%0B", r, g, b); - SEND_PCL( *outFile, t ); - } - } - else /* PseudoColor or StaticGray */ - { - sprintf( t, "SP%ld;", (long) pGC->fgPixel ); - SEND_PCL( *outFile, t ); - } -#else - ScreenPtr screen; - screen = pDrawable->pScreen; - if ( pGC->fgPixel == screen->whitePixel ) - SEND_PCL( *outFile, "SP0;"); - else - SEND_PCL( *outFile, "SP1;"); -#endif /* XP_PCL_COLOR */ - } - - if( changeMask & GCJoinStyle ) - switch( pGC->joinStyle ) - { - case JoinMiter: - SEND_PCL( *outFile, "LA2,1;" ); - break; - case JoinRound: - SEND_PCL( *outFile, "LA2,4;" ); - break; - case JoinBevel: - SEND_PCL( *outFile, "LA2,5;" ); - break; - } - - if( changeMask & GCCapStyle ) - switch( pGC->capStyle ) - { - case CapNotLast: - case CapButt: - SEND_PCL( *outFile, "LA1,1;" ); - break; - case CapRound: - SEND_PCL( *outFile, "LA1,4;" ); - break; - case CapProjecting: - SEND_PCL( *outFile, "LA1,2;" ); - break; - } - - if( changeMask & GCLineWidth ) - { - float penWidth, pixelsPerMM; - ScreenPtr screen; - char temp[30]; - - if( pGC->lineWidth == 0 || pGC->lineWidth == 1 ) - /* A pen width of 0.0 mm gives a one-pixel-wide line */ - penWidth = 0.0; - else - { - screen = pDrawable->pScreen; - pixelsPerMM = (float)screen->width / (float)screen->mmWidth; - - penWidth = pGC->lineWidth / pixelsPerMM; - } - sprintf( temp, "PW%g;", penWidth ); - SEND_PCL( *outFile, temp ); - } - - if( changeMask & GCLineStyle ) - { - int i, num = pGC->numInDashList; - double total; - char t[30]; - - switch( pGC->lineStyle ) - { - case LineSolid: - SEND_PCL( *outFile, "LT;" ); - break; - case LineOnOffDash: - /* - * Calculate the pattern length of the dashes, in pixels, - * then convert to mm - */ - for( i = 0, total = 0.0; i < 20 && i < num; i++ ) - total += pGC->dash[i]; - if( num % 2 ) - for( i = num; i < 20 && i < num + num; i++ ) - total += pGC->dash[i-num]; - - total *= ( (double)pDrawable->pScreen->mmWidth / - (double)pDrawable->pScreen->width ); - - sprintf( t, "LT8,%f,1;", total ); - SEND_PCL( *outFile, t ); - break; - } - } - - - if( changeMask & GCFillStyle ) - switch( pGC->fillStyle ) - { - case FillSolid: - SEND_PCL( *outFile, "FT1;TR0;CF;" ); - break; - case FillTiled: - SEND_PCL( *outFile, "FT22,100;TR0;CF2,0;" ); - break; - case FillOpaqueStippled: - SEND_PCL( *outFile, "FT22,101;TR0;CF2,0;" ); - if( pGC->fgPixel != gcPriv->stippleFg || - pGC->bgPixel != gcPriv->stippleBg ) - changeMask |= GCStipple; - break; - case FillStippled: - SEND_PCL( *outFile, "FT22,102;TR1;CF2,0;" ); - break; - } - - if( changeMask & GCTile && !pGC->tileIsPixel ) - { - char *bits; - int h, w, sz; - - h = pGC->tile.pixmap->drawable.height; - w = pGC->tile.pixmap->drawable.width; - - if( pGC->tile.pixmap->drawable.depth == 1 ) - { - sz = h * BitmapBytePad( w ); - - bits = (char *)xalloc( sz ); - mfbGetImage(&(pGC->tile.pixmap->drawable), 0, 0, w, h, XYPixmap, ~0, bits); - PclSendPattern( bits, sz, 1, h, w, 100, *outFile ); - xfree( bits ); - } - else if( pGC->tile.pixmap->drawable.depth == 8 ) - { - sz = h * PixmapBytePad( w, 8 ); - bits = (char *)xalloc( sz ); - cfbGetImage(&(pGC->tile.pixmap->drawable), 0, 0, w, h, ZPixmap, ~0, bits); - PclSendPattern( bits, sz, 8, h, w, 100, *outFile ); - xfree( bits ); - } -#if PSZ == 32 - else - { - sz = h * PixmapBytePad( w, 24 ); - - bits = (char *)xalloc( sz ); - cfb32GetImage(&(pGC->tile.pixmap->drawable), 0, 0, w, h, ZPixmap, ~0, bits); - PclSendPattern( bits, sz, 24, h, w, 100, *outFile ); - xfree( bits ); - } -#endif - } - - if( changeMask & ( GCTileStipXOrigin | GCTileStipYOrigin ) ) - { - char t[30]; - - sprintf( t, "AC%d,%d;", pGC->patOrg.x, pGC->patOrg.y ); - SEND_PCL( *outFile, t ); - } - - /* - * We have to resend the stipple pattern either when the stipple itself - * changes, or if we're in FillOpaqueStippled mode and either the - * foreground or the background color changes. - */ - if( changeMask & GCStipple || - ( pGC->fillStyle == FillOpaqueStippled && - ( pGC->fgPixel != gcPriv->stippleFg || - pGC->bgPixel != gcPriv->stippleBg ) ) ) - { - int h, w, i, sz, w2; - char *bits, *row, t[30]; - PixmapPtr scratchPix; - GCPtr scratchGC; - - if( pGC->stipple != NULL ) - { - SEND_PCL( *outFile, "\033%0A" ); - - h = pGC->stipple->drawable.height; - w = pGC->stipple->drawable.width; - sz = h * BitmapBytePad( w ); - - bits = (char *)xalloc( sz ); - mfbGetImage( &(pGC->stipple->drawable), 0, 0, w, h, XYPixmap, ~0, bits ); - - w2 = ( w / 8 ) + ( ( w%8 ) ? 1 : 0 ); - /* - * XXX The PCL docs say that I need to word-align each - * XXX row, but I get garbage when I do... - */ - /* - if( w2 % 2 ) - w2++; - */ - - sprintf( t, "\033*c102g%dW", h * w2 + 8 ); - SEND_PCL( *outFile, t ); - - sprintf( t, "%c%c%c%c%c%c%c%c", 0, 0, 1, 0, h>>8, h&0xff, w>>8, - w&0xff ); - SEND_PCL_COUNT( *outFile, t, 8 ); - - for( row = bits, i = 0; i < h; i++, row += BitmapBytePad( w ) ) - SEND_PCL_COUNT( *outFile, row, w2 ); - - SEND_PCL( *outFile, "\033%0B" ); - - xfree( bits ); - - /* - * Also do the opaque stipple, as a tile - */ - if( pGC->depth != 1 ) - sz = h * PixmapBytePad( w, pGC->depth ); - bits = (char *)xalloc( sz ); - - scratchPix = - (*pGC->pScreen->CreatePixmap)( pGC->pScreen, - w, h, pGC->depth ); - scratchGC = GetScratchGC( pGC->depth, pGC->pScreen ); - CopyGC( pGC, scratchGC, ~0L ); - - if( pGC->depth == 1 ) - { - mfbValidateGC( scratchGC, ~0L, - (DrawablePtr)scratchPix ); - mfbCopyPlane( &(pGC->stipple->drawable), - (DrawablePtr)scratchPix, scratchGC, 0, - 0, w, h, 0, 0, 1 ); - mfbGetImage( &(scratchPix->drawable), 0, 0, w, h, XYPixmap, ~0, - bits ); - } - else if( pGC->depth <= 32 ) - { -#if PSZ == 8 - cfbValidateGC( scratchGC, ~0L, - (DrawablePtr)scratchPix ); - cfbCopyPlane( &(pGC->stipple->drawable), - (DrawablePtr)scratchPix, scratchGC, 0, - 0, w, h, 0, 0, 1 ); - cfbGetImage( &(scratchPix->drawable), 0, 0, w, h, ZPixmap, ~0, - bits ); -#else - cfb32ValidateGC( scratchGC, ~0L, - (DrawablePtr)scratchPix ); - cfb32CopyPlane( pGC->stipple, - (DrawablePtr)scratchPix, scratchGC, 0, - 0, w, h, 0, 0, 1 ); - cfb32GetImage( scratchPix, 0, 0, w, h, ZPixmap, ~0, - bits ); -#endif - } - PclSendPattern( bits, sz, pGC->depth, h, w, 101, *outFile ); - FreeScratchGC( scratchGC ); - (*pGC->pScreen->DestroyPixmap)( scratchPix ); - xfree( bits ); - } - } - - if( changeMask & ( GCTileStipXOrigin | GCTileStipYOrigin ) ) - { - char t[30]; - - sprintf( t, "AC%d,%d;", pGC->patOrg.x, pGC->patOrg.y ); - SEND_PCL( *outFile, t ); - } - - if( changeMask & GCDashList ) - { - int num = pGC->numInDashList; - double total; - char dashes[20]; - char t[100], t2[20]; - - /* Make up the doubled dash list, if necessary */ - for( i = 0; i < 20 && i < num; i++ ) - dashes[i] = pGC->dash[i]; - - if( num % 2 ) - { - for( i = num; i < 20 && i < num + num; i++ ) - dashes[i] = dashes[i-num]; - if( ( num *= 2 ) > 20 ) - num = 20; - } - - /* Add up dash lengths to get percentage */ - for( i = 0, total = 0; i < num; i++ ) - total += dashes[i]; - - /* Build up the HP-GL/2 for the dash list */ - strcpy( t, "UL8" ); - for( i = 0; i < num; i++ ) - { - sprintf( t2, ",%d", - (int)( ( (double)dashes[i] / total * 100.0 ) + 0.5 ) ); - strcat( t, t2 ); - } - strcat( t, ";" ); - SEND_PCL( *outFile, t ); - } - - - /* Go back to PCL mode */ - SEND_PCL( *outFile, "\033%0A" ); - - /* - * Update the drawable's private information, which includes - * erasing the drawable's private changeMask, since all the - * changes have been made. - */ - if( changeMask ) - PclSetDrawablePrivateGC( pDrawable, *pGC ); - - return TRUE; -} - -/* - * PclComputeCompositeClip() - * - * I'd like to use the miComputeCompositeClip function, but it sticks - * things into the mi GC privates, where the PCL driver can't get at - * it. So, rather than mess around with the mi code, I ripped it out - * and made the appropriate changes here. - */ - - -void -PclComputeCompositeClip( - GCPtr pGC, - DrawablePtr pDrawable) -{ - if (pDrawable->type == DRAWABLE_WINDOW) - { - WindowPtr pWin = (WindowPtr) pDrawable; - RegionPtr pregWin; - Bool freeTmpClip, freeCompClip; - - if (pGC->subWindowMode == IncludeInferiors) - { - pregWin = NotClippedByChildren(pWin); - freeTmpClip = TRUE; - } - else - { - pregWin = &pWin->clipList; - freeTmpClip = FALSE; - } - freeCompClip = pGC->freeCompClip; - - /* - * if there is no client clip, we can get by with just keeping the - * pointer we got, and remembering whether or not should destroy (or - * maybe re-use) it later. this way, we avoid unnecessary copying of - * regions. (this wins especially if many clients clip by children - * and have no client clip.) - */ - if (pGC->clientClipType == CT_NONE) - { - if (freeCompClip) - REGION_DESTROY(pGC->pScreen, pGC->pCompositeClip); - pGC->pCompositeClip = pregWin; - pGC->freeCompClip = freeTmpClip; - } - else - { - /* - * we need one 'real' region to put into the composite clip. if - * pregWin the current composite clip are real, we can get rid of - * one. if pregWin is real and the current composite clip isn't, - * use pregWin for the composite clip. if the current composite - * clip is real and pregWin isn't, use the current composite - * clip. if neither is real, create a new region. - */ - - REGION_TRANSLATE(pGC->pScreen, pGC->clientClip, - pDrawable->x + pGC->clipOrg.x, - pDrawable->y + pGC->clipOrg.y); - - if (freeCompClip) - { - REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip, - pregWin, pGC->clientClip); - if (freeTmpClip) - REGION_DESTROY(pGC->pScreen, pregWin); - } - else if (freeTmpClip) - { - REGION_INTERSECT(pGC->pScreen, pregWin, pregWin, - pGC->clientClip); - pGC->pCompositeClip = pregWin; - } - else - { - pGC->pCompositeClip = REGION_CREATE(pGC->pScreen, NullBox, 0); - REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip, - pregWin, pGC->clientClip); - } - pGC->freeCompClip = TRUE; - REGION_TRANSLATE(pGC->pScreen, pGC->clientClip, - -(pDrawable->x + pGC->clipOrg.x), - -(pDrawable->y + pGC->clipOrg.y)); - } - } /* end of composite clip for a window */ - else - { - BoxRec pixbounds; - - /* XXX should we translate by drawable.x/y here ? */ - pixbounds.x1 = 0; - pixbounds.y1 = 0; - pixbounds.x2 = pDrawable->width; - pixbounds.y2 = pDrawable->height; - - if (pGC->freeCompClip) - { - REGION_RESET(pGC->pScreen, pGC->pCompositeClip, &pixbounds); - } - else - { - pGC->freeCompClip = TRUE; - pGC->pCompositeClip = REGION_CREATE(pGC->pScreen, &pixbounds, 1); - } - - if (pGC->clientClipType == CT_REGION) - { - REGION_TRANSLATE(pGC->pScreen, pGC->pCompositeClip, - -pGC->clipOrg.x, -pGC->clipOrg.y); - REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip, - pGC->pCompositeClip, pGC->clientClip); - REGION_TRANSLATE(pGC->pScreen, pGC->pCompositeClip, - pGC->clipOrg.x, pGC->clipOrg.y); - } - } /* end of composite clip for pixmap */ -} - -/* - * PclValidateGC() - * - * Unlike many screen GCValidate routines, this function should not need - * to mess with setting the drawing functions. Different drawing - * functions are usually needed to optimize such things as drawing - * wide or dashed lines; this functionality will be handled primarily - * by the printer itself, while the necessary PCL code to set the - * attributes will be done in PclUpdateDrawableGC(). - */ - -/*ARGSUSED*/ -void -PclValidateGC( - GCPtr pGC, - unsigned long changes, - DrawablePtr pDrawable) -{ - /* - * Pixmaps should be handled by their respective validation - * functions. - */ - if( pDrawable->type == DRAWABLE_PIXMAP ) - { - if( pDrawable->depth == 1 ) - { - mfbValidateGC( pGC, ~0, pDrawable ); - } - else if( pDrawable->depth <= 32 ) - { -#if PSZ == 8 - cfbValidateGC( pGC, ~0, pDrawable ); -#else - cfb32ValidateGC( pGC, ~0, pDrawable ); -#endif - } - return; - } - - /* - * Reset the drawing operations - */ - pGC->ops = &PclGCOps; - - /* - * Validate the information, and correct it if necessary. - */ - - /* - * If necessary, compute the composite clip region. (Code ripped - * from migc.c) - */ - if ((changes & (GCClipXOrigin|GCClipYOrigin|GCClipMask|GCSubwindowMode)) || - (pDrawable->serialNumber != (pGC->serialNumber & DRAWABLE_SERIAL_BITS)) - ) - { - PclComputeCompositeClip(pGC, pDrawable); - } - - /* - * PCL does not directly support the DoubleDash line style, nor is - * there an easy way to simulate it, so we'll just change it to a - * LineOnOffDash, which is supported by PCL. - */ - if( ( changes & GCLineStyle ) && ( pGC->lineStyle == LineDoubleDash ) ) - pGC->lineStyle = LineOnOffDash; - - /* - * Update the drawable's changeMask to reflect the changes made to the GC. - */ -/* - PclSetDrawablePrivateGC( pDrawable, *pGC, changes ); -*/ -} diff --git a/nx-X11/programs/Xserver/Xprint/pcl/PclInit.c b/nx-X11/programs/Xserver/Xprint/pcl/PclInit.c deleted file mode 100644 index 8bedee7c3..000000000 --- a/nx-X11/programs/Xserver/Xprint/pcl/PclInit.c +++ /dev/null @@ -1,631 +0,0 @@ -/* $Xorg: PclInit.c,v 1.3 2000/08/17 19:48:08 cpqbld Exp $ */ -/******************************************************************* -** -** ********************************************************* -** * -** * File: PclInit.c -** * -** * Contents: -** * Initialization code of Pcl driver for the print server. -** * -** * Created: 1/30/95 -** * -** ********************************************************* -** -********************************************************************/ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ - -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ -/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclInit.c,v 1.11 2001/12/21 21:02:05 dawes Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include -#include - -#include "Pcl.h" - -#include "cfb.h" -#include /* for unlink() */ - -#include "attributes.h" -#include "DiPrint.h" - -#define MODELDIRNAME "/models" - -static void AllocatePclPrivates(ScreenPtr pScreen); -static int PclInitContext(XpContextPtr pCon); -static Bool PclDestroyContext(XpContextPtr pCon); - -int PclScreenPrivateIndex; -int PclContextPrivateIndex; -int PclPixmapPrivateIndex; -int PclWindowPrivateIndex; -int PclGCPrivateIndex; - -#ifdef XP_PCL_COLOR -/* - * The supported visuals on this screen - */ -static VisualRec Visuals[] = -{ - { 1, StaticGray, 1, 2, 1, 0, 0, 0, 0, 0, 0 }, - { 2, PseudoColor, 8, 256, 8, 0, 0, 0, 0, 0, 0 }, - { 3, TrueColor, 8, 256, 24, 0xFF0000, 0xFF00, 0xFF, 16, 8, 0 } -}; - -/* - * The supported depths on this screen - */ -static DepthRec Depths[] = -{ - { 1, 1, NULL }, - { 8, 1, NULL }, - { 24, 1, NULL } -}; -#else -/* - * The supported visuals on this screen - */ -static VisualRec Visuals[] = -{ - { 1, StaticGray, 1, 2, 1, 0, 0, 0, 0, 0, 0} -}; - -/* - * The supported depths on this screen - */ -static DepthRec Depths[] = -{ - { 1, 1, NULL } -}; -#endif /* XP_PCL_COLOR */ - - -#define NUM_VISUALS(visuals) (sizeof(visuals) / sizeof(VisualRec)) -#define NUM_DEPTHS(depths) (sizeof(depths) / sizeof(DepthRec)) - -Bool -PclCloseScreen(int index, - ScreenPtr pScreen) -{ - PclScreenPrivPtr pPriv = pScreen->devPrivates[PclScreenPrivateIndex].ptr; - - pScreen->CloseScreen = pPriv->CloseScreen; - xfree( pPriv ); - - return (*pScreen->CloseScreen)(index, pScreen); -} - -Bool -InitializePclDriver( - int ndx, - ScreenPtr pScreen, - int argc, - char **argv) -{ - int maxRes, xRes, yRes, maxDim; - unsigned i; - PclScreenPrivPtr pPriv; - - /* - * Register this driver's InitContext function with the print - * extension. This is a bit sleazy, as the extension hasn't yet - * been initialized, but the extensionneeds to know this, and this - * seems the best time to provide the information. - */ -#ifdef XP_PCL_COLOR - XpRegisterInitFunc( pScreen, "XP-PCL-COLOR", PclInitContext ); -#elif XP_PCL_MONO - XpRegisterInitFunc( pScreen, "XP-PCL-MONO", PclInitContext ); -#else - XpRegisterInitFunc( pScreen, "XP-PCL-LJ3", PclInitContext ); -#endif /* XP_PCL_MONO */ - - /* - * Create and fill in the devPrivate for the PCL driver. - */ - AllocatePclPrivates(pScreen); - - pPriv = - (PclScreenPrivPtr)pScreen->devPrivates[PclScreenPrivateIndex].ptr; - - maxDim = MAX( pScreen->height, pScreen->width ); - xRes = pScreen->width / ( pScreen->mmWidth / 25.4 ); - yRes = pScreen->height / ( pScreen->mmHeight / 25.4 ); - maxRes = MAX( xRes, yRes ); - -#ifdef XP_PCL_COLOR - cfbScreenInit( pScreen, NULL, maxDim, maxDim, maxRes, maxRes, - maxRes ); - /* - * Clean up the fields that we stomp (code taken from cfbCloseScreen) - */ - for( i = 0; (int) i < pScreen->numDepths; i++ ) - xfree( pScreen->allowedDepths[i].vids ); - xfree( pScreen->allowedDepths ); - xfree( pScreen->visuals ); -#else - mfbScreenInit( pScreen, NULL, maxDim, maxDim, maxRes, maxRes, - maxRes ); -#endif /* XP_PCL_COLOR */ - - miInitializeBackingStore ( pScreen ); - - pScreen->defColormap = FakeClientID(0); - pScreen->blackPixel = 1; - pScreen->whitePixel = 0; - - pPriv->CloseScreen = pScreen->CloseScreen; - pScreen->CloseScreen = PclCloseScreen; - - pScreen->QueryBestSize = (QueryBestSizeProcPtr)PclQueryBestSize; - pScreen->SaveScreen = (SaveScreenProcPtr)_XpBoolNoop; - pScreen->GetImage = (GetImageProcPtr)_XpVoidNoop; - pScreen->GetSpans = (GetSpansProcPtr)_XpVoidNoop; - pScreen->CreateWindow = PclCreateWindow; - pScreen->DestroyWindow = PclDestroyWindow; -/* - pScreen->PositionWindow = PclPositionWindow; -*/ - pScreen->ChangeWindowAttributes = PclChangeWindowAttributes; -/* - pScreen->RealizeWindow = PclMapWindow; - pScreen->UnrealizeWindow = PclUnmapWindow; -*/ - pScreen->PaintWindowBackground = PclPaintWindow; - pScreen->PaintWindowBorder = PclPaintWindow; - pScreen->CopyWindow = PclCopyWindow; /* XXX Hard routine to write! */ - - pScreen->CreatePixmap = PclCreatePixmap; - pScreen->DestroyPixmap = PclDestroyPixmap; - pScreen->RealizeFont = PclRealizeFont; - pScreen->UnrealizeFont = PclUnrealizeFont; - pScreen->CreateGC = PclCreateGC; - - pScreen->CreateColormap = PclCreateColormap; - pScreen->DestroyColormap = PclDestroyColormap; - pScreen->InstallColormap = (InstallColormapProcPtr)NoopDDA; - pScreen->UninstallColormap = (UninstallColormapProcPtr)NoopDDA; - pScreen->ListInstalledColormaps = PclListInstalledColormaps; - pScreen->StoreColors = PclStoreColors; -/* - pScreen->ResolveColor = PclResolveColor; -*/ - - pScreen->BitmapToRegion = mfbPixmapToRegion; - - pScreen->ConstrainCursor = PclConstrainCursor; - pScreen->CursorLimits = PclCursorLimits; - pScreen->DisplayCursor = PclDisplayCursor; - pScreen->RealizeCursor = PclRealizeCursor; - pScreen->UnrealizeCursor = PclUnrealizeCursor; - pScreen->RecolorCursor = PclRecolorCursor; - pScreen->SetCursorPosition = PclSetCursorPosition; - - pScreen->visuals = Visuals; - pScreen->numVisuals = NUM_VISUALS( Visuals ); - pScreen->allowedDepths = Depths; - pScreen->numDepths = NUM_DEPTHS( Depths ); - - for( i = 0; i < NUM_DEPTHS( Depths ); i++ ) - { - pScreen->allowedDepths[i].vids = - (VisualID *)xalloc( sizeof(VisualID ) ); - pScreen->allowedDepths[i].vids[0] = i + 1; - } - -#ifdef XP_PCL_COLOR - pScreen->rootVisual = 2; - pScreen->rootDepth = 8; -#else - pScreen->rootVisual = 1; - pScreen->rootDepth = 1; -#endif /* XP_PCL_COLOR */ - - pPriv->colormaps = NULL; - PclCreateDefColormap( pScreen ); - - return TRUE; -} - -static void -AllocatePclPrivates(ScreenPtr pScreen) -{ - static unsigned long PclGeneration = 0; - - if((unsigned long) PclGeneration != serverGeneration) - { - PclScreenPrivateIndex = AllocateScreenPrivateIndex(); - - PclWindowPrivateIndex = AllocateWindowPrivateIndex(); - AllocateWindowPrivate( pScreen, PclWindowPrivateIndex, - sizeof( PclWindowPrivRec ) ); - - PclContextPrivateIndex = XpAllocateContextPrivateIndex(); - XpAllocateContextPrivate( PclContextPrivateIndex, - sizeof( PclContextPrivRec ) ); - - PclGCPrivateIndex = AllocateGCPrivateIndex(); - AllocateGCPrivate( pScreen, PclGCPrivateIndex, - sizeof( PclGCPrivRec ) ); - - PclPixmapPrivateIndex = AllocatePixmapPrivateIndex(); - AllocatePixmapPrivate( pScreen, PclPixmapPrivateIndex, - sizeof( PclPixmapPrivRec ) ); - - PclGeneration = serverGeneration; - } - - pScreen->devPrivates[PclScreenPrivateIndex].ptr = (pointer)xalloc( - sizeof(PclScreenPrivRec)); -} - -/* - * PclInitContext - * - * Establish the appropriate values for a PrintContext used with the PCL - * driver. - */ - -static char DOC_ATT_SUPP[]="document-attributes-supported"; -static char DOC_ATT_VAL[]="document-format xp-listfonts-modes"; -static char JOB_ATT_SUPP[]="job-attributes-supported"; -static char JOB_ATT_VAL[]=""; -static char PAGE_ATT_SUPP[]="xp-page-attributes-supported"; -static char PAGE_ATT_VAL[]="content-orientation default-printer-resolution \ -default-input-tray default-medium plex xp-listfonts-modes"; - -static int -PclInitContext(XpContextPtr pCon) -{ - XpDriverFuncsPtr pFuncs; - PclContextPrivPtr pConPriv; - char *server, *attrStr; - char *modelID; - char *configDir; - char *pathName; - int i, j; - float width, height; - XpOidMediumDiscreteSizeList* ds_list; - XpOidArea* repro; - XpOid page_size; - XpOidMediumSS* m; - - /* - * Initialize the attribute store for this printer. - */ - XpInitAttributes( pCon ); - - /* - * Initialize the function pointers - */ - pFuncs = &( pCon->funcs ); - pFuncs->StartJob = PclStartJob; - pFuncs->EndJob = PclEndJob; - pFuncs->StartDoc = PclStartDoc; - pFuncs->EndDoc = PclEndDoc; - pFuncs->StartPage = PclStartPage; - pFuncs->EndPage = PclEndPage; - pFuncs->PutDocumentData = PclDocumentData; - pFuncs->GetDocumentData = PclGetDocumentData; - pFuncs->GetAttributes = PclGetAttributes; - pFuncs->SetAttributes = PclSetAttributes; - pFuncs->AugmentAttributes = PclAugmentAttributes; - pFuncs->GetOneAttribute = PclGetOneAttribute; - pFuncs->DestroyContext = PclDestroyContext; - pFuncs->GetMediumDimensions = PclGetMediumDimensions; - pFuncs->GetReproducibleArea = PclGetReproducibleArea; - - - /* - * Set up the context privates - */ - pConPriv = - (PclContextPrivPtr)pCon->devPrivates[PclContextPrivateIndex].ptr; - - pConPriv->jobFileName = (char *)NULL; - pConPriv->pageFileName = (char *)NULL; - pConPriv->pJobFile = (FILE *)NULL; - pConPriv->pPageFile = (FILE *)NULL; - pConPriv->dash = NULL; - pConPriv->validGC = 0; - - pConPriv->getDocClient = (ClientPtr)NULL; - pConPriv->getDocBufSize = 0; - modelID = XpGetOneAttribute(pCon, XPPrinterAttr, "xp-model-identifier"); - if ( (configDir = XpGetConfigDir(False)) != (char *) NULL ) { - pathName = (char *)xalloc(strlen(configDir) + strlen(MODELDIRNAME) + - strlen(modelID) + strlen("color.map") + 4); - if (pathName) { - sprintf(pathName, "%s/%s/%s/%s", configDir, MODELDIRNAME, modelID, - "color.map"); - pConPriv->ctbl = PclReadMap(pathName, &pConPriv->ctbldim); - xfree(pathName); - - } else - pConPriv->ctbl = NULL; - } else - pConPriv->ctbl = NULL; - -#ifdef XP_PCL_LJ3 - /* - * Initialize the spooling buffer for saving the figures temporary - * (LaserJet IIIs printers don't support the macro function which - * includes some HP-GL/2 commands.) - */ - pConPriv->fcount = 0; - if ( !(pConPriv->figures = (char *)xalloc(1024)) ) - pConPriv->fcount_max = 0; - else - pConPriv->fcount_max = 1024; -#endif /* XP_PCL_LJ3 */ - - /* - * document-attributes-supported - */ - server = XpGetOneAttribute( pCon, XPServerAttr, DOC_ATT_SUPP ); - if( ( attrStr = (char *)xalloc(strlen(server) + strlen(DOC_ATT_SUPP) - + strlen(DOC_ATT_VAL) + - strlen(PAGE_ATT_VAL) + 8 ) ) - == (char *)NULL ) - return BadAlloc; - sprintf( attrStr, "*%s:\t%s %s %s", DOC_ATT_SUPP, server, - DOC_ATT_VAL, PAGE_ATT_VAL ); - XpAugmentAttributes( pCon, XPPrinterAttr, attrStr ); - xfree( attrStr ); - - /* - * job-attributes-supported - */ - server = XpGetOneAttribute( pCon, XPServerAttr, JOB_ATT_SUPP ); - if( ( attrStr = (char *)xalloc(strlen(server) + strlen(JOB_ATT_SUPP) - + strlen(JOB_ATT_VAL) + 8 ) ) - == (char *)NULL ) - return BadAlloc; - sprintf( attrStr, "*%s:\t%s %s", JOB_ATT_SUPP, server, JOB_ATT_VAL ); - XpAugmentAttributes( pCon, XPPrinterAttr, attrStr ); - xfree( attrStr ); - - /* - * xp-page-attributes-supported - */ - server = XpGetOneAttribute( pCon, XPServerAttr, PAGE_ATT_SUPP ); - if( ( attrStr = (char *)xalloc(strlen(server) + strlen(PAGE_ATT_SUPP) - + strlen(PAGE_ATT_VAL) + 8 ) ) - == (char *)NULL ) - return BadAlloc; - sprintf( attrStr, "*%s:\t%s %s", PAGE_ATT_SUPP, server, PAGE_ATT_VAL ); - XpAugmentAttributes( pCon, XPPrinterAttr, attrStr ); - xfree( attrStr ); - - /* - * Validate the attribute pools - */ - XpValidateAttributePool( pCon, XPPrinterAttr, &PclValidatePoolsRec ); - - /* - * Munge the reproducible areas to reflect the fact that PCL will not let - * me move the right or left margins closer than .25" to the edge of the - * paper. - */ - m = XpGetMediumSSAttr( pCon, XPPrinterAttr, - xpoid_att_medium_source_sizes_supported, - (const XpOidList*) NULL, - (const XpOidList*) NULL ); - for( i = 0; i < XpOidMediumSSCount( m ); i++ ) - { - if( XpOidMediumSS_DISCRETE == (m->mss)[i].mstag ) - { - ds_list = (m->mss)[i].ms.discrete; - for( j = 0; j < ds_list->count; j++ ) - { - repro = &(ds_list->list)[j].assured_reproduction_area; - page_size = (ds_list->list)[j].page_size; - XpGetMediumMillimeters( page_size, &width, &height ); - - if( repro->minimum_x < 6.35 ) - repro->minimum_x = 6.35; - if( width - repro->maximum_x < 6.35 ) - repro->maximum_x = width - 6.35; - } - } - } - XpPutMediumSSAttr( pCon, XPPrinterAttr, - xpoid_att_medium_source_sizes_supported, m ); - XpOidMediumSSDelete( m ); - - /* - * Finish validating the attribute pools - */ - - XpValidateAttributePool( pCon, XPDocAttr, &PclValidatePoolsRec ); - XpValidateAttributePool( pCon, XPJobAttr, &PclValidatePoolsRec ); - XpValidateAttributePool( pCon, XPPageAttr, &PclValidatePoolsRec ); - - /* - * Clear out the colormap storage - */ - pConPriv->palettes = NULL; - - return Success; -} - -static Bool -PclDestroyContext(XpContextPtr pCon) -{ - PclContextPrivPtr pConPriv = (PclContextPrivPtr) - pCon->devPrivates[PclContextPrivateIndex].ptr; - PclPaletteMapPtr p, t; - PclCmapToContexts *pCmap; - ScreenPtr screen; - PclScreenPrivPtr sPriv; - PclContextListPtr con, prevCon, temp; - - - /* - * Clean up the temporary files - */ - if( pConPriv->pPageFile != (FILE *)NULL ) - { - fclose( pConPriv->pPageFile ); - pConPriv->pPageFile = (FILE *)NULL; - } - if( pConPriv->pageFileName != (char *)NULL ) - { - unlink( pConPriv->pageFileName ); - xfree( pConPriv->pageFileName ); - pConPriv->pageFileName = (char *)NULL; - } - - if( pConPriv->pJobFile != (FILE *)NULL ) - { - fclose( pConPriv->pJobFile ); - pConPriv->pJobFile = NULL; - } - if( pConPriv->jobFileName != (char *)NULL ) - { - unlink( pConPriv->jobFileName ); - xfree( pConPriv->jobFileName ); - pConPriv->jobFileName = (char *)NULL; - } - - xfree( pConPriv->dash ); - xfree(pConPriv->ctbl); - pConPriv->ctbl = NULL; -#ifdef XP_PCL_LJ3 - xfree( pConPriv->figures ); -#endif /* XP_PCL_LJ3 */ - - /* - * Destroy the colormap<->palette mappings - */ - p = pConPriv->palettes; - while( p ) - { - t = p; - p = p->next; - xfree( t ); - } - pConPriv->palettes = NULL; - - /* - * Remove the context from the screen-level colormap<->contexts mappings - */ - screen = screenInfo.screens[pCon->screenNum]; - sPriv = (PclScreenPrivPtr)screen->devPrivates[PclScreenPrivateIndex].ptr; - pCmap = sPriv->colormaps; - while( pCmap ) - { - con = pCmap->contexts; - prevCon = NULL; - - while( con ) - { - if( con->context->contextID == pCon->contextID ) - { - if( prevCon ) - { - temp = con; - prevCon->next = con = con->next; - } - else - { - temp = pCmap->contexts; - pCmap->contexts = con = con->next; - } - xfree( temp ); - } - else - con = con->next; - } - - pCmap = pCmap->next; - } - - XpDestroyAttributes(pCon); - - return Success; -} - -XpContextPtr -PclGetContextFromWindow(WindowPtr win) -{ - PclWindowPrivPtr pPriv; - - while( win ) - { - pPriv = - (PclWindowPrivPtr)win->devPrivates[PclWindowPrivateIndex].ptr; - if( pPriv->validContext ) - return pPriv->context; - - win = win->parent; - } - - return NULL; -} diff --git a/nx-X11/programs/Xserver/Xprint/pcl/PclLine.c b/nx-X11/programs/Xserver/Xprint/pcl/PclLine.c deleted file mode 100644 index f2b564df8..000000000 --- a/nx-X11/programs/Xserver/Xprint/pcl/PclLine.c +++ /dev/null @@ -1,316 +0,0 @@ -/* $Xorg: PclLine.c,v 1.3 2000/08/17 19:48:08 cpqbld Exp $ */ -/******************************************************************* -** -** ********************************************************* -** * -** * File: PclLine.c -** * -** * Contents: -** * Line drawing routines for the PCL driver -** * -** * Created: 10/11/95 -** * -** ********************************************************* -** -********************************************************************/ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ -/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclLine.c,v 1.6 1999/12/13 02:12:55 robin Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "Pcl.h" -#include "gcstruct.h" -#include "windowstr.h" - -/* - * PclPolyLine() - * PclPolySegment() - * - * Generates PCL code to draw a polyline, or a collection of distinct - * line segments, clipped by the current clip region. Since PCL - * supports clipping to a rectangle, and the clip region is - * represented as a collection of visible rectangles, we can draw and - * clip the line by repeatedly drawing the complete line, clipped to - * each rectangle in the clip region. - * - * Since each box in the clipping region generates approximately 30 - * bytes of PCL code, we have to have a way to avoid having a large - * number of boxes. The worst problem the case where the clipping - * region is a collection of one-pixel-high boxes, perhaps arising - * from a bitmap clip mask, or a region defined by a non-rectangular - * polygon. - * - * To alleviate this problem, we create a second clipping region, - * which consists of the union of the bounding boxes of each line - * segment. (Each bounding box is also increased by some amount - * related to the current line width to allow for non-zero-width - * lines, and for the various end and join styles.) This region is - * intersected with the "real" clipping region to get the region used - * to actually clip the polyline. This should result in a significant - * reduction in the number of clip rectangles, as the region-handling - * code should consolidate many of the fragments of one-pixel-high - * rectangles into larger rectangles. - */ - -void -PclPolyLine( - DrawablePtr pDrawable, - GCPtr pGC, - int mode, - int nPoints, - xPoint *pPoints) -{ - char t[80]; - FILE *outFile; - int xoffset = 0, yoffset = 0; - int nbox; - BoxPtr pbox; - xRectangle *drawRects, *r; - RegionPtr drawRegion, region; - short fudge; - int i; - XpContextPtr pCon; - PclContextPrivPtr pConPriv; - - if( PclUpdateDrawableGC( pGC, pDrawable, &outFile ) == FALSE ) - return; - - pCon = PclGetContextFromWindow( (WindowPtr) pDrawable ); - pConPriv = (PclContextPrivPtr) - pCon->devPrivates[PclContextPrivateIndex].ptr; - - /* - * Allocate the storage required to deal with the clipping - * regions. - */ - region = REGION_CREATE( pGC->pScreen, NULL, 0 ); - drawRects = (xRectangle *) - xalloc( ( nPoints - 1 ) * sizeof( xRectangle ) ); - - /* - * Calculate the "fudge factor" based on the line width. - * Multiplying by three seems to be a good first guess. - * XXX I need to think of a way to test this. - */ - fudge = 3 * pGC->lineWidth + 1; - - /* - * Generate the PCL code to draw the polyline, by defining it as a - * macro which uses the HP-GL/2 line drawing function. - */ - - MACRO_START( outFile, pConPriv ); - SAVE_PCL( outFile, pConPriv, "\033%0B" ); - - sprintf( t, "PU%d,%dPD\n", pPoints[0].x + pDrawable->x, - pPoints[0].y + pDrawable->y ); - SAVE_PCL( outFile, pConPriv, t ); /* Move to the start of the polyline */ - - switch( mode ) - { - case CoordModeOrigin: - xoffset = pDrawable->x; - yoffset = pDrawable->y; - SAVE_PCL( outFile, pConPriv, "PA" ); - break; - case CoordModePrevious: - xoffset = yoffset = 0; - SAVE_PCL( outFile, pConPriv, "PR" ); - break; - } - - /* - * Build the "drawing region" as we build the PCL to draw the - * line. - */ - for(i = 1, r = drawRects; i < nPoints; i++, r++ ) - { - if( i != 1 ) - SAVE_PCL( outFile, pConPriv, "," ); - - sprintf( t, "%d,%d", pPoints[i].x + xoffset, - pPoints[i].y + yoffset ); - SAVE_PCL( outFile, pConPriv, t ); - - r->x = MIN( pPoints[i-1].x, pPoints[i].x ) + xoffset - fudge; - r->y = MIN( pPoints[i-1].y, pPoints[i].y ) + yoffset - fudge; - r->width = abs( pPoints[i-1].x - pPoints[i].x ) + 2 * fudge; - r->height = abs( pPoints[i-1].y - pPoints[i].y ) + 2 * fudge; - } - SAVE_PCL( outFile, pConPriv, ";\033%0A" ); /* End the macro */ - MACRO_END( outFile ); - - /* - * Convert the collection of rectangles into a proper region, then - * intersect it with the clip region. - */ - drawRegion = RECTS_TO_REGION( pGC->pScreen, nPoints - 1, - drawRects, CT_UNSORTED ); - if( mode == CoordModePrevious ) - REGION_TRANSLATE( pGC->pScreen, drawRegion, pPoints[0].x, pPoints[0].y ); - REGION_INTERSECT( pGC->pScreen, region, drawRegion, pGC->pCompositeClip ); - - /* - * For each rectangle in the clip region, set the HP-GL/2 "input - * window" and render the entire polyline to it. - */ - pbox = REGION_RECTS( region ); - nbox = REGION_NUM_RECTS( region ); - - PclSendData(outFile, pConPriv, pbox, nbox, 1.0); - - /* - * Clean up the temporary regions - */ - REGION_DESTROY( pGC->pScreen, drawRegion ); - REGION_DESTROY( pGC->pScreen, region ); - xfree( drawRects ); -} - -void -PclPolySegment( - DrawablePtr pDrawable, - GCPtr pGC, - int nSegments, - xSegment *pSegments) -{ - FILE *outFile, *dummy; - char t[80]; - int xoffset, yoffset; - int nbox, i; - unsigned long valid; - BoxPtr pbox; - xRectangle *drawRects, *r; - RegionPtr drawRegion, region; - short fudge; - XpContextPtr pCon; - PclContextPrivPtr pConPriv; - GC cacheGC; - - - if( PclUpdateDrawableGC( pGC, pDrawable, &outFile ) == FALSE ) - return; - - pCon = PclGetContextFromWindow( (WindowPtr) pDrawable ); - pConPriv = (PclContextPrivPtr) - pCon->devPrivates[PclContextPrivateIndex].ptr; - - /* - * Allocate the storage for the temporary regions. - */ - region = REGION_CREATE( pGC->pScreen, NULL, 0 ); - drawRects = (xRectangle *) - xalloc( nSegments * sizeof( xRectangle ) ); - - /* - * Calculate the fudge factor, based on the line width - */ - fudge = pGC->lineWidth * 3 + 1; - - /* - * Turn off line joining. - */ - SEND_PCL( outFile, "\033%0BLA2,6;\033%0A" ); - - /* - * Generate the PCL code to draw the segments, by defining them as - * a macro which uses the HP-GL/2 line drawing function. - * - * XXX I wonder if this should be implemented using the Encoded - * XXX Polyline function. Since I'm only sending it once, it's not - * XXX necessarily too important. - */ - - MACRO_START( outFile, pConPriv ); - SAVE_PCL( outFile, pConPriv, "\033%0B" ); - - xoffset = pDrawable->x; - yoffset = pDrawable->y; - - for( i = 0, r = drawRects; i < nSegments; i++, r++ ) - { - r->x = MIN( pSegments[i].x1, pSegments[i].x2 ) + xoffset; - r->y = MIN( pSegments[i].y1, pSegments[i].y2 ) + yoffset; - r->width = abs( pSegments[i].x1 - pSegments[i].x2 ); - r->height = abs( pSegments[i].y1 - pSegments[i].y2 ); - - sprintf( t, "PU%d,%d;PD%d,%d;", pSegments[i].x1 + xoffset, - pSegments[i].y1 + yoffset, pSegments[i].x2 + - xoffset, pSegments[i].y2 + yoffset ); - SAVE_PCL( outFile, pConPriv, t ); - - r->x -= fudge; - r->y -= fudge; - r->width += 2 * fudge; - r->height += 2 * fudge; - } - SAVE_PCL( outFile, pConPriv, "\033%0A" ); - MACRO_END ( outFile ); - - /* - * Convert the collection of rectangles into a proper region, then - * intersect it with the clip region. - */ - drawRegion = RECTS_TO_REGION( pGC->pScreen, nSegments, - drawRects, CT_UNSORTED ); - REGION_INTERSECT( pGC->pScreen, region, drawRegion, pGC->pCompositeClip ); - - /* - * For each rectangle in the clip region, set the HP-GL/2 "input - * window" and render the entire set of segments to it. - */ - pbox = REGION_RECTS( region ); - nbox = REGION_NUM_RECTS( region ); - - PclSendData(outFile, pConPriv, pbox, nbox, 1.0); - - /* - * Now we need to reset the line join mode to whatever it was at before. - * The easiest way is to force the cached GC's joinstyle to be different - * from the current GC's joinstyle, then re-update the GC. This way, we - * don't have to duplicate code unnecessarily. - */ - PclGetDrawablePrivateStuff( pDrawable, &cacheGC, &valid, &dummy ); - cacheGC.joinStyle = !cacheGC.joinStyle; - PclSetDrawablePrivateGC( pDrawable, cacheGC ); - PclUpdateDrawableGC( pGC, pDrawable, &outFile ); - - /* - * Clean up - */ - REGION_DESTROY( pGC->pScreen, drawRegion ); - REGION_DESTROY( pGC->pScreen, region ); - xfree( drawRects ); -} diff --git a/nx-X11/programs/Xserver/Xprint/pcl/PclMisc.c b/nx-X11/programs/Xserver/Xprint/pcl/PclMisc.c deleted file mode 100644 index 3a958e783..000000000 --- a/nx-X11/programs/Xserver/Xprint/pcl/PclMisc.c +++ /dev/null @@ -1,306 +0,0 @@ -/* $Xorg: PclMisc.c,v 1.3 2000/08/17 19:48:08 cpqbld Exp $ */ -/******************************************************************* -** -** ********************************************************* -** * -** * File: PclMisc.c -** * -** * Contents: -** * Miscellaneous code for Pcl driver. -** * -** * Created: 2/01/95 -** * -** ********************************************************* -** -********************************************************************/ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ -/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclMisc.c,v 1.10tsi Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include /* for SIGCLD on pre-POSIX systems */ -#include "Pcl.h" - -#include "cursor.h" -#include "resource.h" - -#include "windowstr.h" -#include "propertyst.h" -#include "attributes.h" - - -/*ARGSUSED*/ -void -PclQueryBestSize( - int type, - short *pwidth, - short *pheight, - ScreenPtr pScreen) -{ - unsigned width, highBit; - - switch(type) - { - case CursorShape: - *pwidth = 0; - *pheight = 0; - break; - case TileShape: - case StippleShape: - width = *pwidth; - if (!width) break; - /* Return the nearest power of two >= what they gave us */ - highBit = 0x80000000; - /* Find the highest 1 bit in the given width */ - while(!(highBit & width)) - highBit >>= 1; - /* If greater than that then return the next power of two */ - if((highBit - 1) & width) - highBit <<= 1; - *pwidth = highBit; - /* height is a don't-care */ - break; - } -} - -/* - * GetPropString searches the window heirarchy from pWin up looking for - * a property by the name of propName. If found, returns the property's - * value. If not, it returns NULL. - */ -char * -GetPropString( - WindowPtr pWin, - char *propName) -{ - Atom atom; - PropertyPtr pProp = (PropertyPtr)NULL; - char *retVal; - - atom = MakeAtom(propName, strlen(propName), FALSE); - if(atom != BAD_RESOURCE) - { - WindowPtr pPropWin; - int n; - - /* - * The atom has been defined, but it might only exist as a - * property on an unrelated window. - */ - for(pPropWin = pWin; pPropWin != (WindowPtr)NULL; - pPropWin = pPropWin->parent) - { - for(pProp = (PropertyPtr)(wUserProps(pPropWin)); - pProp != (PropertyPtr)NULL; - pProp = pProp->next) - { - if (pProp->propertyName == atom) - break; - } - if(pProp != (PropertyPtr)NULL) - break; - } - if(pProp == (PropertyPtr)NULL) - return (char *)NULL; - - n = (pProp->format/8) * pProp->size; /* size (bytes) of prop */ - retVal = (char *)xalloc(n + 1); - (void)memcpy((void *)retVal, (void *)pProp->data, n); - retVal[n] = '\0'; - - return retVal; - } - - return (char *)NULL; -} - -#include -#include - -/* ARGSUSED */ -static void SigchldHndlr ( - int dummy) -{ - int status; - int olderrno = errno; - struct sigaction act; - sigfillset(&act.sa_mask); - act.sa_flags = 0; - act.sa_handler = SigchldHndlr; - - (void) wait (&status); - - /* - * Is this really necessary? - */ - sigaction(SIGCHLD, &act, (struct sigaction *)NULL); - errno = olderrno; -} - -/* - * SystemCmd provides a wrapper for the 'system' library call. The call - * appears to be sensitive to the handling of SIGCHLD, so this wrapper - * sets the status to SIG_DFL, and then resets the established handler - * after system returns. - */ -int -SystemCmd(char *cmdStr) -{ - int status; - struct sigaction newAct, oldAct; - sigfillset(&newAct.sa_mask); - newAct.sa_flags = 0; - newAct.sa_handler = SIG_DFL; - sigfillset(&oldAct.sa_mask); - oldAct.sa_flags = 0; - oldAct.sa_handler = SigchldHndlr; - - /* - * get the old handler, and set the action to IGN - */ - sigaction(SIGCHLD, &newAct, &oldAct); - - status = system (cmdStr); - - sigaction(SIGCHLD, &oldAct, (struct sigaction *)NULL); - return status; -} - - -/* - * PclGetMediumDimensions is installed in the GetMediumDimensions field - * of each Pcl-initialized context. - */ -int -PclGetMediumDimensions(XpContextPtr pCon, - CARD16 *width, - CARD16 *height) -{ - XpGetMediumDimensions(pCon, width, height); - return Success; -} - -/* - * PclGetReproducibleArea is installed in the GetReproducibleArea field - * of each Pcl-initialized context. - */ -int -PclGetReproducibleArea(XpContextPtr pCon, - xRectangle *pRect) -{ - XpGetReproductionArea(pCon, pRect); - return Success; -} - -#ifdef XP_PCL_LJ3 -/* - * PclSpoolFigs spooled the rendering PCL/HP-GL2 commands into the - * temporary buffer pointed by figures pointer in pcl private context. - * LaserJet IIIs printers don't support the macro function which - * includes some HP-GL/2 commands. - */ -void -PclSpoolFigs(PclContextPrivPtr pConPriv, char *t, int n) -{ -char *ptr; - - ptr = pConPriv->figures; - while ( ( pConPriv->fcount + n) > pConPriv->fcount_max ) { - ptr = (char *)xrealloc(ptr, 1024 + pConPriv->fcount_max); - if ( !ptr ) - return; - pConPriv->figures = ptr; - pConPriv->fcount_max += 1024; - } - ptr += pConPriv->fcount; - pConPriv->fcount += n; - memcpy(ptr, t, n); -} -#endif /* XP_PCL_LJ3 */ - -/* - * PclSendData: - * For XP-PCL-COLOR/XP-PCL-MONO, it executes the macro stored before - * in the clipped area. - * For XP-PCL-LJ3, it draws the spooled figures in the clipped area. - */ -void -PclSendData( - FILE *outFile, - PclContextPrivPtr pConPriv, - BoxPtr pbox, - int nbox, - double ratio -) -{ -char *ptr; -int n; -char t[80]; - -#ifdef XP_PCL_LJ3 - ptr = pConPriv->figures; - n = pConPriv->fcount; -#else - ptr = "\033&f3X"; - n = 5; -#endif /* XP_PCL_LJ3 */ - - while( nbox ) - { - /* - * Set the HP-GL/2 input window to the current - * rectangle in the clip region, then send the code to - * execute the macro defined above. - */ - if (ratio == 1.0) - sprintf( t, "\033%%0BIW%d,%d,%d,%d;\033%%0A", - pbox->x1, pbox->y1, - pbox->x2, pbox->y2 ); - else - sprintf( t, "\033%%0BIW%g,%d,%g,%d;\033%%0A", - ratio * pbox->x1, pbox->y1, - ratio * pbox->x2, pbox->y2 ); - - SEND_PCL( outFile, t ); - SEND_PCL_COUNT( outFile, ptr, n); - - nbox--; - pbox++; - } -} diff --git a/nx-X11/programs/Xserver/Xprint/pcl/PclPixel.c b/nx-X11/programs/Xserver/Xprint/pcl/PclPixel.c deleted file mode 100644 index bfad618ed..000000000 --- a/nx-X11/programs/Xserver/Xprint/pcl/PclPixel.c +++ /dev/null @@ -1,159 +0,0 @@ -/* $Xorg: PclPixel.c,v 1.3 2000/08/17 19:48:08 cpqbld Exp $ */ -/******************************************************************* -** -** ********************************************************* -** * -** * File: PclPixel.c -** * -** * Contents: -** * Pixel-drawing code for the PCL DDX driver -** * -** * Created: 10/23/95 -** * -** ********************************************************* -** -********************************************************************/ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ -/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclPixel.c,v 1.6tsi Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include - -#include "windowstr.h" -#include "gcstruct.h" - -#include "Pcl.h" - -void -PclPolyPoint( pDrawable, pGC, mode, nPoints, pPoints ) - DrawablePtr pDrawable; - GCPtr pGC; - int mode; - int nPoints; - xPoint *pPoints; -{ - char t[80]; - FILE *outFile; - int xoffset, yoffset; - BoxRec box; - int xloc, yloc, i; -#if 0 - XpContextPtr pCon; - PclContextPrivPtr cPriv; - PclPixmapPrivPtr pPriv; -#endif - - if( PclUpdateDrawableGC( pGC, pDrawable, &outFile ) == FALSE ) - return; - - xoffset = pDrawable->x; - yoffset = pDrawable->y; - - /* - * Enter HP-GL/2 and change the line style to one in which only - * the vertices of the specified polyline are drawn. We must also - * temporarily change the line width so that only a single pixel - * is drawn. Then move to the first possible location. - */ - xloc = pPoints[0].x + pDrawable->x; - yloc = pPoints[0].y + pDrawable->y; - - sprintf( t, "\27%%0BPW0,0;LT0;PU;PA%d,%d", xloc, yloc ); - SEND_PCL( outFile, t ); - - /* - * Check each point against the clip region. If it is outside the - * region, don't send the PCL to the printer. - */ - - for( i = 0; i < nPoints; i++ ) - { - if( POINT_IN_REGION( pGC->pScreen, pGC->clientClip, xloc, yloc, &box ) ) - { - sprintf( t, ",%d,%d", xloc, yloc ); - SEND_PCL( outFile, t ); - } - - if( mode == CoordModeOrigin ) - { - xloc = pPoints[i+1].x + xoffset; - yloc = pPoints[i+1].y + yoffset; - } - else - { - xloc += pPoints[i+1].x; - yloc += pPoints[i+1].y; - } - } - -#if 0 - /* - * Change the line style and width back to what they were before - * this routine was called. No, this isn't pretty... - */ - if( pDrawable->type == DRAWABLE_WINDOW ) - { - pCon = PclGetContextFromWindow( (WindowPtr)pDrawable ); - cPriv = pCon->devPrivates[PclContextPrivateIndex].ptr; - cPriv->changeMask = GCLineWidth | GCLineStyle; - } - else - { - pPriv = - ((PixmapPtr)pDrawable)->devPrivates[PclPixmapPrivateIndex].ptr; - pPriv->changeMask = GCLineWidth | GCLineStyle; - } -#endif - - PclUpdateDrawableGC( pGC, pDrawable, &outFile ); - - /* - * Go back to PCL - */ - SEND_PCL( outFile, "\27%0A" ); -} - -void -PclPushPixels( pGC, pBitmap, pDrawable, width, height, x, y ) - GCPtr pGC; - PixmapPtr pBitmap; - DrawablePtr pDrawable; - int width; - int height; - int x; - int y; -{ -} diff --git a/nx-X11/programs/Xserver/Xprint/pcl/PclPixmap.c b/nx-X11/programs/Xserver/Xprint/pcl/PclPixmap.c deleted file mode 100644 index 9449dfdd6..000000000 --- a/nx-X11/programs/Xserver/Xprint/pcl/PclPixmap.c +++ /dev/null @@ -1,85 +0,0 @@ -/* $Xorg: PclPixmap.c,v 1.3 2000/08/17 19:48:08 cpqbld Exp $ */ -/******************************************************************* -** -** ********************************************************* -** * -** * File: PclPixmap.c -** * -** * Contents: -** * Pixmap handling code for the PCL DDX driver -** * -** * Created: 2/19/96 -** * -** ********************************************************* -** -********************************************************************/ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ -/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclPixmap.c,v 1.3 1999/12/16 02:26:27 robin Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "Pcl.h" -#include "cfb.h" -#include "cfb32.h" -#include "mfb.h" -#include "pixmapstr.h" - -PixmapPtr -PclCreatePixmap(ScreenPtr pScreen, - int width, - int height, - int depth) -{ - if( depth == 1 ) - return mfbCreatePixmap( pScreen, width, height, depth ); - else if( depth <= 8 ) - return cfbCreatePixmap( pScreen, width, height, depth ); - else if( depth <= 32 ) - return cfb32CreatePixmap( pScreen, width, height, depth ); - return 0; -} - - -Bool -PclDestroyPixmap(PixmapPtr pPixmap) -{ - if( pPixmap->drawable.depth == 1 ) - return mfbDestroyPixmap( pPixmap ); - else if( pPixmap->drawable.depth <= 8 ) - return cfbDestroyPixmap( pPixmap ); - else if( pPixmap->drawable.depth <= 32 ) - return cfb32DestroyPixmap( pPixmap ); - return 0; -} diff --git a/nx-X11/programs/Xserver/Xprint/pcl/PclPolygon.c b/nx-X11/programs/Xserver/Xprint/pcl/PclPolygon.c deleted file mode 100644 index 41ba4b1c0..000000000 --- a/nx-X11/programs/Xserver/Xprint/pcl/PclPolygon.c +++ /dev/null @@ -1,353 +0,0 @@ -/* $Xorg: PclPolygon.c,v 1.3 2000/08/17 19:48:08 cpqbld Exp $ */ -/******************************************************************* -** -** ********************************************************* -** * -** * File: PclPolygon.c -** * -** * Contents: -** * Draws Polygons and Rectangles for the PCL DDX -** * -** * Created: 10/23/95 -** * -** ********************************************************* -** -********************************************************************/ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ -/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclPolygon.c,v 1.6 1999/12/13 02:12:56 robin Exp $ */ - - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "Pcl.h" -#include "gcstruct.h" -#include "windowstr.h" - -void -PclPolyRectangle( - DrawablePtr pDrawable, - GCPtr pGC, - int nRects, - xRectangle *pRects) -{ - char t[80]; - FILE *outFile; - int nbox, i; - BoxPtr pbox; - xRectangle *drawRects, *r; - RegionPtr drawRegion, region; - short fudge; - int xoffset, yoffset; - XpContextPtr pCon; - PclContextPrivPtr pConPriv; - - if( PclUpdateDrawableGC( pGC, pDrawable, &outFile ) == FALSE ) - return; - - pCon = PclGetContextFromWindow( (WindowPtr) pDrawable ); - pConPriv = (PclContextPrivPtr) - pCon->devPrivates[PclContextPrivateIndex].ptr; - - /* - * Allocate the storage required to deal with the clipping - * regions. - */ - region = REGION_CREATE( pGC->pScreen, NULL, 0 ); - drawRects = (xRectangle *)xalloc( nRects * sizeof( xRectangle ) ); - - fudge = 3 * pGC->lineWidth + 1; - - /* - * Generate the PCL code to draw the rectangles, by defining them - * as a macro which uses the HP-GL/2 rectangle drawing function. - */ - MACRO_START( outFile, pConPriv ); - SAVE_PCL( outFile, pConPriv, "\033%0B" ); - - xoffset = pDrawable->x; - yoffset = pDrawable->y; - - for( i = 0, r = drawRects; i < nRects; i++, r++ ) - { - xRectangle rect = pRects[i]; - - /* Draw the rectangle */ - sprintf( t, "PU%d,%d;ER%d,%d;", rect.x + xoffset, - rect.y + yoffset, rect.width, rect.height ); - SAVE_PCL( outFile, pConPriv, t ); - - /* Build the bounding box */ - r->x = MIN( rect.x, rect.x + rect.width ) + xoffset - - fudge; - r->y = MIN( rect.y, rect.y + rect.height ) + yoffset - - fudge; - r->width = rect.width + 2 * fudge; - r->height = rect.height + 2 * fudge; - } - SAVE_PCL( outFile, pConPriv, ";\033%0A" ); /* End the macro */ - MACRO_END( outFile ); - - /* - * Convert the collection of rectangles to a proper region, then - * intersect it with the clip region. - */ - drawRegion = RECTS_TO_REGION( pGC->pScreen, nRects, - drawRects, CT_UNSORTED ); - - REGION_INTERSECT( pGC->pScreen, region, drawRegion, pGC->pCompositeClip ); - - /* - * For each rectangle in the clip region, set the HP-GL/2 "input - * window" and render the set of rectangles to it. - */ - pbox = REGION_RECTS( region ); - nbox = REGION_NUM_RECTS( region ); - - PclSendData(outFile, pConPriv, pbox, nbox, 1.0); - - /* - * Clean up the temporary regions - */ - REGION_DESTROY( pGC->pScreen, drawRegion ); - REGION_DESTROY( pGC->pScreen, region ); - xfree( drawRects ); -} - -void -PclFillPolygon( - DrawablePtr pDrawable, - GCPtr pGC, - int shape, - int mode, - int nPoints, - DDXPointPtr pPoints) -{ - char t[80]; - FILE *outFile; - int nbox, i; - BoxPtr pbox; - BoxRec box; - RegionPtr drawRegion, region; - int xoffset, yoffset; - int xtop, xbottom, yleft, yright; - int fillRule; - XpContextPtr pCon; - PclContextPrivPtr pConPriv; - char *command; - - if( PclUpdateDrawableGC( pGC, pDrawable, &outFile ) == FALSE ) - return; - - pCon = PclGetContextFromWindow( (WindowPtr) pDrawable ); - pConPriv = (PclContextPrivPtr) - pCon->devPrivates[PclContextPrivateIndex].ptr; - - /* - * Generate the PCL code to draw the filled polygon, by defining - * it as a macro which uses the HP-GL/2 polygon drawing function. - */ - MACRO_START( outFile, pConPriv ); - SAVE_PCL( outFile, pConPriv, "\033%0B" ); - - if( mode == CoordModeOrigin ) - { - xoffset = pDrawable->x; - yoffset = pDrawable->y; - command = "PA"; - } - else - { - xoffset = yoffset = 0; - command = "PR"; - } - - /* Begin the polygon */ - sprintf( t, "PU%d,%d;PM0;%s", pPoints[0].x + xoffset, pPoints[0].y - + yoffset, command ); - SAVE_PCL( outFile, pConPriv, t ); - - /* Seed the bounding box */ - xtop = xbottom = pPoints[0].x + xoffset; - yleft = yright = pPoints[0].y + yoffset; - - /* Add the rest of the points to the polygon */ - for( i = 1; i < nPoints; i++ ) - { - if( i != 1 ) - SAVE_PCL( outFile, pConPriv, "," ); - - sprintf( t, "%d,%d", pPoints[i].x + xoffset, pPoints[i].y + - yoffset ); - SAVE_PCL( outFile, pConPriv, t ); - - /* Update the bounding box */ - xtop = MIN( xtop, pPoints[i].x + xoffset ); - xbottom = MAX( xbottom, pPoints[i].x + xoffset ); - yleft = MIN( yleft, pPoints[i].y + yoffset ); - yright = MAX( yright, pPoints[i].y + yoffset ); - } - - /* Close the polygon and the macro */ - - if( pGC->fillRule == EvenOddRule ) - fillRule = 0; - else - fillRule = 1; - - sprintf( t, ";PM2;FP%d;\033%%0A", fillRule ); - SAVE_PCL( outFile, pConPriv, t ); - MACRO_END ( outFile ); - - /* - * Build the bounding region from the bounding box of the polygon - */ - box.x1 = xtop; - box.y1 = yleft; - box.x2 = xbottom; - box.y2 = yright; - drawRegion = REGION_CREATE( pGC->pScreen, &box, 0 ); - - if( mode == CoordModePrevious ) - REGION_TRANSLATE( pGC->pScreen, drawRegion, pPoints[0].x, pPoints[0].y ); - - region = REGION_CREATE( pGC->pScreen, NULL, 0 ); - - REGION_INTERSECT( pGC->pScreen, region, drawRegion, pGC->pCompositeClip ); - - /* - * For each rectangle in the clip region, set the HP-GL/2 "input - * window" and render the polygon to it. - */ - pbox = REGION_RECTS( region ); - nbox = REGION_NUM_RECTS( region ); - - PclSendData(outFile, pConPriv, pbox, nbox, 1.0); - - /* - * Clean up the temporary regions - */ - REGION_DESTROY( pGC->pScreen, drawRegion ); - REGION_DESTROY( pGC->pScreen, region ); -} - -void -PclPolyFillRect( - DrawablePtr pDrawable, - GCPtr pGC, - int nRects, - xRectangle *pRects) -{ - char t[80]; - FILE *outFile; - int nbox, i; - BoxPtr pbox; - xRectangle *drawRects, *r; - RegionPtr drawRegion, region; - int xoffset, yoffset; - short fudge; - XpContextPtr pCon; - PclContextPrivPtr pConPriv; - - if( PclUpdateDrawableGC( pGC, pDrawable, &outFile ) == FALSE ) - return; - - pCon = PclGetContextFromWindow( (WindowPtr) pDrawable ); - pConPriv = (PclContextPrivPtr) - pCon->devPrivates[PclContextPrivateIndex].ptr; - - /* - * Allocate the storage required to deal with the clipping - * regions. - */ - region = REGION_CREATE( pGC->pScreen, NULL, 0 ); - drawRects = (xRectangle *)xalloc( nRects * sizeof( xRectangle ) ); - - - fudge = 3 * pGC->lineWidth + 1; - - /* - * Generate the PCL code to draw the filled rectangles, by - * defining them as a macro which uses the HP-GL/2 rectangle - * drawing function. - */ - MACRO_START( outFile, pConPriv ); - SAVE_PCL( outFile, pConPriv, "\033%0B" ); - - xoffset = pDrawable->x; - yoffset = pDrawable->y; - - for( i = 0, r = drawRects; i < nRects; i++, r++ ) - { - xRectangle rect = pRects[i]; - - /* Draw the rectangle */ - sprintf( t, "PU%d,%d;RR%d,%d;", rect.x + xoffset, rect.y + - yoffset, rect.width, rect.height ); - SAVE_PCL( outFile, pConPriv, t ); - - /* Build the bounding box */ - r->x = MIN( rect.x, rect.x + rect.width ) + xoffset - fudge; - r->y = MIN( rect.y, rect.y + rect.height ) + yoffset - - fudge; - r->width = rect.width + 2 * fudge; - r->height = rect.height + 2 * fudge; - } - SAVE_PCL( outFile, pConPriv, ";\033%0A" ); /* End the macro */ - MACRO_END( outFile ); - - /* - * Convert the collection of rectangles to a proper region, then - * intersect it with the clip region. - */ - drawRegion = RECTS_TO_REGION( pGC->pScreen, nRects, - drawRects, CT_UNSORTED ); - REGION_INTERSECT( pGC->pScreen, region, drawRegion, pGC->pCompositeClip ); - - /* - * For each rectangle in the clip region, set the HP-GL/2 "input - * window" and render the set of rectangles to it. - */ - pbox = REGION_RECTS( region ); - nbox = REGION_NUM_RECTS( region ); - - PclSendData(outFile, pConPriv, pbox, nbox, 1.0); - - /* - * Clean up the temporary regions - */ - REGION_DESTROY( pGC->pScreen, drawRegion ); - REGION_DESTROY( pGC->pScreen, region ); - xfree( drawRects ); -} diff --git a/nx-X11/programs/Xserver/Xprint/pcl/PclPrint.c b/nx-X11/programs/Xserver/Xprint/pcl/PclPrint.c deleted file mode 100644 index 701710253..000000000 --- a/nx-X11/programs/Xserver/Xprint/pcl/PclPrint.c +++ /dev/null @@ -1,711 +0,0 @@ -/* $Xorg: PclPrint.c,v 1.3 2000/08/17 19:48:08 cpqbld Exp $ */ -/******************************************************************* -** -** ********************************************************* -** * -** * File: PclPrint.c -** * -** * Contents: Print extension code of Pcl driver -** * -** * Created: 2/03/95 -** * -** ********************************************************* -** -********************************************************************/ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ -/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclPrint.c,v 1.7tsi Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include -#include -#include - -#define NEED_EVENTS -#include -#undef NEED_EVENTS - -#include "Pcl.h" - -#include "windowstr.h" -#include "attributes.h" -#include "AttrValid.h" -#include "Oid.h" - -int -PclStartJob( - XpContextPtr pCon, - Bool sendClientData, - ClientPtr client) -{ - PclContextPrivPtr pConPriv = - (PclContextPrivPtr)pCon->devPrivates[PclContextPrivateIndex].ptr; - PclPaletteMap *pal; - - /* - * Check for existing page file, and delete it if it exists. - */ - if(pConPriv->pageFileName != (char *)NULL) - { - if(pConPriv->pPageFile != (FILE *)NULL) - { - fclose(pConPriv->pPageFile); - pConPriv->pPageFile = (FILE *)NULL; - } - unlink(pConPriv->pageFileName); - xfree(pConPriv->pageFileName); - pConPriv->pageFileName = (char *)NULL; - } - - /* - * Create a temporary file to store the printer output. - */ - if (!XpOpenTmpFile("w+", &pConPriv->jobFileName, &pConPriv->pJobFile)) - return BadAlloc; - - /* - * Create/Initialize the SoftFontInfo structure - */ - pConPriv->pSoftFontInfo = PclCreateSoftFontInfo(); - - /* - * Set up the colormap handling - */ - pConPriv->palettes = NULL; - pConPriv->nextPaletteId = 4; - pConPriv->currentPalette = 0; - - pal = &( pConPriv->staticGrayPalette ); - pal->paletteId = 1; - pal->downloaded = 0; - - pal = &( pConPriv->trueColorPalette ); - pal->paletteId = 2; - pal->downloaded = 0; - - pal = &( pConPriv->specialTrueColorPalette ); - pal->paletteId = 3; - pal->downloaded = 0; - - return Success; -} - -int -PclEndJob( - XpContextPtr pCon, - Bool cancel) -{ - PclContextPrivPtr priv = (PclContextPrivPtr) - pCon->devPrivates[PclContextPrivateIndex].ptr; - -#ifdef CCP_DEBUG - FILE *xpoutput; -#endif - FILE *fp; - int retVal; - char *fileName, *trailer; - struct stat statBuf; - PclPaletteMapPtr p; - - trailer = "\033%-12345X@PJL RESET\n"; - - if( cancel == True ) - { - if( priv->getDocClient != (ClientPtr)NULL ) { - XpFinishDocData( priv->getDocClient ); - - priv->getDocClient = NULL; - priv->getDocBufSize = 0; - } - - return Success; - } - - if( priv->getDocClient != (ClientPtr)NULL && priv->getDocBufSize > 0 ) - { - /* - * We need to stash the trailer information somewhere... - */ - if (!XpOpenTmpFile("w+", &fileName, &fp)) - return BadAlloc; - -#ifndef XP_PCL_LJ3 - SEND_PCL( fp, trailer ); - rewind( fp ); - - retVal = XpSendDocumentData( priv->getDocClient, fp, - strlen( trailer ), - priv->getDocBufSize ); -#endif /* XP_PCL_LJ3 */ - - fclose( fp ); - unlink( fileName ); - xfree( fileName ); - - if( priv->getDocClient != (ClientPtr)NULL ) { - XpFinishDocData( priv->getDocClient ); - - priv->getDocClient = NULL; - priv->getDocBufSize = 0; - } - - return retVal; - } - -#ifndef XP_PCL_LJ3 - SEND_PCL( priv->pJobFile, trailer ); -#endif /* XP_PCL_LJ3 */ - - /* - * Submit the job to the spooler - */ - fflush( priv->pJobFile ); - - /* - * Dump the job file to another output file, for testing - * purposes. - */ - rewind( priv->pJobFile ); - stat( priv->jobFileName, &statBuf ); - -#ifdef CCP_DEBUG - unlink( "/users/prince/XpOutput" ); - xpoutput = fopen( "/users/prince/XpOutput", "w" ); - - rewind( priv->pJobFile ); - TransferBytes( priv->pJobFile, xpoutput, - (int)statBuf.st_size ); - fclose( xpoutput ); -#endif - - XpSubmitJob( priv->jobFileName, pCon ); - fclose( priv->pJobFile ); - unlink( priv->jobFileName ); - xfree( priv->jobFileName ); - priv->jobFileName = NULL; - - PclDestroySoftFontInfo(priv->pSoftFontInfo); - priv->pSoftFontInfo = (PclSoftFontInfoPtr) NULL; - - /* - * Clear out the colormap cache - */ - p = priv->palettes; - while( p ) - { - p->downloaded = 0; - p = p->next; - } - - return Success; -} - -/* StartPage - * - * If page file exists - * close page file - * set page file pointer = NULL - * unlink page file - * Create a new page file - * Send the page header information to the page file - * ClearArea the window and all descendant windows - */ -int -PclStartPage( - XpContextPtr pCon, - WindowPtr pWin) -{ - PclContextPrivPtr pConPriv = (PclContextPrivPtr) - pCon->devPrivates[PclContextPrivateIndex].ptr; - PclWindowPrivPtr pWinPriv = - (PclWindowPrivPtr)pWin->devPrivates[PclWindowPrivateIndex].ptr; - xRectangle repro; - char t[80]; - XpOid orient, plex, tray, medium; - int dir, plexNum, num; - - /* - * Put a pointer to the context in the window private structure - */ - pWinPriv->validContext = 1; - pWinPriv->context = pCon; - - /* - * Clear out the old page file, if necessary - */ - if(pConPriv->pPageFile != (FILE *)NULL) - { - fclose(pConPriv->pPageFile); - pConPriv->pPageFile = (FILE *)NULL; - } - if(pConPriv->pageFileName != (char *)NULL) - { - unlink(pConPriv->pageFileName); - pConPriv->pageFileName = (char *)NULL; - } - - /* - * Make up a new page file. - */ - if (!XpOpenTmpFile("w+", &pConPriv->pageFileName, &pConPriv->pPageFile)) - return BadAlloc; - - /* - * Reset the GC cached in the context private struct. - */ - pConPriv->validGC = 0; - - /* - * Set the page orientation - */ - orient = XpGetContentOrientation( pCon ); - switch( orient ) - { - case xpoid_val_content_orientation_landscape: - dir = 1; - break; - case xpoid_val_content_orientation_reverse_portrait: - dir = 2; - break; - case xpoid_val_content_orientation_reverse_landscape: - dir = 3; - break; - case xpoid_val_content_orientation_portrait: - default: - dir = 0; - break; - } - sprintf( t, "\033&l%dO", dir ); - SEND_PCL( pConPriv->pPageFile, t ); - - /* - * Set the duplexing method. Since PCL wants to think of it in - * terms of the "binding edge," and the attribute store thinks in - * "duplex/tumble," this is a little complicated. - * - * Actually, this has no bearing on the output, since the HP1600C - * will only print on one side of the paper, and ignore all - * requests to enable duplexing. But, in an attempt to keep this - * driver somewhat generic, we'll enable it anyway. - */ - plex = XpGetPlex( pCon ); - - if( plex == xpoid_val_plex_duplex ) - { - if( dir == 0 || dir == 2 ) - plexNum = 1; - else - plexNum = 2; - } - else if( plex == xpoid_val_plex_tumble ) - { - if( dir == 0 || dir == 2 ) - plexNum = 2; - else - plexNum = 1; - } - else - plexNum = 0; - sprintf( t, "\033&l%dS", plexNum ); - SEND_PCL( pConPriv->pPageFile, t ); - - /* - * Set the input tray or medium. If XpGetPageSize gives us a valid medium, - * we can just send that to the printer, and let the printer handle the - * details. Otherwise, we select the tray returned from XpGetPageSize, - * which will be either a tray that should contain the correct medium - * (possibly with operator intervention), or the default tray from the - * config files. - */ - medium = XpGetPageSize( pCon, &tray, NULL ); - if( medium != xpoid_none ) - { - switch( medium ) - { - case xpoid_val_medium_size_na_legal: - num = 3; - break; - case xpoid_val_medium_size_iso_a3: - num = 27; - break; - case xpoid_val_medium_size_iso_a4: - num = 26; - break; - case xpoid_val_medium_size_executive: - num = 1; - break; - case xpoid_val_medium_size_ledger: - num = 6; - break; - case xpoid_val_medium_size_monarch_envelope: - num = 80; - break; - case xpoid_val_medium_size_na_number_10_envelope: - num = 81; - break; - case xpoid_val_medium_size_iso_designated_long: - num = 90; - break; - case xpoid_val_medium_size_iso_c5: - num = 91; - break; - case xpoid_val_medium_size_iso_b5: - num = 100; - break; - case xpoid_val_medium_size_jis_b5: - num = 45; - break; - case xpoid_val_medium_size_na_letter: - default: - num = 2; - break; - } - sprintf( t, "\033&l%dA", num ); - SEND_PCL( pConPriv->pPageFile, t ); - } - else - { - switch( tray ) - { - case xpoid_val_input_tray_manual: - num = 2; - break; - case xpoid_val_input_tray_envelope: - num = 3; - break; - case xpoid_val_input_tray_large_capacity: - num = 5; - break; - case xpoid_val_input_tray_bottom: - num = 4; - break; - case xpoid_val_input_tray_main: - default: - num = 1; - break; - } - sprintf( t, "\033&l%dH", num ); - SEND_PCL( pConPriv->pPageFile, t ); - } - - /* - * Set the scaling factors so that the HP-GL/2 coordinate system - * matches the X coordinate system, both in axis orientation and - * in unit<->pixel conversion. - */ - XpGetReproductionArea( pCon, &repro ); - - sprintf( t, "\033&l0E\033*p%dx%dY", repro.x - 75, repro.y ); - SEND_PCL( pConPriv->pPageFile, t ); - - sprintf( t, "\033*c%dx%dY\033*c0T", (int)(repro.width / 300.0 * 720.0), - (int)(repro.height / 300.0 * 720.0) ); - SEND_PCL( pConPriv->pPageFile, t ); - - sprintf( t, "\033%%0BSC%d,%d,%d,%d;\033%%0A", repro.x, repro.x + - repro.width, repro.y + repro.height, repro.y ); - SEND_PCL( pConPriv->pPageFile, t ); - - return Success; -} - -/* - * When sending the generated PCL code back to the client, we send everything - * that we have generated so far for the job. After sending the data, we clean - * out the job file, to avoid repeatedly sending the same data. - */ - -static int -SendDocData( PclContextPrivPtr pPriv ) -{ - struct stat statBuf; - int ret; - - rewind( pPriv->pJobFile ); - if( stat( pPriv->jobFileName, &statBuf ) < 0 ) - return BadAlloc; - - ret = XpSendDocumentData( pPriv->getDocClient, pPriv->pJobFile, - (int)statBuf.st_size, pPriv->getDocBufSize ); - - /* - * Clean out the job file - */ - fclose( pPriv->pJobFile ); - unlink( pPriv->jobFileName ); - - xfree(pPriv->jobFileName); - - if (!XpOpenTmpFile("w+", &pPriv->jobFileName, &pPriv->pJobFile)) - return BadAlloc; - - return ret; -} - -/* - * EndPage: - * - * Write page trailer to page file - * Write page file to job file - */ -int -PclEndPage( - XpContextPtr pCon, - WindowPtr pWin) -{ - PclContextPrivPtr pConPriv = (PclContextPrivPtr) - pCon->devPrivates[PclContextPrivateIndex].ptr; - - struct stat statBuf; - - /* - * Send the page trailer to the page file. - */ - SEND_PCL( pConPriv->pPageFile, "\014" ); - fflush( pConPriv->pPageFile ); - - /* - * Write the page file contents to the job file, or to the - * whatever client has called GetDocumentData. - * - * pWinPriv->pPageFile must first be set to the start of the page file. - */ - rewind(pConPriv->pPageFile); - if(stat(pConPriv->pageFileName, &statBuf) < 0) - return BadAlloc; - - if(TransferBytes(pConPriv->pPageFile, pConPriv->pJobFile, - (int)statBuf.st_size) != (int)statBuf.st_size) - return BadAlloc; - - if( pConPriv->getDocClient != (ClientPtr)NULL && - pConPriv->getDocBufSize > 0 ) - { - return SendDocData( pConPriv ); - } - - return Success; -} - -/* - * The PclStartDoc() and PclEndDoc() functions serve basically as NOOP - * placeholders. This driver doesn't deal with the notion of multiple - * documents per page. - */ - -int -PclStartDoc(XpContextPtr pCon, - XPDocumentType type) -{ - PclContextPrivPtr pConPriv = (PclContextPrivPtr) - pCon->devPrivates[PclContextPrivateIndex].ptr; - -#ifndef XP_PCL_LJ3 - /* - * Set the printer resolution for the page. Since we can only - * render color at 300dpi, we just hard-code this. - */ - SEND_PCL( pConPriv->pJobFile, - "\033%-12345X@PJL SET RESOLUTION = 300\r\n" ); -#endif /* XP_PCL_LJ3 */ - - /* - * Initialize HP-GL/2 - */ - SEND_PCL( pConPriv->pJobFile, "\033E\033%0BIN,SP1,TR0;\033%0A" ); - - /* - * Stash the type of the document (used by PutDocumentData operation) - */ - pConPriv->isRaw = (type == XPDocRaw); - - return Success; -} - -int -PclEndDoc( - XpContextPtr pCon, - Bool cancel) -{ - /* - * XXX What should I do if I get cancel == TRUE? - */ - return Success; -} - -/* - * PclDocumentData() - * - * Hand any pre-generated PDL down to the spool files, formatting it - * as necessary to fit the given window. - * - */ - -#define DOC_PCL 1 -#define DOC_HPGL 2 - -int -PclDocumentData( - XpContextPtr pCon, - DrawablePtr pDraw, - char *pData, - int len_data, - char *pFmt, - int len_fmt, - char *pOpt, - int len_opt, - ClientPtr client) -{ - int type = 0; - PclContextPrivPtr pPriv = (PclContextPrivPtr) - pCon->devPrivates[PclContextPrivateIndex].ptr; - XpOidDocFmtList *formats; - XpOidDocFmt *f; - char t[80]; - xRectangle repro; - - /* - * Verify the input format - */ - formats = XpGetDocFmtListAttr( pCon, XPPrinterAttr, - (pPriv->isRaw) ? - xpoid_att_xp_raw_formats_supported : - xpoid_att_xp_embedded_formats_supported, - NULL ); - f = XpOidDocFmtNew( pFmt ); - if( !XpOidDocFmtListHasFmt( formats, f ) ) - { - XpOidDocFmtListDelete( formats ); - XpOidDocFmtDelete( f ); - return BadMatch; - } - XpOidDocFmtListDelete( formats ); - - if( !(pPriv->isRaw) ) - { - if( !strcmp( f->format, "PCL" ) ) - type = DOC_PCL; - else if( !strcmp( f->format, "HPGL" ) ) - type = DOC_HPGL; - else - { - XpOidDocFmtDelete( f ); - return BadMatch; - } - - switch( type ) - { - case DOC_HPGL: - /* - * Move the picture frame to the appropriate place on the page, - * then assume that the embedded code will scale it properly. - */ - sprintf( t, "\033&l0E\033*p%dx%dY", - pDraw->x - 75, - pDraw->y ); - SEND_PCL( pPriv->pPageFile, t ); - - sprintf( t, "\033*c%dx%dY\033*coT", - (int)( pDraw->width / 300.0 * 720.0 ), - (int)( pDraw->height / 300.0 * 720.0 ) ); - SEND_PCL( pPriv->pPageFile, t ); - break; - } - } - - - /* - * Send the data down the pipe - */ - SEND_PCL_COUNT( pPriv->pPageFile, pData, len_data ); - - /* - * If it's not a raw document, clean up the embedding - */ - if( !(pPriv->isRaw) ) - switch( type ) - { - case DOC_HPGL: - /* - * Reset the picture frame - */ - XpGetReproductionArea( pCon, &repro ); - - sprintf( t, "\033&l0E\033*p%dx%dY", repro.x - 75, repro.y ); - SEND_PCL( pPriv->pPageFile, t ); - - sprintf( t, "\033*c%dx%dY\033*c0T", - (int)(repro.width / 300.0 * 720.0), - (int)(repro.height / 300.0 * 720.0) ); - SEND_PCL( pPriv->pPageFile, t ); - - sprintf( t, "\033%%0BSC%d,%d,%d,%d;\033%%0A", repro.x, repro.x + - repro.width, repro.y + repro.height, repro.y ); - SEND_PCL( pPriv->pPageFile, t ); - break; - } - - XpOidDocFmtDelete( f ); - return Success; -} - -/* - * - * PclGetDocumentData() - * - * This function allows the driver to send the generated PCL back to - * the client. - * - * XXX This function is barely spec'ed, much less implemented! - */ - -int -PclGetDocumentData( - XpContextPtr pCon, - ClientPtr client, - int maxBufferSize) -{ - PclContextPrivPtr pPriv = (PclContextPrivPtr) - pCon->devPrivates[PclContextPrivateIndex].ptr; - - pPriv->getDocClient = client; - pPriv->getDocBufSize = maxBufferSize; - - return Success; -} diff --git a/nx-X11/programs/Xserver/Xprint/pcl/PclSFonts.c b/nx-X11/programs/Xserver/Xprint/pcl/PclSFonts.c deleted file mode 100644 index 287c5c14f..000000000 --- a/nx-X11/programs/Xserver/Xprint/pcl/PclSFonts.c +++ /dev/null @@ -1,429 +0,0 @@ -/* $Xorg: PclSFonts.c,v 1.3 2000/08/17 19:48:08 cpqbld Exp $ */ -/******************************************************************* -** -** ********************************************************* -** * -** * File: PclSFonts.c -** * -** * Contents: -** * Send Soft Font Download data to the specified -** * file pointer. -** * -** * Created: 3/4/96 -** * -** ********************************************************* -** -********************************************************************/ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ -/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclSFonts.c,v 1.7tsi Exp $ */ - - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include "Pcl.h" - -static char tmp1; -static short tmp2; -#define Put1byte(fp, x) tmp1=x; fwrite((char *)&tmp1, 1, 1, fp) -#define Put2bytes(fp, x) tmp2=x; fwrite((char *)&tmp2, 2, 1, fp) - -#define ESC 0x1b -#define SYMBOL_SET 277 - -static unsigned int PclDownloadChar(FILE *,PclCharDataPtr,unsigned short,unsigned char); -static unsigned int PclDownloadHeader(FILE *, PclFontDescPtr, unsigned short); - -#ifdef PCL_FONT_COMPRESS -static unsigned char *compress_bitmap_data(PclCharDataPtr, unsigned int *); -#endif /* PCL_FONT_COMPRESS */ - -/* -*- PclDownloadSoftFont8 -*- - * Send the Character Definition Command for 8-bit font - * **************************************************************************/ -void -PclDownloadSoftFont8( - FILE *fp, - PclSoftFontInfoPtr pSoftFontInfo, - PclFontHead8Ptr pfh, - PclCharDataPtr pcd, - unsigned char *code -) -{ - /* - * Check whether the font header has already been downloaded. - * If not, download it. - */ - - if ( !pfh->fid ) { - pfh->fid = pSoftFontInfo->cur_max_fid++; - PclDownloadHeader(fp, &(pfh->fd), pfh->fid); - } - pfh->index[*code] = *code; - PclDownloadChar(fp, pcd, pfh->fid, pfh->index[*code]); - -} - -/* -*- PclDownloadSoftFont16 -*- - * Send the Character Definition Command for 16 bit font - * **************************************************************************/ -void -PclDownloadSoftFont16( - FILE *fp, - PclSoftFontInfoPtr pSoftFontInfo, - PclFontHead16Ptr pfh, - PclCharDataPtr pcd, - unsigned char row, - unsigned char col -) -{ - /* - * Check whether the font header is already downloaded. - * If not, download it. - */ - - if ( !pfh->cur_cindex ) { - pfh->cur_fid = pSoftFontInfo->cur_max_fid++; - PclDownloadHeader(fp, &(pfh->fd), pfh->cur_fid); - } - pfh->index[row][col].fid = pfh->cur_fid; - pfh->index[row][col].cindex = pfh->cur_cindex++; - - PclDownloadChar(fp, pcd, pfh->index[row][col].fid, pfh->index[row][col].cindex); -} - -/* -*- PclCreateSoftFontInfo -*- - * Create and Initialize the structure for storing the information - * of the downloaded soft font. - * **************************************************************************/ -PclSoftFontInfoPtr -PclCreateSoftFontInfo(void) -{ -PclSoftFontInfoPtr pSoftFontInfo; - - pSoftFontInfo = (PclSoftFontInfoPtr)xalloc(sizeof(PclSoftFontInfoRec)); - if ( pSoftFontInfo == (PclSoftFontInfoPtr) NULL) - return (PclSoftFontInfoPtr) NULL; - pSoftFontInfo->phead8 = (PclFontHead8Ptr)NULL; - pSoftFontInfo->phead16 = (PclFontHead16Ptr)NULL; - pSoftFontInfo->pinfont = (PclInternalFontPtr)NULL; - pSoftFontInfo->cur_max_fid = 1; - return pSoftFontInfo; -} - -/* -*- PclDestroySoftFontInfo -*- - * Destroy the soft font information structure - * **************************************************************************/ -void -PclDestroySoftFontInfo( PclSoftFontInfoPtr pSoftFontInfo ) -{ -PclFontHead8Ptr pfh8, pfh8_next; -PclFontHead16Ptr pfh16, pfh16_next; -PclInternalFontPtr pin, pin_next; -unsigned char nindex_row; -int i; - - if ( pSoftFontInfo == (PclSoftFontInfoPtr) NULL ) - return; - - pfh8 = pSoftFontInfo->phead8; - while (pfh8 != (PclFontHead8Ptr) NULL) { - xfree(pfh8->fontname); - xfree(pfh8->index); - pfh8_next = pfh8->next; - xfree(pfh8); - pfh8 = pfh8_next; - } - - pfh16 = pSoftFontInfo->phead16; - while (pfh16 != (PclFontHead16Ptr) NULL) { - xfree(pfh16->fontname); - nindex_row = pfh16->lastRow - pfh16->firstRow + 1; - for (i=0; iindex[i]); - xfree(pfh16->index); - pfh16_next = pfh16->next; - xfree(pfh16); - pfh16 = pfh16_next; - } - - pin = pSoftFontInfo->pinfont; - while (pin != (PclInternalFontPtr) NULL) { - xfree(pin->fontname); - pin_next = pin->next; - xfree(pin); - pin = pin_next; - } - - xfree(pSoftFontInfo); -} - -/* -*- PclDownloadHeader -*- - * Send the Font Header Commnad. - * Format 0 : Font Header for Pcl Bitmapped Fonts - * Format 20 : Font Header for Resolution Specified Bitmapped Fonts - * **************************************************************************/ -static unsigned int -PclDownloadHeader( - FILE *fp, - PclFontDescPtr fd, - unsigned short fid -) -{ -int nbytes; - -#ifdef XP_PCL_LJ3 - nbytes = 64; -#else - nbytes = 68; -#endif /* XP_PCL_LJ3 */ - /* - * Font ID Command : Esc *c#D - * (Default = 0, Range = 0 - 32767) - */ - fprintf(fp, "%c*c%dD", ESC, fid); - - /* - * Font Header Commnad : Esc )s#W[font header data] - * (Default = 0, Range = 0 - 32767) - */ - fprintf(fp, "%c)s%dW", ESC, nbytes); - - Put2bytes(fp, nbytes); /* Font Description Size */ -#ifdef XP_PCL_LJ3 - Put1byte(fp, 0); /* Header Format */ -#else - Put1byte(fp, 20); /* Header Format */ -#endif /* XP_PCL_LJ3 */ - Put1byte(fp, 2); /* Font Type */ - Put2bytes(fp, 0); /* Style MSB */ - Put2bytes(fp, fd->ascent); /* BaseLine Position */ - Put2bytes(fp, fd->cellwidth); /* Cell Width */ - Put2bytes(fp, fd->cellheight); /* Cell Height */ - Put1byte(fp, 0); /* Orienation */ - Put1byte(fp, fd->spacing); /* Spacing */ - Put2bytes(fp, SYMBOL_SET); /* Symbol Set */ - Put2bytes(fp, fd->pitch*4); /* font pitch */ - Put2bytes(fp, fd->cellheight * 4); /* Height */ - Put2bytes(fp, 0); /* x-Height */ - Put1byte(fp, 0); /* width type (normal) */ - Put1byte(fp, 0); /* Style LSB */ - Put1byte(fp, 0); /* Stroke Weight */ - Put1byte(fp, 5); /* Typeface LSB */ - Put1byte(fp, 0); /* Typeface MSB */ - Put1byte(fp, 0); /* Serif Style */ - Put1byte(fp, 0); /* Quality */ - Put1byte(fp, 0); /* Placement */ - Put1byte(fp, 0); /* Underline Position */ - Put1byte(fp, 0); /* Underline Thickness */ - Put2bytes(fp, fd->cellheight*1.2); /* Text Height */ - Put2bytes(fp, fd->cellwidth * 4); /* Text Width */ - Put2bytes(fp, 0); /* First Code */ - Put2bytes(fp, 255); /* Last Code */ - Put1byte(fp, 0); /* Pitch Extend */ - Put1byte(fp, 0); /* Height Extend */ - Put2bytes(fp, 0); /* Cap Height */ - Put2bytes(fp, 0); /* Font Number 1 */ - Put2bytes(fp, 0); /* Font Number 2 */ - Put2bytes(fp, 0); /* Font Name */ - Put2bytes(fp, 0); /* Font Name */ - Put2bytes(fp, 0); /* Font Name */ - Put2bytes(fp, 0); /* Font Name */ - Put2bytes(fp, 0); /* Font Name */ - Put2bytes(fp, 0); /* Font Name */ - Put2bytes(fp, 0); /* Font Name */ - Put2bytes(fp, 0); /* Font Name */ - -#ifdef XP_PCL_LJ3 - return 64; -#else - Put2bytes(fp, 300); /* X Resolution */ - Put2bytes(fp, 300); /* Y Resolution */ - return 68; -#endif /* XP_PCL_LJ3 */ - -} - -/* -*- PclDownloadCharacter -*- - * Send the Character Definition Command. - * **************************************************************************/ -static unsigned int -PclDownloadChar( - FILE *fp, - PclCharDataPtr cd, - unsigned short fid, - unsigned char code -) -{ -unsigned int nbytes, n; -unsigned char *raster; - - /* - * Font ID Command : Esc *c#D - * (Default = 0, Range = 0 - 32767) - * Character Code Command : Esc *c#E - * (Default = 0, Range = 0 - 65535) - */ - fprintf(fp, "%c*c%dd%dE", ESC, fid, code); - - /* - * Character Definition Command : Esc (s#W[character descriptor and data] - * (Default = N/A, Range = 0 - 32767) - */ - - nbytes = n = cd->height * ((cd->width + 7) / 8); -#ifdef PCL_FONT_COMPRESS - raster = compress_bitmap_data(cd, &nbytes); -#else - raster = (unsigned char *)NULL; -#endif /* PCL_FONT_COMPRESS */ - fprintf(fp, "%c(s%dW", ESC, nbytes + 16); - - Put1byte(fp, 4); /* Format */ - Put1byte(fp, 0); /* Continuation */ - Put1byte(fp, 14); /* Descriptor Size */ - if (raster) { /* Class */ - Put1byte(fp, 2); - } else { - Put1byte(fp, 1); /* Class */ - } - Put2bytes(fp, 0); /* Orientation */ - Put2bytes(fp, cd->h_offset); /* left offset */ - Put2bytes(fp, cd->v_offset); /* top offset */ - Put2bytes(fp, cd->width); /* character width */ - Put2bytes(fp, cd->height); /* character height */ - Put2bytes(fp, cd->font_pitch*4); /* delta X */ - - /* - * Raster Character Data - */ - if (raster) { - fwrite(raster, nbytes, 1, fp); - xfree(raster); - } else - fwrite(cd->raster_top, nbytes, 1, fp); - - return n + 16; -} - - -#ifdef PCL_FONT_COMPRESS -/* -*- compress_bitmap_data -*- - * Compress Bitmap data - * **************************************************************************/ -static unsigned char * -compress_bitmap_data( - PclCharDataPtr cd, - unsigned int *nbytes -) -{ -unsigned int byte_width; -unsigned char *raster, *rptr_s, *rptr_e, *rptr_end; -unsigned char *tmp_s, *tmp_ptr; -unsigned char *p; -unsigned char cur, pixel; -unsigned int num; - -int i, j, k, w; - - byte_width = (cd->width + 7) / 8; - *nbytes = cd->height * byte_width; - - /* Create buffer for storing compress bitmap glyph */ - raster = (unsigned char *)xalloc(*nbytes); - rptr_s = raster; - rptr_e = raster; - rptr_end = raster + *nbytes; - - tmp_s = (unsigned char *)xalloc(cd->width * 8 + 2); - - p = cd->raster_top; - for (i=0; iheight; i++) { - tmp_ptr = tmp_s; - *tmp_ptr++ = 0; - if ( (*p>>7)&0x1 == 1 ) { - *tmp_ptr++ = 0; - cur = 1; - } else { - cur = 0; - } - num = 0; - for (j=0, w=0; jwidth; k++, w++) { - pixel = (*p>>(7-k))&0x1; - if ( pixel == cur ) { - num++; - } else { - cur = pixel; - while (num > 255) { - *tmp_ptr++ = 255; - *tmp_ptr++ = 0; - num -= 255; - } - *tmp_ptr++ = num; - num = 1; - } - } - } - if ( pixel == cur ) { - while (num > 255) { - *tmp_ptr++ = 255; - *tmp_ptr++ = 0; - num -= 255; - } - *tmp_ptr++ = num&0xff; - } else - *tmp_ptr++ = num; - - if ( ((rptr_e - rptr_s) == (tmp_ptr - tmp_s)) && - !memcmp(rptr_s+1, tmp_s+1, (tmp_ptr - tmp_s) - 1) ) - *rptr_s += 1; - else { - if ( rptr_e + (tmp_ptr - tmp_s) > rptr_end ) { - xfree(raster); - xfree(tmp_s); - return (unsigned char *)NULL; - } - memcpy (rptr_e, tmp_s, tmp_ptr - tmp_s); - rptr_s = rptr_e; - rptr_e = rptr_s + (tmp_ptr - tmp_s); - } - } - xfree(tmp_s); - *nbytes = rptr_e - raster; - - return raster; -} -#endif /* PCL_FONT_COMPRESS */ diff --git a/nx-X11/programs/Xserver/Xprint/pcl/PclSFonts.h b/nx-X11/programs/Xserver/Xprint/pcl/PclSFonts.h deleted file mode 100644 index fdd62f651..000000000 --- a/nx-X11/programs/Xserver/Xprint/pcl/PclSFonts.h +++ /dev/null @@ -1,116 +0,0 @@ -/* $Xorg: PclSFonts.h,v 1.3 2000/08/17 19:48:08 cpqbld Exp $ */ -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifndef _PCLFONTS_H -#define _PCLFONTS_H - -/* -*-H-*- -****************************************************************************** -****************************************************************************** -* -* File: PclFonts.h -* Description: Send Soft Font Download data to the specified file pointer. -* -* -****************************************************************************** -****************************************************************************** -*/ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ - - -typedef struct { - unsigned char fid; /* sfont font ID */ - unsigned char cindex; /* character indext */ -} PclFontMapRec, PclFontMapPtr; - -typedef struct { - int h_offset; - int v_offset; - unsigned int width; - unsigned int height; - int font_pitch; - unsigned char *raster_top; -} PclCharDataRec, *PclCharDataPtr; - -typedef struct { - unsigned char spacing; - unsigned int pitch; - unsigned int cellheight; - unsigned int cellwidth; - int ascent; - int descent; -} PclFontDescRec, *PclFontDescPtr; - -typedef struct _PclFontHead8Rec { - char *fontname; - PclFontDescRec fd; - unsigned short fid; - unsigned char *index; - struct _PclFontHead8Rec *next; -} PclFontHead8Rec, *PclFontHead8Ptr; - -typedef struct _PclFontHead16Rec { - char *fontname; - PclFontDescRec fd; - unsigned short cur_fid; - unsigned char cur_cindex; - PclFontMapRec **index; - unsigned short firstCol; - unsigned short lastCol; - unsigned short firstRow; - unsigned short lastRow; - struct _PclFontHead16Rec *next; -} PclFontHead16Rec, *PclFontHead16Ptr; - -typedef struct _PclInternalFontRec { - char *fontname; - float pitch; - float height; - char *pcl_font_name; - char *spacing; - struct _PclInternalFontRec *next; -} PclInternalFontRec, *PclInternalFontPtr; - -typedef struct { - PclFontHead8Ptr phead8; - PclFontHead16Ptr phead16; - PclInternalFontPtr pinfont; - unsigned char cur_max_fid; -} PclSoftFontInfoRec, *PclSoftFontInfoPtr; - -#define MONOSPACE 0 -#define PROPSPACE 1 - -#endif /* _PCLFONTS_H */ diff --git a/nx-X11/programs/Xserver/Xprint/pcl/PclSpans.c b/nx-X11/programs/Xserver/Xprint/pcl/PclSpans.c deleted file mode 100644 index 51c0137fc..000000000 --- a/nx-X11/programs/Xserver/Xprint/pcl/PclSpans.c +++ /dev/null @@ -1,139 +0,0 @@ -/* $Xorg: PclSpans.c,v 1.3 2000/08/17 19:48:08 cpqbld Exp $ */ -/******************************************************************* -** -** ********************************************************* -** * -** * File: PclSpans.c -** * -** * Contents: -** * Code to set and fill spans in the PCL DDX -** * -** * Created: 10/23/95 -** * -** ********************************************************* -** -********************************************************************/ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ -/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclSpans.c,v 1.5 1999/12/13 02:12:57 robin Exp $ */ - - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "Pcl.h" -#include "gcstruct.h" -#include "windowstr.h" - -void -PclFillSpans( - DrawablePtr pDrawable, - GCPtr pGC, - int nSpans, - DDXPointPtr pPoints, - int *pWidths, - int fSorted) -{ - char t[80]; - FILE *outFile; - int xoffset, yoffset; - xRectangle *rects, *r; - RegionPtr fillRegion, region = 0; - int i; - int nbox; - BoxPtr pbox; - - if( PclUpdateDrawableGC( pGC, pDrawable, &outFile ) == FALSE ) - return; - - /* - * Build a region out of the spans - */ - rects = (xRectangle *)xalloc( nSpans * sizeof( xRectangle ) ); - xoffset = pDrawable->x; - yoffset = pDrawable->y; - - for( i = 0, r = rects; i < nSpans; i++, r++ ) - { - r->x = pPoints[i].x + xoffset; - r->y = pPoints[i].y + yoffset; - r->width = pWidths[i]; - r->height = 1; - } - fillRegion = RECTS_TO_REGION( pGC->pScreen, nSpans, rects, ( fSorted ) ? - CT_YSORTED : CT_UNSORTED ); - - /* - * Intersect this region with the clip region. Whatever's left, - * should be filled. - */ - REGION_INTERSECT( pGC->pScreen, region, fillRegion, pGC->clientClip ); - - pbox = REGION_RECTS( region ); - nbox = REGION_NUM_RECTS( region ); - - /* Enter HP-GL/2 */ - SEND_PCL( outFile, "\27%0B" ); - - while( nbox ) - { - sprintf( t, "PU%d,%d;RR%d,%d;", pbox->x1, pbox->y1, - pbox->x2, pbox->y2 ); - SEND_PCL( outFile, t ); - - nbox--; - pbox++; - } - - /* Go back to PCL */ - SEND_PCL( outFile, "\27%0A" ); - - /* - * Clean up the temporary regions - */ - REGION_DESTROY( pGC->pScreen, fillRegion ); - REGION_DESTROY( pGC->pScreen, region ); - xfree( rects ); -} - -void -PclSetSpans( - DrawablePtr pDrawable, - GCPtr pGC, - char *pSrc, - DDXPointPtr pPoints, - int *pWidths, - int nSpans, - int fSorted) -{ -} diff --git a/nx-X11/programs/Xserver/Xprint/pcl/PclText.c b/nx-X11/programs/Xserver/Xprint/pcl/PclText.c deleted file mode 100644 index be794772c..000000000 --- a/nx-X11/programs/Xserver/Xprint/pcl/PclText.c +++ /dev/null @@ -1,936 +0,0 @@ -/* $Xorg: PclText.c,v 1.5 2001/03/06 16:28:48 pookie Exp $ */ -/******************************************************************* -** -** ********************************************************* -** * -** * File: PclText.c -** * -** * Contents: -** * Character-drawing routines for the PCL DDX -** * -** * Created: 10/23/95 -** * -** ********************************************************* -** -********************************************************************/ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ -/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclText.c,v 1.10tsi Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifdef DO_TWO_BYTE_PCL -#include "iconv.h" -#endif /* DO_TWO_BYTE_PCL */ -#include "gcstruct.h" -#include "windowstr.h" - -#include "Pcl.h" -#include "migc.h" -#include - -#include "PclSFonts.h" - -static PclFontHead8Ptr makeFontHeader8 (FontPtr, PclSoftFontInfoPtr); -static PclFontHead16Ptr makeFontHeader16(FontPtr, PclSoftFontInfoPtr); -static PclInternalFontPtr makeInternalFont(FontPtr, PclSoftFontInfoPtr); -static void fillFontDescData(FontPtr, PclFontDescPtr, unsigned int); -static PclCharDataPtr fillCharDescData(PclCharDataPtr, CharInfoPtr); -static void output_text(FILE *, PclContextPrivPtr, unsigned char); -static char * getFontName(FontPtr); -static char isInternal(FontPtr); -static void selectInternalFont(FILE *, PclInternalFontPtr, int); -static void selectSize(FILE *, PclContextPrivPtr, PclInternalFontPtr); -static char t[80]; - -#ifdef DO_TWO_BYTE_PCL -static void code_conv(PclSoftFontInfoPtr, FontPtr, char *, char *); -#endif /* DO_TWO_BYTE_PCL */ - -#define ESC 0x1b -#define PER 0x25 -#define ETX 0x3 -#define ETX_ALT 0x2a -#define DOWNLOAD_FONT 0 -#define INTERNAL_FONT 1 - -int -PclPolyText8( - DrawablePtr pDrawable, - GCPtr pGC, - int x, - int y, - int count, - char *string) -{ -XpContextPtr pCon; -PclContextPrivPtr pConPriv; -unsigned long n, i; -int w; -CharInfoPtr charinfo[255], *chinfo; - -FILE *outFile; -PclSoftFontInfoPtr pSoftFontInfo; -PclFontHead8Ptr pfh8 = (PclFontHead8Ptr)NULL; -PclInternalFontPtr pin = (PclInternalFontPtr)NULL; -PclCharDataRec cd; -unsigned char *p; -unsigned char last_fid; -int max_ascent, max_descent; - -int nbox; -BoxPtr pbox; -BoxRec box; -RegionPtr drawRegion, region; -char font_type; - - if( PclUpdateDrawableGC( pGC, pDrawable, &outFile ) == FALSE ) - return x; - - GetGlyphs(pGC->font, (unsigned long)count, (unsigned char *)string, - Linear8Bit, &n, charinfo); - if ( n == 0 ) - return x; - - pCon = PclGetContextFromWindow( (WindowPtr)pDrawable ); - pConPriv = (PclContextPrivPtr) - pCon->devPrivates[PclContextPrivateIndex].ptr; - pSoftFontInfo = pConPriv->pSoftFontInfo; - font_type = isInternal(pGC->font); - if ( font_type == DOWNLOAD_FONT ) { - /* - * Create Soft Font Header Information - */ - pfh8 = makeFontHeader8(pGC->font, pSoftFontInfo); - if (!pfh8) - return x; - - /* - * exec Soft Font Downloading - */ - p = (unsigned char *)string; - for (i=0, chinfo=charinfo; iindex[*p] ) { - fillCharDescData(&cd, *chinfo); - PclDownloadSoftFont8(pConPriv->pJobFile, pSoftFontInfo, - pfh8, &cd, p); - xfree(cd.raster_top); - } - } - - /* - * print characters - */ - MACRO_START( outFile, pConPriv ); - sprintf(t, "\033%%0B;PU%d,%dPD;TD1;DT%c,1;", - x + pDrawable->x, y + pDrawable->y + pGC->font->info.fontAscent, - ETX); - SAVE_PCL( outFile, pConPriv, t ); - SAVE_PCL_COUNT( outFile, pConPriv, "FI0;SS;LB", 9 ); - - last_fid = 0; - w = 0; - max_ascent = charinfo[0]->metrics.ascent; - max_descent = charinfo[0]->metrics.descent; - p = (unsigned char *)string; - for (i=0, chinfo=charinfo; ifid ) { - sprintf(t, "%c;FI%d;SS;LB", ETX, pfh8->fid); - SAVE_PCL( outFile, pConPriv, t ); - - last_fid = pfh8->fid; - } - - output_text(outFile, pConPriv, pfh8->index[*p]); - - w += (*chinfo)->metrics.characterWidth; - max_ascent = MAX(max_ascent, (*chinfo)->metrics.ascent); - max_descent = MAX(max_descent, (*chinfo)->metrics.descent); - } - - sprintf(t, "%c", ETX); - SAVE_PCL_COUNT( outFile, pConPriv, t, 1 ); - sprintf(t, "TD0;\033%%1A"); - SAVE_PCL( outFile, pConPriv, t ); - MACRO_END( outFile ); - - } else { - int fid = 0; - - pin = makeInternalFont(pGC->font, pSoftFontInfo); - if (!pin) - return x; - - selectInternalFont(outFile, pin, fid); - - /* - * print characters - */ - MACRO_START( outFile, pConPriv ); - sprintf(t, "\033%%0B;PU%d,%dPD;TD1;DT%c,1;", - x + pDrawable->x, y + pDrawable->y + pGC->font->info.fontAscent, - ETX); - SAVE_PCL( outFile, pConPriv, t ); - selectSize(outFile, pConPriv, pin); - SAVE_PCL_COUNT( outFile, pConPriv, "FI0;SS;LB", 9 ); - - w = 0; - max_ascent = charinfo[0]->metrics.ascent; - max_descent = charinfo[0]->metrics.descent; - p = (unsigned char *)string; - for (i=0, chinfo=charinfo; imetrics.characterWidth; - max_ascent = MAX(max_ascent, (*chinfo)->metrics.ascent); - max_descent = MAX(max_descent, (*chinfo)->metrics.descent); - } - sprintf(t, "%c", ETX); - SAVE_PCL_COUNT( outFile, pConPriv, t, 1 ); - sprintf(t, "TD0;\033%%1A"); - SAVE_PCL( outFile, pConPriv, t ); - MACRO_END( outFile ); - } - - /* - * Convert the collection of rectangles into a proper region, then - * intersect it with the clip region. - */ - box.x1 = x + pDrawable->x; - box.y1 = y - max_ascent + pDrawable->y + pGC->font->info.fontAscent; - box.x2 = x + w + pDrawable->x; - box.y2 = y + max_descent + pDrawable->y + pGC->font->info.fontAscent; - - drawRegion = miRegionCreate( &box, 0 ); - region = miRegionCreate( NULL, 0 ); - miIntersect( region, drawRegion, pGC->pCompositeClip ); - - /* - * For each rectangle in the clip region, set the HP-GL/2 "input - * window" and render the entire polyline to it. - */ - pbox = REGION_RECTS( region ); - nbox = REGION_NUM_RECTS( region ); - - PclSendData(outFile, pConPriv, pbox, nbox, 1.0); - - /* - * Clean up the temporary regions - */ - REGION_DESTROY( pGC->pScreen, drawRegion ); - REGION_DESTROY( pGC->pScreen, region ); - - return x+w; -} - -int -PclPolyText16( - DrawablePtr pDrawable, - GCPtr pGC, - int x, - int y, - int count, - unsigned short *string) -{ -XpContextPtr pCon; -PclContextPrivPtr pConPriv; -unsigned long n, i; -int w; -CharInfoPtr charinfo[255], *chinfo; - -FILE *outFile; -PclSoftFontInfoPtr pSoftFontInfo; -PclFontHead16Ptr pfh16 = (PclFontHead16Ptr)NULL; -PclCharDataRec cd; -FontInfoPtr pfi; -unsigned char row, col; -char *p; -unsigned char last_fid; -int max_ascent, max_descent; -unsigned short def; - -int nbox; -BoxPtr pbox; -BoxRec box; -RegionPtr drawRegion, region; -char font_type; - - if( PclUpdateDrawableGC( pGC, pDrawable, &outFile ) == FALSE ) - return x; - - GetGlyphs(pGC->font, (unsigned long)count, (unsigned char *)string, - (FONTLASTROW(pGC->font) == 0) ? Linear16Bit : TwoD16Bit, - &n, charinfo); - - pCon = PclGetContextFromWindow( (WindowPtr)pDrawable ); - pConPriv = (PclContextPrivPtr) - pCon->devPrivates[PclContextPrivateIndex].ptr; - pSoftFontInfo = pConPriv->pSoftFontInfo; - - font_type = isInternal(pGC->font); - if ( font_type == DOWNLOAD_FONT ) { - /* - * Create Soft Font Header Information - */ - pfh16 = makeFontHeader16(pGC->font, pSoftFontInfo); - if (!pfh16) - return x; - - /* - * exec Soft Font Downloading - */ - pfi = (FontInfoRec *)&pGC->font->info; - p = (char *)string; - for (i=0, p=(char *)string, chinfo=charinfo; ifirstRow <= row) && (row <= pfi->lastRow) - && (pfi->firstCol <= col) && (col <= pfi->lastCol) ) { - row = row - pfi->firstRow; - col = col - pfi->firstCol; - } else { - def = pfi->defaultCh; - row = ((def>>8)&0xff) - pfi->firstRow; - col = (def&0xff) - pfi->firstCol; - } - if ( !pfh16->index[row][col].fid ) { - fillCharDescData(&cd, *chinfo); - PclDownloadSoftFont16(pConPriv->pJobFile, pSoftFontInfo, - pfh16, &cd, row, col); - xfree(cd.raster_top); - } - } - - /* - * print characters - */ - MACRO_START( outFile, pConPriv ); - sprintf(t, "\033%%0B;PU%d,%dPD;TD1;DT%c,1;", - x + pDrawable->x, y + pDrawable->y + pGC->font->info.fontAscent, - ETX); - SAVE_PCL( outFile, pConPriv, t ); - SAVE_PCL_COUNT( outFile, pConPriv, "FI0;SS;LB", 9 ); - - last_fid = 0; - - w = 0; - max_ascent = charinfo[0]->metrics.ascent; - max_descent = charinfo[0]->metrics.descent; - for (i=0, p=(char *)string, chinfo=charinfo; ifirstRow <= row) && (row <= pfi->lastRow) - && (pfi->firstCol <= col) && (col <= pfi->lastCol) ) { - row = row - pfi->firstRow; - col = col - pfi->firstCol; - } else { - def = pfi->defaultCh; - row = ((def>>8)&0xff) - pfi->firstRow; - col = (def&0xff) - pfi->firstCol; - } - if ( last_fid != pfh16->index[row][col].fid ) { - sprintf(t, "%cFI%d;SS;LB", - ETX, pfh16->index[row][col].fid); - SAVE_PCL( outFile, pConPriv, t ); - last_fid = pfh16->index[row][col].fid; - } - - output_text(outFile, pConPriv, pfh16->index[row][col].cindex); - - w += (*chinfo)->metrics.characterWidth; - max_ascent = MAX(max_ascent, (*chinfo)->metrics.ascent); - max_descent = MAX(max_descent, (*chinfo)->metrics.descent); - } - sprintf(t, "%c", ETX); - SAVE_PCL_COUNT( outFile, pConPriv, t, 1 ); - sprintf(t, "TD0;\033%%1A"); - SAVE_PCL( outFile, pConPriv, t ); - MACRO_END( outFile ); - - } else { -#ifdef DO_TWO_BYTE_PCL - PclInternalFontPtr pin; - int fid = 0; - - pin = makeInternalFont(pGC->font, pSoftFontInfo); - if (!pin) - return x; - - selectInternalFont(outFile, pin, fid); - fprintf(outFile, "%c&t31P", ESC); - - /* - * print characters - */ - MACRO_START( outFile, pConPriv ); - sprintf(t, "\033%%0B;PU%d,%dPD;TD1;DT%c,1;", - x + pDrawable->x, y + pDrawable->y + pGC->font->info.fontAscent, - ETX); - SAVE_PCL( outFile, pConPriv, t ); - sprintf(t, "TD0;\033%%1A"); - SAVE_PCL( outFile, pConPriv, t ); - - w = 0; - last_fid = 0; - max_ascent = charinfo[0]->metrics.ascent; - max_descent = charinfo[0]->metrics.descent; - for (i=0, p=(char *)string, chinfo=charinfo; ifont, (char *)p, tobuf); - fprintf(outFile, "%c%c", tobuf[0], tobuf[1]); - - w += (*chinfo)->metrics.characterWidth; - max_ascent = MAX(max_ascent, (*chinfo)->metrics.ascent); - max_descent = MAX(max_descent, (*chinfo)->metrics.descent); - } - MACRO_END( outFile ); -#else - return x; -#endif /* DO_TWO_BYTE_PCL */ - } - - /* - * Convert the collection of rectangles into a proper region, then - * intersect it with the clip region. - */ - box.x1 = x + pDrawable->x; - box.y1 = y - max_ascent + pDrawable->y + pGC->font->info.fontAscent; - box.x2 = x + w + pDrawable->x; - box.y2 = y + max_descent + pDrawable->y + pGC->font->info.fontAscent; - - drawRegion = miRegionCreate( &box, 0 ); - region = miRegionCreate( NULL, 0 ); - miIntersect( region, drawRegion, pGC->pCompositeClip ); - - /* - * For each rectangle in the clip region, set the HP-GL/2 "input - * window" and render the entire polyline to it. - */ - pbox = REGION_RECTS( region ); - nbox = REGION_NUM_RECTS( region ); - - PclSendData(outFile, pConPriv, pbox, nbox, 1.0); - - /* - * Clean up the temporary regions - */ - REGION_DESTROY( pGC->pScreen, drawRegion ); - REGION_DESTROY( pGC->pScreen, region ); - - return x+w; -} - -void -PclImageText8( - DrawablePtr pDrawable, - GCPtr pGC, - int x, int y, - int count, - char *string) -{ -} - -void -PclImageText16( - DrawablePtr pDrawable, - GCPtr pGC, - int x, - int y, - int count, - unsigned short *string) -{ -} - -void -PclImageGlyphBlt( - DrawablePtr pDrawable, - GCPtr pGC, - int x, int y, - unsigned int nGlyphs, - CharInfoPtr *pCharInfo, - pointer pGlyphBase) -{ -} - -void -PclPolyGlyphBlt( - DrawablePtr pDrawable, - GCPtr pGC, - int x, int y, - unsigned int nGlyphs, - CharInfoPtr *pCharInfo, - pointer pGlyphBase) -{ -} - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -static PclFontHead8Ptr -makeFontHeader8(FontPtr pfont, PclSoftFontInfoPtr pSoftFontInfo) -{ -PclFontHead8Ptr phead8 = pSoftFontInfo->phead8; -PclFontHead8Ptr pfh8 = phead8; -PclFontHead8Ptr prev = (PclFontHead8Ptr)NULL; -FontInfoPtr pfi; -char *fontname; -unsigned char nindex; -int i; -unsigned long n; -CharInfoPtr charinfo[1]; -unsigned int space_width; - - if (pSoftFontInfo == (PclSoftFontInfoPtr) NULL) - return (PclFontHead8Ptr)NULL; - - /* - * Verify it has already been created, if so, return it. - */ - if ( (fontname = getFontName(pfont)) == (char *)NULL) - return (PclFontHead8Ptr)NULL; - - while (pfh8 != (PclFontHead8Ptr) NULL) { - if (!strcmp(pfh8->fontname, fontname)) - return pfh8; - prev = pfh8; - pfh8 = pfh8->next; - } - - /* - * Create Font Header Information - */ - pfh8 = (PclFontHead8Ptr)xalloc(sizeof(PclFontHead8Rec)); - if (pfh8 == (PclFontHead8Ptr)NULL) - return (PclFontHead8Ptr)NULL; - - pfi = (FontInfoRec *)&pfont->info; - GetGlyphs(pfont, 1, (unsigned char *)&pfi->defaultCh, - Linear8Bit, &n, charinfo); - if ( n ) - space_width = charinfo[0]->metrics.characterWidth; - else - space_width = FONTMAXBOUNDS(pfont,characterWidth); - - fillFontDescData(pfont, &(pfh8->fd), space_width); - pfh8->fid = 0; - pfh8->fontname = (char *)xalloc(strlen(fontname) + 1); - if (pfh8->fontname == (char *)NULL) { - xfree(pfh8); - return (PclFontHead8Ptr) NULL; - } - strcpy(pfh8->fontname, fontname); - - nindex = 0xff; - pfh8->index = (unsigned char *)xalloc(nindex); - if ( pfh8->index == (unsigned char *) NULL ) { - xfree(pfh8->fontname); - xfree(pfh8); - return (PclFontHead8Ptr) NULL; - } - - for (i=0; i<=nindex; i++) - pfh8->index[i] = 0x0; - - pfh8->next = (PclFontHead8Ptr)NULL; - - if ( prev == (PclFontHead8Ptr) NULL) - pSoftFontInfo->phead8 = pfh8; - else - prev->next = pfh8; - - return pfh8; -} - -static PclFontHead16Ptr -makeFontHeader16(FontPtr pfont, PclSoftFontInfoPtr pSoftFontInfo) -{ -PclFontHead16Ptr phead16 = pSoftFontInfo->phead16; -PclFontHead16Ptr pfh16 = phead16; -PclFontHead16Ptr prev = (PclFontHead16Ptr)NULL; -PclFontMapRec ** index; -FontInfoPtr pfi; -char *fontname; -unsigned char nindex_row, nindex_col; -int i, j; -unsigned long n; -CharInfoPtr charinfo[1]; -unsigned int space_width; - - if (pSoftFontInfo == (PclSoftFontInfoPtr) NULL) - return (PclFontHead16Ptr)NULL; - - /* - * Verify it has already been created, if so, return it. - */ - if ( (fontname = getFontName(pfont)) == (char *)NULL) - return (PclFontHead16Ptr)NULL; - - while (pfh16 != (PclFontHead16Ptr) NULL) { - if (!strcmp(pfh16->fontname, fontname)) - return pfh16; - prev = pfh16; - pfh16 = pfh16->next; - } - - /* - * Create Font Header Information - */ - pfh16 = (PclFontHead16Ptr)xalloc(sizeof(PclFontHead16Rec)); - if (pfh16 == (PclFontHead16Ptr)NULL) - return (PclFontHead16Ptr)NULL; - - pfi = (FontInfoRec *)&pfont->info; - GetGlyphs(pfont, 1, (unsigned char *)&pfi->defaultCh, - (FONTLASTROW(pfont) == 0) ? Linear16Bit : TwoD16Bit, - &n, charinfo); - - if ( n ) - space_width = charinfo[0]->metrics.characterWidth; - else - space_width = FONTMAXBOUNDS(pfont,characterWidth); - - fillFontDescData(pfont, &(pfh16->fd), space_width); - pfh16->cur_fid = 0; - pfh16->cur_cindex = 0; - pfh16->fontname = (char *)xalloc(strlen(fontname) + 1); - if (pfh16->fontname == (char *)NULL) { - xfree(pfh16); - return (PclFontHead16Ptr) NULL; - } - strcpy(pfh16->fontname, fontname); - - pfi = (FontInfoRec *)&pfont->info; - nindex_col = pfi->lastCol - pfi->firstCol + 1; - nindex_row = pfi->lastRow - pfi->firstRow + 1; - index = (PclFontMapRec **)xalloc(sizeof(PclFontMapRec *)*nindex_row); - if (index == (PclFontMapRec **)NULL) { - xfree(pfh16->fontname); - xfree(pfh16); - return (PclFontHead16Ptr) NULL; - } - for (i=0; ifontname); - xfree(pfh16); - return (PclFontHead16Ptr) NULL; - } - for (j=0; j<=nindex_col; j++) - index[i][j].fid = 0x0; - } - - pfh16->index = index; - pfh16->firstCol = pfi->firstCol; - pfh16->lastCol = pfi->lastCol; - pfh16->firstRow = pfi->firstRow; - pfh16->lastRow = pfi->lastRow; - pfh16->next = (PclFontHead16Ptr)NULL; - - if ( prev == (PclFontHead16Ptr) NULL) - pSoftFontInfo->phead16 = pfh16; - else - prev->next = pfh16; - - return pfh16; -} - -static PclInternalFontPtr -makeInternalFont(FontPtr pfont, PclSoftFontInfoPtr pSoftFontInfo) -{ -PclInternalFontPtr pinfont = pSoftFontInfo->pinfont; -PclInternalFontPtr pin = pinfont; -PclInternalFontPtr prev = (PclInternalFontPtr)NULL; -FontPropPtr props; -FontInfoPtr pfi; -char *fontname; -Atom xa_pcl_font_name, xa_res, xa_ave_width, xa_spacing; -int width = 1; -int mask; -int i; - - if (pSoftFontInfo == (PclSoftFontInfoPtr) NULL) - return (PclInternalFontPtr)NULL; - - /* - * Verify it has already been created, if so, return it. - */ - if ( (fontname = getFontName(pfont)) == (char *)NULL) - return (PclInternalFontPtr)NULL; - - while (pin != (PclInternalFontPtr) NULL) { - if (!strcmp(pin->fontname, fontname)) - return pin; - prev = pin; - pin = pin->next; - } - - /* - * Create Internal Font Information - */ - pin = (PclInternalFontPtr)xalloc(sizeof(PclInternalFontRec)); - if (pin == (PclInternalFontPtr)NULL) - return (PclInternalFontPtr)NULL; - - pin->fontname = (char *)xalloc(strlen(fontname) + 1); - if (pin->fontname == (char *)NULL) { - xfree(pin); - return (PclInternalFontPtr) NULL; - } - strcpy(pin->fontname, fontname); - - xa_pcl_font_name = MakeAtom("PCL_FONT_NAME", strlen("PCL_FONT_NAME"), TRUE); - xa_res = MakeAtom("RESOLUTION_X", strlen("RESOLUTION_X"), TRUE); - xa_ave_width = MakeAtom("AVERAGE_WIDTH", strlen("AVERAGE_WIDTH"), TRUE); - xa_spacing = MakeAtom("SPACING", strlen("SPACING"), TRUE); - pfi = (FontInfoRec *)&pfont->info; - props = pfi->props; - - mask = 0; - for (i=0; inprops; i++, props++) { - if ( (Atom) props->name == xa_pcl_font_name ) { - pin->pcl_font_name = NameForAtom(props->value); - mask |= 0x1; - } else if ( props->name == XA_POINT_SIZE ) { - pin->height = (float) props->value / 10.0; - mask |= 0x2; - } else if ( (Atom) props->name == xa_res ) { - mask |= 0x4; - } else if ( (Atom) props->name == xa_ave_width ) { - width = (int) props->value / 10; - mask |= 0x8; - } else if ( (Atom) props->name == xa_spacing ) { - pin->spacing = NameForAtom(props->value); - mask |= 0x10; - } - } - if ( mask != 0x1f ) { - xfree(pin->fontname); - xfree(pin); - return (PclInternalFontPtr) NULL; - } - - if ( *pin->spacing != 'P' || *pin->spacing != 'p' ) { - if (width == 0) - width = 1; - pin->pitch = (float) 300.0 / width; /* Hard-Code: Resolution is 300 */ - } - - pin->next = (PclInternalFontPtr)NULL; - if ( prev == (PclInternalFontPtr) NULL) - pSoftFontInfo->pinfont = pin; - else - prev->next = pin; - - return pin; -} - -static void -fillFontDescData(FontPtr pfont, PclFontDescPtr pfd, unsigned int space) -{ -FontInfoPtr pfi; - - pfi = (FontInfoRec *)&pfont->info; - - if ( (pfi->maxbounds.leftSideBearing == pfi->minbounds.leftSideBearing) - && (pfi->maxbounds.rightSideBearing == pfi->minbounds.rightSideBearing) - && (pfi->maxbounds.characterWidth == pfi->minbounds.characterWidth) - && (pfi->maxbounds.ascent == pfi->minbounds.ascent) - && (pfi->maxbounds.descent == pfi->minbounds.descent) - ) - pfd->spacing = MONOSPACE; - else - pfd->spacing = PROPSPACE; - - pfd->pitch = space; - pfd->cellheight = FONTMAXBOUNDS(pfont,ascent) - + FONTMAXBOUNDS(pfont,descent); - pfd->cellwidth = FONTMAXBOUNDS(pfont,rightSideBearing) - - FONTMINBOUNDS(pfont,leftSideBearing); - pfd->ascent = FONTMAXBOUNDS(pfont,ascent); /*FONTASCENT(pfont);*/ - pfd->descent = FONTMAXBOUNDS(pfont,descent); /*FONTDESCENT(pfont);*/ -} - -static PclCharDataPtr -fillCharDescData(PclCharDataPtr pcd, CharInfoPtr pci) -{ -unsigned int byte_width; -unsigned char *p; -register int nbyGlyphWidth; -unsigned char *pglyph, *pg; -unsigned int i, j; - - pcd->h_offset = pci->metrics.leftSideBearing; - pcd->v_offset = pci->metrics.ascent; - pcd->width = pci->metrics.rightSideBearing - - pci->metrics.leftSideBearing; - pcd->height = pci->metrics.ascent + pci->metrics.descent; - pcd->font_pitch = pci->metrics.characterWidth; - - byte_width = (pcd->width + 7)/8; - pcd->raster_top = (unsigned char *)xalloc(byte_width * pcd->height); - if (pcd->raster_top == (unsigned char *)NULL) - return (PclCharDataPtr)NULL; - - p = pcd->raster_top; - nbyGlyphWidth = GLYPHWIDTHBYTESPADDED(pci); - pglyph = FONTGLYPHBITS(pglyphBase, pci); - for (i=0; iheight; i++) { - pg = pglyph + nbyGlyphWidth * i; - for (j=0; jinfo; - props = pfi->props; - fontname = (char *) NULL; - for (i=0; inprops; i++, props++) { - if ( props->name == XA_FONT ) { - fontname = (char *)NameForAtom(props->value); - break; - } - } - return fontname; -} - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Internal Font Selection */ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -static char -isInternal(FontPtr pfont) -{ -int i; -FontInfoPtr pfi; -FontPropPtr props; -Atom dest; - - dest = MakeAtom("PRINTER_RESIDENT_FONT", strlen("PRINTER_RESIDENT_FONT"), TRUE); - - pfi = (FontInfoRec *)&pfont->info; - props = pfi->props; - for (i=0; inprops; i++, props++) { - if ( (Atom) props->name == dest && props->value == 2 ) - return INTERNAL_FONT; - } - return DOWNLOAD_FONT; -} - -static void -selectInternalFont(FILE *outFile, PclInternalFontPtr pin, int fid) -{ - fprintf(outFile, "%c*c%dD", ESC, fid); - if ( *pin->spacing == 'P' || *pin->spacing == 'p' ) - fprintf(outFile, pin->pcl_font_name, pin->height); - else - fprintf(outFile, pin->pcl_font_name, pin->pitch); - fprintf(outFile, "%c*c6F", ESC); -} - -static void -selectSize(FILE *outFile, - PclContextPrivPtr pConPriv, - PclInternalFontPtr pin) -{ - if ( *pin->spacing == 'P' || *pin->spacing == 'p' ) { - sprintf(t, "SD4,%f;", pin->height); - SAVE_PCL( outFile, pConPriv, t ); - } else { - sprintf(t, "SD3,%f;", pin->pitch); - SAVE_PCL( outFile, pConPriv, t ); - } - return; -} - -#ifdef DO_TWO_BYTE_PCL -static void -code_conv( - PclSoftFontInfoPtr pSoftFontInfo, - FontPtr pfont, - char *from, - char *to -) -{ -iconv_t cd; -char frombuf[9], *fromptr; -size_t inbyte = 5, outbyte=2; - - fromptr = frombuf; - frombuf[0] = 0x1b; /* Esc */ - frombuf[1] = 0x24; /* $ */ - frombuf[2] = 0x42; /* B */ - frombuf[3] = *from; - frombuf[4] = *(from+1); - frombuf[5] = 0x1b; /* Esc */ - frombuf[6] = 0x28; /* ( */ - frombuf[7] = 0x4a; /* J */ - frombuf[8] = 0x0; - if ((cd = iconv_open("sjis", "jis")) == (iconv_t)(-1)) { - *to = (unsigned char)NULL; - return; - } - - if ( iconv(cd, &fromptr, &inbyte, &to, &outbyte) == -1 ) - *to = (unsigned char)NULL; - - iconv_close(cd); - return; -} -#endif /* DO_TWO_BYTE_PCL */ diff --git a/nx-X11/programs/Xserver/Xprint/pcl/PclWindow.c b/nx-X11/programs/Xserver/Xprint/pcl/PclWindow.c deleted file mode 100644 index cac5826e9..000000000 --- a/nx-X11/programs/Xserver/Xprint/pcl/PclWindow.c +++ /dev/null @@ -1,452 +0,0 @@ -/* $Xorg: PclWindow.c,v 1.3 2000/08/17 19:48:08 cpqbld Exp $ */ -/******************************************************************* -** -** ********************************************************* -** * -** * File: PclWindow.c -** * -** * Contents: -** * Window code for Pcl driver. -** * -** * Created: 2/02/95 -** * -** ********************************************************* -** -********************************************************************/ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ -/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclWindow.c,v 1.10tsi Exp $ */ - - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include -#include - -#include "mistruct.h" -#include "regionstr.h" -#include "windowstr.h" -#include "gcstruct.h" - -#include "Pcl.h" - -#if 0 -/* - * The following list of strings defines the properties which will be - * placed on the screen's root window if the property was defined in - * the start-up configuration resource database. - */ -static /* const */ char *propStrings[] = { - DT_PRINT_JOB_HEADER, - DT_PRINT_JOB_TRAILER, - DT_PRINT_JOB_COMMAND, /* old-obsolete */ - DT_PRINT_JOB_EXEC_COMMAND, - DT_PRINT_JOB_EXEC_OPTIONS, - DT_PRINT_PAGE_HEADER, - DT_PRINT_PAGE_TRAILER, - DT_PRINT_PAGE_COMMAND, - (char *)NULL -}; -#endif - -/* - * PclCreateWindow - watch for the creation of the root window. - * When it's created, register the screen with the print extension, - * and put the default command/header properties on it. - */ -/*ARGSUSED*/ - -Bool -PclCreateWindow( - register WindowPtr pWin) -{ - PclWindowPrivPtr pPriv; - -#if 0 - Bool status = Success; - ScreenPtr pScreen = pWin->drawable.pScreen; - PclScreenPrivPtr pScreenPriv = (PclScreenPrivPtr) - pScreen->devPrivates[PclScreenPrivateIndex].ptr; - PclWindowPrivPtr pWinPriv = (PclWindowPrivPtr) - pWin->devPrivates[PclWindowPrivateIndex].ptr; - - /* - * Initialize this window's private struct. - */ - pWinPriv->jobFileName = (char *)NULL; - pWinPriv->pJobFile = (FILE *)NULL; - pWinPriv->pageFileName = (char *)NULL; - pWinPriv->pPageFile = (FILE *)NULL; - - if(pWin->parent == (WindowPtr)NULL) /* root window? */ - { - Atom propName; /* type = XA_STRING */ - char *propVal; - int i; - XrmDatabase rmdb = pScreenPriv->resDB; - - /* - * Put the defaults spec'd in the config files in properties on this - * screen's root window. - */ - for(i = 0; propStrings[i] != (char *)NULL; i++) - { - if((propVal = _DtPrintGetPrinterResource(pWin, rmdb, - propStrings[i])) != - (char *)NULL) - { - propName = MakeAtom(propStrings[i], strlen(propStrings[i]), - TRUE); - ChangeWindowProperty(pWin, propName, XA_STRING, 8, - PropModeReplace, strlen(propVal), - (pointer)propVal, FALSE); - xfree(propVal); - } - } - } - - return status; -#endif - - /* - * Invalidate the window's private print context. - */ - pPriv = (PclWindowPrivPtr)pWin->devPrivates[PclWindowPrivateIndex].ptr; - pPriv->validContext = 0; - - return TRUE; -} - - -/*ARGSUSED*/ -Bool PclMapWindow( - WindowPtr pWindow) -{ - return TRUE; -} - -/*ARGSUSED*/ -Bool -PclPositionWindow( - register WindowPtr pWin, - int x, - int y) -{ - return TRUE; -} - -/*ARGSUSED*/ -Bool -PclUnmapWindow( - WindowPtr pWindow) -{ - return TRUE; -} - -/*ARGSUSED*/ -void -PclCopyWindow( - WindowPtr pWin, - DDXPointRec ptOldOrg, - RegionPtr prgnSrc) -{ -} - -/*ARGSUSED*/ -Bool -PclChangeWindowAttributes( - register WindowPtr pWin, - register unsigned long mask) -{ - if( pWin->backingStore != NotUseful ) - { - pWin->backingStore = NotUseful; - mask |= CWBackingStore; - } - - return TRUE; -} - - -/* - * This function is largely ripped from miPaintWindow, but modified so - * that the background is not painted to the root window, and so that - * the backing store is not referenced. - */ -void -PclPaintWindow( - WindowPtr pWin, - RegionPtr pRegion, - int what) -{ - -#define FUNCTION 0 -#define FOREGROUND 1 -#define TILE 2 -#define FILLSTYLE 3 -#define ABSX 4 -#define ABSY 5 -#define CLIPMASK 6 -#define SUBWINDOW 7 -#define COUNT_BITS 8 - - pointer gcval[7]; - pointer newValues [COUNT_BITS]; - - BITS32 gcmask, index, mask; - RegionRec prgnWin; - DDXPointRec oldCorner; - BoxRec box; - WindowPtr pBgWin; - GCPtr pGC; - register int i; - register BoxPtr pbox; - register ScreenPtr pScreen = pWin->drawable.pScreen; - register xRectangle *prect; - int numRects; - - gcmask = 0; - - /* - * We don't want to paint a window that has no place to put the - * PCL output. - */ - if( PclGetContextFromWindow( pWin ) == (XpContextPtr)NULL ) - return; - - if (what == PW_BACKGROUND) - { - switch (pWin->backgroundState) { - case None: - return; - case ParentRelative: - (*pWin->parent->drawable.pScreen->PaintWindowBackground) - (pWin->parent, pRegion, what); - return; - case BackgroundPixel: - newValues[FOREGROUND] = (pointer)pWin->background.pixel; - newValues[FILLSTYLE] = (pointer)FillSolid; - gcmask |= GCForeground | GCFillStyle; - break; - case BackgroundPixmap: - newValues[TILE] = (pointer)pWin->background.pixmap; - newValues[FILLSTYLE] = (pointer)FillTiled; - gcmask |= GCTile | GCFillStyle | GCTileStipXOrigin | - GCTileStipYOrigin; - break; - } - } - else - { - if (pWin->borderIsPixel) - { - newValues[FOREGROUND] = (pointer)pWin->border.pixel; - newValues[FILLSTYLE] = (pointer)FillSolid; - gcmask |= GCForeground | GCFillStyle; - } - else - { - newValues[TILE] = (pointer)pWin->border.pixmap; - newValues[FILLSTYLE] = (pointer)FillTiled; - gcmask |= GCTile | GCFillStyle | GCTileStipXOrigin - | GCTileStipYOrigin; - } - } - - prect = (xRectangle *)ALLOCATE_LOCAL(REGION_NUM_RECTS(pRegion) * - sizeof(xRectangle)); - if (!prect) - return; - - newValues[FUNCTION] = (pointer)GXcopy; - gcmask |= GCFunction | GCClipMask; - - i = pScreen->myNum; - - pBgWin = pWin; - if (what == PW_BORDER) - { - while (pBgWin->backgroundState == ParentRelative) - pBgWin = pBgWin->parent; - } - - pGC = GetScratchGC(pWin->drawable.depth, pWin->drawable.pScreen); - if (!pGC) - { - DEALLOCATE_LOCAL(prect); - return; - } - /* - * mash the clip list so we can paint the border by - * mangling the window in place, pretending it - * spans the entire screen - */ - if (what == PW_BORDER) - { - prgnWin = pWin->clipList; - oldCorner.x = pWin->drawable.x; - oldCorner.y = pWin->drawable.y; - pWin->drawable.x = pWin->drawable.y = 0; - box.x1 = 0; - box.y1 = 0; - box.x2 = pScreen->width; - box.y2 = pScreen->height; - REGION_INIT(pScreen, &pWin->clipList, &box, 1); - pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; - newValues[ABSX] = (pointer)(long)pBgWin->drawable.x; - newValues[ABSY] = (pointer)(long)pBgWin->drawable.y; - } - else - { - newValues[ABSX] = (pointer)0; - newValues[ABSY] = (pointer)0; - } - -/* - * XXX Backing store is turned off for the PCL driver - - if (pWin->backStorage) - (*pWin->drawable.pScreen->DrawGuarantee) (pWin, pGC, - GuaranteeVisBack); - */ - - mask = gcmask; - gcmask = 0; - i = 0; - while (mask) { - index = lowbit (mask); - mask &= ~index; - switch (index) { - case GCFunction: - if ((pointer)(long) pGC->alu != newValues[FUNCTION]) { - gcmask |= index; - gcval[i++] = newValues[FUNCTION]; - } - break; - case GCTileStipXOrigin: - if ((pointer)(long) pGC->patOrg.x != newValues[ABSX]) { - gcmask |= index; - gcval[i++] = newValues[ABSX]; - } - break; - case GCTileStipYOrigin: - if ((pointer)(long) pGC->patOrg.y != newValues[ABSY]) { - gcmask |= index; - gcval[i++] = newValues[ABSY]; - } - break; - case GCClipMask: - if ((pointer)(long) pGC->clientClipType != (pointer)CT_NONE) { - gcmask |= index; - gcval[i++] = (pointer)CT_NONE; - } - break; - case GCSubwindowMode: - if ((pointer)(long) pGC->subWindowMode != newValues[SUBWINDOW]) { - gcmask |= index; - gcval[i++] = newValues[SUBWINDOW]; - } - break; - case GCTile: - if (pGC->tileIsPixel || - (pointer) pGC->tile.pixmap != newValues[TILE]) - { - gcmask |= index; - gcval[i++] = newValues[TILE]; - } - break; - case GCFillStyle: - if ((pointer)(long) pGC->fillStyle != newValues[FILLSTYLE]) { - gcmask |= index; - gcval[i++] = newValues[FILLSTYLE]; - } - break; - case GCForeground: - if ((pointer) pGC->fgPixel != newValues[FOREGROUND]) { - gcmask |= index; - gcval[i++] = newValues[FOREGROUND]; - } - break; - } - } - - if (gcmask) - DoChangeGC(pGC, gcmask, (XID *)gcval, 1); - - if (pWin->drawable.serialNumber != pGC->serialNumber) - ValidateGC((DrawablePtr)pWin, pGC); - - numRects = REGION_NUM_RECTS(pRegion); - pbox = REGION_RECTS(pRegion); - for (i= numRects; --i >= 0; pbox++, prect++) - { - prect->x = pbox->x1 - pWin->drawable.x; - prect->y = pbox->y1 - pWin->drawable.y; - prect->width = pbox->x2 - pbox->x1; - prect->height = pbox->y2 - pbox->y1; - } - prect -= numRects; - (*pGC->ops->PolyFillRect)((DrawablePtr)pWin, pGC, numRects, prect); - DEALLOCATE_LOCAL(prect); - -/* - * XXX Backing store is turned off for the PCL driver - - if (pWin->backStorage) - (*pWin->drawable.pScreen->DrawGuarantee) (pWin, pGC, - GuaranteeNothing); - */ - - if (what == PW_BORDER) - { - REGION_UNINIT(pScreen, &pWin->clipList); - pWin->clipList = prgnWin; - pWin->drawable.x = oldCorner.x; - pWin->drawable.y = oldCorner.y; - pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; - } - FreeScratchGC(pGC); - -} - -/*ARGSUSED*/ -Bool -PclDestroyWindow( - WindowPtr pWin) -{ - return TRUE; -} - diff --git a/nx-X11/programs/Xserver/Xprint/pcl/Pclmap.h b/nx-X11/programs/Xserver/Xprint/pcl/Pclmap.h deleted file mode 100644 index 5224fd9e3..000000000 --- a/nx-X11/programs/Xserver/Xprint/pcl/Pclmap.h +++ /dev/null @@ -1,213 +0,0 @@ -/* $Xorg: Pclmap.h,v 1.3 2000/08/17 19:48:08 cpqbld Exp $ */ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ -/* $XFree86: xc/programs/Xserver/Xprint/pcl/Pclmap.h,v 1.5 2001/07/25 15:05:00 dawes Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifndef _PCLMAP_H_ -#define _PCLMAP_H_ - -#ifdef XP_PCL_COLOR -#ifdef CATNAME -#undef CATNAME -#endif -#if !defined(UNIXCPP) || defined(ANSICPP) -#define PCLNAME(subname) PclCr##subname -#define CATNAME(prefix,subname) prefix##Color##subname -#else -#define PCLNAME(subname) PclCr/**/subname -#define CATNAME(prefix,subname) prefix/**/Color/**/subname -#endif -#endif /* XP_PCL_COLOR */ - -#ifdef XP_PCL_MONO -#ifdef CATNAME -#undef CATNAME -#endif -#if !defined(UNIXCPP) || defined(ANSICPP) -#define PCLNAME(subname) PclMn##subname -#define CATNAME(prefix,subname) prefix##Mono##subname -#else -#define PCLNAME(subname) PclMn/**/subname -#define CATNAME(prefix,subname) prefix/**/Mono/**/subname -#endif -#endif /* XP_PCL_MONO */ - -#ifdef XP_PCL_LJ3 -#ifdef CATNAME -#undef CATNAME -#endif -#if !defined(UNIXCPP) || defined(ANSICPP) -#define PCLNAME(subname) PclLj3##subname -#define CATNAME(prefix,subname) prefix##Lj3##subname -#else -#define PCLNAME(subname) PclLj3/**/subname -#define CATNAME(prefix,subname) prefix/**/Lj3/**/subname -#endif -#endif /* XP_PCL_LJ3 */ - -#ifdef PCLNAME - -/* PclInit.c */ -#define InitializePclDriver CATNAME(Initialize, PclDriver) -#define PclCloseScreen PCLNAME(CloseScreen) -#define PclGetContextFromWindow PCLNAME(GetContextFromWindow) -#define PclScreenPrivateIndex PCLNAME(ScreenPrivateIndex) -#define PclWindowPrivateIndex PCLNAME(WindowPrivateIndex) -#define PclContextPrivateIndex PCLNAME(ContextPrivateIndex) -#define PclPixmapPrivateIndex PCLNAME(PixmapPrivateIndex) -#define PclGCPrivateIndex PCLNAME(GCPrivateIndex) - -/* PclPrint.c */ -#define PclStartJob PCLNAME(StartJob) -#define PclEndJob PCLNAME(EndJob) -#define PclStartPage PCLNAME(StartPage) -#define PclEndPage PCLNAME(EndPage) -#define PclStartDoc PCLNAME(StartDoc) -#define PclEndDoc PCLNAME(EndDoc) -#define PclDocumentData PCLNAME(DocumentData) -#define PclGetDocumentData PCLNAME(GetDocumentData) - -/* PclWindow.c */ -#define PclCreateWindow PCLNAME(CreateWindow) -#define PclMapWindow PCLNAME(MapWindow) -#define PclPositionWindow PCLNAME(PositionWindow) -#define PclUnmapWindow PCLNAME(UnmapWindow) -#define PclCopyWindow PCLNAME(CopyWindow) -#define PclChangeWindowAttributes PCLNAME(ChangeWindowAttributes) -#define PclPaintWindow PCLNAME(PaintWindow) -#define PclDestroyWindow PCLNAME(DestroyWindow) - -/* PclGC.c */ -#define PclCreateGC PCLNAME(CreateGC) -#define PclDestroyGC PCLNAME(DestroyGC) -#define PclGetDrawablePrivateStuff PCLNAME(GetDrawablePrivateStuff) -#define PclSetDrawablePrivateGC PCLNAME(SetDrawablePrivateGC) -#define PclSendPattern PCLNAME(SendPattern) -#define PclUpdateDrawableGC PCLNAME(UpdateDrawableGC) -#define PclComputeCompositeClip PCLNAME(ComputeCompositeClip) -#define PclValidateGC PCLNAME(ValidateGC) - -/* PclAttr.c */ -#define PclGetAttributes PCLNAME(GetAttributes) -#define PclGetOneAttribute PCLNAME(GetOneAttribute) -#define PclAugmentAttributes PCLNAME(AugmentAttributes) -#define PclSetAttributes PCLNAME(SetAttributes) - -/* PclColor.c */ -#define PclLookUp PCLNAME(LookUp) -#define PclCreateDefColormap PCLNAME(CreateDefColormap) -#define PclCreateColormap PCLNAME(CreateColormap) -#define PclDestroyColormap PCLNAME(DestroyColormap) -#define PclInstallColormap PCLNAME(InstallColormap) -#define PclUninstallColormap PCLNAME(UninstallColormap) -#define PclListInstalledColormaps PCLNAME(ListInstalledColormaps) -#define PclStoreColors PCLNAME(StoreColors) -#define PclResolveColor PCLNAME(ResolveColor) -#define PclFindPaletteMap PCLNAME(FindPaletteMap) -#define PclUpdateColormap PCLNAME(UpdateColormap) -#define PclReadMap PCLNAME(ReadMap) - -/* PclPixmap.c */ -#define PclCreatePixmap PCLNAME(CreatePixmap) -#define PclDestroyPixmap PCLNAME(DestroyPixmap) - -/* PclArc.c */ -#define PclDoArc PCLNAME(DoArc) -#define PclPolyArc PCLNAME(PolyArc) -#define PclPolyFillArc PCLNAME(PolyFillArc) - -/* PclArea.c */ -#define PclPutImage PCLNAME(PutImage) -#define PclCopyArea PCLNAME(CopyArea) -#define PclCopyPlane PCLNAME(CopyPlane) - -/* PclLine */ -#define PclPolyLine PCLNAME(PolyLine) -#define PclPolySegment PCLNAME(PolySegment) - -/* PclPixel.c */ -#define PclPolyPoint PCLNAME(PolyPoint) -#define PclPushPixels PCLNAME(PushPixels) - -/* PclPolygon.c */ -#define PclPolyRectangle PCLNAME(PolyRectangle) -#define PclFillPolygon PCLNAME(FillPolygon) -#define PclPolyFillRect PCLNAME(PolyFillRect) - -/* PclSpans.c */ -#define PclFillSpans PCLNAME(FillSpans) -#define PclSetSpans PCLNAME(SetSpans) - -/* PclText.c */ -#define PclPolyText8 PCLNAME(PolyText8) -#define PclPolyText16 PCLNAME(PolyText16) -#define PclImageText8 PCLNAME(ImageText8) -#define PclImageText16 PCLNAME(ImageText16) -#define PclImageGlyphBlt PCLNAME(ImageGlyphBlt) -#define PclPolyGlyphBlt PCLNAME(PolyGlyphBlt) -#define PclPolyGlyphBlt PCLNAME(PolyGlyphBlt) - -/* PclFonts.c */ -#define PclRealizeFont PCLNAME(RealizeFont) -#define PclUnrealizeFont PCLNAME(UnrealizeFont) - -/* PclSFonts.c */ -#define PclDownloadSoftFont8 PCLNAME(DownloadSoftFont8) -#define PclDownloadSoftFont16 PCLNAME(DownloadSoftFont16) -#define PclCreateSoftFontInfo PCLNAME(CreateSoftFontInfo) -#define PclDestroySoftFontInfo PCLNAME(DestroySoftFontInfo) - -/* PclMisc.c */ -#define PclQueryBestSize PCLNAME(QueryBestSize) -#define GetPropString PCLNAME(GetPropString) -#define SystemCmd PCLNAME(SystemCmd) -#define PclGetMediumDimensions PCLNAME(GetMediumDimensions) -#define PclGetReproducibleArea PCLNAME(GetReproducibleArea) -#define PclSpoolFigs PCLNAME(SpoolFigs) -#define PclSendData PCLNAME(SendData) - -/* PclCursor.c */ -#define PclConstrainCursor PCLNAME(ConstrainCursor) -#define PclCursorLimits PCLNAME(CursorLimits) -#define PclDisplayCursor PCLNAME(DisplayCursor) -#define PclRealizeCursor PCLNAME(RealizeCursor) -#define PclUnrealizeCursor PCLNAME(UnrealizeCursor) -#define PclRecolorCursor PCLNAME(RecolorCursor) -#define PclSetCursorPosition PCLNAME(SetCursorPosition) - -#endif - -#endif /* _PCLMAP_H_ */ diff --git a/nx-X11/programs/Xserver/Xprint/pdf/README b/nx-X11/programs/Xserver/Xprint/pdf/README deleted file mode 100644 index 9f3847570..000000000 --- a/nx-X11/programs/Xserver/Xprint/pdf/README +++ /dev/null @@ -1 +0,0 @@ -Tracking bug for this work is http://xprint.mozdev.org/bugs/show_bug.cgi?id=3529 diff --git a/nx-X11/programs/Xserver/Xprint/ps/Imakefile b/nx-X11/programs/Xserver/Xprint/ps/Imakefile deleted file mode 100644 index c73466fe4..000000000 --- a/nx-X11/programs/Xserver/Xprint/ps/Imakefile +++ /dev/null @@ -1,89 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.5 2001/03/14 18:26:56 pookie Exp $ - -#include - -#if BuildFreeType || BuildFreetype2Library -FT2SOURCEDIR = $(TOP)/extras/freetype2/src -FT2INCDIR = $(TOP)/extras/freetype2/include -FT2INCS = -I$(FT2INCDIR) \ - -I$(FT2SOURCEDIR)/type42 -TTF2PT1OURCEDIR = $(TOP)/extras/ttf2pt1 -FT_DEFINES = -DXP_USE_FREETYPE -FTSRCS = psout_ft.c psout_ftpstype1.c psout_ftpstype3.c PsFTFonts.c -FTOBJS = psout_ft.o psout_ftpstype1.o psout_ftpstype3.o PsFTFonts.o - -#if !defined (LynxOSArchitecture) -TTF2PT1SRCFILE = ttf2pt1.c -TTF2PT1OBJFILE = ttf2pt1.o -#else -TTF2PT1SRCFILE = ttf2pt1wrap.c -TTF2PT1OBJFILE = ttf2pt1wrap.o -#endif - -#if defined(SCOArchitecture) -XTRA_SYS_DEFINES = SCOBuildFlags -#endif - -TTF2PT1SRCS = ft.c pt1.c runt1asm.c $(TTF2PT1SRCFILE) -TTF2PT1OBJS = ft.o pt1.o runt1asm.o $(TTF2PT1OBJFILE) -TTF2PT1_DEFINES = -DUSE_FREETYPE -DXP_ONLY_BLOCKS -#endif /* BuildFreeType || BuildFreetype2Library */ - -SRCS1 = PsInit.c PsPrint.c PsGC.c PsMisc.c PsSpans.c PsArea.c PsPixel.c \ - PsLine.c PsPolygon.c PsArc.c PsText.c PsWindow.c PsFonts.c \ - PsAttr.c PsAttVal.c PsColor.c PsPixmap.c psout.c PsCache.c PsImageUtil.c - -OBJS1 = PsInit.o PsPrint.o PsGC.o PsMisc.o PsSpans.o PsArea.o PsPixel.o \ - PsLine.o PsPolygon.o PsArc.o PsText.o PsWindow.o PsFonts.o \ - PsAttr.o PsAttVal.o PsColor.o PsPixmap.o psout.o PsCache.o PsImageUtil.o - -SRCS = $(SRCS1) $(TTF2PT1SRCS) $(FTSRCS) - -OBJS = $(OBJS1) $(TTF2PT1OBJS) $(FTOBJS) - -#if BuildFreeType || BuildFreetype2Library -LinkSourceFile(ttf2pt1.c,$(TTF2PT1OURCEDIR)/) -LinkSourceFile(pt1.c,$(TTF2PT1OURCEDIR)/) -LinkSourceFile(pt1.h,$(TTF2PT1OURCEDIR)/) -LinkSourceFile(ft.c,$(TTF2PT1OURCEDIR)/) -LinkSourceFile(runt1asm.c,$(TTF2PT1OURCEDIR)/) -LinkSourceFile(t1asm.c,$(TTF2PT1OURCEDIR)/) -LinkSourceFile(ttf.h,$(TTF2PT1OURCEDIR)/) -LinkSourceFile(global.h,$(TTF2PT1OURCEDIR)/) -LinkSourceFile(version.h,$(TTF2PT1OURCEDIR)/) -#endif /* BuildFreeType || BuildFreetype2Library */ - -#ifdef XVendorString -VENDORSTRING = XVendorString - VENDOR_STRING = -DVENDOR_STRING=\"$(VENDORSTRING)\" -#endif - -#ifdef XVendorRelease -VENDORRELEASE = XVendorRelease - VENDOR_RELEASE = -DVENDOR_RELEASE="$(VENDORRELEASE)" -#endif - -VENDOR_DEFINES = $(VENDOR_STRING) $(VENDOR_RELEASE) - -XCOMM DEFINES = -DPIXPRIV - -XCOMM BM_CACHE disabled because it causes PostScript errors -XCOMM (see http://xprint.mozdev.org/bugs/show_bug.cgi?id=1489) -XCOMM DEFINES = -DPSOUT_USE_DEEPCOLOR -DXP_PSTEXT -DBM_CACHE $(VENDOR_DEFINES) $(TTF2PT1_DEFINES) $(FT_DEFINES) - DEFINES = -UXFree86LOADER -DPSOUT_USE_DEEPCOLOR -DXP_PSTEXT -D_XP_PRINT_SERVER_ $(VENDOR_DEFINES) $(TTF2PT1_DEFINES) $(FT_DEFINES) $(EXT_DEFINES) $(XTRA_SYS_DEFINES) - - INCLUDES = -I. -I../../mi -I../../mfb -I$(LIBSRC) \ - -I$(XINCLUDESRC) -I../../include -I.. -I$(TOP)/include \ - -I$(EXTINCSRC) -I$(FONTINCSRC) -I$(FONTLIBSRC)/include \ - $(FT2INCS) -I../../../../lib/font/FreeType - - LINTLIBS = $(TOP)/server/dix/llib-ldix.ln $(TOP)/server/os/llib-los.ln \ - $(TOP)/server/ddx/mfb/llib-lmfb.ln \ - $(TOP)/server/ddx/mi/llib-lmi.ln - -NormalLibraryObjectRule() - -NormalLibraryTarget(ps,$(OBJS)) -NormalLintTarget($(SRCS1) $(SRCS2)) - -DependTarget() diff --git a/nx-X11/programs/Xserver/Xprint/ps/Ps.h b/nx-X11/programs/Xserver/Xprint/ps/Ps.h deleted file mode 100644 index 781161d8a..000000000 --- a/nx-X11/programs/Xserver/Xprint/ps/Ps.h +++ /dev/null @@ -1,590 +0,0 @@ -/* $Xorg: Ps.h,v 1.5 2001/02/09 02:04:35 xorgcvs Exp $ */ -/* - -Copyright 1996, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* - * (c) Copyright 1996 Hewlett-Packard Company - * (c) Copyright 1996 International Business Machines Corp. - * (c) Copyright 1996 Sun Microsystems, Inc. - * (c) Copyright 1996 Novell, Inc. - * (c) Copyright 1996 Digital Equipment Corp. - * (c) Copyright 1996 Fujitsu Limited - * (c) Copyright 1996 Hitachi, Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF - * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * Except as contained in this notice, the names of the copyright holders - * shall not be used in advertising or otherwise to promote the sale, use - * or other dealings in this Software without prior written authorization - * from said copyright holders. - */ - -/******************************************************************* -** -** ********************************************************* -** * -** * File: Ps.h -** * -** * Contents: defines and includes for the Ps driver -** * for a printing X server. -** * -** * Created By: Roger Helmendach (Liberty Systems) -** * -** * Copyright: Copyright 1996 The Open Group, Inc. -** * -** ********************************************************* -** -********************************************************************/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifndef _PS_H_ -#define _PS_H_ - -#include - -#ifdef abs -#undef abs /* this is because of a non-Spec1170ness in misc.h */ -#endif -#include -#include "scrnintstr.h" -#include "dix.h" - -#include "PsDef.h" -#include "psout.h" - -#include -#include - -#include "regionstr.h" -#include -#include "dixfontstr.h" -#include "gcstruct.h" - -/* - * Some sleazes to force the XrmDB stuff into the server - */ -#ifndef HAVE_XPointer -typedef char *XPointer; -#define Status int -#define True 1 -#define False 0 -#endif - -#include "misc.h" -#include -#include -#include "attributes.h" - - -/* - * Public index variables from PsInit.c - */ - -extern int PsScreenPrivateIndex; -extern int PsWindowPrivateIndex; -extern int PsContextPrivateIndex; -extern int PsPixmapPrivateIndex; -extern XpValidatePoolsRec PsValidatePoolsRec; - -/* - * Display list structures - */ - -#define DPY_BLOCKSIZE 4096 - -typedef struct -{ - int mode; - int nPoints; - xPoint *pPoints; -} PsPolyPointsRec; - -typedef struct -{ - int nSegments; - xSegment *pSegments; -} PsSegmentsRec; - -typedef struct -{ - int nRects; - xRectangle *pRects; -} PsRectanglesRec; - -typedef struct -{ - int nArcs; - xArc *pArcs; -} PsArcsRec; - -typedef struct -{ - int x; - int y; - int count; - char *string; -} PsText8Rec; - -typedef struct -{ - int x; - int y; - int count; - unsigned short *string; -} PsText16Rec; - -typedef struct -{ - int depth; - int x; - int y; - int w; - int h; - int leftPad; - int format; - int res; /* image resolution */ - char *pData; -} PsImageRec; - -typedef struct -{ - int x; - int y; - int w; - int h; -} PsFrameRec; - -typedef enum -{ - PolyPointCmd, - PolyLineCmd, - PolySegmentCmd, - PolyRectangleCmd, - FillPolygonCmd, - PolyFillRectCmd, - PolyArcCmd, - PolyFillArcCmd, - Text8Cmd, - Text16Cmd, - TextI8Cmd, - TextI16Cmd, - PutImageCmd, - BeginFrameCmd, - EndFrameCmd -} DisplayElmType; - -typedef struct _DisplayElmRec -{ - DisplayElmType type; - GCPtr gc; - union - { - PsPolyPointsRec polyPts; - PsSegmentsRec segments; - PsRectanglesRec rects; - PsArcsRec arcs; - PsText8Rec text8; - PsText16Rec text16; - PsImageRec image; - PsFrameRec frame; - } c; -} DisplayElmRec; - -typedef DisplayElmRec *DisplayElmPtr; - -typedef struct _DisplayListRec -{ - struct _DisplayListRec *next; - int nelms; - DisplayElmRec elms[DPY_BLOCKSIZE]; -} DisplayListRec; - -typedef DisplayListRec *DisplayListPtr; - -/* - * Private structures - */ - -typedef struct -{ - XrmDatabase resDB; - Bool (*DestroyWindow)(WindowPtr); -} PsScreenPrivRec, *PsScreenPrivPtr; - -typedef struct PsFontTypeInfoRec PsFontTypeInfoRec; - -/* Structure to hold information about one font on disk - * Notes: - * - multiple XLFD names can refer to the same |PsFontTypeInfoRec| (if - * they all use the same font on the disk) - * - the FreeType font download code uses multiple |PsFontTypeInfoRec| - * records for one font on disk if they differ in the encoding being - * used (this is an exception from the - * 'one-|PsFontTypeInfoRec|-per-font-on-disk'-design; maybe it it is better - * to rework that in a later step and add a new per-encoding structure). - */ -struct PsFontTypeInfoRec -{ - PsFontTypeInfoRec *next; /* Next record in list... */ - char *adobe_ps_name; /* PostScript font name (from the - * "_ADOBE_POSTSCRIPT_FONTNAME" atom) */ - char *download_ps_name; /* PostScript font name used for font download */ - char *filename; /* File name of font */ -#ifdef XP_USE_FREETYPE - char *ft_download_encoding; /* encoding used for download */ - PsFTDownloadFontType ft_download_font_type; /* PS font type used for download (e.g. Type1/Type3/CID/etc.) */ -#endif /* XP_USE_FREETYPE */ - int is_iso_encoding; /* Is this font encoded in ISO Latin 1 ? */ - int font_type; /* See PSFTI_FONT_TYPE_* below... */ - Bool downloadableFont; /* Font can be downloaded */ - Bool alreadyDownloaded[256]; /* Font has been downloaded (for 256 8bit "sub"-font) */ -}; - -#define PSFTI_FONT_TYPE_OTHER (0) -#define PSFTI_FONT_TYPE_PMF (1) -#define PSFTI_FONT_TYPE_PS_TYPE1_PFA (2) -#define PSFTI_FONT_TYPE_PS_TYPE1_PFB (3) -#define PSFTI_FONT_TYPE_TRUETYPE (4) -/* PSFTI_FONT_TYPE_FREETYPE is means the font is handled by the freetype engine */ -#define PSFTI_FONT_TYPE_FREETYPE (5) - -typedef struct PsFontInfoRec PsFontInfoRec; - -/* Structure which represents our context info for a single XLFD font - * Note that multiple |PsFontInfoRec| records can share the same - * |PsFontTypeInfoRec| record - the |PsFontInfoRec| records represent - * different appearances of the same font on disk(=|PsFontTypeInfoRec|)). - */ -struct PsFontInfoRec -{ - PsFontInfoRec *next; /* Next record in list... */ - /* |font| and |font_fontPrivate| are used by |PsFindFontInfoRec()| to - * identify a font */ - FontPtr font; /* The font this record is for */ - pointer font_fontPrivate; - PsFontTypeInfoRec *ftir; /* Record about the font file on disk */ - const char *dfl_name; /* XLFD for this font */ - int size; /* Font size. Use |mtx| if |size==0| */ - float mtx[4]; /* Transformation matrix (see |size|) */ -}; - -typedef struct -{ - char *jobFileName; - FILE *pJobFile; - GC lastGC; - unsigned char *dash; - int validGC; - ClientPtr getDocClient; - int getDocBufSize; - PsOutPtr pPsOut; - PsFontTypeInfoRec *fontTypeInfoRecords; - PsFontInfoRec *fontInfoRecords; -} PsContextPrivRec, *PsContextPrivPtr; - -typedef struct -{ - int validContext; - XpContextPtr context; -} PsWindowPrivRec, *PsWindowPrivPtr; - -typedef struct -{ - XpContextPtr context; - GC lastGC; - int validGC; - DisplayListPtr dispList; -} PsPixmapPrivRec, *PsPixmapPrivPtr; - -/* - * Macro functions - */ - -#define SEND_PS(f,c) fwrite( c, sizeof( char ), strlen( c ), f ) -#define MIN(a,b) (((a)<(b))?(a):(b)) -#ifndef MAX -#define MAX(a,b) (((a)>(b))?(a):(b)) -#endif - -/* - * Functions in PsInit.c - */ - -extern Bool InitializePsDriver(int ndx, ScreenPtr pScreen, int argc, - char **argv); -extern XpContextPtr PsGetContextFromWindow(WindowPtr win); - -/* - * Functions in PsPrint.c - */ - -extern int PsStartJob(XpContextPtr pCon, Bool sendClientData, ClientPtr client); -extern int PsEndJob(XpContextPtr pCon, Bool cancel); -extern int PsStartPage(XpContextPtr pCon, WindowPtr pWin); -extern int PsEndPage(XpContextPtr pCon, WindowPtr pWin); -extern int PsStartDoc(XpContextPtr pCon, XPDocumentType type); -extern int PsEndDoc(XpContextPtr pCon, Bool cancel); -extern int PsDocumentData(XpContextPtr pCon, DrawablePtr pDraw, char *pData, - int len_data, char *pFmt, int len_fmt, char *pOpt, int len_opt, - ClientPtr client); -extern int PsGetDocumentData(XpContextPtr pCon, ClientPtr client, - int maxBufferSize); - -/* - * Functions in PsGC.c - */ - -extern Bool PsCreateGC(GCPtr pGC); -extern PsContextPrivPtr PsGetPsContextPriv( DrawablePtr pDrawable ); -extern int PsUpdateDrawableGC(GCPtr pGC, DrawablePtr pDrawable, - PsOutPtr *psOut, ColormapPtr *cMap); -extern void PsValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable); -extern void PsChangeGC(GCPtr pGC, unsigned long changes); -extern void PsCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst); -extern void PsDestroyGC(GCPtr pGC); -extern void PsChangeClip(GCPtr pGC, int type, pointer pValue, int nrects); -extern void PsDestroyClip(GCPtr pGC); -extern void PsCopyClip(GCPtr pgcDst, GCPtr pgcSrc); - -extern GCPtr PsCreateAndCopyGC(DrawablePtr pDrawable, GCPtr pSrc); - -/* - * Functions in PsMisc.c - */ - -extern void PsQueryBestSize(int type, short *pwidth, short *pheight, - ScreenPtr pScreen); -extern Bool PsCloseScreen(int index, ScreenPtr pScreen); -extern void PsLineAttrs(PsOutPtr psOut, GCPtr pGC, ColormapPtr cMap); -extern int PsGetMediumDimensions( - XpContextPtr pCon, - CARD16 *pWidth, - CARD16 *pHeight); -extern int PsGetReproducibleArea( - XpContextPtr pCon, - xRectangle *pRect); -extern int PsSetImageResolution( - XpContextPtr pCon, - int imageRes, - Bool *status); - -/* - * Functions in PsSpans.c - */ - -extern void PsFillSpans(DrawablePtr pDrawable, GCPtr pGC, int nSpans, - DDXPointPtr pPoints, int *pWidths, int fSorted); -extern void PsSetSpans(DrawablePtr pDrawable, GCPtr pGC, char *pSrc, - DDXPointPtr pPoints, int *pWidths, int nSpans, - int fSorted); - -/* - * Functions in PsArea.c - */ - -extern void PsPutScaledImage(DrawablePtr pDrawable, GCPtr pGC, int depth, - int x, int y, int w, int h, int leftPad, int format, - int imageRes, char *pImage); -extern void PsPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, - int x, int y, int w, int h, int leftPad, int format, - char *pImage); -extern void PsPutImageMask(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, - int w, int h, int leftPad, int format, char *pImage); -extern RegionPtr PsCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, - int srcx, int srcy, int width, int height, - int dstx, int dsty); -extern RegionPtr PsCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, - int srcx, int srcy, int width, int height, - int dstx, int dsty, unsigned long plane); - -/* - * Functions in PsPixel.c - */ - -extern void PsPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, - int nPoints, xPoint *pPoints); -extern void PsPushPixels(GCPtr pGC, PixmapPtr pBitmap, DrawablePtr pDrawable, - int width, int height, int x, int y); - -/* - * Functions in PsLine.c - */ - -extern void PsPolyLine(DrawablePtr pDrawable, GCPtr pGC, int mode, - int nPoints, xPoint *pPoints); -extern void PsPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nSegments, - xSegment *pSegments); - -/* - * Functions in PsPolygon.c - */ - -extern void PsPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nRects, - xRectangle *pRects); -extern void PsFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape, - int mode, int nPoints, DDXPointPtr pPoints); -extern void PsPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nRects, - xRectangle *pRects); - -/* - * Functions in PsPolygon.c - */ - -extern void PsPolyArc(DrawablePtr pDrawable, GCPtr pGC, int nArcs, - xArc *pArcs); -extern void PsPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int nArcs, - xArc *pArcs); - -/* - * Functions in PsText.c - */ - -extern int PsPolyText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, - int count, char *string); -extern int PsPolyText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, - int count, unsigned short *string); -extern void PsImageText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, - int count, char *string); -extern void PsImageText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, - int count, unsigned short *string); -extern void PsImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, - unsigned int nGlyphs, CharInfoPtr *pCharInfo, - pointer pGlyphBase); -extern void PsPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, - unsigned int nGlyphs, CharInfoPtr *pCharInfo, - pointer pGlyphBase); - -/* - * Functions in PsWindow.c - */ - -extern Bool PsCreateWindow(WindowPtr pWin); -extern Bool PsMapWindow(WindowPtr pWin); -extern Bool PsPositionWindow(WindowPtr pWin, int x, int y); -extern Bool PsUnmapWindow(WindowPtr pWin); -extern void PsCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, - RegionPtr prgnSrc); -extern Bool PsChangeWindowAttributes(WindowPtr pWin, unsigned long mask); -extern void PsPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what); -extern Bool PsDestroyWindow(WindowPtr pWin); - -/* - * Functions in PsFonts.c - */ - -extern Bool PsRealizeFont(ScreenPtr pscr, FontPtr pFont); -extern Bool PsUnrealizeFont(ScreenPtr pscr, FontPtr pFont); -extern char *PsGetFontName(FontPtr pFont); -extern int PsGetFontSize(FontPtr pFont, float *mtx); -extern char *PsGetPSFontName(FontPtr pFont); -extern char *PsGetPSFaceOrFontName(FontPtr pFont); -extern int PsIsISOLatin1Encoding(FontPtr pFont); -extern char *PsGetEncodingName(FontPtr pFont); -extern PsFontInfoRec *PsGetFontInfoRec(DrawablePtr pDrawable, FontPtr pFont); -extern void PsFreeFontInfoRecords(PsContextPrivPtr priv); -extern PsFTDownloadFontType PsGetFTDownloadFontType(void); - -/* - * Functions in PsFTFonts.c - */ - -extern char *PsGetFTFontFileName(FontPtr pFont); -extern Bool PsIsFreeTypeFont(FontPtr pFont); - -/* - * Functions in PsAttr.c - */ - -extern char *PsGetAttributes(XpContextPtr pCon, XPAttributes pool); -extern char *PsGetOneAttribute(XpContextPtr pCon, XPAttributes pool, - char *attr); -extern int PsAugmentAttributes(XpContextPtr pCon, XPAttributes pool, - char *attrs); -extern int PsSetAttributes(XpContextPtr pCon, XPAttributes pool, char *attrs); - -/* - * Functions in PsColor.c - */ - -extern Bool PsCreateColormap(ColormapPtr pColor); -extern void PsDestroyColormap(ColormapPtr pColor); -extern void PsInstallColormap(ColormapPtr pColor); -extern void PsUninstallColormap(ColormapPtr pColor); -extern int PsListInstalledColormaps(ScreenPtr pScreen, XID *pCmapList); -extern void PsStoreColors(ColormapPtr pColor, int ndef, xColorItem *pdefs); -extern void PsResolveColor(unsigned short *pRed, unsigned short *pGreen, - unsigned short *pBlue, VisualPtr pVisual); -extern PsOutColor PsGetPixelColor(ColormapPtr cMap, int pixval); -extern void PsSetFillColor(DrawablePtr pDrawable, GCPtr pGC, PsOutPtr psOut, - ColormapPtr cMap); - -/* - * Functions in PsPixmap.c - */ - -extern PixmapPtr PsCreatePixmap(ScreenPtr pScreen, int width, int height, - int depth); -extern void PsScrubPixmap(PixmapPtr pPixmap); -extern Bool PsDestroyPixmap(PixmapPtr pPixmap); -extern DisplayListPtr PsGetFreeDisplayBlock(PsPixmapPrivPtr priv); -extern void PsReplayPixmap(PixmapPtr pix, DrawablePtr pDrawable); -extern int PsCloneDisplayElm(PixmapPtr dst, - DisplayElmPtr elm, DisplayElmPtr newElm, - int xoff, int yoff); -extern void PsCopyDisplayList(PixmapPtr src, PixmapPtr dst, int xoff, - int yoff, int x, int y, int w, int h); -extern PsElmPtr PsCreateFillElementList(PixmapPtr pix, int *nElms); -extern PsElmPtr PsCloneFillElementList(int nElms, PsElmPtr elms); -extern void PsDestroyFillElementList(int nElms, PsElmPtr elms); - -/* - * Functions in PsImageUtil.c - */ - -extern unsigned long -PsGetImagePixel(char *pImage, int depth, int w, int h, int leftPad, int format, - int px, int py); - -#endif /* _PS_H_ */ diff --git a/nx-X11/programs/Xserver/Xprint/ps/PsArc.c b/nx-X11/programs/Xserver/Xprint/ps/PsArc.c deleted file mode 100644 index 511971e7a..000000000 --- a/nx-X11/programs/Xserver/Xprint/ps/PsArc.c +++ /dev/null @@ -1,182 +0,0 @@ -/* $Xorg: PsArc.c,v 1.4 2001/02/09 02:04:35 xorgcvs Exp $ */ -/* - -Copyright 1996, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* - * (c) Copyright 1996 Hewlett-Packard Company - * (c) Copyright 1996 International Business Machines Corp. - * (c) Copyright 1996 Sun Microsystems, Inc. - * (c) Copyright 1996 Novell, Inc. - * (c) Copyright 1996 Digital Equipment Corp. - * (c) Copyright 1996 Fujitsu Limited - * (c) Copyright 1996 Hitachi, Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF - * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * Except as contained in this notice, the names of the copyright holders - * shall not be used in advertising or otherwise to promote the sale, use - * or other dealings in this Software without prior written authorization - * from said copyright holders. - */ - -/******************************************************************* -** -** ********************************************************* -** * -** * File: PsArc.c -** * -** * Contents: Arc-drawing code for the PS DDX driver -** * -** * Created By: Roger Helmendach (Liberty Systems) -** * -** * Copyright: Copyright 1996 The Open Group, Inc. -** * -** ********************************************************* -** -********************************************************************/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include - -#include "Ps.h" -#include "gcstruct.h" -#include "windowstr.h" - -void -PsPolyArc( - DrawablePtr pDrawable, - GCPtr pGC, - int nArcs, - xArc *pArcs) -{ - if( pDrawable->type==DRAWABLE_PIXMAP ) - { - DisplayElmPtr elm; - PixmapPtr pix = (PixmapPtr)pDrawable; - PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pix->devPrivate.ptr; - DisplayListPtr disp; - GCPtr gc; - - if ((gc = PsCreateAndCopyGC(pDrawable, pGC)) == NULL) return; - - disp = PsGetFreeDisplayBlock(priv); - - elm = &disp->elms[disp->nelms]; - elm->type = PolyArcCmd; - elm->gc = gc; - elm->c.arcs.nArcs = nArcs; - elm->c.arcs.pArcs = (xArc *)xalloc(nArcs*sizeof(xArc)); - memcpy(elm->c.arcs.pArcs, pArcs, nArcs*sizeof(xArc)); - disp->nelms += 1; - } - else - { - int i; - PsOutPtr psOut; - ColormapPtr cMap; - - if( PsUpdateDrawableGC(pGC, pDrawable, &psOut, &cMap)==FALSE ) return; - PsOut_Offset(psOut, pDrawable->x, pDrawable->y); - PsOut_Color(psOut, PsGetPixelColor(cMap, pGC->fgPixel)); - PsLineAttrs(psOut, pGC, cMap); - for( i=0 ; itype==DRAWABLE_PIXMAP ) - { - DisplayElmPtr elm; - PixmapPtr pix = (PixmapPtr)pDrawable; - PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pix->devPrivate.ptr; - DisplayListPtr disp; - GCPtr gc; - - if ((gc = PsCreateAndCopyGC(pDrawable, pGC)) == NULL) return; - - disp = PsGetFreeDisplayBlock(priv); - - elm = &disp->elms[disp->nelms]; - elm->type = PolyFillArcCmd; - elm->gc = gc; - elm->c.arcs.nArcs = nArcs; - elm->c.arcs.pArcs = (xArc *)xalloc(nArcs*sizeof(xArc)); - memcpy(elm->c.arcs.pArcs, pArcs, nArcs*sizeof(xArc)); - disp->nelms += 1; - } - else - { - int i; - PsOutPtr psOut; - PsArcEnum styl; - ColormapPtr cMap; - - if( PsUpdateDrawableGC(pGC, pDrawable, &psOut, &cMap)==FALSE ) return; - PsOut_Offset(psOut, pDrawable->x, pDrawable->y); - PsSetFillColor(pDrawable, pGC, psOut, cMap); - PsLineAttrs(psOut, pGC, cMap); - if( pGC->arcMode==ArcChord ) styl = PsChord; - else styl = PsPieSlice; - for( i=0 ; i -#endif - -#include "Ps.h" -#include "gcstruct.h" -#include "windowstr.h" - - -void -PsPutScaledImage(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, - int w, int h, int leftPad, int format, int imageRes, char *pImage) -{ - if( pDrawable->type==DRAWABLE_PIXMAP ) - { - int size = PixmapBytePad(w, depth)*h; - DisplayElmPtr elm; - PixmapPtr pix = (PixmapPtr)pDrawable; - PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pix->devPrivate.ptr; - DisplayListPtr disp; - GCPtr gc; - - if ((gc = PsCreateAndCopyGC(pDrawable, pGC)) == NULL) return; - - disp = PsGetFreeDisplayBlock(priv); - elm = &disp->elms[disp->nelms]; - elm->type = PutImageCmd; - elm->gc = gc; - elm->c.image.depth = depth; - elm->c.image.x = x; - elm->c.image.y = y; - elm->c.image.w = w; - elm->c.image.h = h; - elm->c.image.leftPad = leftPad; - elm->c.image.format = format; - elm->c.image.res = imageRes; - elm->c.image.pData = (char *)xalloc(size); - memcpy(elm->c.image.pData, pImage, size); - disp->nelms += 1; - } - else - { - int i, j; - int r, c; - char *pt; - PsOutPtr psOut; - ColormapPtr cMap; - int pageRes, sw, sh; - - if( PsUpdateDrawableGC(pGC, pDrawable, &psOut, &cMap)==FALSE ) return; - if (!imageRes) { - sw = w; - sh = h; - } else { - pageRes = XpGetResolution(XpGetPrintContext(requestingClient)); - sw = (float)w * (float)pageRes / (float)imageRes + 0.5; - sh = (float)h * (float)pageRes / (float)imageRes + 0.5; - } - PsOut_Offset(psOut, pDrawable->x, pDrawable->y); - - if( depth!=1 ) - { - PsOut_BeginImage(psOut, 0, 0, x, y, w, h, sw, sh, 3); - - for( r=0 ; rbgPixel), - PsGetPixelColor(cMap, pGC->fgPixel), - x, y, w, h, sw, sh, 1); - for( r=0 ; r>j)&1)<<(7-j)); } -#elif IMAGE_BYTE_ORDER == MSBFirst - iv_ = iv; -#else -#error Unsupported byte order -#endif - c = iv_; - PsOut_OutImageBytes(psOut, 1, &c); - } - } - PsOut_EndImage(psOut); - } - } -} - -void -PsPutScaledImageIM(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, - int w, int h, int leftPad, int format, int imageRes, char *pImage) -{ - if( pDrawable->type==DRAWABLE_PIXMAP ) - { - int size = PixmapBytePad(w, depth)*h; - DisplayElmPtr elm; - PixmapPtr pix = (PixmapPtr)pDrawable; - PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pix->devPrivate.ptr; - DisplayListPtr disp; - GCPtr gc; - - if ((gc = PsCreateAndCopyGC(pDrawable, pGC)) == NULL) return; - - disp = PsGetFreeDisplayBlock(priv); - elm = &disp->elms[disp->nelms]; - elm->type = PutImageCmd; - elm->gc = gc; - elm->c.image.depth = depth; - elm->c.image.x = x; - elm->c.image.y = y; - elm->c.image.w = w; - elm->c.image.h = h; - elm->c.image.leftPad = leftPad; - elm->c.image.format = format; - elm->c.image.res = imageRes; - elm->c.image.pData = (char *)xalloc(size); - memcpy(elm->c.image.pData, pImage, size); - disp->nelms += 1; - } - else - { - int i, j; - int r, c; - char *pt; - PsOutPtr psOut; - ColormapPtr cMap; - int pageRes, sw, sh; -#ifdef BM_CACHE - long cache_id = 0; -#endif - - if( PsUpdateDrawableGC(pGC, pDrawable, &psOut, &cMap)==FALSE ) return; - if (!imageRes) { - sw = w; - sh = h; - } else { - pageRes = XpGetResolution(XpGetPrintContext(requestingClient)); - sw = (float)w * (float)pageRes / (float)imageRes + 0.5; - sh = (float)h * (float)pageRes / (float)imageRes + 0.5; - } - PsOut_Offset(psOut, pDrawable->x, pDrawable->y); - -#ifdef BM_CACHE - cache_id = PsBmIsImageCached(w, h, pImage); - - if(!cache_id) - { - cache_id = PsBmPutImageInCache(w, h, pImage); - - if(!cache_id) - return; - - PsOut_BeginImageCache(psOut, cache_id); -#endif - if( depth!=1 ) - { - PsOut_BeginImageIM(psOut, 0, 0, x, y, w, h, sw, sh, 3); - - for( r=0 ; rbgPixel), - PsGetPixelColor(cMap, pGC->fgPixel), - x, y, w, h, sw, sh, 1); - for( r=0 ; r>j)&1)<<(7-j)); } -#elif IMAGE_BYTE_ORDER == MSBFirst - iv_ = iv; -#else -#error Unsupported byte order -#endif - c = iv_; - PsOut_OutImageBytes(psOut, 1, &c); - } - } - PsOut_EndImage(psOut); - } -#ifdef BM_CACHE - PsOut_EndImageCache(psOut); - } - PsOut_ImageCache(psOut, x, y, cache_id, PsGetPixelColor(cMap, pGC->bgPixel), - PsGetPixelColor(cMap, pGC->fgPixel)); -#endif - } -} -void -PsPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, - int w, int h, int leftPad, int format, char *pImage) -{ - XpContextPtr pcon; - if (requestingClient && (pcon = XpGetPrintContext(requestingClient))) - PsPutScaledImage(pDrawable, pGC, depth, x, y, w, h, leftPad, format, - pcon->imageRes, pImage); -} -void -PsPutImageMask(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, - int w, int h, int leftPad, int format, char *pImage) -{ - XpContextPtr pcon; - if (requestingClient && (pcon = XpGetPrintContext(requestingClient))) - PsPutScaledImageIM(pDrawable, pGC, depth, x, y, w, h, leftPad, format, - pcon->imageRes, pImage); -} - -RegionPtr -PsCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, int srcx, int srcy, - int width, int height, int dstx, int dsty) -{ - PixmapPtr src = (PixmapPtr)pSrc; - PixmapPtr dst = (PixmapPtr)pDst; - - if( pSrc->type!=DRAWABLE_PIXMAP ) return NULL; - if( pDst->type!=DRAWABLE_PIXMAP ) - { - PsOutPtr psOut; - ColormapPtr cMap; - if( PsUpdateDrawableGC(pGC, pDst, &psOut, &cMap)==FALSE ) return NULL; - PsOut_Offset(psOut, pDst->x, pDst->y); - PsOut_BeginFrame(psOut, dstx-srcx, dsty-srcy, dstx, dsty, width, height); - PsReplayPixmap(src, pDst); - PsOut_EndFrame(psOut); - } - else PsCopyDisplayList(src, dst, dstx-srcx, dsty-srcy, dstx, dsty, - width, height); - return NULL; -} - -RegionPtr -PsCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, int srcx, int srcy, - int width, int height, int dstx, int dsty, unsigned long plane) -{ - PixmapPtr src = (PixmapPtr)pSrc; - PixmapPtr dst = (PixmapPtr)pDst; - - if( pSrc->type!=DRAWABLE_PIXMAP ) return NULL; - if( pDst->type!=DRAWABLE_PIXMAP ) - { - PsOutPtr psOut; - ColormapPtr cMap; - if( PsUpdateDrawableGC(pGC, pDst, &psOut, &cMap)==FALSE ) return NULL; - PsOut_Offset(psOut, pDst->x, pDst->y); - PsOut_BeginFrame(psOut, dstx-srcx, dsty-srcy, dstx, dsty, width, height); - PsReplayPixmap(src, pDst); - PsOut_EndFrame(psOut); - } - else PsCopyDisplayList(src, dst, dstx-srcx, dsty-srcy, dstx, dsty, - width, height); - return NULL; -} diff --git a/nx-X11/programs/Xserver/Xprint/ps/PsAttVal.c b/nx-X11/programs/Xserver/Xprint/ps/PsAttVal.c deleted file mode 100644 index fc23ffef5..000000000 --- a/nx-X11/programs/Xserver/Xprint/ps/PsAttVal.c +++ /dev/null @@ -1,290 +0,0 @@ -/* - * $Xorg: PsAttVal.c,v 1.5 2001/03/13 18:45:31 pookie Exp $ - */ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "Ps.h" -#include "AttrValid.h" - -/* - * define valid values and defaults for Printer pool - */ -static XpOid ValidContentOrientationsOids[] = { - xpoid_val_content_orientation_portrait, - xpoid_val_content_orientation_landscape, - xpoid_val_content_orientation_reverse_portrait, - xpoid_val_content_orientation_reverse_landscape -}; -static XpOidList ValidContentOrientations = { - ValidContentOrientationsOids, XpNumber(ValidContentOrientationsOids) -}; - -static XpOid DefaultContentOrientationsOids[] = { - xpoid_val_content_orientation_portrait, - xpoid_val_content_orientation_landscape -}; -static XpOidList DefaultContentOrientations = { - DefaultContentOrientationsOids, XpNumber(DefaultContentOrientationsOids) -}; - -static XpOid ValidPlexesOids[] = { - xpoid_val_plex_simplex, xpoid_val_plex_duplex, xpoid_val_plex_tumble -}; -static XpOidList ValidPlexes = { - ValidPlexesOids, XpNumber(ValidPlexesOids) -}; - -static XpOid DefaultPlexesOids[] = { - xpoid_val_plex_simplex -}; -static XpOidList DefaultPlexes = { - DefaultPlexesOids, XpNumber(DefaultPlexesOids) -}; - -static unsigned long ValidPrinterResolutionsCards[] = { - 75, - 100, - 120, - 150, - 180, - 200, - 240, - 300, - 360, - 400, - 600, - 720, - 940, - 1200, - 1440, - 2400 -}; -static XpOidCardList ValidPrinterResolutions = { - ValidPrinterResolutionsCards, XpNumber(ValidPrinterResolutionsCards) -}; - -static unsigned long DefaultPrinterResolutionsCards[] = { - 75, - 100, - 120, - 150, - 180, - 200, - 240, - 300, - 360, - 400, - 600, - 720, - 940, - 1200 -}; -static XpOidCardList DefaultPrinterResolutions = { - DefaultPrinterResolutionsCards, XpNumber(DefaultPrinterResolutionsCards) -}; - -static XpOid ValidListfontsModesOids[] = { - xpoid_val_xp_list_internal_printer_fonts, xpoid_val_xp_list_glyph_fonts -}; -static XpOidList ValidListfontsModes = { - ValidListfontsModesOids, XpNumber(ValidListfontsModesOids) -}; - -static XpOid DefaultListfontsModesOids[] = { - xpoid_val_xp_list_glyph_fonts -}; -static XpOidList DefaultListfontsModes = { - DefaultListfontsModesOids, XpNumber(DefaultListfontsModesOids) -}; - -static XpOid ValidSetupProvisoOids[] = { - xpoid_val_xp_setup_mandatory, xpoid_val_xp_setup_optional -}; -static XpOidList ValidSetupProviso = { - - - ValidSetupProvisoOids, XpNumber(ValidSetupProvisoOids) -}; - -static XpOidDocFmt ValidDocFormatsSupportedFmts[] = { - { "Postscript", "2", NULL } -}; -static XpOidDocFmtList ValidDocFormatsSupported = { - ValidDocFormatsSupportedFmts, XpNumber(ValidDocFormatsSupportedFmts) -}; - -static XpOidDocFmt DefaultDocFormatsSupportedFmts[] = { - { "Postscript", "2", NULL } -}; -static XpOidDocFmtList DefaultDocFormatsSupported = { - DefaultDocFormatsSupportedFmts, XpNumber(DefaultDocFormatsSupportedFmts) -}; - -static XpOidDocFmt ValidEmbeddedFormatsSupportedFmts[] = { - { "Postscript", "2", NULL } -}; -static XpOidDocFmtList ValidEmbeddedFormatsSupported = { - ValidEmbeddedFormatsSupportedFmts, XpNumber(ValidEmbeddedFormatsSupportedFmts) -}; - -static XpOidDocFmt DefaultEmbeddedFormatsSupportedFmts[] = { - { "Postscript", "2", NULL } -}; -static XpOidDocFmtList DefaultEmbeddedFormatsSupported = { - DefaultEmbeddedFormatsSupportedFmts, XpNumber(DefaultEmbeddedFormatsSupportedFmts) -}; - -static XpOidDocFmt ValidRawFormatsSupportedFmts[] = { - { "Postscript", "2", NULL } - -}; -static XpOidDocFmtList ValidRawFormatsSupported = { - ValidRawFormatsSupportedFmts, XpNumber(ValidRawFormatsSupportedFmts) -}; - -static XpOidDocFmt DefaultRawFormatsSupportedFmts[] = { - { "Postscript", "2", NULL } -}; -static XpOidDocFmtList DefaultRawFormatsSupported = { - DefaultRawFormatsSupportedFmts, XpNumber(DefaultRawFormatsSupportedFmts) -}; - -static XpOid ValidInputTraysOids[] = { - xpoid_val_input_tray_manual, - xpoid_val_input_tray_main, - xpoid_val_input_tray_envelope, - xpoid_val_input_tray_large_capacity, - xpoid_val_input_tray_bottom -}; -static XpOidList ValidInputTrays = { - ValidInputTraysOids, XpNumber(ValidInputTraysOids) -}; - -static XpOid ValidMediumSizesOids[] = { - xpoid_val_medium_size_iso_a0, - xpoid_val_medium_size_iso_a1, - xpoid_val_medium_size_iso_a2, - xpoid_val_medium_size_iso_a3, - xpoid_val_medium_size_iso_a4, - xpoid_val_medium_size_iso_a5, - xpoid_val_medium_size_iso_a6, - xpoid_val_medium_size_iso_a7, - xpoid_val_medium_size_iso_a8, - xpoid_val_medium_size_iso_a9, - xpoid_val_medium_size_iso_a10, - xpoid_val_medium_size_iso_b0, - xpoid_val_medium_size_iso_b1, - xpoid_val_medium_size_iso_b2, - xpoid_val_medium_size_iso_b3, - xpoid_val_medium_size_iso_b4, - xpoid_val_medium_size_iso_b5, - xpoid_val_medium_size_iso_b6, - xpoid_val_medium_size_iso_b7, - xpoid_val_medium_size_iso_b8, - xpoid_val_medium_size_iso_b9, - xpoid_val_medium_size_iso_b10, - xpoid_val_medium_size_na_letter, - xpoid_val_medium_size_na_legal, - xpoid_val_medium_size_executive, - xpoid_val_medium_size_folio, - xpoid_val_medium_size_invoice, - xpoid_val_medium_size_ledger, - xpoid_val_medium_size_quarto, - xpoid_val_medium_size_iso_c3, - xpoid_val_medium_size_iso_c4, - xpoid_val_medium_size_iso_c5, - xpoid_val_medium_size_iso_c6, - xpoid_val_medium_size_iso_designated_long, - xpoid_val_medium_size_na_10x13_envelope, - xpoid_val_medium_size_na_9x12_envelope, - xpoid_val_medium_size_na_number_10_envelope, - xpoid_val_medium_size_na_7x9_envelope, - xpoid_val_medium_size_na_9x11_envelope, - xpoid_val_medium_size_na_10x14_envelope, - xpoid_val_medium_size_na_number_9_envelope, - xpoid_val_medium_size_na_6x9_envelope, - xpoid_val_medium_size_na_10x15_envelope, - xpoid_val_medium_size_monarch_envelope, - xpoid_val_medium_size_a, - xpoid_val_medium_size_b, - xpoid_val_medium_size_c, - xpoid_val_medium_size_d, - xpoid_val_medium_size_e, - xpoid_val_medium_size_jis_b0, - xpoid_val_medium_size_jis_b1, - xpoid_val_medium_size_jis_b2, - xpoid_val_medium_size_jis_b3, - xpoid_val_medium_size_jis_b4, - xpoid_val_medium_size_jis_b5, - xpoid_val_medium_size_jis_b6, - xpoid_val_medium_size_jis_b7, - xpoid_val_medium_size_jis_b8, - xpoid_val_medium_size_jis_b9, - xpoid_val_medium_size_jis_b10, - xpoid_val_medium_size_hp_2x_postcard, - xpoid_val_medium_size_hp_european_edp, - xpoid_val_medium_size_hp_mini, - xpoid_val_medium_size_hp_postcard, - xpoid_val_medium_size_hp_tabloid, - xpoid_val_medium_size_hp_us_edp, - xpoid_val_medium_size_hp_us_government_legal, - xpoid_val_medium_size_hp_us_government_letter, -}; -static XpOidList ValidMediumSizes = { - ValidMediumSizesOids, XpNumber(ValidMediumSizesOids) -}; - -static XpOidDocFmt DefaultDocumentFormat = { - "Postscript", "2", NULL -}; - - -/* - * init struct for XpValidate*Pool - */ -XpValidatePoolsRec PsValidatePoolsRec = { - &ValidContentOrientations, &DefaultContentOrientations, - &ValidDocFormatsSupported, &DefaultDocFormatsSupported, - &ValidInputTrays, &ValidMediumSizes, - &ValidPlexes, &DefaultPlexes, - &ValidPrinterResolutions, &DefaultPrinterResolutions, - &ValidEmbeddedFormatsSupported, &DefaultEmbeddedFormatsSupported, - &ValidListfontsModes, &DefaultListfontsModes, - &ValidRawFormatsSupported, &DefaultRawFormatsSupported, - &ValidSetupProviso, - &DefaultDocumentFormat -}; diff --git a/nx-X11/programs/Xserver/Xprint/ps/PsAttr.c b/nx-X11/programs/Xserver/Xprint/ps/PsAttr.c deleted file mode 100644 index 74da5a0e1..000000000 --- a/nx-X11/programs/Xserver/Xprint/ps/PsAttr.c +++ /dev/null @@ -1,117 +0,0 @@ -/* $Xorg: PsAttr.c,v 1.4 2001/02/09 02:04:35 xorgcvs Exp $ */ -/* - -Copyright 1996, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* - * (c) Copyright 1996 Hewlett-Packard Company - * (c) Copyright 1996 International Business Machines Corp. - * (c) Copyright 1996 Sun Microsystems, Inc. - * (c) Copyright 1996 Novell, Inc. - * (c) Copyright 1996 Digital Equipment Corp. - * (c) Copyright 1996 Fujitsu Limited - * (c) Copyright 1996 Hitachi, Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF - * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * Except as contained in this notice, the names of the copyright holders - * shall not be used in advertising or otherwise to promote the sale, use - * or other dealings in this Software without prior written authorization - * from said copyright holders. - */ - -/******************************************************************* -** -** ********************************************************* -** * -** * File: PsAttr.c -** * -** * Contents: Attribute-handling functions for the PS driver -** * -** * Created By: Roger Helmendach (Liberty Systems) -** * -** * Copyright: Copyright 1996 The Open Group, Inc. -** * -** ********************************************************* -** -********************************************************************/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "Ps.h" -#include "attributes.h" - -char * -PsGetAttributes( - XpContextPtr pCon, - XPAttributes pool) -{ - return XpGetAttributes(pCon, pool); -} - -char * -PsGetOneAttribute( - XpContextPtr pCon, - XPAttributes pool, - char *attr) -{ - return XpGetOneAttribute(pCon, pool, attr); -} - -int -PsAugmentAttributes( - XpContextPtr pCon, - XPAttributes pool, - char *attrs) -{ - return XpAugmentAttributes(pCon, pool, attrs); -} - -int -PsSetAttributes( - XpContextPtr pCon, - XPAttributes pool, - char *attrs) -{ - return XpSetAttributes(pCon, pool, attrs); -} diff --git a/nx-X11/programs/Xserver/Xprint/ps/PsCache.c b/nx-X11/programs/Xserver/Xprint/ps/PsCache.c deleted file mode 100644 index e69aa2eb7..000000000 --- a/nx-X11/programs/Xserver/Xprint/ps/PsCache.c +++ /dev/null @@ -1,328 +0,0 @@ -/* - -Copyright 1996, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* - * (c) Copyright 1996 Hewlett-Packard Company - * (c) Copyright 1996 International Business Machines Corp. - * (c) Copyright 1996, 2000 Sun Microsystems, Inc. All Rights Reserved. - * (c) Copyright 1996 Novell, Inc. - * (c) Copyright 1996 Digital Equipment Corp. - * (c) Copyright 1996 Fujitsu Limited - * (c) Copyright 1996 Hitachi, Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF - * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * Except as contained in this notice, the names of the copyright holders - * shall not be used in advertising or otherwise to promote the sale, use - * or other dealings in this Software without prior written authorization - * from said copyright holders. - */ - -/******************************************************************* -** -** ********************************************************* -** * -** * File: PsCache.c -** * -** * Contents: Character-caching routines -** * -** * Created By: Jay Hobson (Sun MicroSystems) -** * -** * Copyright: Copyright 1996 The Open Group, Inc. -** * -** ********************************************************* -** -********************************************************************/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "Ps.h" -#include "gcstruct.h" -#include "windowstr.h" -#include -#include - -#define GET 0 -#define RESET 1 - -struct bm_cache_list { - struct bm_cache_list *next; - struct bm_cache_list *prev; - int height; - long id; - char *pBuffer; -}; - -struct bm_cache_head { - struct bm_cache_list *head; - int width; - struct bm_cache_head *next; - struct bm_cache_head *prev; -}; - -static struct bm_cache_head *bm_cache = NULL; - -static long -PsBmUniqueId(int func) -{ - static long unique_id = 0; - - if(func == RESET) - { - unique_id = 0; - return 0; - } - else - return ++unique_id; -} - -int -PsBmIsImageCached( - int gWidth, - int gHeight, - char *pBuffer) -{ - int return_val = 0; - struct bm_cache_head *pList = bm_cache; - - while(pList != NULL && !return_val) - { - if(pList->width == gWidth) - { - struct bm_cache_list *pItem = pList->head; - - while(pItem != NULL) - { - if(pItem->height == gHeight) - { - int length = 4*(gWidth/32+(gWidth%32!=0))*gHeight; - - if(!memcmp(pItem->pBuffer, pBuffer, sizeof(char)*length)) - { - return_val = pItem->id; - break; - } - } - else if(pItem->height > gHeight) - break; - - pItem = pItem->next; - } - } - else if(pList->width > gWidth) - break; - - pList = pList->next; - } - return return_val; -} - -int -PsBmPutImageInCache( - int gWidth, - int gHeight, - char *pBuffer) -{ - int return_val = 0; - struct bm_cache_head *pList = bm_cache; - struct bm_cache_list *pNew; - int length = 4*(gWidth/32+(gWidth%32!=0))*gHeight; - - if(gWidth == 1 && gHeight == 1 && pBuffer[0] == 0) - return return_val; - - pNew = (struct bm_cache_list *)malloc(sizeof(struct bm_cache_list)); - pNew->next = NULL; - pNew->prev = NULL; - pNew->height = gHeight; - pNew->id = PsBmUniqueId(GET); - pNew->pBuffer = (char *)malloc(sizeof(char)*length); - - memcpy(pNew->pBuffer, pBuffer, length); - - while(pList != NULL) - { - if(pList->width == gWidth) - { - struct bm_cache_list *pItem = pList->head; - - while(pItem != NULL) - { - if(pItem->height >= gHeight) - { - pNew->next = pItem; - pNew->prev = pItem->prev; - if(pItem->prev != NULL) - pItem->prev->next = pNew; - else - pList->head = pNew; - pItem->prev = pNew; - - return_val = pNew->id; - - break; - } - else if(pItem->next == NULL) - { - pNew->prev = pItem; - pItem->next = pNew; - - return_val = pNew->id; - - break; - } - - pItem = pItem->next; - } - - break; - } - - pList = pList->next; - } - - if(pList == NULL) - { - struct bm_cache_head *pNewList; - - pNewList = (struct bm_cache_head *)malloc(sizeof(struct bm_cache_head)); - - pNewList->next = NULL; - pNewList->prev = NULL; - pNewList->width = gWidth; - pNewList->head = pNew; - - if(bm_cache == NULL) - { - bm_cache = pNewList; - return_val = pNew->id; - } - else - { - pList = bm_cache; - - while(pList != NULL) - { - if(pList->width > gWidth) - { - pNewList->next = pList; - pNewList->prev = pList->prev; - - if(pList->prev != NULL) - pList->prev->next = pNewList; - else - bm_cache = pNewList; - pList->prev = pNewList; - - return_val = pNew->id; - - break; - } - else if(pList->next == NULL) - { - pNewList->prev = pList; - pList->next = pNewList; - - return_val = pNew->id; - - break; - } - - pList = pList->next; - } - } - } - - return return_val; -} - - -static void -PsBmClearImageCacheItem( - struct bm_cache_list *pItem) -{ - if(pItem != NULL) - { - if(pItem->pBuffer != NULL) - free(pItem->pBuffer); - pItem->pBuffer = NULL; - - if(pItem->next) - PsBmClearImageCacheItem(pItem->next); - pItem->next = NULL; - - free(pItem); - pItem = NULL; - } -} - -static void -PsBmClearImageCacheList( - struct bm_cache_head *pList) -{ - if(pList != NULL) - { - if(pList->head) - PsBmClearImageCacheItem(pList->head); - pList->head = NULL; - - if(pList->next) - PsBmClearImageCacheList(pList->next); - pList->next = NULL; - - free(pList); - pList = NULL; - } -} - -void -PsBmClearImageCache() -{ - PsBmClearImageCacheList(bm_cache); - - bm_cache = NULL; - - PsBmUniqueId(RESET); -} - diff --git a/nx-X11/programs/Xserver/Xprint/ps/PsColor.c b/nx-X11/programs/Xserver/Xprint/ps/PsColor.c deleted file mode 100644 index 91a44f85a..000000000 --- a/nx-X11/programs/Xserver/Xprint/ps/PsColor.c +++ /dev/null @@ -1,258 +0,0 @@ -/* $Xorg: PsColor.c,v 1.4 2001/02/09 02:04:36 xorgcvs Exp $ */ -/* - -Copyright 1996, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* - * (c) Copyright 1996 Hewlett-Packard Company - * (c) Copyright 1996 International Business Machines Corp. - * (c) Copyright 1996 Sun Microsystems, Inc. - * (c) Copyright 1996 Novell, Inc. - * (c) Copyright 1996 Digital Equipment Corp. - * (c) Copyright 1996 Fujitsu Limited - * (c) Copyright 1996 Hitachi, Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF - * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * Except as contained in this notice, the names of the copyright holders - * shall not be used in advertising or otherwise to promote the sale, use - * or other dealings in this Software without prior written authorization - * from said copyright holders. - */ - -/******************************************************************* -** -** ********************************************************* -** * -** * File: PsColor.c -** * -** * Contents: Color routines for the PS driver -** * -** * Created By: Roger Helmendach (Liberty Systems) -** * -** * Copyright: Copyright 1996 The Open Group, Inc. -** * -** ********************************************************* -** -********************************************************************/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "Ps.h" -#include "mi.h" -#include "micmap.h" -#include "gcstruct.h" -#include "windowstr.h" -#include "colormapst.h" - -Bool -PsCreateColormap(ColormapPtr pColor) -{ - return miInitializeColormap(pColor); -} - -void -PsDestroyColormap(ColormapPtr pColor) -{ - /* NO-OP */ -} - -void -PsInstallColormap(ColormapPtr pColor) -{ - miInstallColormap(pColor); -} - -void -PsUninstallColormap(ColormapPtr pColor) -{ - miUninstallColormap(pColor); -} - -int -PsListInstalledColormaps( - ScreenPtr pScreen, - XID *pCmapList) -{ - return miListInstalledColormaps(pScreen, pCmapList); -} - -void -PsStoreColors( - ColormapPtr pColor, - int ndef, - xColorItem *pdefs) -{ - int i; - for( i=0 ; ired[pdefs[i].pixel].co.local.red = pdefs[i].red; - if( pdefs[i].flags&DoGreen ) - pColor->red[pdefs[i].pixel].co.local.green = pdefs[i].green; - if( pdefs[i].flags&DoBlue ) - pColor->red[pdefs[i].pixel].co.local.blue = pdefs[i].blue; - } -} - -void -PsResolveColor( - unsigned short *pRed, - unsigned short *pGreen, - unsigned short *pBlue, - VisualPtr pVisual) -{ - miResolveColor(pRed, pGreen, pBlue, pVisual); -} - -PsOutColor -PsGetPixelColor(ColormapPtr cMap, int pixval) -{ - VisualPtr v = cMap->pVisual; - switch( v->class ) - { - case TrueColor: - { - PsOutColor p = pixval; - PsOutColor r, g, b; - - r = (p & v->redMask) >> v->offsetRed; - g = (p & v->greenMask) >> v->offsetGreen; - b = (p & v->blueMask) >> v->offsetBlue; - - r = cMap->red[r].co.local.red; - g = cMap->green[g].co.local.green; - b = cMap->blue[b].co.local.blue; - -#ifdef PSOUT_USE_DEEPCOLOR - return((r<<32)|(g<<16)|b); -#else - r >>= 8; - g >>= 8; - b >>= 8; - - return((r<<16)|(g<<8)|b); -#endif /* PSOUT_USE_DEEPCOLOR */ - } - case PseudoColor: - case GrayScale: - case StaticGray: - { - PsOutColor r, g, b; - - if( pixval < 0 || pixval > v->ColormapEntries) - return(0); - - r = cMap->red[pixval].co.local.red; - g = cMap->red[pixval].co.local.green; - b = cMap->red[pixval].co.local.blue; - - if ((v->class | DynamicClass) == GrayScale) - { - /* rescale to gray (see |miResolveColor()|) */ - r = g = b = (30L*r + 59L*g + 11L*b) / 100L; - } - -#ifdef PSOUT_USE_DEEPCOLOR - return((r<<32)|(g<<16)|b); -#else - r >>= 8; - g >>= 8; - b >>= 8; - - return((r<<16)|(g<<8)|b); -#endif /* PSOUT_USE_DEEPCOLOR */ - } - default: - FatalError("PsGetPixelColor: Unsupported visual %x\n", - (int)cMap->pVisual->class); - break; - } - - return 0; /* NO-OP*/ -} - -void -PsSetFillColor(DrawablePtr pDrawable, GCPtr pGC, PsOutPtr psOut, - ColormapPtr cMap) -{ - switch(pGC->fillStyle) - { - case FillSolid: - PsOut_Color(psOut, PsGetPixelColor(cMap, pGC->fgPixel)); - break; - case FillTiled: - if( !PsOut_BeginPattern(psOut, pGC->tile.pixmap, - pGC->tile.pixmap->drawable.width, - pGC->tile.pixmap->drawable.height, PsTile, 0, 0) ) - { - PsReplayPixmap(pGC->tile.pixmap, pDrawable); - PsOut_EndPattern(psOut); - } - PsOut_SetPattern(psOut, pGC->tile.pixmap, PsTile); - break; - case FillStippled: - if( !PsOut_BeginPattern(psOut, pGC->stipple, - pGC->stipple->drawable.width, - pGC->stipple->drawable.height, PsStip, 0, - PsGetPixelColor(cMap, pGC->fgPixel)) ) - { - PsReplayPixmap(pGC->stipple, pDrawable); - PsOut_EndPattern(psOut); - } - PsOut_SetPattern(psOut, pGC->stipple, PsStip); - break; - case FillOpaqueStippled: - if( !PsOut_BeginPattern(psOut, pGC->stipple, - pGC->stipple->drawable.width, - pGC->stipple->drawable.height, PsOpStip, - PsGetPixelColor(cMap, pGC->bgPixel), - PsGetPixelColor(cMap, pGC->fgPixel)) ) - { - PsReplayPixmap(pGC->stipple, pDrawable); - PsOut_EndPattern(psOut); - } - PsOut_SetPattern(psOut, pGC->stipple, PsOpStip); - break; - } -} diff --git a/nx-X11/programs/Xserver/Xprint/ps/PsDef.h b/nx-X11/programs/Xserver/Xprint/ps/PsDef.h deleted file mode 100644 index cf45c8516..000000000 --- a/nx-X11/programs/Xserver/Xprint/ps/PsDef.h +++ /dev/null @@ -1,97 +0,0 @@ -/* $Xorg: PsDef.h,v 1.4 2001/02/09 02:04:36 xorgcvs Exp $ */ -/* - -Copyright 1996, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* - * (c) Copyright 1996 Hewlett-Packard Company - * (c) Copyright 1996 International Business Machines Corp. - * (c) Copyright 1996 Sun Microsystems, Inc. - * (c) Copyright 1996 Novell, Inc. - * (c) Copyright 1996 Digital Equipment Corp. - * (c) Copyright 1996 Fujitsu Limited - * (c) Copyright 1996 Hitachi, Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF - * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * Except as contained in this notice, the names of the copyright holders - * shall not be used in advertising or otherwise to promote the sale, use - * or other dealings in this Software without prior written authorization - * from said copyright holders. - */ - -/******************************************************************* -** -** ********************************************************* -** * -** * File: PsDef.h -** * -** * Contents: extran defines and includes for the Ps driver -** * for a printing X server. -** * -** * Created By: Roger Helmendach (Liberty Systems) -** * -** * Copyright: Copyright 1996 The Open Group, Inc. -** * -** ********************************************************* -** -********************************************************************/ -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifndef _PSDEF_H_ -#define _PSDEF_H_ - -#define DT_PRINT_JOB_HEADER "DT_PRINT_JOB_HEADER" -#define DT_PRINT_JOB_TRAILER "DT_PRINT_JOB_TRAILER" -#define DT_PRINT_JOB_COMMAND "DT_PRINT_JOB_COMMAND" -#define DT_PRINT_JOB_EXEC_COMMAND "DT_PRINT_JOB_EXEC_COMMAND" -#define DT_PRINT_JOB_EXEC_OPTIONS "DT_PRINT_JOB_EXEC_OPTION" -#define DT_PRINT_PAGE_HEADER "DT_PRINT_PAGE_HEADER" -#define DT_PRINT_PAGE_TRAILER "DT_PRINT_PAGE_TRAILER" -#define DT_PRINT_PAGE_COMMAND "DT_PRINT_PAGE_COMMAND" - -#define DT_IN_FILE_STRING "%(InFile)%" -#define DT_OUT_FILE_STRING "%(OutFile)%" -#define DT_ALLOWED_COMMANDS_FILE "printCommands" - -#endif /* _PSDEF_H_ */ diff --git a/nx-X11/programs/Xserver/Xprint/ps/PsFTFonts.c b/nx-X11/programs/Xserver/Xprint/ps/PsFTFonts.c deleted file mode 100644 index c992987d4..000000000 --- a/nx-X11/programs/Xserver/Xprint/ps/PsFTFonts.c +++ /dev/null @@ -1,85 +0,0 @@ - -/* -Copyright (c) 2003-2004 Roland Mainz - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include - -#include "regionstr.h" -#include -#include "dixfontstr.h" -#include "scrnintstr.h" -#include -#include -#include - -#include "Ps.h" - -#include -#include FT_FREETYPE_H - -#include "ft.h" -#define NOT_IN_FTFUNCS -#include "ftfuncs.h" - -char * -PsGetFTFontFileName(FontPtr pFont) -{ - FTFontPtr tf = (FTFontPtr)pFont->fontPrivate; - return tf->instance->face->filename; -} - -Bool -PsIsFreeTypeFont(FontPtr pFont) -{ - int i; - int nprops = pFont->info.nprops; - FontPropPtr props = pFont->info.props; - /* "RASTERIZER_NAME" must match the rasterizer name set in - * xc/lib/font/FreeType/ftfuncs.c */ - Atom name = MakeAtom("RASTERIZER_NAME", 15, True); - Atom value = (Atom)0; - char *rv; - - for( i=0 ; i -#endif - -#include "regionstr.h" -#include -#include "dixfontstr.h" -#include "scrnintstr.h" -#include -#include -#include - -#include "Ps.h" - -#include -#include -#include - -Bool -PsRealizeFont( - ScreenPtr pscr, - FontPtr pFont) -{ - return TRUE; -} - -Bool -PsUnrealizeFont( - ScreenPtr pscr, - FontPtr pFont) -{ - return TRUE; -} - -char * -PsGetFontName(FontPtr pFont) -{ - int i; - int nprops = pFont->info.nprops; - FontPropPtr props = pFont->info.props; - Atom name = MakeAtom("FONT", 4, True); - Atom value = (Atom)0; - - for( i=0 ; iinfo.nprops; - FontPropPtr props = pFont->info.props; - /* "_ADOBE_POSTSCRIPT_FONTNAME" maps directly to a PMF OBJ_NAME attribute - * name - changing the name will break printer-builtin fonts. */ - Atom name = MakeAtom("_ADOBE_POSTSCRIPT_FONTNAME", 26, True); - Atom value = (Atom)0; - - for( i=0 ; iinfo.nprops; - FontPropPtr props = pFont->info.props; - Atom reg = MakeAtom("CHARSET_REGISTRY", 16, True); - Atom enc = MakeAtom("CHARSET_ENCODING", 16, True); - Atom rv = 0, ev = 0; - char *rp = 0; - char *ep = 0; - - for( i=0 ; iinfo.nprops; - FontPropPtr props = pFont->info.props; - Atom fnt = MakeAtom("FONT", 4, True); - Atom reg = MakeAtom("CHARSET_REGISTRY", 16, True); - Atom enc = MakeAtom("CHARSET_ENCODING", 16, True); - Atom fv = 0, rv = 0, ev = 0; - char *fp = 0; - char *rp = 0; - char *ep = 0; - char *encname; - - for( i=0 ; ifpe->name == "tcp/:7100")) - */ -static -Bool IsFPEaReadableDir(FontPtr pFont) -{ - const char *fpe_name = pFont->fpe->name; - if (!fpe_name) - return False; - -#define MODEL_FONTPATH_PREFIX "PRINTER:" -#define MODEL_FONTPATH_PREFIX_LEN 8 - /* Strip model-specific font path prefix if there is one... */ - if (!strncmp(fpe_name, MODEL_FONTPATH_PREFIX, MODEL_FONTPATH_PREFIX_LEN)) - fpe_name += MODEL_FONTPATH_PREFIX_LEN; - - if (access(fpe_name, F_OK) == 0) - { - return True; - } - - return False; -} - -static -char *getFontFilename(FontPtr pFont) -{ - FontDirectoryPtr dir; - const char *dlfnam; - FILE *file; - struct stat statb; - int count, i, status; - char buf[512]; - char *front, *end, *fn; - char font_dir_fname[PATH_MAX], /* Full path of fonts.dir */ - font_file_fname[PATH_MAX]; /* Name of font file (excluding path) */ - -#ifdef XP_USE_FREETYPE - if( PsIsFreeTypeFont(pFont) ) - { - const char *fontname = PsGetFTFontFileName(pFont); - -#ifdef DEBUG_gisburn - fprintf(stderr, "getFontFilename: freetype font, file='%s'\n", fontname?fontname:""); -#endif /* DEBUG_gisburn */ - - if( !fontname ) - return NULL; - - return strdup(fontname); - } -#endif /* XP_USE_FREETYPE */ - - if (!IsFPEaReadableDir(pFont)) - { -#ifdef DEBUG_gisburn - fprintf(stderr, "getFontFilename: '%s' no valid font path on disk\n", pFont->fpe->name); -#endif /* DEBUG_gisburn */ - return NULL; - } - - dir = pFont->fpe->private; - sprintf(font_dir_fname, "%s%s", dir->directory, "fonts.dir"); - - if (!(dlfnam = PsGetFontName(pFont))) - return NULL; - - file = fopen(font_dir_fname, "r"); - if (file) - { - if (fstat (fileno(file), &statb) == -1) - return NULL; - - while( fgets(buf, sizeof(buf)-1, file) ) - { - if ((fn = strstr(buf, " -"))) - { - strcpy(font_file_fname, buf); - font_file_fname[fn - buf] = '\0'; - fn++; - if ((front = str_case_str(fn, "normal-"))) - { - fn[front - fn] = '\0'; - if (str_case_str(dlfnam, fn)) - { - char full_font_file_path[PATH_MAX]; - - fclose(file); - - sprintf(full_font_file_path, "%s%s", dir->directory, font_file_fname); - -#ifdef xDEBUG_gisburn - fprintf(stderr, "getFontFilename: returning '%s'\n", full_font_file_path); -#endif /* DEBUG_gisburn */ - return strdup(full_font_file_path); - } - } - } - } - } - font_file_fname[0] = '\0'; - fclose(file); - -#ifdef DEBUG_gisburn - fprintf(stderr, "getFontFilename: returning NULL\n"); -#endif /* DEBUG_gisburn */ - - return NULL; -} - -static -PsFontTypeInfoRec *PsFindFontTypeInfoRec(DrawablePtr pDrawable, FontPtr pFont) -{ - PsContextPrivRec *cPriv = PsGetPsContextPriv(pDrawable); - PsFontTypeInfoRec *rec; - const char *psname; - char *font_filename; - char *encname; -#ifdef XP_USE_FREETYPE - Bool is_freetypefont; -#endif /* XP_USE_FREETYPE */ - -#ifdef XP_USE_FREETYPE - is_freetypefont = PsIsFreeTypeFont(pFont); -#endif /* XP_USE_FREETYPE */ - encname = PsGetEncodingName(pFont); - - /* First try: Search by PostScript font name */ - psname = PsGetPSFontName(pFont); - if (psname) - { - for( rec = cPriv->fontTypeInfoRecords ; rec != NULL ; rec = rec->next ) - { -#ifdef XP_USE_FREETYPE - if (is_freetypefont) - { - if (rec->adobe_ps_name) - { - if ((rec->font_type == PSFTI_FONT_TYPE_FREETYPE) && - (!strcmp(rec->adobe_ps_name, psname)) && - (!strcmp(rec->ft_download_encoding, encname))) - { - return rec; - } - } - } - else -#endif /* XP_USE_FREETYPE */ - { - if (rec->adobe_ps_name) - { - if ((rec->font_type != PSFTI_FONT_TYPE_FREETYPE) && - (!strcmp(rec->adobe_ps_name, psname))) - { - return rec; - } - } - } - } - } - - /* Last attempt: Search by filename */ - font_filename = getFontFilename(pFont); - if (font_filename) - { - for( rec = cPriv->fontTypeInfoRecords ; rec != NULL ; rec = rec->next ) - { - if (rec->filename) - { -#ifdef XP_USE_FREETYPE - if (is_freetypefont) - { - if ( (rec->font_type == PSFTI_FONT_TYPE_FREETYPE) && - (!strcasecmp(rec->filename, font_filename)) && - (!strcasecmp(rec->ft_download_encoding, encname)) ) - { - free(font_filename); - return rec; - } - } - else -#endif /* XP_USE_FREETYPE */ - { - if ( (rec->font_type != PSFTI_FONT_TYPE_FREETYPE) && - (!strcasecmp(rec->filename, font_filename)) ) - { - free(font_filename); - return rec; - } - } - } - } - - free(font_filename); - } - - return NULL; -} - -static -void PsAddFontTypeInfoRec(DrawablePtr pDrawable, PsFontTypeInfoRec *add_rec) -{ - PsContextPrivRec *cPriv = PsGetPsContextPriv(pDrawable); - - /* ToDO: Always move the last used entry to the top that the list get's - * sorted in an efficient order... :-) */ - add_rec->next = cPriv->fontTypeInfoRecords; - cPriv->fontTypeInfoRecords = add_rec; -} - -static -Bool strcaseendswith(const char *str, const char *suffix) -{ - const char *s; - - s = str + strlen(str) - strlen(suffix); - - if (!strcasecmp(s, suffix)) - return True; - - return False; -} - - -static -int getFontFileType( const char *filename ) -{ - int type; - - /* Is this a Adobe PostScript Type 1 binary font (PFB) ? */ - if( strcaseendswith(filename, ".pfb") ) - { - type = PSFTI_FONT_TYPE_PS_TYPE1_PFB; - } - /* Is this a Adobe PostScript ASCII font (PFA) ? */ - else if( strcaseendswith(filename, ".pfa") ) - { - type = PSFTI_FONT_TYPE_PS_TYPE1_PFA; - } - /* Is this a PMF(=Printer Metrics File) ? */ - else if( strcaseendswith(filename, ".pmf") ) - { - type = PSFTI_FONT_TYPE_PMF; - } - /* Is this a TrueType font file ? */ - else if( strcaseendswith(filename, ".ttf") || - strcaseendswith(filename, ".ttc") || - strcaseendswith(filename, ".otf") || - strcaseendswith(filename, ".otc") ) - { - type = PSFTI_FONT_TYPE_TRUETYPE; - } - else - { - type = PSFTI_FONT_TYPE_OTHER; - } - -#ifdef XP_USE_FREETYPE - { - XpContextPtr pCon; - char *downloadfonts; - pCon = XpGetPrintContext(requestingClient); - downloadfonts = XpGetOneAttribute(pCon, XPPrinterAttr, "xp-psddx-download-fonts"); - if( downloadfonts ) - { - /* Should we download PS Type1 fonts as PS Type1||Type3 ? */ - if( (type == PSFTI_FONT_TYPE_PS_TYPE1_PFA) && - (strstr(downloadfonts, "pfa") != NULL) ) - { - type = PSFTI_FONT_TYPE_FREETYPE; - } - - if( (type == PSFTI_FONT_TYPE_PS_TYPE1_PFB) && - (strstr(downloadfonts, "pfb") != NULL) ) - { - type = PSFTI_FONT_TYPE_FREETYPE; - } - - /* Should we download TrueType fonts as PS Type1||Type3 ? */ - if( (type == PSFTI_FONT_TYPE_TRUETYPE) && - ((strstr(downloadfonts, "ttf") != NULL) || - (strstr(downloadfonts, "ttc") != NULL) || - (strstr(downloadfonts, "otf") != NULL) || - (strstr(downloadfonts, "otc") != NULL)) ) - { - type = PSFTI_FONT_TYPE_FREETYPE; - } - } - } -#endif /* XP_USE_FREETYPE */ - -#ifdef DEBUG_gisburn - fprintf(stderr, "getFontFileType: '%s' is %d\n", filename, (int)type); -#endif /* DEBUG_gisburn */ - return type; -} - -PsFTDownloadFontType PsGetFTDownloadFontType(void) -{ - PsFTDownloadFontType downloadfonttype; - XpContextPtr pCon; - char *psfonttype; - - pCon = XpGetPrintContext(requestingClient); - psfonttype = XpGetOneAttribute(pCon, XPPrinterAttr, "xp-psddx-download-font-type"); - - if( !psfonttype || !strlen(psfonttype) ) - { - return PsFontType1; /* Default download font type is PS Type1 */ - } - - if( !strcmp(psfonttype, "bitmap") ) - { - downloadfonttype = PsFontBitmap; - } - else if( !strcmp(psfonttype, "pstype3") ) - { - downloadfonttype = PsFontType3; - } - else if( !strcmp(psfonttype, "pstype1") ) - { - downloadfonttype = PsFontType1; - } - else - { - FatalError("PS DDX: XPPrinterAttr/xp-psddx-download-freetype-font-type='%s' not implemented\n", psfonttype); - return 0; /* NO-OP, FatalError() will call |exit()| */ - } - - return downloadfonttype; -} - -static -PsFontTypeInfoRec *PsCreateFontTypeInfoRec(DrawablePtr pDrawable, FontPtr pFont) -{ - char *dlfnam; - PsFontTypeInfoRec *rec; - char *psname; - - if (!(dlfnam = PsGetFontName(pFont))) - return NULL; - - if (!(rec = (PsFontTypeInfoRec *)xalloc(sizeof(PsFontTypeInfoRec)))) - return NULL; - memset(rec, 0, sizeof(PsFontTypeInfoRec)); - - rec->next = NULL; - - if ((rec->filename = getFontFilename(pFont))) - { - rec->font_type = getFontFileType(rec->filename); - } - else - { - rec->filename = NULL; - rec->font_type = PSFTI_FONT_TYPE_OTHER; - } - - rec->adobe_ps_name = PsGetPSFontName(pFont); -#ifdef XP_USE_FREETYPE - rec->ft_download_encoding = PsGetEncodingName(pFont); - rec->ft_download_font_type = PsGetFTDownloadFontType(); -#endif /* XP_USE_FREETYPE */ - rec->download_ps_name = NULL; - -#define SET_FONT_DOWNLOAD_STATUS(rec, downloaded) { int i; for (i = 0 ; i < 256 ; i++) { (rec)->alreadyDownloaded[i]=(downloaded); } } - - /* Set some flags based on the font type */ - switch( rec->font_type ) - { - case PSFTI_FONT_TYPE_PS_TYPE1_PFA: - case PSFTI_FONT_TYPE_PS_TYPE1_PFB: - rec->downloadableFont = True; - SET_FONT_DOWNLOAD_STATUS(rec, False); - rec->is_iso_encoding = PsIsISOLatin1Encoding(pFont); - break; - - case PSFTI_FONT_TYPE_PMF: - rec->downloadableFont = True; /* This font is in printer's ROM */ - SET_FONT_DOWNLOAD_STATUS(rec, True); - rec->is_iso_encoding = PsIsISOLatin1Encoding(pFont); - break; - - case PSFTI_FONT_TYPE_TRUETYPE: - /* Note: TrueType font download not implemented */ - rec->downloadableFont = False; - SET_FONT_DOWNLOAD_STATUS(rec, False); - rec->is_iso_encoding = PsIsISOLatin1Encoding(pFont); - break; - -#ifdef XP_USE_FREETYPE - case PSFTI_FONT_TYPE_FREETYPE: - if( rec->ft_download_font_type == PsFontType1 || - rec->ft_download_font_type == PsFontType3 ) - { - rec->downloadableFont = True; - } - else - { - rec->downloadableFont = False; - } - - SET_FONT_DOWNLOAD_STATUS(rec, False); - rec->is_iso_encoding = False; /* Freetype--->PS Type1/Type3 uses always non-iso PS encoding for now */ - break; -#endif /* XP_USE_FREETYPE */ - - case PSFTI_FONT_TYPE_OTHER: - default: - rec->downloadableFont = False; - SET_FONT_DOWNLOAD_STATUS(rec, False); - rec->is_iso_encoding = PsIsISOLatin1Encoding(pFont); - break; - } - -#ifdef XP_USE_FREETYPE - if( (rec->font_type == PSFTI_FONT_TYPE_FREETYPE) ) - { - char *s; - register int c; - - if( rec->adobe_ps_name ) - { - rec->download_ps_name = malloc(strlen(rec->adobe_ps_name) + strlen(rec->ft_download_encoding) + 2); - sprintf(rec->download_ps_name, "%s_%s", rec->adobe_ps_name, rec->ft_download_encoding); - } - else - { - /* Unfortunately not all TTF fonts have a PostScript font name (like - * Solaris TTF fonts in /usr/openwin/lib/locale/ko.UTF-8/X11/fonts/TrueType, - * /usr/openwin/lib/locale/ko/X11/fonts/TrueType) - in this case we - * have to generate a font name - */ - char ftfontname[64]; - static long myfontindex = 0L; - sprintf(ftfontname, "psfont_%lx", myfontindex++); - - rec->download_ps_name = malloc(strlen(ftfontname) + strlen(rec->ft_download_encoding) + 2); - sprintf(rec->download_ps_name, "%s_%s", ftfontname, rec->ft_download_encoding); - - fprintf(stderr, "PsCreateFontTypeInfoRec: Note: '%s' has no PS font name, using '%s' for now.\n", dlfnam, rec->download_ps_name); - } - - /* Make sure the font name we use for download is a valid PS font name */ - for( s = rec->download_ps_name ; *s != '\0'; s++ ) - { - c = *s; - - /* Check for allowed chars, invalid ones are replaced with a '_' - * (and check that the first char is not a digit) */ - if( !(isalnum(c) || c == '.' || c == '_' || c == '-') || (s==rec->download_ps_name && isdigit(c)) ) - { - *s = '_'; - } - } - } - else -#endif /* XP_USE_FREETYPE */ - { - if( rec->adobe_ps_name ) - { - rec->download_ps_name = strdup(rec->adobe_ps_name); - } - else - { - rec->download_ps_name = NULL; - } - } - - /* Safeguard - only treat font as downloadable when we have a PS font name!! */ - if (!rec->download_ps_name && rec->downloadableFont) - { - /* XXX: Log this message to the log when the logging service has been hook'ed up */ - fprintf(stderr, "PsCreateFontTypeInfoRec: Safeguard: No PS font name for '%s'!\n", dlfnam); - rec->downloadableFont = False; - } - -#ifdef DEBUG_gisburn - fprintf(stderr, "PsCreateFontTypeInfoRec: Created PsFontTypeInfoRec '%s' ('%s'/'%s')\n", - ((rec->filename) ?(rec->filename) :("")), - ((rec->adobe_ps_name) ?(rec->adobe_ps_name):("")), - ((rec->download_ps_name)?(rec->download_ps_name):(""))); -#endif /* DEBUG_gisburn */ - - return rec; -} - -static -PsFontTypeInfoRec *PsGetFontTypeInfoRec(DrawablePtr pDrawable, FontPtr pFont) -{ - PsFontTypeInfoRec *rec; - char *dlfnam; - - if(!(dlfnam = PsGetFontName(pFont))) - return NULL; - - rec = PsFindFontTypeInfoRec(pDrawable, pFont); - if (rec) - return rec; - - rec = PsCreateFontTypeInfoRec(pDrawable, pFont); - if (!rec) - return NULL; - - PsAddFontTypeInfoRec(pDrawable, rec); - - return rec; -} - -static -void PsFreeFontTypeInfoRecords( PsContextPrivPtr priv ) -{ - PsFontTypeInfoRec *curr, *next; - curr = priv->fontTypeInfoRecords; - while( curr != NULL ) - { - if (curr->filename) - free(curr->filename); /* Free memory allocated by |strdup()| */ - - if (curr->download_ps_name) - free(curr->download_ps_name); - - next = curr->next; - xfree(curr); - curr = next; - } -} - -static -PsFontInfoRec *PsFindFontInfoRec(DrawablePtr pDrawable, FontPtr pFont) -{ - PsContextPrivRec *cPriv = PsGetPsContextPriv(pDrawable); - PsFontInfoRec *rec; - - if (!pFont) - return NULL; - - for( rec = cPriv->fontInfoRecords ; rec != NULL ; rec = rec->next ) - { - if ((rec->font == pFont) && - (rec->font_fontPrivate == pFont->fontPrivate)) - return rec; - } - - return NULL; -} - -static -void PsAddFontInfoRec(DrawablePtr pDrawable, PsFontInfoRec *add_rec) -{ - PsContextPrivRec *cPriv = PsGetPsContextPriv(pDrawable); - - /* ToDO: Always move the last used entry to the top that the list get's - * sorted in an efficient order... :-) */ - add_rec->next = cPriv->fontInfoRecords; - cPriv->fontInfoRecords = add_rec; -} - -static -PsFontInfoRec *PsCreateFontInfoRec(DrawablePtr pDrawable, FontPtr pFont) -{ - PsFontInfoRec *rec; - PsFontTypeInfoRec *ftir; - - if (!(ftir = PsGetFontTypeInfoRec(pDrawable, pFont))) - return NULL; - - if (!(rec = (PsFontInfoRec *)xalloc(sizeof(PsFontInfoRec)))) - return NULL; - memset(rec, 0, sizeof(PsFontInfoRec)); - - rec->font = pFont; - rec->font_fontPrivate = pFont->fontPrivate; - rec->ftir = ftir; - rec->next = NULL; - rec->dfl_name = PsGetFontName(pFont); - rec->size = PsGetFontSize(pFont, rec->mtx); - -#ifdef DEBUG_gisburn - fprintf(stderr, "PsCreateFontInfoRec: Created PsFontInfoRec '%s'\n", - ((rec->dfl_name)?(rec->dfl_name):(""))); -#endif /* DEBUG_gisburn */ - - return rec; -} - -PsFontInfoRec *PsGetFontInfoRec(DrawablePtr pDrawable, FontPtr pFont) -{ - PsFontInfoRec *rec; - - rec = PsFindFontInfoRec(pDrawable, pFont); - if (rec) - return rec; - - rec = PsCreateFontInfoRec(pDrawable, pFont); - if (!rec) - return NULL; - - PsAddFontInfoRec(pDrawable, rec); - - return rec; -} - -void PsFreeFontInfoRecords( PsContextPrivPtr priv ) -{ - PsFontInfoRec *curr, *next; - curr = priv->fontInfoRecords; - while( curr != NULL ) - { - next = curr->next; - xfree(curr); - curr = next; - } - - PsFreeFontTypeInfoRecords(priv); - - priv->fontTypeInfoRecords = NULL; - priv->fontInfoRecords = NULL; -} diff --git a/nx-X11/programs/Xserver/Xprint/ps/PsGC.c b/nx-X11/programs/Xserver/Xprint/ps/PsGC.c deleted file mode 100644 index 56ff5cdae..000000000 --- a/nx-X11/programs/Xserver/Xprint/ps/PsGC.c +++ /dev/null @@ -1,419 +0,0 @@ -/* $Xorg: PsGC.c,v 1.4 2001/02/09 02:04:36 xorgcvs Exp $ */ -/* - -Copyright 1996, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* - * (c) Copyright 1996 Hewlett-Packard Company - * (c) Copyright 1996 International Business Machines Corp. - * (c) Copyright 1996 Sun Microsystems, Inc. - * (c) Copyright 1996 Novell, Inc. - * (c) Copyright 1996 Digital Equipment Corp. - * (c) Copyright 1996 Fujitsu Limited - * (c) Copyright 1996 Hitachi, Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF - * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * Except as contained in this notice, the names of the copyright holders - * shall not be used in advertising or otherwise to promote the sale, use - * or other dealings in this Software without prior written authorization - * from said copyright holders. - */ - -/******************************************************************* -** -** ********************************************************* -** * -** * File: PsGC.c -** * -** * Contents: Graphics Context handling for the PS driver -** * -** * Created By: Roger Helmendach (Liberty Systems) -** * -** * Copyright: Copyright 1996 The Open Group, Inc. -** * -** ********************************************************* -** -********************************************************************/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "Ps.h" -#include "gcstruct.h" -#include "pixmapstr.h" -#include "windowstr.h" -#include "migc.h" -#include "scrnintstr.h" - -static GCOps PsGCOps = -{ - PsFillSpans, - PsSetSpans, - PsPutImage, - PsCopyArea, - PsCopyPlane, - PsPolyPoint, - PsPolyLine, - PsPolySegment, - PsPolyRectangle, - PsPolyArc, - PsFillPolygon, - PsPolyFillRect, - PsPolyFillArc, - PsPolyText8, - PsPolyText16, - PsImageText8, - PsImageText16, - PsImageGlyphBlt, - PsPolyGlyphBlt, - PsPushPixels -#ifdef NEED_LINEHELPER - ,NULL -#endif -}; - - -static GCFuncs PsGCFuncs = -{ - PsValidateGC, - PsChangeGC, - PsCopyGC, - PsDestroyGC, - PsChangeClip, - PsDestroyClip, - PsCopyClip -}; - -Bool -PsCreateGC(pGC) - GCPtr pGC; -{ - pGC->clientClip = NULL; - pGC->clientClipType = CT_NONE; - - pGC->ops = &PsGCOps; - pGC->funcs = &PsGCFuncs; - - pGC->clientClip = (pointer)xalloc(sizeof(PsClipRec)); - memset(pGC->clientClip, 0, sizeof(PsClipRec)); - return TRUE; -} - -static int -PsGetDrawablePrivateStuff( - DrawablePtr pDrawable, - GC *gc, - unsigned long *valid, - PsOutPtr *psOut, - ColormapPtr *cMap) -{ - XpContextPtr pCon; - PsContextPrivPtr cPriv; - PsScreenPrivPtr sPriv; - - switch(pDrawable->type) - { - case DRAWABLE_PIXMAP: - return FALSE; - case DRAWABLE_WINDOW: - pCon = PsGetContextFromWindow((WindowPtr)pDrawable); - if( pCon==NULL ) return FALSE; - else - { - Colormap c; - ColormapPtr cmap; - - c = wColormap((WindowPtr)pDrawable); - cmap = (ColormapPtr)LookupIDByType(c, RT_COLORMAP); - - cPriv = pCon->devPrivates[PsContextPrivateIndex].ptr; - sPriv = (PsScreenPrivPtr) - pDrawable->pScreen->devPrivates[PsScreenPrivateIndex].ptr; - *gc = cPriv->lastGC; - *valid = cPriv->validGC; - *psOut = cPriv->pPsOut; - *cMap = cmap; - return TRUE; - } - default: - return FALSE; - } -} - -PsContextPrivPtr -PsGetPsContextPriv( DrawablePtr pDrawable ) -{ - XpContextPtr pCon; - PsContextPrivPtr cPriv; - - switch(pDrawable->type) - { - case DRAWABLE_PIXMAP: - return FALSE; - case DRAWABLE_WINDOW: - pCon = PsGetContextFromWindow((WindowPtr)pDrawable); - if (pCon != NULL) - { - return pCon->devPrivates[PsContextPrivateIndex].ptr; - } - } - return NULL; -} - -int -PsUpdateDrawableGC( - GCPtr pGC, - DrawablePtr pDrawable, - PsOutPtr *psOut, - ColormapPtr *cMap) -{ - GC dGC; - unsigned long valid; - int i; - PsContextPrivPtr cPriv; - BoxPtr boxes; - - if (!PsGetDrawablePrivateStuff(pDrawable, &dGC, &valid, psOut, cMap)) - return FALSE; - - switch (pDrawable->type) { - - case DRAWABLE_PIXMAP: - /* we don't support pixmaps yet! */ - return FALSE; - break; - case DRAWABLE_WINDOW: - if( pGC ) - { - RegionPtr pReg; - WindowPtr pWin = (WindowPtr)pDrawable; - Bool freeClip; - PsClipPtr clp = (PsClipPtr)pGC->clientClip; - if( clp->outterClips ) - { xfree(clp->outterClips); clp->outterClips = 0; } - clp->nOutterClips = 0; - if( pGC->subWindowMode==IncludeInferiors ) - { - pReg = NotClippedByChildren(pWin); - freeClip = TRUE; - } - else - { - pReg = &pWin->clipList; - freeClip = FALSE; - } - - if( pReg->data ) - { - boxes = (BoxPtr)((char *)pReg->data+sizeof(long)*2); - clp->nOutterClips = pReg->data->numRects; - clp->outterClips = - (PsRectPtr)xalloc(clp->nOutterClips*sizeof(PsRectRec)); - for( i=0 ; inOutterClips ; i++ ) - { - clp->outterClips[i].x = boxes[i].x1; - clp->outterClips[i].y = boxes[i].y1; - clp->outterClips[i].w = (boxes[i].x2-boxes[i].x1)+1; - clp->outterClips[i].h = (boxes[i].y2-boxes[i].y1)+1; - } - } - - if( freeClip ) REGION_DESTROY(pGC->pScreen, pReg); - PsOut_Offset(*psOut, pDrawable->x, pDrawable->y); - PsOut_Clip(*psOut, pGC->clientClipType, (PsClipPtr)pGC->clientClip); - } - cPriv = ( PsGetContextFromWindow( (WindowPtr)pDrawable ) ) - ->devPrivates[PsContextPrivateIndex].ptr; - break; - } - return TRUE; -} - -void -PsValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) -{ - pGC->ops = &PsGCOps; -} - -void -PsChangeGC(GCPtr pGC, unsigned long changes) -{ -} - -void -PsCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst) -{ -} - -void -PsDestroyGC(GCPtr pGC) -{ - PsDestroyClip(pGC); - xfree(pGC->clientClip); -} - -void -PsChangeClip(GCPtr pGC, int type, pointer pValue, int nrects) -{ - int i; - PsClipPtr clp = (PsClipPtr)pGC->clientClip; - RegionPtr rgn; - BoxPtr boxes; - xRectangle *rects; - - PsDestroyClip(pGC); - pGC->clientClipType = type; - switch(type) - { - case CT_NONE: break; - case CT_PIXMAP: - clp->elms = PsCreateFillElementList((PixmapPtr)pValue, &clp->nElms); - (*pGC->pScreen->DestroyPixmap)((PixmapPtr)pValue); - break; - case CT_REGION: - rgn = (RegionPtr)pValue; - boxes = (BoxPtr)((char *)rgn->data+sizeof(long)*2); - clp->nRects = rgn->data->numRects; - clp->rects = (PsRectPtr)xalloc(clp->nRects*sizeof(PsRectRec)); - for( i=0 ; inRects ; i++ ) - { - clp->rects[i].x = boxes[i].x1; - clp->rects[i].y = boxes[i].y1; - clp->rects[i].w = (boxes[i].x2-boxes[i].x1)+1; - clp->rects[i].h = (boxes[i].y2-boxes[i].y1)+1; - } - REGION_DESTROY(pGC->pScreen, (RegionPtr)pValue); - break; - case CT_UNSORTED: - case CT_YSORTED: - case CT_YXSORTED: - case CT_YXBANDED: - rects = (xRectangle *)pValue; - clp->nRects = nrects; - clp->rects = (PsRectPtr)xalloc(clp->nRects*sizeof(PsRectRec)); - for( i=0 ; inRects ; i++ ) - { - clp->rects[i].x = rects[i].x; - clp->rects[i].y = rects[i].y; - clp->rects[i].w = rects[i].width; - clp->rects[i].h = rects[i].height; - } - xfree(pValue); - break; - } -} - -void -PsDestroyClip(GCPtr pGC) -{ - PsClipPtr clp = (PsClipPtr)pGC->clientClip; - - if( clp->rects ) xfree(clp->rects); - if( clp->outterClips ) xfree(clp->outterClips); - clp->rects = (PsRectPtr)0; - clp->outterClips = (PsRectPtr)0; - clp->nRects = 0; - clp->nOutterClips = 0; - if( clp->elms ) PsDestroyFillElementList(clp->nElms, clp->elms); - clp->elms = (PsElmPtr)0; - clp->nElms = 0; - pGC->clientClipType = CT_NONE; -} - -void -PsCopyClip(GCPtr pDst, GCPtr pSrc) -{ - PsClipPtr src = (PsClipPtr)pSrc->clientClip; - PsClipPtr dst = (PsClipPtr)pDst->clientClip; - - PsDestroyClip(pDst); - pDst->clientClipType = pSrc->clientClipType; - *dst = *src; - if( src->rects ) - { - dst->rects = (PsRectPtr)xalloc(src->nRects*sizeof(PsRectRec)); - memcpy(dst->rects, src->rects, src->nRects*sizeof(PsRectRec)); - } - if( src->elms ) - dst->elms = PsCloneFillElementList(src->nElms, src->elms); -} - - -GCPtr -PsCreateAndCopyGC(DrawablePtr pDrawable, GCPtr pSrc) -{ - GCPtr pDst; - - if (pSrc == NULL) { - /* https://freedesktop.org/bugzilla/show_bug.cgi?id=1416 ("'x11perf - * -copypixpix500' crashes Xprt's PostScript DDX [PsCreateAndCopyGC"): - * I have no clue whether this is the real fix or just wallpapering - * over the crash (that's why we warn here loudly when this - * happens) ... */ - fprintf(stderr, "PsCreateAndCopyGC: pSrc == NULL\n"); - return NULL; - } - - if ((pDst = - CreateScratchGC(pDrawable->pScreen, pDrawable->depth)) == NULL) - { - return NULL; - } - - if (CopyGC(pSrc, pDst, - GCFunction | GCPlaneMask | GCForeground | GCBackground | - GCLineWidth | GCLineStyle | GCCapStyle | GCJoinStyle | - GCFillStyle | GCFillRule | GCTile | GCStipple | - GCTileStipXOrigin | GCTileStipYOrigin | GCFont | - GCSubwindowMode | GCGraphicsExposures | GCClipXOrigin | - GCClipYOrigin | GCClipMask | GCDashOffset | GCDashList | - GCArcMode) != Success) - { - (void)FreeGC(pDst, (GContext)0); - - return NULL; - } - - return pDst; -} - diff --git a/nx-X11/programs/Xserver/Xprint/ps/PsImageUtil.c b/nx-X11/programs/Xserver/Xprint/ps/PsImageUtil.c deleted file mode 100644 index 282786564..000000000 --- a/nx-X11/programs/Xserver/Xprint/ps/PsImageUtil.c +++ /dev/null @@ -1,329 +0,0 @@ - -/* $Xorg: PsImageUtil.c,v 1.1 2005/03/25 1:19:56 gisburn Exp $ */ -/* -Copyright (c) 2005 Roland Mainz - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ - -/* Please do not beat me for this ugly code - most of it has been stolen from - * xc/lib/X11/ImUtil.c */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "gcstruct.h" -#include "windowstr.h" -#include "servermd.h" -#include "attributes.h" - -static unsigned char const _reverse_byte[0x100] = { - 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, - 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, - 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8, - 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8, - 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4, - 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4, - 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec, - 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc, - 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2, - 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2, - 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea, - 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa, - 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6, - 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6, - 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee, - 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe, - 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1, - 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1, - 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9, - 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9, - 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5, - 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5, - 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed, - 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd, - 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3, - 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3, - 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb, - 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb, - 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7, - 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7, - 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef, - 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff -}; - -static -int XReverse_Bytes( - register unsigned char *bpt, - register int nb) -{ - do { - *bpt = _reverse_byte[*bpt]; - bpt++; - } while (--nb > 0); - return 0; -} - -/* - * Data structure for "image" data, used by image manipulation routines. - */ -typedef struct { - int width, height; /* size of image */ - int xoffset; /* number of pixels offset in X direction */ - int format; /* XYBitmap, XYPixmap, ZPixmap */ - char *data; /* pointer to image data */ - int byte_order; /* data byte order, LSBFirst, MSBFirst */ - int bitmap_unit; /* quant. of scanline 8, 16, 32 */ - int bitmap_bit_order; /* LSBFirst, MSBFirst */ - int depth; /* depth of image */ - int bytes_per_line; /* accelarator to next line */ - int bits_per_pixel; /* bits per pixel (ZPixmap) */ -} TmpImage; - - -static void xynormalizeimagebits ( - register unsigned char *bp, - register TmpImage *img) -{ - register unsigned char c; - - if (img->byte_order != img->bitmap_bit_order) { - switch (img->bitmap_unit) { - - case 16: - c = *bp; - *bp = *(bp + 1); - *(bp + 1) = c; - break; - - case 32: - c = *(bp + 3); - *(bp + 3) = *bp; - *bp = c; - c = *(bp + 2); - *(bp + 2) = *(bp + 1); - *(bp + 1) = c; - break; - } - } - if (img->bitmap_bit_order == MSBFirst) - XReverse_Bytes (bp, img->bitmap_unit >> 3); -} - -static void znormalizeimagebits ( - register unsigned char *bp, - register TmpImage *img) -{ - register unsigned char c; - switch (img->bits_per_pixel) { - - case 4: - *bp = ((*bp >> 4) & 0xF) | ((*bp << 4) & ~0xF); - break; - - case 16: - c = *bp; - *bp = *(bp + 1); - *(bp + 1) = c; - break; - - case 24: - c = *(bp + 2); - *(bp + 2) = *bp; - *bp = c; - break; - - case 32: - c = *(bp + 3); - *(bp + 3) = *bp; - *bp = c; - c = *(bp + 2); - *(bp + 2) = *(bp + 1); - *(bp + 1) = c; - break; - } -} - -/* - * Macros - * - * The ROUNDUP macro rounds up a quantity to the specified boundary, - * then truncates to bytes. - * - * The XYNORMALIZE macro determines whether XY format data requires - * normalization and calls a routine to do so if needed. The logic in - * this module is designed for LSBFirst byte and bit order, so - * normalization is done as required to present the data in this order. - * - * The ZNORMALIZE macro performs byte and nibble order normalization if - * required for Z format data. - * - * The XYINDEX macro computes the index to the starting byte (char) boundary - * for a bitmap_unit containing a pixel with coordinates x and y for image - * data in XY format. - * - * The ZINDEX macro computes the index to the starting byte (char) boundary - * for a pixel with coordinates x and y for image data in ZPixmap format. - * - */ - -#if defined(Lynx) && defined(ROUNDUP) -#undef ROUNDUP -#endif - -#define ROUNDUP(nbytes, pad) ((((nbytes) + ((pad)-1)) / (pad)) * ((pad)>>3)) - -#define XYNORMALIZE(bp, img) \ - if ((img->byte_order == MSBFirst) || (img->bitmap_bit_order == MSBFirst)) \ - xynormalizeimagebits((unsigned char *)(bp), img) - -#define ZNORMALIZE(bp, img) \ - if (img->byte_order == MSBFirst) \ - znormalizeimagebits((unsigned char *)(bp), img) - -#define XYINDEX(x, y, img) \ - ((y) * img->bytes_per_line) + \ - (((x) + img->xoffset) / img->bitmap_unit) * (img->bitmap_unit >> 3) - -#define ZINDEX(x, y, img) ((y) * img->bytes_per_line) + \ - (((x) * img->bits_per_pixel) >> 3) - -/* - * GetPixel - * - * Returns the specified pixel. The X and Y coordinates are relative to - * the origin (upper left [0,0]) of the image. The pixel value is returned - * in normalized format, i.e. the LSB of the long is the LSB of the pixel. - * The algorithm used is: - * - * copy the source bitmap_unit or Zpixel into temp - * normalize temp if needed - * extract the pixel bits into return value - * - */ - -static unsigned long const low_bits_table[] = { - 0x00000000, 0x00000001, 0x00000003, 0x00000007, - 0x0000000f, 0x0000001f, 0x0000003f, 0x0000007f, - 0x000000ff, 0x000001ff, 0x000003ff, 0x000007ff, - 0x00000fff, 0x00001fff, 0x00003fff, 0x00007fff, - 0x0000ffff, 0x0001ffff, 0x0003ffff, 0x0007ffff, - 0x000fffff, 0x001fffff, 0x003fffff, 0x007fffff, - 0x00ffffff, 0x01ffffff, 0x03ffffff, 0x07ffffff, - 0x0fffffff, 0x1fffffff, 0x3fffffff, 0x7fffffff, - 0xffffffff -}; - -static unsigned long XGetPixel (TmpImage *ximage, int x, int y) -{ - unsigned long pixel, px; - register char *src; - register char *dst; - register int i, j; - int bits, nbytes; - long plane; - - if ((ximage->bits_per_pixel | ximage->depth) == 1) { - src = &ximage->data[XYINDEX(x, y, ximage)]; - dst = (char *)&pixel; - pixel = 0; - for (i = ximage->bitmap_unit >> 3; --i >= 0; ) *dst++ = *src++; - XYNORMALIZE(&pixel, ximage); - bits = (x + ximage->xoffset) % ximage->bitmap_unit; - pixel = ((((char *)&pixel)[bits>>3])>>(bits&7)) & 1; - } else if (ximage->format == XYPixmap) { - pixel = 0; - plane = 0; - nbytes = ximage->bitmap_unit >> 3; - for (i = ximage->depth; --i >= 0; ) { - src = &ximage->data[XYINDEX(x, y, ximage)+ plane]; - dst = (char *)&px; - px = 0; - for (j = nbytes; --j >= 0; ) *dst++ = *src++; - XYNORMALIZE(&px, ximage); - bits = (x + ximage->xoffset) % ximage->bitmap_unit; - pixel = (pixel << 1) | - (((((char *)&px)[bits>>3])>>(bits&7)) & 1); - plane = plane + (ximage->bytes_per_line * ximage->height); - } - } else if (ximage->format == ZPixmap) { - src = &ximage->data[ZINDEX(x, y, ximage)]; - dst = (char *)&px; - px = 0; - for (i = (ximage->bits_per_pixel + 7) >> 3; --i >= 0; ) - *dst++ = *src++; - ZNORMALIZE(&px, ximage); - pixel = 0; - for (i=sizeof(unsigned long); --i >= 0; ) - pixel = (pixel << 8) | ((unsigned char *)&px)[i]; - if (ximage->bits_per_pixel == 4) { - if (x & 1) - pixel >>= 4; - else - pixel &= 0xf; - } - } else { - return 0; /* bad image */ - } - if (ximage->bits_per_pixel == ximage->depth) - return pixel; - else - return (pixel & low_bits_table[ximage->depth]); -} - -unsigned long -PsGetImagePixel(char *pImage, int depth, int w, int h, int leftPad, int format, - int px, int py) -{ - TmpImage xi = {0}; - - xi.width = w; - xi.height = h; - xi.xoffset = 0/*leftPad*/; - xi.format = format; - xi.data = pImage; - xi.byte_order = IMAGE_BYTE_ORDER; - xi.bitmap_bit_order = BITMAP_BIT_ORDER; - xi.bitmap_unit = ((depth > 16)?(32): - ((depth > 8)?(16): - ((depth > 1)? (8): - (1)))); - xi.depth = depth; - xi.bits_per_pixel = xi.bitmap_unit; - - /* - * compute per line accelerator. - */ - if (format == ZPixmap) - xi.bytes_per_line = - ROUNDUP((xi.bits_per_pixel * xi.width), 32); - else - xi.bytes_per_line = - ROUNDUP((xi.width + xi.xoffset), 32); - - return XGetPixel(&xi, px, py); -} - - - diff --git a/nx-X11/programs/Xserver/Xprint/ps/PsInit.c b/nx-X11/programs/Xserver/Xprint/ps/PsInit.c deleted file mode 100644 index a11a61ae4..000000000 --- a/nx-X11/programs/Xserver/Xprint/ps/PsInit.c +++ /dev/null @@ -1,667 +0,0 @@ -/* $Xorg: PsInit.c,v 1.4 2001/02/09 02:04:36 xorgcvs Exp $ */ -/* - -Copyright 1996, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* - * (c) Copyright 1996 Hewlett-Packard Company - * (c) Copyright 1996 International Business Machines Corp. - * (c) Copyright 1996 Sun Microsystems, Inc. - * (c) Copyright 1996 Novell, Inc. - * (c) Copyright 1996 Digital Equipment Corp. - * (c) Copyright 1996 Fujitsu Limited - * (c) Copyright 1996 Hitachi, Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF - * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * Except as contained in this notice, the names of the copyright holders - * shall not be used in advertising or otherwise to promote the sale, use - * or other dealings in this Software without prior written authorization - * from said copyright holders. - */ - -/******************************************************************* -** -** ********************************************************* -** * -** * File: PsInit.c -** * -** * Contents: Initialization code of Ps driver for the print server. -** * -** * Created By: Roger Helmendach (Liberty Systems) -** * -** * Copyright: Copyright 1996 The Open Group, Inc. -** * -** ********************************************************* -** -********************************************************************/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include -#include - -#include "Ps.h" -#include "mi.h" -#include "micmap.h" -#include "AttrValid.h" -#include "mfb.h" - -#include "windowstr.h" -#include "DiPrint.h" - -static void AllocatePsPrivates(ScreenPtr pScreen); -static int PsInitContext(XpContextPtr pCon); -static int PsDestroyContext(XpContextPtr pCon); - -int PsScreenPrivateIndex; -int PsContextPrivateIndex; -int PsPixmapPrivateIndex; -int PsWindowPrivateIndex; - -#ifdef GLXEXT -extern void GlxWrapInitVisuals(miInitVisualsProcPtr *); -#endif /* GLXEXT */ - -Bool -InitializePsDriver(ndx, pScreen, argc, argv) - int ndx; - ScreenPtr pScreen; - int argc; - char **argv; -{ -#if 0 - int maxXres, maxYres, maxWidth, maxHeight; - int maxRes, maxDim, numBytes; - PsScreenPrivPtr pPriv; -#endif - char **printerNames; - int numPrinters; - int nv, /* total number of visuals */ - nv_1bit, /* number of 8bit visuals */ - nv_8bit, /* number of 8bit visuals */ - nv_12bit, /* number of 12bit visuals */ - nv_14bit, /* number of 14bit visuals */ - nv_16bit, /* number of 16bit visuals */ - nv_24bit, /* number of 24bit visuals*/ - nv_30bit; /* number of 30bit visuals*/ - int nd; /* number of depths */ - int defaultVisualIndex = -1; - VisualID *vids_1bit, - *vids_8bit, - *vids_12bit, - *vids_14bit, - *vids_16bit, - *vids_24bit, - *vids_30bit; - VisualPtr visuals; - DepthPtr depths; - VisualID defaultVisual; - int rootDepth; - -/* - * Register this driver's InitContext function with the print - * extension. - */ - XpRegisterInitFunc(pScreen, "XP-POSTSCRIPT", PsInitContext); - -/* - * Create and fill in the devPrivate for the PS driver. - */ - AllocatePsPrivates(pScreen); - -#if 0 - pPriv = (PsScreenPrivPtr)pScreen->devPrivates[PsScreenPrivateIndex].ptr; - pPriv->resDB = rmdb; -#endif - - pScreen->defColormap = (Colormap) FakeClientID(0); - pScreen->blackPixel = 1; - pScreen->whitePixel = 0; - pScreen->QueryBestSize = (QueryBestSizeProcPtr)PsQueryBestSize; - pScreen->SaveScreen = (SaveScreenProcPtr)_XpBoolNoop; - pScreen->GetImage = (GetImageProcPtr)_XpVoidNoop; - pScreen->GetSpans = (GetSpansProcPtr)_XpVoidNoop; - pScreen->CreateWindow = PsCreateWindow; - pScreen->DestroyWindow = PsDestroyWindow; - pScreen->PositionWindow = PsPositionWindow; - pScreen->ChangeWindowAttributes = PsChangeWindowAttributes; - pScreen->RealizeWindow = PsMapWindow; - pScreen->UnrealizeWindow = PsUnmapWindow; - pScreen->PaintWindowBackground = PsPaintWindow; - pScreen->PaintWindowBorder = PsPaintWindow; - pScreen->CloseScreen = PsCloseScreen; - pScreen->CopyWindow = PsCopyWindow; - /* XXX Hard routine to write! */ - -/* - * These two are going to be VERY different... - */ - pScreen->CreatePixmap = PsCreatePixmap; - pScreen->DestroyPixmap = PsDestroyPixmap; - pScreen->RealizeFont = PsRealizeFont; - pScreen->UnrealizeFont = PsUnrealizeFont; - pScreen->CreateGC = PsCreateGC; - pScreen->CreateColormap = PsCreateColormap; - pScreen->DestroyColormap = PsDestroyColormap; - pScreen->InstallColormap = PsInstallColormap; - pScreen->UninstallColormap = PsUninstallColormap; - pScreen->ListInstalledColormaps = PsListInstalledColormaps; - pScreen->StoreColors = PsStoreColors; - pScreen->ResolveColor = PsResolveColor; - /* Will BitmapToRegion make any difference at all? */ - pScreen->BitmapToRegion = mfbPixmapToRegion; - - visuals = (VisualPtr) xalloc(16*sizeof(VisualRec)); - depths = (DepthPtr) xalloc(16*sizeof(DepthRec)); - vids_1bit = (VisualID *)xalloc(16*sizeof(VisualID)); - vids_8bit = (VisualID *)xalloc(16*sizeof(VisualID)); - vids_12bit = (VisualID *)xalloc(16*sizeof(VisualID)); - vids_14bit = (VisualID *)xalloc(16*sizeof(VisualID)); - vids_16bit = (VisualID *)xalloc(16*sizeof(VisualID)); - vids_24bit = (VisualID *)xalloc(16*sizeof(VisualID)); - vids_30bit = (VisualID *)xalloc(16*sizeof(VisualID)); - - nv = nv_1bit = nv_8bit = nv_12bit = nv_14bit = nv_16bit = nv_24bit = nv_30bit = nd = 0; - -#ifdef PSOUT_USE_DEEPCOLOR -/* gisburn: 30bit TrueColor has been disabled for now since it causes problems - * with GLX - see https://bugs.freedesktop.org/show_bug.cgi?id=2868 ("Mesa - * seems to be unable to handle 30bit TrueColor visuals") for details... - */ -#ifdef DISABLED_FOR_NOW - /* TrueColor, 30bit, 10bit per R-,G-,B-gun */ - visuals[nv].vid = FakeClientID(0); - visuals[nv].class = TrueColor; - visuals[nv].bitsPerRGBValue = 10; - visuals[nv].ColormapEntries = 1024; - visuals[nv].nplanes = 30; - visuals[nv].redMask = 0X3FF00000; - visuals[nv].greenMask = 0X000FFC00; - visuals[nv].blueMask = 0X000003FF; - visuals[nv].offsetRed = 20; - visuals[nv].offsetGreen = 10; - visuals[nv].offsetBlue = 0; - vids_30bit[nv_30bit] = visuals[nv].vid; - nv++; nv_30bit++; -#endif /* DISABLED_FOR_NOW */ -#endif /* PSOUT_USE_DEEPCOLOR */ - - /* TrueColor, 24bit */ - visuals[nv].vid = FakeClientID(0); - visuals[nv].class = TrueColor; - visuals[nv].bitsPerRGBValue = 8; - visuals[nv].ColormapEntries = 256; - visuals[nv].nplanes = 24; - visuals[nv].redMask = 0X00FF0000; - visuals[nv].greenMask = 0X0000FF00; - visuals[nv].blueMask = 0X000000FF; - visuals[nv].offsetRed = 16; - visuals[nv].offsetGreen = 8; - visuals[nv].offsetBlue = 0; - vids_24bit[nv_24bit] = visuals[nv].vid; - nv++; nv_24bit++; - - /* TrueColor, 16bit */ - visuals[nv].vid = FakeClientID(0); - visuals[nv].class = TrueColor; - visuals[nv].bitsPerRGBValue = 6; - visuals[nv].ColormapEntries = 64; - visuals[nv].nplanes = 16; - visuals[nv].redMask = 0x0000f800; - visuals[nv].greenMask = 0x000007e0; - visuals[nv].blueMask = 0x0000001f; - visuals[nv].offsetRed = 11; - visuals[nv].offsetGreen = 5; - visuals[nv].offsetBlue = 0; - vids_16bit[nv_16bit] = visuals[nv].vid; - nv++; nv_16bit++; - -#ifdef PSOUT_USE_DEEPCOLOR - /* PostScript Level 2 and above, colors can have 12 bits per component - * (36 bit for RGB) */ - - /* PseudoColor, 14bit (15bit won't work as |ColormapEntries==32768| - * is too large for a |signed short|... xx@@!!!... ;-( ) */ - visuals[nv].vid = FakeClientID(0); - visuals[nv].class = PseudoColor; - visuals[nv].bitsPerRGBValue = 12; - visuals[nv].ColormapEntries = 16384; - visuals[nv].nplanes = 14; - visuals[nv].redMask = 0x0; - visuals[nv].greenMask = 0x0; - visuals[nv].blueMask = 0x0; - visuals[nv].offsetRed = 0x0; - visuals[nv].offsetGreen = 0x0; - visuals[nv].offsetBlue = 0x0; - vids_14bit[nv_14bit] = visuals[nv].vid; - nv++; nv_14bit++; - - /* PseudoColor, 12bit */ - visuals[nv].vid = FakeClientID(0); - visuals[nv].class = PseudoColor; - visuals[nv].bitsPerRGBValue = 12; - visuals[nv].ColormapEntries = 4096; - visuals[nv].nplanes = 12; - visuals[nv].redMask = 0x0; - visuals[nv].greenMask = 0x0; - visuals[nv].blueMask = 0x0; - visuals[nv].offsetRed = 0x0; - visuals[nv].offsetGreen = 0x0; - visuals[nv].offsetBlue = 0x0; - vids_12bit[nv_12bit] = visuals[nv].vid; - defaultVisualIndex = nv; - nv++; nv_12bit++; - - /* GrayScale, 12bit, 12bit per R-,G-,B-gun */ - visuals[nv].vid = FakeClientID(0); - visuals[nv].class = GrayScale; - visuals[nv].bitsPerRGBValue = 12; - visuals[nv].ColormapEntries = 4096; - visuals[nv].nplanes = 12; - visuals[nv].redMask = 0x0; - visuals[nv].greenMask = 0x0; - visuals[nv].blueMask = 0x0; - visuals[nv].offsetRed = 0x0; - visuals[nv].offsetGreen = 0x0; - visuals[nv].offsetBlue = 0x0; - vids_12bit[nv_12bit] = visuals[nv].vid; - nv++; nv_12bit++; - - /* StaticGray, 12bit, 12bit per R-,G-,B-gun */ - visuals[nv].vid = FakeClientID(0); - visuals[nv].class = StaticGray; - visuals[nv].bitsPerRGBValue = 12; - visuals[nv].ColormapEntries = 4096; - visuals[nv].nplanes = 12; - visuals[nv].redMask = 0x0; - visuals[nv].greenMask = 0x0; - visuals[nv].blueMask = 0x0; - visuals[nv].offsetRed = 0x0; - visuals[nv].offsetGreen = 0x0; - visuals[nv].offsetBlue = 0x0; - vids_12bit[nv_12bit] = visuals[nv].vid; - nv++; nv_12bit++; -#endif /* PSOUT_USE_DEEPCOLOR */ - - /* PseudoColor, 8bit */ - visuals[nv].vid = FakeClientID(0); - visuals[nv].class = PseudoColor; - visuals[nv].bitsPerRGBValue = 8; - visuals[nv].ColormapEntries = 256; - visuals[nv].nplanes = 8; - visuals[nv].redMask = 0x0; - visuals[nv].greenMask = 0x0; - visuals[nv].blueMask = 0x0; - visuals[nv].offsetRed = 0x0; - visuals[nv].offsetGreen = 0x0; - visuals[nv].offsetBlue = 0x0; - vids_8bit[nv_8bit] = visuals[nv].vid; -#ifndef PSOUT_USE_DEEPCOLOR - defaultVisualIndex = nv; -#endif /* !PSOUT_USE_DEEPCOLOR */ - nv++; nv_8bit++; - - /* GrayScale, 8bit */ - visuals[nv].vid = FakeClientID(0); - visuals[nv].class = GrayScale; - visuals[nv].bitsPerRGBValue = 8; - visuals[nv].ColormapEntries = 256; - visuals[nv].nplanes = 8; - visuals[nv].redMask = 0x0; - visuals[nv].greenMask = 0x0; - visuals[nv].blueMask = 0x0; - visuals[nv].offsetRed = 0x0; - visuals[nv].offsetGreen = 0x0; - visuals[nv].offsetBlue = 0x0; - vids_8bit[nv_8bit] = visuals[nv].vid; - nv++; nv_8bit++; - - /* StaticGray, 8bit */ - visuals[nv].vid = FakeClientID(0); - visuals[nv].class = StaticGray; - visuals[nv].bitsPerRGBValue = 8; - visuals[nv].ColormapEntries = 256; - visuals[nv].nplanes = 8; - visuals[nv].redMask = 0x0; - visuals[nv].greenMask = 0x0; - visuals[nv].blueMask = 0x0; - visuals[nv].offsetRed = 0x0; - visuals[nv].offsetGreen = 0x0; - visuals[nv].offsetBlue = 0x0; - vids_8bit[nv_8bit] = visuals[nv].vid; - nv++; nv_8bit++; - - /* StaticGray, 1bit */ - visuals[nv].vid = FakeClientID(0); - visuals[nv].class = StaticGray; - visuals[nv].bitsPerRGBValue = 1; - visuals[nv].ColormapEntries = 2; - visuals[nv].nplanes = 1; - visuals[nv].redMask = 0x0; - visuals[nv].greenMask = 0x0; - visuals[nv].blueMask = 0x0; - visuals[nv].offsetRed = 0x0; - visuals[nv].offsetGreen = 0x0; - visuals[nv].offsetBlue = 0x0; - vids_1bit[nv_1bit] = visuals[nv].vid; - nv++; nv_1bit++; - - if( nv_30bit > 0 ) - { - depths[nd].depth = 30; - depths[nd].numVids = nv_30bit; - depths[nd].vids = vids_30bit; - nd++; - } - - if( nv_24bit > 0 ) - { - depths[nd].depth = 24; - depths[nd].numVids = nv_24bit; - depths[nd].vids = vids_24bit; - nd++; - } - - if( nv_16bit > 0 ) - { - depths[nd].depth = 16; - depths[nd].numVids = nv_16bit; - depths[nd].vids = vids_16bit; - nd++; - } - - if( nv_14bit > 0 ) - { - depths[nd].depth = 14; - depths[nd].numVids = nv_14bit; - depths[nd].vids = vids_14bit; - nd++; - } - - if( nv_12bit > 0 ) - { - depths[nd].depth = 12; - depths[nd].numVids = nv_12bit; - depths[nd].vids = vids_12bit; - nd++; - } - - if( nv_8bit > 0 ) - { - depths[nd].depth = 8; - depths[nd].numVids = nv_8bit; - depths[nd].vids = vids_8bit; - nd++; - } - - if( nv_1bit > 0 ) - { - depths[nd].depth = 1; - depths[nd].numVids = nv_1bit; - depths[nd].vids = vids_1bit; - nd++; - } - - /* Defaul visual is 12bit PseudoColor */ - defaultVisual = visuals[defaultVisualIndex].vid; - rootDepth = visuals[defaultVisualIndex].nplanes; - -#ifdef GLXEXT - { - miInitVisualsProcPtr proc = NULL; - - GlxWrapInitVisuals(&proc); - /* GlxInitVisuals ignores the last three arguments. */ - proc(&visuals, &depths, &nv, &nd, - &rootDepth, &defaultVisual, 0, 0, 0); - } -#endif /* GLXEXT */ - - miScreenInit(pScreen, (pointer)0, - pScreen->width, pScreen->height, - (int) (pScreen->width / (pScreen->mmWidth / 25.40)), - (int) (pScreen->height / (pScreen->mmHeight / 25.40)), - 0, rootDepth, nd, - depths, defaultVisual, nv, visuals); - - if( miCreateDefColormap(pScreen)==FALSE ) return FALSE; - -/*scalingScreenInit(pScreen);*/ - - return TRUE; -} - -static void -AllocatePsPrivates(ScreenPtr pScreen) -{ - static unsigned long PsGeneration = 0; - - if((unsigned long)PsGeneration != serverGeneration) - { - PsScreenPrivateIndex = AllocateScreenPrivateIndex(); - - PsWindowPrivateIndex = AllocateWindowPrivateIndex(); - AllocateWindowPrivate(pScreen, PsWindowPrivateIndex, - sizeof(PsWindowPrivRec)); - - PsContextPrivateIndex = XpAllocateContextPrivateIndex(); - XpAllocateContextPrivate(PsContextPrivateIndex, - sizeof(PsContextPrivRec)); - - PsPixmapPrivateIndex = AllocatePixmapPrivateIndex(); - AllocatePixmapPrivate(pScreen, PsPixmapPrivateIndex, - sizeof(PsPixmapPrivRec)); - - PsGeneration = serverGeneration; - } - pScreen->devPrivates[PsScreenPrivateIndex].ptr = - (pointer)xalloc(sizeof(PsScreenPrivRec)); -} - -/* - * PsInitContext - * - * Establish the appropriate values for a PrintContext used with the PS - * driver. - */ - -static char DOC_ATT_SUPP[]="document-attributes-supported"; -static char DOC_ATT_VAL[]="document-format xp-listfonts-modes"; -static char JOB_ATT_SUPP[]="job-attributes-supported"; -static char JOB_ATT_VAL[]=""; -static char PAGE_ATT_SUPP[]="xp-page-attributes-supported"; -static char PAGE_ATT_VAL[]="content-orientation default-printer-resolution \ -default-input-tray default-medium plex xp-listfonts-modes"; - -static int -PsInitContext(pCon) - XpContextPtr pCon; -{ - XpDriverFuncsPtr pFuncs; - PsContextPrivPtr pConPriv; - char *server, *attrStr; - - /* - * Initialize the attribute store for this printer. - */ - XpInitAttributes(pCon); - - /* - * Initialize the function pointers - */ - pFuncs = &(pCon->funcs); - pFuncs->StartJob = PsStartJob; - pFuncs->EndJob = PsEndJob; - pFuncs->StartDoc = PsStartDoc; - pFuncs->EndDoc = PsEndDoc; - pFuncs->StartPage = PsStartPage; - pFuncs->EndPage = PsEndPage; - pFuncs->PutDocumentData = PsDocumentData; - pFuncs->GetDocumentData = PsGetDocumentData; - pFuncs->GetAttributes = PsGetAttributes; - pFuncs->SetAttributes = PsSetAttributes; - pFuncs->AugmentAttributes = PsAugmentAttributes; - pFuncs->GetOneAttribute = PsGetOneAttribute; - pFuncs->DestroyContext = PsDestroyContext; - pFuncs->GetMediumDimensions = PsGetMediumDimensions; - pFuncs->GetReproducibleArea = PsGetReproducibleArea; - pFuncs->SetImageResolution = PsSetImageResolution; - - /* - * Set up the context privates - */ - pConPriv = - (PsContextPrivPtr)pCon->devPrivates[PsContextPrivateIndex].ptr; - - memset(pConPriv, 0, sizeof(PsContextPrivRec)); - pConPriv->jobFileName = (char *)NULL; - pConPriv->pJobFile = (FILE *)NULL; - pConPriv->dash = (unsigned char *)NULL; - pConPriv->validGC = 0; - pConPriv->getDocClient = (ClientPtr)NULL; - pConPriv->getDocBufSize = 0; - pConPriv->pPsOut = NULL; - pConPriv->fontInfoRecords = NULL; - pConPriv->fontTypeInfoRecords = NULL; - - /* - * document-attributes-supported - */ - server = XpGetOneAttribute( pCon, XPServerAttr, DOC_ATT_SUPP ); - if ((attrStr = (char *) xalloc(strlen(server) + - strlen(DOC_ATT_SUPP) + strlen(DOC_ATT_VAL) - + strlen(PAGE_ATT_VAL) + 8)) == NULL) - { - return BadAlloc; - } - sprintf(attrStr, "*%s:\t%s %s %s", - DOC_ATT_SUPP, server, DOC_ATT_VAL, PAGE_ATT_VAL); - XpAugmentAttributes( pCon, XPPrinterAttr, attrStr); - xfree(attrStr); - - /* - * job-attributes-supported - */ - server = XpGetOneAttribute( pCon, XPServerAttr, JOB_ATT_SUPP ); - if ((attrStr = (char *) xalloc(strlen(server) + strlen(JOB_ATT_SUPP) + - strlen(JOB_ATT_VAL) + 8)) == NULL) - { - return BadAlloc; - } - sprintf(attrStr, "*%s:\t%s %s", JOB_ATT_SUPP, server, JOB_ATT_VAL); - XpAugmentAttributes(pCon, XPPrinterAttr, attrStr); - xfree(attrStr); - - /* - * xp-page-attributes-supported - */ - server = XpGetOneAttribute( pCon, XPServerAttr, PAGE_ATT_SUPP ); - if ((attrStr = (char *) xalloc(strlen(server) + strlen(PAGE_ATT_SUPP) + - strlen(PAGE_ATT_VAL) + 8)) == NULL) - { - return BadAlloc; - } - sprintf(attrStr, "*%s:\t%s %s", PAGE_ATT_SUPP, server, PAGE_ATT_VAL); - XpAugmentAttributes(pCon, XPPrinterAttr, attrStr); - xfree(attrStr); - - /* - * Validate the attribute pools - */ - XpValidateAttributePool(pCon, XPPrinterAttr, &PsValidatePoolsRec); - XpValidateAttributePool(pCon, XPDocAttr, &PsValidatePoolsRec); - XpValidateAttributePool(pCon, XPJobAttr, &PsValidatePoolsRec); - XpValidateAttributePool(pCon, XPPageAttr, &PsValidatePoolsRec); - - return Success; -} - -static Bool -PsDestroyContext(pCon) - XpContextPtr pCon; -{ - PsContextPrivPtr pConPriv = - (PsContextPrivPtr)pCon->devPrivates[PsContextPrivateIndex].ptr; - - if( pConPriv->pJobFile!=(FILE *)NULL ) - { - fclose(pConPriv->pJobFile); - pConPriv->pJobFile = NULL; - } - if( pConPriv->jobFileName!=(char *)NULL ) - { - unlink(pConPriv->jobFileName); - xfree(pConPriv->jobFileName); - pConPriv->jobFileName = (char *)NULL; - } - - PsFreeFontInfoRecords(pConPriv); - - /* Reset context to make sure we do not use any stale/invalid/obsolete data */ - memset(pConPriv, 0, sizeof(PsContextPrivRec)); - -/*### free up visuals/depths ###*/ - - return Success; -} - -XpContextPtr -PsGetContextFromWindow(win) - WindowPtr win; -{ - PsWindowPrivPtr pPriv; - - while( win ) - { - pPriv = (PsWindowPrivPtr)win->devPrivates[PsWindowPrivateIndex].ptr; - if( pPriv->validContext ) return pPriv->context; - win = win->parent; - } - - return NULL; -} diff --git a/nx-X11/programs/Xserver/Xprint/ps/PsLine.c b/nx-X11/programs/Xserver/Xprint/ps/PsLine.c deleted file mode 100644 index 2524769c8..000000000 --- a/nx-X11/programs/Xserver/Xprint/ps/PsLine.c +++ /dev/null @@ -1,192 +0,0 @@ -/* $Xorg: PsLine.c,v 1.4 2001/02/09 02:04:36 xorgcvs Exp $ */ -/* - -Copyright 1996, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* - * (c) Copyright 1996 Hewlett-Packard Company - * (c) Copyright 1996 International Business Machines Corp. - * (c) Copyright 1996 Sun Microsystems, Inc. - * (c) Copyright 1996 Novell, Inc. - * (c) Copyright 1996 Digital Equipment Corp. - * (c) Copyright 1996 Fujitsu Limited - * (c) Copyright 1996 Hitachi, Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF - * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * Except as contained in this notice, the names of the copyright holders - * shall not be used in advertising or otherwise to promote the sale, use - * or other dealings in this Software without prior written authorization - * from said copyright holders. - */ - -/******************************************************************* -** -** ********************************************************* -** * -** * File: PsLine.c -** * -** * Contents: Line drawing routines for the PS driver -** * -** * Created By: Roger Helmendach (Liberty Systems) -** * -** * Copyright: Copyright 1996 The Open Group, Inc. -** * -** ********************************************************* -** -********************************************************************/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "Ps.h" -#include "gcstruct.h" -#include "windowstr.h" - -void -PsPolyLine( - DrawablePtr pDrawable, - GCPtr pGC, - int mode, - int nPoints, - xPoint *pPoints) -{ - if( pDrawable->type==DRAWABLE_PIXMAP ) - { - DisplayElmPtr elm; - PixmapPtr pix = (PixmapPtr)pDrawable; - PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pix->devPrivate.ptr; - DisplayListPtr disp; - GCPtr gc; - - if ((gc = PsCreateAndCopyGC(pDrawable, pGC)) == NULL) return; - - disp = PsGetFreeDisplayBlock(priv); - - elm = &disp->elms[disp->nelms]; - elm->type = PolyLineCmd; - elm->gc = gc; - elm->c.polyPts.mode = mode; - elm->c.polyPts.nPoints = nPoints; - elm->c.polyPts.pPoints = (xPoint *)xalloc(nPoints*sizeof(xPoint)); - memcpy(elm->c.polyPts.pPoints, pPoints, nPoints*sizeof(xPoint)); - disp->nelms += 1; - } - else - { - int i; - PsOutPtr psOut; - PsPointPtr pts; - ColormapPtr cMap; - - if( PsUpdateDrawableGC(pGC, pDrawable, &psOut, &cMap)==FALSE ) return; - PsOut_Offset(psOut, pDrawable->x, pDrawable->y); - PsOut_Color(psOut, PsGetPixelColor(cMap, pGC->fgPixel)); - PsLineAttrs(psOut, pGC, cMap); - pts = (PsPointPtr)xalloc(sizeof(PsPointRec)*nPoints); - if( mode==CoordModeOrigin ) - { - for( i=0 ; itype==DRAWABLE_PIXMAP ) - { - DisplayElmPtr elm; - PixmapPtr pix = (PixmapPtr)pDrawable; - PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pix->devPrivate.ptr; - DisplayListPtr disp; - GCPtr gc; - - if ((gc = PsCreateAndCopyGC(pDrawable, pGC)) == NULL) return; - - disp = PsGetFreeDisplayBlock(priv); - - elm = &disp->elms[disp->nelms]; - elm->type = PolySegmentCmd; - elm->gc = gc; - elm->c.segments.nSegments = nSegments; - elm->c.segments.pSegments = (xSegment *)xalloc(nSegments*sizeof(xSegment)); - memcpy(elm->c.segments.pSegments, pSegments, nSegments*sizeof(xSegment)); - disp->nelms += 1; - } - else - { - int i; - PsOutPtr psOut; - PsPointRec pts[2]; - ColormapPtr cMap; - - if( PsUpdateDrawableGC(pGC, pDrawable, &psOut, &cMap)==FALSE ) return; - PsOut_Offset(psOut, pDrawable->x, pDrawable->y); - PsOut_Color(psOut, PsGetPixelColor(cMap, pGC->fgPixel)); - PsLineAttrs(psOut, pGC, cMap); - for( i=0 ; i -#endif - -#include /* for SIGCLD on pre-POSIX systems */ -#include -#include "Ps.h" - -#include "cursor.h" -#include "resource.h" - -#include "windowstr.h" -#include "propertyst.h" - - -/*ARGSUSED*/ -void -PsQueryBestSize( - int type, - short *pwidth, - short *pheight, - ScreenPtr pScreen) -{ - unsigned width, highBit; - - switch(type) - { - case CursorShape: - *pwidth = 0; - *pheight = 0; - break; - case TileShape: - case StippleShape: - width = *pwidth; - if (!width) break; - /* Return the nearest power of two >= what they gave us */ - highBit = 0x80000000; - /* Find the highest 1 bit in the given width */ - while(!(highBit & width)) - highBit >>= 1; - /* If greater than that then return the next power of two */ - if((highBit - 1) & width) - highBit <<= 1; - *pwidth = highBit; - /* height is a don't-care */ - break; - } -} - -/* - * PsGetMediumDimensions is installed in the GetMediumDimensions field - * of each Ps-initialized context. - */ -int -PsGetMediumDimensions(XpContextPtr pCon, CARD16 *width, CARD16 *height) -{ - XpGetMediumDimensions(pCon, width, height); - return Success; -} - -/* - * PsGetReproducibleArea is installed in the GetReproducibleArea field - * of each Ps-initialized context. - */ -int -PsGetReproducibleArea(XpContextPtr pCon, xRectangle *pRect) -{ - XpGetReproductionArea(pCon, pRect); - return Success; -} - -/* - * PsSetImageResolution is installed in the SetImageResolution field - * of each Ps-initialized context. - */ -int -PsSetImageResolution(XpContextPtr pCon, int imageRes, Bool *status) -{ - pCon->imageRes = imageRes; - *status = True; - return Success; -} - -/* - * GetPropString searches the window heirarchy from pWin up looking for - * a property by the name of propName. If found, returns the property's - * value. If not, it returns NULL. - */ -/* -char * -GetPropString( - WindowPtr pWin, - char *propName) -{ - Atom atom; - PropertyPtr pProp = (PropertyPtr)NULL; - char *retVal; - - atom = MakeAtom(propName, strlen(propName), FALSE); - if(atom != BAD_RESOURCE) - { - WindowPtr pPropWin; - int n; -*/ - - /* - * The atom has been defined, but it might only exist as a - * property on an unrelated window. - */ -/* - for(pPropWin = pWin; pPropWin != (WindowPtr)NULL; - pPropWin = pPropWin->parent) - { - for(pProp = (PropertyPtr)(wUserProps(pPropWin)); - pProp != (PropertyPtr)NULL; - pProp = pProp->next) - { - if (pProp->propertyName == atom) - break; - } - if(pProp != (PropertyPtr)NULL) - break; - } - if(pProp == (PropertyPtr)NULL) - return (char *)NULL; - - n = (pProp->format/8) * pProp->size; *//* size (bytes) of prop */ -/* - retVal = (char *)xalloc(n + 1); - (void)memcpy((void *)retVal, (void *)pProp->data, n); - retVal[n] = '\0'; - - return retVal; - } - - return (char *)NULL; -} - -#include - -*/ -/* ARGSUSED */ -/* -static void SigchldHndlr (int dummy) -{ - int status, w; - struct sigaction act; - sigfillset(&act.sa_mask); - act.sa_flags = 0; - act.sa_handler = SigchldHndlr; - - w = wait (&status); - -*/ - /* - * Is this really necessary? - */ -/* - sigaction(SIGCHLD, &act, (struct sigaction *)NULL); -} -*/ - -/* - * SystemCmd provides a wrapper for the 'system' library call. The call - * appears to be sensitive to the handling of SIGCHLD, so this wrapper - * sets the status to SIG_DFL, and then resets the established handler - * after system returns. - */ -/* -int -SystemCmd(char *cmdStr) -{ - int status; - struct sigaction newAct, oldAct; - sigfillset(&newAct.sa_mask); - newAct.sa_flags = 0; - newAct.sa_handler = SIG_DFL; - sigfillset(&oldAct.sa_mask); - oldAct.sa_flags = 0; - oldAct.sa_handler = SigchldHndlr; - -*/ - /* - * get the old handler, and set the action to IGN - */ -/* - sigaction(SIGCHLD, &newAct, &oldAct); - - status = system (cmdStr); - - sigaction(SIGCHLD, &oldAct, (struct sigaction *)NULL); - return status; -} -*/ - -Bool -PsCloseScreen( - int index, - ScreenPtr pScreen) -{ - return TRUE; -} - -void -PsLineAttrs( - PsOutPtr psOut, - GCPtr pGC, - ColormapPtr cMap) -{ - int i; - int nDsh; - int dshOff; - int *dsh; - PsCapEnum cap; - PsJoinEnum join; - - switch(pGC->capStyle) { - case CapButt: cap = PsCButt; break; - case CapRound: cap = PsCRound; break; - case CapProjecting: cap = PsCSquare; break; - default: cap = PsCButt; break; } - switch(pGC->joinStyle) { - case JoinMiter: join = PsJMiter; break; - case JoinRound: join = PsJRound; break; - case JoinBevel: join = PsJBevel; break; - default: join = PsJBevel; break; } - if( pGC->lineStyle==LineSolid ) { nDsh = dshOff = 0; dsh = (int *)0; } - else - { - nDsh = pGC->numInDashList; - dshOff = pGC->dashOffset; - if( !nDsh ) dsh = (int *)0; - else - { - dsh = (int *)xalloc(sizeof(int)*nDsh); - for( i=0 ; idash[i]&0xFF; - } - } - - if( pGC->lineStyle!=LineDoubleDash ) - PsOut_LineAttrs(psOut, (int)pGC->lineWidth, - cap, join, nDsh, dsh, dshOff, -1); - else - PsOut_LineAttrs(psOut, (int)pGC->lineWidth, - cap, join, nDsh, dsh, dshOff, - PsGetPixelColor(cMap, pGC->bgPixel)); - if( nDsh && dsh ) xfree(dsh); -} diff --git a/nx-X11/programs/Xserver/Xprint/ps/PsPixel.c b/nx-X11/programs/Xserver/Xprint/ps/PsPixel.c deleted file mode 100644 index 2197f0ab9..000000000 --- a/nx-X11/programs/Xserver/Xprint/ps/PsPixel.c +++ /dev/null @@ -1,157 +0,0 @@ -/* $Xorg: PsPixel.c,v 1.4 2001/02/09 02:04:36 xorgcvs Exp $ */ -/* - -Copyright 1996, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* - * (c) Copyright 1996 Hewlett-Packard Company - * (c) Copyright 1996 International Business Machines Corp. - * (c) Copyright 1996 Sun Microsystems, Inc. - * (c) Copyright 1996 Novell, Inc. - * (c) Copyright 1996 Digital Equipment Corp. - * (c) Copyright 1996 Fujitsu Limited - * (c) Copyright 1996 Hitachi, Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF - * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * Except as contained in this notice, the names of the copyright holders - * shall not be used in advertising or otherwise to promote the sale, use - * or other dealings in this Software without prior written authorization - * from said copyright holders. - */ - -/******************************************************************* -** -** ********************************************************* -** * -** * File: PsPixel.c -** * -** * Contents: Pixel-drawing code for the PS DDX driver -** * -** * Created By: Roger Helmendach (Liberty Systems) -** * -** * Copyright: Copyright 1995 The Open Group, Inc. -** * -** ********************************************************* -** -********************************************************************/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include - -#include "windowstr.h" -#include "gcstruct.h" - -#include "Ps.h" - -void -PsPolyPoint( - DrawablePtr pDrawable, - GCPtr pGC, - int mode, - int nPoints, - xPoint *pPoints) -{ - if( pDrawable->type==DRAWABLE_PIXMAP ) - { - DisplayElmPtr elm; - PixmapPtr pix = (PixmapPtr)pDrawable; - PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pix->devPrivate.ptr; - DisplayListPtr disp; - GCPtr gc; - - if ((gc = PsCreateAndCopyGC(pDrawable, pGC)) == NULL) return; - - disp = PsGetFreeDisplayBlock(priv); - - elm = &disp->elms[disp->nelms]; - elm->type = PolyPointCmd; - elm->gc = gc; - elm->c.polyPts.mode = mode; - elm->c.polyPts.nPoints = nPoints; - elm->c.polyPts.pPoints = (xPoint *)xalloc(nPoints*sizeof(xPoint)); - memcpy(elm->c.polyPts.pPoints, pPoints, nPoints*sizeof(xPoint)); - disp->nelms += 1; - } - else - { - int i; - PsOutPtr psOut; - PsPointPtr pts; - ColormapPtr cMap; - - if( PsUpdateDrawableGC(pGC, pDrawable, &psOut, &cMap)==FALSE ) return; - PsOut_Offset(psOut, pDrawable->x, pDrawable->y); - PsOut_Color(psOut, PsGetPixelColor(cMap, pGC->fgPixel)); - pts = (PsPointPtr)xalloc(sizeof(PsPointRec)*nPoints); - if( mode==CoordModeOrigin ) - { - for( i=0 ; i -#endif - -#include "windowstr.h" -#include "gcstruct.h" - -#include "Ps.h" - -#define _BitsPerPixel(d) (\ - (1 << PixmapWidthPaddingInfo[d].padBytesLog2) * 8 / \ - (PixmapWidthPaddingInfo[d].padRoundUp+1)) - -PixmapPtr -PsCreatePixmap( - ScreenPtr pScreen, - int width, - int height, - int depth) -{ - PixmapPtr pPixmap; - - pPixmap = (PixmapPtr)xcalloc(1, sizeof(PixmapRec)); - if( !pPixmap) return NullPixmap; - pPixmap->drawable.type = DRAWABLE_PIXMAP; - pPixmap->drawable.class = 0; - pPixmap->drawable.pScreen = pScreen; - pPixmap->drawable.depth = depth; - pPixmap->drawable.bitsPerPixel = _BitsPerPixel(depth); - pPixmap->drawable.id = 0; - pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; - pPixmap->drawable.x = 0; - pPixmap->drawable.y = 0; - pPixmap->drawable.width = width; - pPixmap->drawable.height = height; - pPixmap->devKind = 0; - pPixmap->refcnt = 1; - - pPixmap->devPrivate.ptr = (PsPixmapPrivPtr)xcalloc(1, sizeof(PsPixmapPrivRec)); - if( !pPixmap->devPrivate.ptr ) - { xfree(pPixmap); return NullPixmap; } - return pPixmap; -} - -/* PsScrubPixmap: Remove all content from a pixmap (used by - * |PsPolyFillRect()| when the "solid fill" operation covers - * the whole pixmap) */ -void -PsScrubPixmap(PixmapPtr pPixmap) -{ - PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pPixmap->devPrivate.ptr; - DisplayListPtr disp = priv->dispList; - - while( disp ) - { - int i; - DisplayListPtr oldDisp = disp; - disp = disp->next; - for( i=0 ; inelms ; i++ ) - { - DisplayElmPtr elm = &oldDisp->elms[i]; - - switch(elm->type) - { - case PolyPointCmd: - case PolyLineCmd: - if( elm->c.polyPts.pPoints ) xfree(elm->c.polyPts.pPoints); - break; - case PolySegmentCmd: - if( elm->c.segments.pSegments ) xfree(elm->c.segments.pSegments); - break; - case PolyRectangleCmd: - if( elm->c.rects.pRects ) xfree(elm->c.rects.pRects); - break; - case FillPolygonCmd: - if( elm->c.polyPts.pPoints ) xfree(elm->c.polyPts.pPoints); - break; - case PolyFillRectCmd: - if( elm->c.rects.pRects ) xfree(elm->c.rects.pRects); - break; - case PolyArcCmd: - if( elm->c.arcs.pArcs ) xfree(elm->c.arcs.pArcs); - break; - case PolyFillArcCmd: - if( elm->c.arcs.pArcs ) xfree(elm->c.arcs.pArcs); - break; - case Text8Cmd: - case TextI8Cmd: - if( elm->c.text8.string ) xfree(elm->c.text8.string); - break; - case Text16Cmd: - case TextI16Cmd: - if( elm->c.text16.string ) xfree(elm->c.text16.string); - break; - case PutImageCmd: - if( elm->c.image.pData ) xfree(elm->c.image.pData); - break; - case BeginFrameCmd: - break; - case EndFrameCmd: - break; - } - - if (elm->type != BeginFrameCmd && elm->type != EndFrameCmd) { - (void) FreeGC(elm->gc, (GContext) 0); - } - } - xfree(oldDisp); - } - - priv->dispList = NULL; -} - -Bool -PsDestroyPixmap(PixmapPtr pPixmap) -{ - PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pPixmap->devPrivate.ptr; - DisplayListPtr disp = priv->dispList; - - if( --pPixmap->refcnt ) return TRUE; - - PsScrubPixmap(pPixmap); - - xfree(priv); - xfree(pPixmap); - return TRUE; -} - -DisplayListPtr -PsGetFreeDisplayBlock(PsPixmapPrivPtr priv) -{ - DisplayListPtr disp = priv->dispList; - - for(; disp ; disp=disp->next ) - { - if( disp->nelms>=DPY_BLOCKSIZE && disp->next ) continue; - if( disp->nelmsnext = (DisplayListPtr)xcalloc(1, sizeof(DisplayListRec)); - disp->next->next = (DisplayListPtr)0; - disp->next->nelms = 0; - } - disp = (DisplayListPtr)xcalloc(1, sizeof(DisplayListRec)); - disp->next = (DisplayListPtr)0; - disp->nelms = 0; - priv->dispList = disp; - return(disp); -} - -void -PsReplay(DisplayElmPtr elm, DrawablePtr pDrawable) -{ - switch(elm->type) - { - case PolyPointCmd: - PsPolyPoint(pDrawable, elm->gc, elm->c.polyPts.mode, - elm->c.polyPts.nPoints, elm->c.polyPts.pPoints); - break; - case PolyLineCmd: - PsPolyLine(pDrawable, elm->gc, elm->c.polyPts.mode, - elm->c.polyPts.nPoints, elm->c.polyPts.pPoints); - break; - case PolySegmentCmd: - PsPolySegment(pDrawable, elm->gc, elm->c.segments.nSegments, - elm->c.segments.pSegments); - break; - case PolyRectangleCmd: - PsPolyRectangle(pDrawable, elm->gc, elm->c.rects.nRects, - elm->c.rects.pRects); - break; - case FillPolygonCmd: - PsFillPolygon(pDrawable, elm->gc, 0, elm->c.polyPts.mode, - elm->c.polyPts.nPoints, elm->c.polyPts.pPoints); - break; - case PolyFillRectCmd: - PsPolyFillRect(pDrawable, elm->gc, elm->c.rects.nRects, - elm->c.rects.pRects); - break; - case PolyArcCmd: - PsPolyArc(pDrawable, elm->gc, elm->c.arcs.nArcs, elm->c.arcs.pArcs); - break; - case PolyFillArcCmd: - PsPolyFillArc(pDrawable, elm->gc, elm->c.arcs.nArcs, elm->c.arcs.pArcs); - break; - case Text8Cmd: - PsPolyText8(pDrawable, elm->gc, elm->c.text8.x, elm->c.text8.y, - elm->c.text8.count, elm->c.text8.string); - break; - case Text16Cmd: - PsPolyText16(pDrawable, elm->gc, elm->c.text16.x, elm->c.text16.y, - elm->c.text16.count, elm->c.text16.string); - break; - case TextI8Cmd: - PsImageText8(pDrawable, elm->gc, elm->c.text8.x, elm->c.text8.y, - elm->c.text8.count, elm->c.text8.string); - break; - case TextI16Cmd: - PsImageText16(pDrawable, elm->gc, elm->c.text16.x, elm->c.text16.y, - elm->c.text16.count, elm->c.text16.string); - break; - case PutImageCmd: - PsPutScaledImage(pDrawable, elm->gc, elm->c.image.depth, - elm->c.image.x, elm->c.image.y, - elm->c.image.w, elm->c.image.h, elm->c.image.leftPad, - elm->c.image.format, elm->c.image.res, - elm->c.image.pData); - break; - case BeginFrameCmd: - { - PsOutPtr psOut; - ColormapPtr cMap; - if( PsUpdateDrawableGC(NULL, pDrawable, &psOut, &cMap)==FALSE ) return; - PsOut_BeginFrame(psOut, 0, 0, elm->c.frame.x, elm->c.frame.y, - elm->c.frame.w, elm->c.frame.h); - } - break; - case EndFrameCmd: - { - PsOutPtr psOut; - ColormapPtr cMap; - if( PsUpdateDrawableGC(NULL, pDrawable, &psOut, &cMap)==FALSE ) return; - PsOut_EndFrame(psOut); - } - break; - } -} - -void -PsReplayPixmap(PixmapPtr pix, DrawablePtr pDrawable) -{ - PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pix->devPrivate.ptr; - DisplayListPtr disp = priv->dispList; - DisplayElmPtr elm; - - for(; disp ; disp=disp->next ) - { - int i; - for( i=0,elm=disp->elms ; inelms ; i++,elm++ ) - PsReplay(elm, pDrawable); - } -} - -int -PsCloneDisplayElm(PixmapPtr dst, DisplayElmPtr elm, DisplayElmPtr newElm, - int xoff, int yoff) -{ - int i; - int size; - int status = 0; - - *newElm = *elm; - - /* I think this is the correct return value */ - if ((newElm->gc = PsCreateAndCopyGC(&dst->drawable, elm->gc)) == NULL) { - return 1; - } - - switch(elm->type) - { - case PolyPointCmd: - case PolyLineCmd: - newElm->c.polyPts.pPoints = - (xPoint *)xalloc(elm->c.polyPts.nPoints*sizeof(xPoint)); - for( i=0 ; ic.polyPts.nPoints ; i++ ) - { - newElm->c.polyPts.pPoints[i].x = elm->c.polyPts.pPoints[i].x+xoff; - newElm->c.polyPts.pPoints[i].y = elm->c.polyPts.pPoints[i].y+yoff; - } - break; - case PolySegmentCmd: - newElm->c.segments.pSegments = - (xSegment *)xalloc(elm->c.segments.nSegments*sizeof(xSegment)); - for( i=0 ; ic.segments.nSegments ; i++ ) - { - newElm->c.segments.pSegments[i].x1 = - elm->c.segments.pSegments[i].x1+xoff; - newElm->c.segments.pSegments[i].y1 = - elm->c.segments.pSegments[i].y1+yoff; - newElm->c.segments.pSegments[i].x2 = - elm->c.segments.pSegments[i].x2+xoff; - newElm->c.segments.pSegments[i].y2 = - elm->c.segments.pSegments[i].y2+yoff; - } - break; - case PolyRectangleCmd: - newElm->c.rects.pRects = - (xRectangle *)xalloc(elm->c.rects.nRects*sizeof(xRectangle)); - for( i=0 ; ic.rects.nRects ; i++ ) - { - newElm->c.rects.pRects[i].x = elm->c.rects.pRects[i].x+xoff; - newElm->c.rects.pRects[i].y = elm->c.rects.pRects[i].y+yoff; - newElm->c.rects.pRects[i].width = elm->c.rects.pRects[i].width; - newElm->c.rects.pRects[i].height = elm->c.rects.pRects[i].height; - } - break; - case FillPolygonCmd: - newElm->c.polyPts.pPoints = - (xPoint *)xalloc(elm->c.polyPts.nPoints*sizeof(xPoint)); - for( i=0 ; ic.polyPts.nPoints ; i++ ) - { - newElm->c.polyPts.pPoints[i].x = elm->c.polyPts.pPoints[i].x+xoff; - newElm->c.polyPts.pPoints[i].y = elm->c.polyPts.pPoints[i].y+yoff; - } - break; - case PolyFillRectCmd: - newElm->c.rects.pRects = - (xRectangle *)xalloc(elm->c.rects.nRects*sizeof(xRectangle)); - for( i=0 ; ic.rects.nRects ; i++ ) - { - newElm->c.rects.pRects[i].x = elm->c.rects.pRects[i].x+xoff; - newElm->c.rects.pRects[i].y = elm->c.rects.pRects[i].y+yoff; - newElm->c.rects.pRects[i].width = elm->c.rects.pRects[i].width; - newElm->c.rects.pRects[i].height = elm->c.rects.pRects[i].height; - } - break; - case PolyArcCmd: - newElm->c.arcs.pArcs = - (xArc *)xalloc(elm->c.arcs.nArcs*sizeof(xArc)); - for( i=0 ; ic.arcs.nArcs ; i++ ) - { - newElm->c.arcs.pArcs[i].x = elm->c.arcs.pArcs[i].x+xoff; - newElm->c.arcs.pArcs[i].y = elm->c.arcs.pArcs[i].y+yoff; - newElm->c.arcs.pArcs[i].width = elm->c.arcs.pArcs[i].width; - newElm->c.arcs.pArcs[i].height = elm->c.arcs.pArcs[i].height; - newElm->c.arcs.pArcs[i].angle1 = elm->c.arcs.pArcs[i].angle1; - newElm->c.arcs.pArcs[i].angle2 = elm->c.arcs.pArcs[i].angle2; - } - break; - case PolyFillArcCmd: - newElm->c.arcs.pArcs = - (xArc *)xalloc(elm->c.arcs.nArcs*sizeof(xArc)); - for( i=0 ; ic.arcs.nArcs ; i++ ) - { - newElm->c.arcs.pArcs[i].x = elm->c.arcs.pArcs[i].x+xoff; - newElm->c.arcs.pArcs[i].y = elm->c.arcs.pArcs[i].y+yoff; - newElm->c.arcs.pArcs[i].width = elm->c.arcs.pArcs[i].width; - newElm->c.arcs.pArcs[i].height = elm->c.arcs.pArcs[i].height; - newElm->c.arcs.pArcs[i].angle1 = elm->c.arcs.pArcs[i].angle1; - newElm->c.arcs.pArcs[i].angle2 = elm->c.arcs.pArcs[i].angle2; - } - break; - case Text8Cmd: - case TextI8Cmd: - newElm->c.text8.string = (char *)xalloc(elm->c.text8.count); - memcpy(newElm->c.text8.string, elm->c.text8.string, elm->c.text8.count); - newElm->c.text8.x += xoff; - newElm->c.text8.y += yoff; - break; - case Text16Cmd: - case TextI16Cmd: - newElm->c.text16.string = - (unsigned short *)xalloc(elm->c.text16.count*sizeof(unsigned short)); - memcpy(newElm->c.text16.string, elm->c.text16.string, - elm->c.text16.count*sizeof(unsigned short)); - newElm->c.text16.x += xoff; - newElm->c.text16.y += yoff; - break; - case PutImageCmd: - size = PixmapBytePad(elm->c.image.w, elm->c.image.depth)*elm->c.image.h; - newElm->c.image.pData = (char *)xalloc(size); - memcpy(newElm->c.image.pData, elm->c.image.pData, size); - newElm->c.image.x += xoff; - newElm->c.image.y += yoff; - break; - case BeginFrameCmd: - case EndFrameCmd: - status = 1; - break; - } - return(status); -} - -void -PsCopyDisplayList(PixmapPtr src, PixmapPtr dst, int xoff, int yoff, - int x, int y, int w, int h) -{ - PsPixmapPrivPtr sPriv = (PsPixmapPrivPtr)src->devPrivate.ptr; - PsPixmapPrivPtr dPriv = (PsPixmapPrivPtr)dst->devPrivate.ptr; - DisplayListPtr sDisp; - DisplayListPtr dDisp = PsGetFreeDisplayBlock(dPriv); - DisplayElmPtr elm = &dDisp->elms[dDisp->nelms]; - - elm->type = BeginFrameCmd; - elm->c.frame.x = x; - elm->c.frame.y = y; - elm->c.frame.w = w; - elm->c.frame.h = h; - dDisp->nelms += 1; - - sDisp = sPriv->dispList; - for(; sDisp ; sDisp=sDisp->next ) - { - int i; - for( i=0,elm=sDisp->elms ; inelms ; i++,elm++ ) - { - dDisp = PsGetFreeDisplayBlock(dPriv); - if (PsCloneDisplayElm(dst, elm, &dDisp->elms[dDisp->nelms], - xoff, yoff)==0) - { - dDisp->nelms += 1; - } - } - } - - dDisp = PsGetFreeDisplayBlock(dPriv); - elm = &dDisp->elms[dDisp->nelms]; - elm->type = EndFrameCmd; - dDisp->nelms += 1; -} - -PsElmPtr -PsCreateFillElementList(PixmapPtr pix, int *nElms) -{ - PsElmPtr elms = (PsElmPtr)0; - PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pix->devPrivate.ptr; - DisplayListPtr disp = priv->dispList; - PsArcEnum styl; - - *nElms = 0; - for(; disp ; disp=disp->next ) - { - int i; - DisplayElmPtr elm = disp->elms; - - for( i=0 ; inelms ; i++,elm++ ) - { - if( !elm->gc ) continue; /* workaround for https://freedesktop.org/bugzilla/show_bug.cgi?id=1416 */ - if( !elm->gc->fgPixel ) continue; - switch(elm->type) - { - case FillPolygonCmd: - *nElms += 1; - break; - case PolyFillRectCmd: - *nElms += elm->c.rects.nRects; - break; - case PolyFillArcCmd: - *nElms += elm->c.arcs.nArcs; - break; - } - } - } - - if( (*nElms) ) - { - elms = (PsElmPtr)xcalloc(1, (*nElms)*sizeof(PsElmRec)); - if( elms ) - { - disp = priv->dispList; - *nElms = 0; - for(; disp ; disp=disp->next ) - { - int i, k; - DisplayElmPtr elm = disp->elms; - - for( i=0 ; inelms ; i++,elm++ ) - { - if( !elm->gc->fgPixel ) continue; - switch(elm->type) - { - case FillPolygonCmd: - elms[*nElms].type = PSOUT_POINTS; - elms[*nElms].nPoints = elm->c.polyPts.nPoints; - elms[*nElms].c.points = - (PsPointPtr)xalloc(elms[*nElms].nPoints*sizeof(PsPointRec)); - for( k=0 ; kc.polyPts.pPoints[k].x; - elms[*nElms].c.points[k].y = elm->c.polyPts.pPoints[k].y; - } - *nElms += 1; - break; - case PolyFillRectCmd: - for( k=0 ; kc.rects.nRects ; k++ ) - { - elms[*nElms].type = PSOUT_RECT; - elms[*nElms].nPoints = 0; - elms[*nElms].c.rect.x = elm->c.rects.pRects[k].x; - elms[*nElms].c.rect.y = elm->c.rects.pRects[k].y; - elms[*nElms].c.rect.w = elm->c.rects.pRects[k].width; - elms[*nElms].c.rect.h = elm->c.rects.pRects[k].height; - *nElms += 1; - } - break; - case PolyFillArcCmd: - if( elm->gc->arcMode==ArcChord ) styl = PsChord; - else styl = PsPieSlice; - for( k=0 ; kc.rects.nRects ; k++ ) - { - elms[*nElms].type = PSOUT_ARC; - elms[*nElms].nPoints = 0; - elms[*nElms].c.arc.x = elm->c.arcs.pArcs[k].x; - elms[*nElms].c.arc.y = elm->c.arcs.pArcs[k].y; - elms[*nElms].c.arc.w = elm->c.arcs.pArcs[k].width; - elms[*nElms].c.arc.h = elm->c.arcs.pArcs[k].height; - elms[*nElms].c.arc.a1 = elm->c.arcs.pArcs[k].angle1; - elms[*nElms].c.arc.a2 = elm->c.arcs.pArcs[k].angle2; - elms[*nElms].c.arc.style = styl; - *nElms += 1; - } - break; - } - } - } - } - } - return(elms); -} - -PsElmPtr -PsCloneFillElementList(int nElms, PsElmPtr elms) -{ - int i; - PsElmPtr newElms; - - newElms = (PsElmPtr)xcalloc(1, nElms*sizeof(PsElmRec)); - if( !newElms ) return(newElms); - for( i=0 ; i -#endif - -#include "Ps.h" -#include "gcstruct.h" -#include "windowstr.h" - -void -PsPolyRectangle( - DrawablePtr pDrawable, - GCPtr pGC, - int nRects, - xRectangle *pRects) -{ - if( pDrawable->type==DRAWABLE_PIXMAP ) - { - DisplayElmPtr elm; - PixmapPtr pix = (PixmapPtr)pDrawable; - PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pix->devPrivate.ptr; - DisplayListPtr disp; - GCPtr gc; - - if ((gc = PsCreateAndCopyGC(pDrawable, pGC)) == NULL) return; - - disp = PsGetFreeDisplayBlock(priv); - - elm = &disp->elms[disp->nelms]; - elm->type = PolyRectangleCmd; - elm->gc = gc; - elm->c.rects.nRects = nRects; - elm->c.rects.pRects = (xRectangle *)xalloc(nRects*sizeof(xRectangle)); - memcpy(elm->c.rects.pRects, pRects, nRects*sizeof(xRectangle)); - disp->nelms += 1; - } - else - { - int i; - PsOutPtr psOut; - ColormapPtr cMap; - - if( PsUpdateDrawableGC(pGC, pDrawable, &psOut, &cMap)==FALSE ) return; - PsOut_Offset(psOut, pDrawable->x, pDrawable->y); - PsOut_Color(psOut, PsGetPixelColor(cMap, pGC->fgPixel)); - PsLineAttrs(psOut, pGC, cMap); - for( i=0 ; itype==DRAWABLE_PIXMAP ) - { - DisplayElmPtr elm; - PixmapPtr pix = (PixmapPtr)pDrawable; - PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pix->devPrivate.ptr; - DisplayListPtr disp; - GCPtr gc; - - if ((gc = PsCreateAndCopyGC(pDrawable, pGC)) == NULL) return; - - disp = PsGetFreeDisplayBlock(priv); - - elm = &disp->elms[disp->nelms]; - elm->type = FillPolygonCmd; - elm->gc = gc; - elm->c.polyPts.mode = mode; - elm->c.polyPts.nPoints = nPoints; - elm->c.polyPts.pPoints = (xPoint *)xalloc(nPoints*sizeof(xPoint)); - memcpy(elm->c.polyPts.pPoints, pPoints, nPoints*sizeof(xPoint)); - disp->nelms += 1; - } - else - { - int i; - PsOutPtr psOut; - PsPointPtr pts; - PsRuleEnum rule; - ColormapPtr cMap; - - if( PsUpdateDrawableGC(pGC, pDrawable, &psOut, &cMap)==FALSE ) return; - PsOut_Offset(psOut, pDrawable->x, pDrawable->y); - PsSetFillColor(pDrawable, pGC, psOut, cMap); - if( pGC->fillRule==EvenOddRule ) rule = PsEvenOdd; - else rule = PsNZWinding; - PsOut_FillRule(psOut, rule); - pts = (PsPointPtr)xalloc(sizeof(PsPointRec)*nPoints); - if( mode==CoordModeOrigin ) - { - for( i=0 ; itype==DRAWABLE_PIXMAP ) - { - DisplayElmPtr elm; - PixmapPtr pix = (PixmapPtr)pDrawable; - PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pix->devPrivate.ptr; - DisplayListPtr disp; - GCPtr gc; - -#ifdef DBE - /* Remove previous pixmap content if we render one single rect which - * covers the whole pixmap surface (this optimisation was added for - * the double-buffer extension ("DBE") which uses |PolyFillRect()| - * to clear the buffer - but it makes sense in other cases, too). - */ - if (nRects == 1) - { - extern Bool noDbeExtension; - - if ( (pRects[0].x==0) && (pRects[0].y==0) && - (pRects[0].width==pDrawable->width) && (pRects[0].height==pDrawable->height) && - (pGC->fillStyle == FillSolid) && - (noDbeExtension == False)) - { -#ifdef DEBUG_gismobile - ErrorF("PsPolyFillRect: scrubbing pixmap...\n"); -#endif /* DEBUG_gismobile */ - /* Remove all content from the pixmap as it would be covered - * by the whole rect anyway */ - PsScrubPixmap(pDrawable); - } - } -#endif /* DBE */ - - if ((gc = PsCreateAndCopyGC(pDrawable, pGC)) == NULL) return; - - disp = PsGetFreeDisplayBlock(priv); - - elm = &disp->elms[disp->nelms]; - elm->type = PolyFillRectCmd; - elm->gc = gc; - elm->c.rects.nRects = nRects; - elm->c.rects.pRects = (xRectangle *)xalloc(nRects*sizeof(xRectangle)); - memcpy(elm->c.rects.pRects, pRects, nRects*sizeof(xRectangle)); - disp->nelms += 1; - } - else - { - int i; - PsOutPtr psOut; - ColormapPtr cMap; - - if( PsUpdateDrawableGC(pGC, pDrawable, &psOut, &cMap)==FALSE ) return; - PsOut_Offset(psOut, pDrawable->x, pDrawable->y); - PsSetFillColor(pDrawable, pGC, psOut, cMap); - for( i=0 ; i -#endif - -#include -#include -#include -#include -#include -#include -#include -#include - -#define NEED_EVENTS -#include -#undef NEED_EVENTS - -#include "Ps.h" - -#include "windowstr.h" -#include "attributes.h" -#include "Oid.h" - -/* static utility function to get document/page attributes */ -static void -S_GetPageAttributes(XpContextPtr pCon,int *iorient,int *icount, int *iplex, - int *ires, unsigned short *iwd, unsigned short *iht) -{ - char *count; - XpOid orient, plex; - /* - * Get the orientation - */ - orient = XpGetContentOrientation(pCon); - switch (orient) { - case xpoid_val_content_orientation_landscape: - *iorient = 1; - break; - case xpoid_val_content_orientation_reverse_portrait: - *iorient = 2; - break; - case xpoid_val_content_orientation_reverse_landscape: - *iorient = 3; - break; - case xpoid_val_content_orientation_portrait: - default: - *iorient = 0; - break; - } - - /* - * Get the count - */ - count = XpGetOneAttribute(pCon, XPDocAttr, "copy-count"); - if( count ) - { - int ii = sscanf(count, "%d", icount); - if( ii!=1 ) *icount = 1; - } - else *icount = 1; - - /* - * Get the plex - */ - plex = XpGetPlex(pCon); - switch(plex) - { - case xpoid_val_plex_duplex: - *iplex = 1; - break; - case xpoid_val_plex_tumble: - *iplex = 2; - break; - default: - *iplex = 0; - break; - } - - /* - * Get the resolution and media size - */ - *ires = XpGetResolution(pCon); - XpGetMediumDimensions(pCon, iwd, iht); -} - - -int -PsStartJob( - XpContextPtr pCon, - Bool sendClientData, - ClientPtr client) -{ - PsContextPrivPtr pConPriv = - (PsContextPrivPtr)pCon->devPrivates[PsContextPrivateIndex].ptr; - - /* - * Create a temporary file to store the printer output. - */ - if (!XpOpenTmpFile("w", &pConPriv->jobFileName, &pConPriv->pJobFile)) - return BadAlloc; - - return Success; -} - - - -/* I thought about making this following code into a set of routines - or using a goto, or something, but in the end decided not to, - because the plain old listing here makes the logic clearer. */ -int -PsEndJob( - XpContextPtr pCon, - Bool cancel) -{ - int r; - struct stat buffer; - int error; - - PsContextPrivPtr priv = - (PsContextPrivPtr)pCon->devPrivates[PsContextPrivateIndex].ptr; - - if (cancel == True) { - if (priv->getDocClient != (ClientPtr) NULL) { - (void) XpFinishDocData( priv->getDocClient ); - - priv->getDocClient = NULL; - priv->getDocBufSize = 0; - } - - /* job is cancelled - do we really care if we're out of space? */ - (void) fclose(priv->pJobFile); - priv->pJobFile = NULL; - - unlink(priv->jobFileName); - xfree(priv->jobFileName); - priv->jobFileName = (char *)NULL; - - PsFreeFontInfoRecords(priv); - - return Success; - } - - /* - * Append any trailing information here - */ - PsOut_EndFile(priv->pPsOut, 0); - priv->pPsOut = NULL; - - /* this is where we find out if we're out of space */ - error = (fclose(priv->pJobFile) == EOF); - priv->pJobFile = NULL; - - /* status to the client if we have ran out of space on the disk or - some other resource problem with the temporary file... */ - if (error) { - if (priv->getDocClient != (ClientPtr) NULL) { - (void) XpFinishDocData( priv->getDocClient ); - - priv->getDocClient = NULL; - priv->getDocBufSize = 0; - } - - unlink(priv->jobFileName); - xfree(priv->jobFileName); - priv->jobFileName = (char *)NULL; - - PsFreeFontInfoRecords(priv); - - return BadAlloc; - } - - /* we have finished without incident & no cancel */ - - if (priv->getDocClient != NULL && priv->getDocBufSize > 0) { - FILE *file; - - file = fopen(priv->jobFileName, "r"); - if (!file || (fstat(fileno(file), &buffer) < 0)) - r = BadAlloc; - else - r = XpSendDocumentData(priv->getDocClient, file, buffer.st_size, - priv->getDocBufSize); - if (file) - fclose(file); - - (void) XpFinishDocData(priv->getDocClient); - - priv->getDocClient = NULL; - priv->getDocBufSize = 0; - } - else { - XpSubmitJob(priv->jobFileName, pCon); - - r = Success; - } - - unlink(priv->jobFileName); - xfree(priv->jobFileName); - priv->jobFileName = (char *)NULL; - - PsFreeFontInfoRecords(priv); - -#ifdef BM_CACHE - PsBmClearImageCache(); -#endif - - return r; -} - -/* StartPage - */ -int -PsStartPage( - XpContextPtr pCon, - WindowPtr pWin) -{ - int iorient, iplex, icount, ires; - unsigned short iwd, iht; - register WindowPtr pChild; - PsContextPrivPtr pConPriv = - (PsContextPrivPtr)pCon->devPrivates[PsContextPrivateIndex].ptr; - PsWindowPrivPtr pWinPriv = - (PsWindowPrivPtr)pWin->devPrivates[PsWindowPrivateIndex].ptr; - char s[80]; - xEvent event; - -/* - * Put a pointer to the context in the window private structure - */ - pWinPriv->validContext = 1; - pWinPriv->context = pCon; - - /* get page level attributes */ - S_GetPageAttributes(pCon,&iorient,&icount,&iplex,&ires,&iwd,&iht); - /* - * Start the page - */ - if (pConPriv->pPsOut == NULL) { - char *title; - - /* get job level attributes */ - title = XpGetOneAttribute(pCon, XPJobAttr, "job-name"); - - pConPriv->pPsOut = PsOut_BeginFile(pConPriv->pJobFile, - title, iorient, icount, iplex, ires, - (int)iwd, (int)iht, False); - pConPriv->fontInfoRecords = NULL; - pConPriv->fontTypeInfoRecords = NULL; - } - PsOut_BeginPage(pConPriv->pPsOut, iorient, icount, iplex, ires, - (int)iwd, (int)iht); - - return Success; -} - - -/* - * EndPage: - * - * Write page trailer to page file - * Write page file to job file - */ -int -PsEndPage( - XpContextPtr pCon, - WindowPtr pWin) -{ - PsWindowPrivPtr pWinPriv = - (PsWindowPrivPtr)pWin->devPrivates[PsWindowPrivateIndex].ptr; - PsContextPrivPtr pConPriv = - (PsContextPrivPtr)pCon->devPrivates[PsContextPrivateIndex].ptr; - - PsOut_EndPage(pConPriv->pPsOut); - - pWinPriv->validContext = 0; - pWinPriv->context = NULL; - - /* status to the client if we have ran out of space on the disk or - some other resource problem with the temporary file... */ -/* if (ferror(pConPriv->pJobFile)) return BadAlloc; */ - - return Success; -} - -/* - * The PsStartDoc() and PsEndDoc() functions serve basically as NOOP - * placeholders. This driver doesn't deal with the notion of multiple - * documents per page. - */ - -int -PsStartDoc(XpContextPtr pCon, XPDocumentType type) -{ - int iorient, iplex, icount, ires; - unsigned short iwd, iht; - char *title; - PsContextPrivPtr pConPriv = - (PsContextPrivPtr)pCon->devPrivates[PsContextPrivateIndex].ptr; - - /* get job level attributes */ - title = XpGetOneAttribute(pCon, XPJobAttr, "job-name"); - - /* get document level attributes */ - S_GetPageAttributes(pCon,&iorient,&icount,&iplex,&ires,&iwd,&iht); - - pConPriv->pPsOut = PsOut_BeginFile(pConPriv->pJobFile, - title, iorient, icount, iplex, ires, - (int)iwd, (int)iht, (Bool)(type == XPDocRaw)); - - pConPriv->fontInfoRecords = NULL; - pConPriv->fontTypeInfoRecords = NULL; - - return Success; -} - -int -PsEndDoc( - XpContextPtr pCon, - Bool cancel) -{ - return Success; -} - -/* - * PsDocumentData() - * - * Hand any pre-generated PDL down to the spool files, formatting it - * as necessary to fit the given window. - */ - -int -PsDocumentData( - XpContextPtr pCon, - DrawablePtr pDraw, - char *pData, - int len_data, - char *pFmt, - int len_fmt, - char *pOpt, - int len_opt, - ClientPtr client) -{ - PsContextPrivPtr cPriv; - PsOutPtr psOut; - - if (len_fmt != 12 || - strncasecmp(pFmt, "PostScript 2", len_fmt) != 0 || - len_opt) - return BadValue; - - cPriv = pCon->devPrivates[PsContextPrivateIndex].ptr; - psOut = cPriv->pPsOut; - - if (pDraw) - PsOut_BeginFrame(psOut, 0, 0, pDraw->x, pDraw->y, - pDraw->width, pDraw->height); - PsOut_RawData(psOut, pData, len_data); - if (pDraw) - PsOut_EndFrame(psOut); - - return Success; -} - -/* - * - * PsGetDocumentData() - * - * This function allows the driver to send the generated PS back to - * the client. - */ - -int -PsGetDocumentData( - XpContextPtr pCon, - ClientPtr client, - int maxBufferSize) -{ - PsContextPrivPtr pPriv = (PsContextPrivPtr) - pCon->devPrivates[PsContextPrivateIndex].ptr; - - pPriv->getDocClient = client; - pPriv->getDocBufSize = maxBufferSize; - - return Success; -} - diff --git a/nx-X11/programs/Xserver/Xprint/ps/PsSpans.c b/nx-X11/programs/Xserver/Xprint/ps/PsSpans.c deleted file mode 100644 index d7652f8fb..000000000 --- a/nx-X11/programs/Xserver/Xprint/ps/PsSpans.c +++ /dev/null @@ -1,166 +0,0 @@ -/* $Xorg: PsSpans.c,v 1.4 2001/02/09 02:04:36 xorgcvs Exp $ */ -/* - -Copyright 1996, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* - * (c) Copyright 1996 Hewlett-Packard Company - * (c) Copyright 1996 International Business Machines Corp. - * (c) Copyright 1996 Sun Microsystems, Inc. - * (c) Copyright 1996 Novell, Inc. - * (c) Copyright 1996 Digital Equipment Corp. - * (c) Copyright 1996 Fujitsu Limited - * (c) Copyright 1996 Hitachi, Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF - * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * Except as contained in this notice, the names of the copyright holders - * shall not be used in advertising or otherwise to promote the sale, use - * or other dealings in this Software without prior written authorization - * from said copyright holders. - */ - -/******************************************************************* -** -** ********************************************************* -** * -** * File: PsSpans.c -** * -** * Contents: Code to set and fill spans in the PS DDX -** * -** * Created By: Roger Helmendach (Liberty Systems) -** * -** * Copyright: Copyright 1996 The Open Group, Inc. -** * -** ********************************************************* -** -********************************************************************/ -/* $XFree86: xc/programs/Xserver/Xprint/ps/PsSpans.c,v 1.8 2001/10/28 03:32:56 tsi Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "Ps.h" -#include "gcstruct.h" -#include "windowstr.h" - -void -PsFillSpans( - DrawablePtr pDrawable, - GCPtr pGC, - int nSpans, - DDXPointPtr pPoints, - int *pWidths, - int fSorted) -{ - PsOutPtr psOut; - int xoffset, yoffset; - xRectangle *rects, *r; - RegionPtr fillRegion, region = 0; - int i; - int nbox; - BoxPtr pbox; - ColormapPtr cMap; - - if( PsUpdateDrawableGC(pGC, pDrawable, &psOut, &cMap)==FALSE ) return; - - /* - * Build a region out of the spans - */ - rects = (xRectangle *)xalloc(nSpans*sizeof(xRectangle)); - xoffset = pDrawable->x; - yoffset = pDrawable->y; - - for( i = 0, r = rects; i < nSpans; i++, r++ ) - { - r->x = pPoints[i].x + xoffset; - r->y = pPoints[i].y + yoffset; - r->width = pWidths[i]; - r->height = 1; - } - fillRegion = RECTS_TO_REGION(pGC->pScreen, nSpans, rects, - (fSorted)?CT_YSORTED:CT_UNSORTED); - - /* - * Intersect this region with the clip region. Whatever's left, - * should be filled. - */ -/*REGION_INTERSECT(pGC->pScreen, region, fillRegion, pGC->clientClip);*/ - - pbox = REGION_RECTS(region); - nbox = REGION_NUM_RECTS(region); - - /* Enter HP-GL/2 */ - /*###SEND_PCL( outFile, "\27%0B" );*/ - - while( nbox ) - { -/*### - sprintf( t, "PU%d,%d;RR%d,%d;", pbox->x1, pbox->y1, pbox->x2, pbox->y2); - SEND_PCL( outFile, t ); -*/ - nbox--; - pbox++; - } - - /* Go back to PCL */ - /*###SEND_PCL( outFile, "\27%0A" );*/ - - /* - * Clean up the temporary regions - */ - REGION_DESTROY(pGC->pScreen, fillRegion); - REGION_DESTROY(pGC->pScreen, region); - xfree(rects); -} - -void -PsSetSpans( - DrawablePtr pDrawable, - GCPtr pGC, - char *pSrc, - DDXPointPtr pPoints, - int *pWidths, - int nSpans, - int fSorted) -{ -} diff --git a/nx-X11/programs/Xserver/Xprint/ps/PsText.c b/nx-X11/programs/Xserver/Xprint/ps/PsText.c deleted file mode 100644 index 228e407dc..000000000 --- a/nx-X11/programs/Xserver/Xprint/ps/PsText.c +++ /dev/null @@ -1,586 +0,0 @@ -/* $Xorg: PsText.c,v 1.7 2001/02/09 02:04:36 xorgcvs Exp $ */ -/* - -Copyright 1996, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* - * (c) Copyright 1996 Hewlett-Packard Company - * (c) Copyright 1996 International Business Machines Corp. - * (c) Copyright 1996 Sun Microsystems, Inc. - * (c) Copyright 1996 Novell, Inc. - * (c) Copyright 1996 Digital Equipment Corp. - * (c) Copyright 1996 Fujitsu Limited - * (c) Copyright 1996 Hitachi, Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF - * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * Except as contained in this notice, the names of the copyright holders - * shall not be used in advertising or otherwise to promote the sale, use - * or other dealings in this Software without prior written authorization - * from said copyright holders. - */ - -/******************************************************************* -** -** ********************************************************* -** * -** * File: PsText.c -** * -** * Contents: Character-drawing routines for the PS DDX -** * -** * Created By: Roger Helmendach (Liberty Systems) -** * -** * Copyright: Copyright 1996 The Open Group, Inc. -** * -** ********************************************************* -** -********************************************************************/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "Ps.h" -#include "gcstruct.h" -#include "windowstr.h" -#include -#include -#include - -int -PsPolyText8( - DrawablePtr pDrawable, - GCPtr pGC, - int x, - int y, - int count, - char *string) -{ - if( pDrawable->type==DRAWABLE_PIXMAP ) - { - DisplayElmPtr elm; - PixmapPtr pix = (PixmapPtr)pDrawable; - PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pix->devPrivate.ptr; - DisplayListPtr disp; - GCPtr gc; - - if ((gc = PsCreateAndCopyGC(pDrawable, pGC)) == NULL) return x; - - disp = PsGetFreeDisplayBlock(priv); - - elm = &disp->elms[disp->nelms]; - elm->type = Text8Cmd; - elm->gc = gc; - elm->c.text8.x = x; - elm->c.text8.y = y; - elm->c.text8.count = count; - elm->c.text8.string = (char *)xalloc(count); - memcpy(elm->c.text8.string, string, count); - disp->nelms += 1; - - return x; - } - else - { - PsFontInfoRec *firec; - - /* We need a context for rendering... */ - if (PsGetPsContextPriv(pDrawable) == NULL) - return x; - - firec = PsGetFontInfoRec(pDrawable, pGC->font); - if (!firec) - return x; - -#ifdef XP_USE_FREETYPE - if (firec->ftir->downloadableFont && - (firec->ftir->font_type == PSFTI_FONT_TYPE_FREETYPE)) - { - PsOutPtr psOut; - ColormapPtr cMap; - - if( PsUpdateDrawableGC(pGC, pDrawable, &psOut, &cMap)==FALSE ) - return x; - - if (firec->ftir->alreadyDownloaded[0] == False) - { - PsOut_DownloadFreeType(psOut, - firec->ftir->ft_download_font_type, - firec->ftir->download_ps_name, pGC->font, 0); - firec->ftir->alreadyDownloaded[0] = True; - } - - PsOut_Offset(psOut, pDrawable->x, pDrawable->y); - PsOut_Color(psOut, PsGetPixelColor(cMap, pGC->fgPixel)); - if (!firec->size) - PsOut_TextAttrsMtx(psOut, firec->ftir->download_ps_name, firec->mtx, firec->ftir->is_iso_encoding); - else - PsOut_TextAttrs(psOut, firec->ftir->download_ps_name, firec->size, firec->ftir->is_iso_encoding); - PsOut_FreeType_Text(pGC->font, psOut, x, y, string, count); - - return x; - } - else -#endif /* XP_USE_FREETYPE */ - if (firec->ftir->downloadableFont && - (firec->ftir->font_type != PSFTI_FONT_TYPE_FREETYPE)) - { - PsOutPtr psOut; - ColormapPtr cMap; - - if( PsUpdateDrawableGC(pGC, pDrawable, &psOut, &cMap)==FALSE ) - return x; - - if (firec->ftir->alreadyDownloaded[0] == False) - { - PsOut_DownloadType1(psOut, "PsPolyText8", - firec->ftir->download_ps_name, firec->ftir->filename); - firec->ftir->alreadyDownloaded[0] = True; - } - - PsOut_Offset(psOut, pDrawable->x, pDrawable->y); - PsOut_Color(psOut, PsGetPixelColor(cMap, pGC->fgPixel)); - if (!firec->size) - PsOut_TextAttrsMtx(psOut, firec->ftir->download_ps_name, firec->mtx, firec->ftir->is_iso_encoding); - else - PsOut_TextAttrs(psOut, firec->ftir->download_ps_name, firec->size, firec->ftir->is_iso_encoding); - PsOut_Text(psOut, x, y, string, count, -1); - - return x; - } - - /* Render glyphs as bitmaps */ - { - unsigned long n, i; - int w; - CharInfoPtr charinfo[255]; - - GetGlyphs(pGC->font, (unsigned long)count, - (unsigned char *)string, Linear8Bit, &n, charinfo); - w = 0; - for (i=0; i < n; i++) - w += charinfo[i]->metrics.characterWidth; - - if (n != 0) - PsPolyGlyphBlt(pDrawable, pGC, x, y, n, - charinfo, FONTGLYPHS(pGC->font)); - x += w; - - return x; - } - } - return x; -} - -int -PsPolyText16( - DrawablePtr pDrawable, - GCPtr pGC, - int x, - int y, - int count, - unsigned short *string) -{ - if( pDrawable->type==DRAWABLE_PIXMAP ) - { - DisplayElmPtr elm; - PixmapPtr pix = (PixmapPtr)pDrawable; - PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pix->devPrivate.ptr; - DisplayListPtr disp; - GCPtr gc; - - if ((gc = PsCreateAndCopyGC(pDrawable, pGC)) == NULL) return x; - - disp = PsGetFreeDisplayBlock(priv); - - elm = &disp->elms[disp->nelms]; - elm->type = Text16Cmd; - elm->gc = gc; - elm->c.text16.x = x; - elm->c.text16.y = y; - elm->c.text16.count = count; - elm->c.text16.string = - (unsigned short *)xalloc(count*sizeof(unsigned short)); - memcpy(elm->c.text16.string, string, count*sizeof(unsigned short)); - disp->nelms += 1; - - return x; - } - else - { - PsFontInfoRec *firec; - - /* We need a context for rendering... */ - if (PsGetPsContextPriv(pDrawable) == NULL) - return x; - - firec = PsGetFontInfoRec(pDrawable, pGC->font); - if (!firec) - return x; - -#ifdef XP_USE_FREETYPE - if (firec->ftir->downloadableFont && - (firec->ftir->font_type == PSFTI_FONT_TYPE_FREETYPE)) - { - PsOutPtr psOut; - ColormapPtr cMap; - unsigned short c, - c_hiByte, - c_lowByte, - fontPage; - int i; - - if( PsUpdateDrawableGC(pGC, pDrawable, &psOut, &cMap)==FALSE ) - return x; - - /* Scan the string we want to render and download all neccesary parts - * of the font (one part(="font page") has 256 glyphs) - */ - for( i = 0 ; i < count ; i++ ) - { - c = string[i]; -#if IMAGE_BYTE_ORDER == LSBFirst - c_hiByte = c & 0x00FF; - c_lowByte = (c >> 8) & 0x00FF; -#elif IMAGE_BYTE_ORDER == MSBFirst - c_hiByte = (c >> 8) & 0x00FF; - c_lowByte = c & 0x00FF; -#else -#error Unsupported byte order -#endif - fontPage = c_hiByte; - - if (firec->ftir->alreadyDownloaded[fontPage] == False) - { - char buffer[256]; - const char *ps_name; - - if (fontPage > 0) - { - sprintf(buffer, "%s_%x", firec->ftir->download_ps_name, (int)fontPage); - ps_name = buffer; - } - else - { - ps_name = firec->ftir->download_ps_name; - } - - PsOut_DownloadFreeType(psOut, - firec->ftir->ft_download_font_type, - ps_name, pGC->font, (fontPage * 0x100)); /* same as (fontPage << 8) */ - - firec->ftir->alreadyDownloaded[fontPage] = True; - } - } - - - PsOut_Offset(psOut, pDrawable->x, pDrawable->y); - PsOut_Color(psOut, PsGetPixelColor(cMap, pGC->fgPixel)); - if (!firec->size) - PsOut_FreeType_TextAttrsMtx16(psOut, firec->ftir->download_ps_name, firec->mtx, firec->ftir->is_iso_encoding); - else - PsOut_FreeType_TextAttrs16(psOut, firec->ftir->download_ps_name, firec->size, firec->ftir->is_iso_encoding); - PsOut_FreeType_Text16(pGC->font, psOut, x, y, string, count); - - return x; - } - else -#endif /* XP_USE_FREETYPE */ - if (firec->ftir->downloadableFont && - (firec->ftir->font_type != PSFTI_FONT_TYPE_FREETYPE)) - { - PsOutPtr psOut; - ColormapPtr cMap; - unsigned short c, - c_hiByte, - c_lowByte, - fontPage; - int i; - - if( PsUpdateDrawableGC(pGC, pDrawable, &psOut, &cMap)==FALSE ) - return x; - - PsOut_DownloadType1(psOut, "PsPolyText16", - firec->ftir->download_ps_name, firec->ftir->filename); - firec->ftir->alreadyDownloaded[fontPage] = True; - - PsOut_Offset(psOut, pDrawable->x, pDrawable->y); - PsOut_Color(psOut, PsGetPixelColor(cMap, pGC->fgPixel)); - if (!firec->size) - PsOut_TextAttrsMtx(psOut, firec->ftir->download_ps_name, firec->mtx, firec->ftir->is_iso_encoding); - else - PsOut_TextAttrs(psOut, firec->ftir->download_ps_name, firec->size, firec->ftir->is_iso_encoding); - PsOut_Text16(psOut, x, y, string, count, -1); - - return x; - } - - /* Render glyphs as bitmaps */ - { - unsigned long n, i; - int w; - CharInfoPtr charinfo[255]; /* encoding only has 1 byte for count */ - - GetGlyphs(pGC->font, (unsigned long)count, (unsigned char *)string, - (FONTLASTROW(pGC->font) == 0) ? Linear16Bit : TwoD16Bit, - &n, charinfo); - w = 0; - for (i=0; i < n; i++) - w += charinfo[i]->metrics.characterWidth; - if (n != 0) - PsPolyGlyphBlt(pDrawable, pGC, x, y, n, charinfo, FONTGLYPHS(pGC->font)); - x += w; - - return x; - } - } - return x; -} - -void -PsImageText8( - DrawablePtr pDrawable, - GCPtr pGC, - int x, - int y, - int count, - char *string) -{ - if( pDrawable->type==DRAWABLE_PIXMAP ) - { - DisplayElmPtr elm; - PixmapPtr pix = (PixmapPtr)pDrawable; - PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pix->devPrivate.ptr; - DisplayListPtr disp; - GCPtr gc; - - if ((gc = PsCreateAndCopyGC(pDrawable, pGC)) == NULL) return; - - disp = PsGetFreeDisplayBlock(priv); - - elm = &disp->elms[disp->nelms]; - elm->type = TextI8Cmd; - elm->gc = gc; - elm->c.text8.x = x; - elm->c.text8.y = y; - elm->c.text8.count = count; - elm->c.text8.string = (char *)xalloc(count); - memcpy(elm->c.text8.string, string, count); - disp->nelms += 1; - } - else - { - int iso; - int siz; - float mtx[4]; - char *fnam; - PsOutPtr psOut; - ColormapPtr cMap; - - if( PsUpdateDrawableGC(pGC, pDrawable, &psOut, &cMap)==FALSE ) return; - PsOut_Offset(psOut, pDrawable->x, pDrawable->y); - PsOut_Color(psOut, PsGetPixelColor(cMap, pGC->fgPixel)); - fnam = PsGetPSFontName(pGC->font); - if( !fnam ) fnam = "Times-Roman"; - siz = PsGetFontSize(pGC->font, mtx); - iso = PsIsISOLatin1Encoding(pGC->font); - if( !siz ) PsOut_TextAttrsMtx(psOut, fnam, mtx, iso); - else PsOut_TextAttrs(psOut, fnam, siz, iso); - PsOut_Text(psOut, x, y, string, count, PsGetPixelColor(cMap, pGC->bgPixel)); - } -} - -void -PsImageText16( - DrawablePtr pDrawable, - GCPtr pGC, - int x, - int y, - int count, - unsigned short *string) -{ - if( pDrawable->type==DRAWABLE_PIXMAP ) - { - DisplayElmPtr elm; - PixmapPtr pix = (PixmapPtr)pDrawable; - PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pix->devPrivate.ptr; - DisplayListPtr disp; - GCPtr gc; - - if ((gc = PsCreateAndCopyGC(pDrawable, pGC)) == NULL) return; - - disp = PsGetFreeDisplayBlock(priv); - - elm = &disp->elms[disp->nelms]; - elm->type = TextI16Cmd; - elm->gc = gc; - elm->c.text16.x = x; - elm->c.text16.y = y; - elm->c.text16.count = count; - elm->c.text16.string = - (unsigned short *)xalloc(count*sizeof(unsigned short)); - memcpy(elm->c.text16.string, string, count*sizeof(unsigned short)); - disp->nelms += 1; - } - else - { - int i; - char *str; - if( !count ) return; - str = (char *)xalloc(count); - for( i=0 ; ifont; - width = FONTMAXBOUNDS(pfont,rightSideBearing) - - FONTMINBOUNDS(pfont,leftSideBearing); - height = FONTMAXBOUNDS(pfont,ascent) + - FONTMAXBOUNDS(pfont,descent); - - if ((width == 0) || (height == 0) ) - return; - { - int i; - w = 0; - for (i=0; i < nGlyphs; i++) w += pCharInfo[i]->metrics.characterWidth; - } - pGCtmp = GetScratchGC(1, pDrawable->pScreen); - if (!pGCtmp) - { - (*pDrawable->pScreen->DestroyPixmap)(pPixmap); - return; - } - - gcvals[0] = GXcopy; - gcvals[1] = pGC->fgPixel; - gcvals[2] = pGC->bgPixel; - - DoChangeGC(pGCtmp, GCFunction|GCForeground|GCBackground, gcvals, 0); - - - nbyLine = BitmapBytePad(width); - pbits = (unsigned char *)ALLOCATE_LOCAL(height*nbyLine); - if (!pbits){ - PsDestroyPixmap(pPixmap); - return; - } - tmpx = 0; - while(nGlyphs--) - { - pci = *pCharInfo++; - pglyph = FONTGLYPHBITS(pGlyphBase, pci); - gWidth = GLYPHWIDTHPIXELS(pci); - gHeight = GLYPHHEIGHTPIXELS(pci); - if (gWidth && gHeight) - { - nbyGlyphWidth = GLYPHWIDTHBYTESPADDED(pci); - nbyPadGlyph = BitmapBytePad(gWidth); - - if (nbyGlyphWidth == nbyPadGlyph -#if GLYPHPADBYTES != 4 - && (((int) pglyph) & 3) == 0 -#endif - ) - { - pb = pglyph; - } - else - { - for (i=0, pb = pbits; imetrics.leftSideBearing, - y - pci->metrics.ascent, gWidth, gHeight, - 0, XYBitmap, (char *)pb); - } - - x += pci->metrics.characterWidth; - } - DEALLOCATE_LOCAL(pbits); - FreeScratchGC(pGCtmp); -} diff --git a/nx-X11/programs/Xserver/Xprint/ps/PsWindow.c b/nx-X11/programs/Xserver/Xprint/ps/PsWindow.c deleted file mode 100644 index 313e51f31..000000000 --- a/nx-X11/programs/Xserver/Xprint/ps/PsWindow.c +++ /dev/null @@ -1,462 +0,0 @@ -/* $Xorg: PsWindow.c,v 1.4 2001/02/09 02:04:36 xorgcvs Exp $ */ -/* - -Copyright 1996, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* - * (c) Copyright 1996 Hewlett-Packard Company - * (c) Copyright 1996 International Business Machines Corp. - * (c) Copyright 1996 Sun Microsystems, Inc. - * (c) Copyright 1996 Novell, Inc. - * (c) Copyright 1996 Digital Equipment Corp. - * (c) Copyright 1996 Fujitsu Limited - * (c) Copyright 1996 Hitachi, Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF - * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * Except as contained in this notice, the names of the copyright holders - * shall not be used in advertising or otherwise to promote the sale, use - * or other dealings in this Software without prior written authorization - * from said copyright holders. - */ - -/******************************************************************* -** -** ********************************************************* -** * -** * File: PsWindow.c -** * -** * Contents: Window code for PS driver. -** * -** * Created By: Roger Helmendach (Liberty Systems) -** * -** * Copyright: Copyright 1996 The Open Group, Inc. -** * -** ********************************************************* -** -********************************************************************/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include - -#include "mistruct.h" -#include "regionstr.h" -#include "windowstr.h" -#include "gcstruct.h" - -#include "Ps.h" - -extern WindowPtr *WindowTable; - -/* - * The following list of strings defines the properties which will be - * placed on the screen's root window if the property was defined in - * the start-up configuration resource database. - */ -static char *propStrings[] = { - DT_PRINT_JOB_HEADER, - DT_PRINT_JOB_TRAILER, - DT_PRINT_JOB_COMMAND, - DT_PRINT_JOB_EXEC_COMMAND, - DT_PRINT_JOB_EXEC_OPTIONS, - DT_PRINT_PAGE_HEADER, - DT_PRINT_PAGE_TRAILER, - DT_PRINT_PAGE_COMMAND, - (char *)NULL -}; - - -/* - * PsCreateWindow - watch for the creation of the root window. - * When it's created, register the screen with the print extension, - * and put the default command/header properties on it. - */ -/*ARGSUSED*/ - -Bool -PsCreateWindow(WindowPtr pWin) -{ - PsWindowPrivPtr pPriv; - -#if 0 - Bool status = Success; - ScreenPtr pScreen = pWin->drawable.pScreen; - PsScreenPrivPtr pScreenPriv = (PsScreenPrivPtr) - pScreen->devPrivates[PsScreenPrivateIndex].ptr; - PsWindowPrivPtr pWinPriv = (PsWindowPrivPtr) - pWin->devPrivates[PsWindowPrivateIndex].ptr; - - /* - * Initialize this window's private struct. - */ - pWinPriv->jobFileName = (char *)NULL; - pWinPriv->pJobFile = (FILE *)NULL; - pWinPriv->pageFileName = (char *)NULL; - pWinPriv->pPageFile = (FILE *)NULL; - - if(pWin->parent == (WindowPtr)NULL) /* root window? */ - { - Atom propName; /* type = XA_STRING */ - char *propVal; - int i; - XrmDatabase rmdb = pScreenPriv->resDB; - - /* - * Put the defaults spec'd in the config files in properties on this - * screen's root window. - */ - for(i = 0; propStrings[i] != (char *)NULL; i++) - { - if((propVal = _DtPrintGetPrinterResource(pWin, rmdb, - propStrings[i])) != - (char *)NULL) - { - propName = MakeAtom(propStrings[i], strlen(propStrings[i]), - TRUE); - ChangeWindowProperty(pWin, propName, XA_STRING, 8, - PropModeReplace, strlen(propVal), - (pointer)propVal, FALSE); - xfree(propVal); - } - } - } - - return status; -#endif - - pPriv = (PsWindowPrivPtr)pWin->devPrivates[PsWindowPrivateIndex].ptr; - pPriv->validContext = 0; - - return TRUE; -} - - -/*ARGSUSED*/ -Bool PsMapWindow(WindowPtr pWindow) -{ - return TRUE; -} - -/*ARGSUSED*/ -Bool -PsPositionWindow( - WindowPtr pWin, - int x, - int y) -{ - return TRUE; -} - -/*ARGSUSED*/ -Bool -PsUnmapWindow(WindowPtr pWindow) -{ - return TRUE; -} - -/*ARGSUSED*/ -void -PsCopyWindow( - WindowPtr pWin, - DDXPointRec ptOldOrg, - RegionPtr prgnSrc) -{ -} - -/*ARGSUSED*/ -Bool -PsChangeWindowAttributes( - WindowPtr pWin, - unsigned long mask) -{ - return TRUE; -} - - -void -PsPaintWindow( - WindowPtr pWin, - RegionPtr pRegion, - int what) -{ - int status; - WindowPtr pRoot; - -#define FUNCTION 0 -#define FOREGROUND 1 -#define TILE 2 -#define FILLSTYLE 3 -#define ABSX 4 -#define ABSY 5 -#define CLIPMASK 6 -#define SUBWINDOW 7 -#define COUNT_BITS 8 - - pointer gcval[7]; - pointer newValues [COUNT_BITS]; - - BITS32 gcmask, index, mask; - RegionRec prgnWin; - DDXPointRec oldCorner; - BoxRec box; - WindowPtr pBgWin; - GCPtr pGC; - register int i; - register BoxPtr pbox; - register ScreenPtr pScreen = pWin->drawable.pScreen; - register xRectangle *prect; - int numRects; - - gcmask = 0; - - /* - * We don't want to paint a window that has no place to put the - * PS output. - */ - if( PsGetContextFromWindow(pWin)==(XpContextPtr)NULL ) return; - - if( what==PW_BACKGROUND ) - { - switch(pWin->backgroundState) - { - case None: return; - case ParentRelative: - (*pWin->parent->drawable.pScreen->PaintWindowBackground) - (pWin->parent, pRegion, what); - return; - case BackgroundPixel: - newValues[FOREGROUND] = (pointer)pWin->background.pixel; - newValues[FILLSTYLE] = (pointer)FillSolid; - gcmask |= GCForeground | GCFillStyle; - break; - case BackgroundPixmap: - newValues[TILE] = (pointer)pWin->background.pixmap; - newValues[FILLSTYLE] = (pointer)FillTiled; - gcmask |= GCTile | GCFillStyle | GCTileStipXOrigin | GCTileStipYOrigin; - break; - } - } - else - { - if( pWin->borderIsPixel ) - { - newValues[FOREGROUND] = (pointer)pWin->border.pixel; - newValues[FILLSTYLE] = (pointer)FillSolid; - gcmask |= GCForeground | GCFillStyle; - } - else - { - newValues[TILE] = (pointer)pWin->border.pixmap; - newValues[FILLSTYLE] = (pointer)FillTiled; - gcmask |= GCTile | GCFillStyle | GCTileStipXOrigin | GCTileStipYOrigin; - } - } - - prect = (xRectangle *)ALLOCATE_LOCAL(REGION_NUM_RECTS(pRegion) * - sizeof(xRectangle)); - if( !prect ) return; - - newValues[FUNCTION] = (pointer)GXcopy; - gcmask |= GCFunction | GCClipMask; - - i = pScreen->myNum; - pRoot = WindowTable[i]; - - pBgWin = pWin; - if (what == PW_BORDER) - { - while( pBgWin->backgroundState==ParentRelative ) pBgWin = pBgWin->parent; - } - - pGC = GetScratchGC(pWin->drawable.depth, pWin->drawable.pScreen); - if( !pGC ) - { - DEALLOCATE_LOCAL(prect); - return; - } - /* - * mash the clip list so we can paint the border by - * mangling the window in place, pretending it - * spans the entire screen - */ - if( what==PW_BORDER ) - { - prgnWin = pWin->clipList; - oldCorner.x = pWin->drawable.x; - oldCorner.y = pWin->drawable.y; - pWin->drawable.x = pWin->drawable.y = 0; - box.x1 = 0; - box.y1 = 0; - box.x2 = pScreen->width; - box.y2 = pScreen->height; - REGION_INIT(pScreen, &pWin->clipList, &box, 1); - pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; - newValues[ABSX] = (pointer)(long)pBgWin->drawable.x; - newValues[ABSY] = (pointer)(long)pBgWin->drawable.y; - } - else - { - newValues[ABSX] = (pointer)0; - newValues[ABSY] = (pointer)0; - } - -/* - * XXX Backing store is turned off for the PS driver - - if( pWin->backStorage ) - (*pWin->drawable.pScreen->DrawGuarantee) (pWin, pGC, GuaranteeVisBack); - */ - - mask = gcmask; - gcmask = 0; - i = 0; - while( mask ) - { - index = lowbit (mask); - mask &= ~index; - switch(index) - { - case GCFunction: - if( (pointer)(long)pGC->alu!=newValues[FUNCTION] ) - { - gcmask |= index; - gcval[i++] = newValues[FUNCTION]; - } - break; - case GCTileStipXOrigin: - if( (pointer)(long)pGC->patOrg.x!=newValues[ABSX] ) - { - gcmask |= index; - gcval[i++] = newValues[ABSX]; - } - break; - case GCTileStipYOrigin: - if( (pointer)(long)pGC->patOrg.y!=newValues[ABSY] ) - { - gcmask |= index; - gcval[i++] = newValues[ABSY]; - } - break; - case GCClipMask: - if( (pointer)pGC->clientClipType!=(pointer)CT_NONE ) - { - gcmask |= index; - gcval[i++] = (pointer)CT_NONE; - } - break; - case GCSubwindowMode: - if( (pointer)pGC->subWindowMode!=newValues[SUBWINDOW] ) - { - gcmask |= index; - gcval[i++] = newValues[SUBWINDOW]; - } - break; - case GCTile: - if( pGC->tileIsPixel || (pointer)pGC->tile.pixmap!=newValues[TILE] ) - { - gcmask |= index; - gcval[i++] = newValues[TILE]; - } - break; - case GCFillStyle: - if( (pointer)pGC->fillStyle!=newValues[FILLSTYLE] ) - { - gcmask |= index; - gcval[i++] = newValues[FILLSTYLE]; - } - break; - case GCForeground: - if( (pointer)pGC->fgPixel!=newValues[FOREGROUND] ) - { - gcmask |= index; - gcval[i++] = newValues[FOREGROUND]; - } - break; - } - } - - if( gcmask ) DoChangeGC(pGC, gcmask, (XID *)gcval, 1); - - if( pWin->drawable.serialNumber!=pGC->serialNumber ) - ValidateGC((DrawablePtr)pWin, pGC); - - numRects = REGION_NUM_RECTS(pRegion); - pbox = REGION_RECTS(pRegion); - for( i=numRects ; --i >= 0 ; pbox++,prect++ ) - { - prect->x = pbox->x1 - pWin->drawable.x; - prect->y = pbox->y1 - pWin->drawable.y; - prect->width = pbox->x2 - pbox->x1; - prect->height = pbox->y2 - pbox->y1; - } - prect -= numRects; - (*pGC->ops->PolyFillRect)((DrawablePtr)pWin, pGC, numRects, prect); - DEALLOCATE_LOCAL(prect); - -/* - * XXX Backing store is turned off for the PS driver - - if( pWin->backStorage ) - (*pWin->drawable.pScreen->DrawGuarantee) (pWin, pGC, GuaranteeNothing); - */ - - if( what==PW_BORDER ) - { - REGION_UNINIT(pScreen, &pWin->clipList); - pWin->clipList = prgnWin; - pWin->drawable.x = oldCorner.x; - pWin->drawable.y = oldCorner.y; - pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; - } - FreeScratchGC(pGC); -} - -/*ARGSUSED*/ -Bool -PsDestroyWindow(WindowPtr pWin) -{ - return TRUE; -} diff --git a/nx-X11/programs/Xserver/Xprint/ps/psout.c b/nx-X11/programs/Xserver/Xprint/ps/psout.c deleted file mode 100644 index 376feec03..000000000 --- a/nx-X11/programs/Xserver/Xprint/ps/psout.c +++ /dev/null @@ -1,1792 +0,0 @@ -/* $Xorg: psout.c,v 1.9 2001/03/26 15:25:12 coskrey Exp $ */ -/* - -Copyright 1996, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* - * (c) Copyright 1996 Hewlett-Packard Company - * (c) Copyright 1996 International Business Machines Corp. - * (c) Copyright 1996, 2000 Sun Microsystems, Inc. All Rights Reserved. - * (c) Copyright 1996 Novell, Inc. - * (c) Copyright 1996 Digital Equipment Corp. - * (c) Copyright 1996 Fujitsu Limited - * (c) Copyright 1996 Hitachi, Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF - * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * Except as contained in this notice, the names of the copyright holders - * shall not be used in advertising or otherwise to promote the sale, use - * or other dealings in this Software without prior written authorization - * from said copyright holders. - */ - -/******************************************************************* -** -** ********************************************************* -** * -** * File: psout.c -** * -** * Contents: Code to output PostScript to file -** * -** * Created By: Roger Helmendach (Liberty Systems) -** * -** * Copyright: Copyright 1996 The Open Group, Inc. -** * -** ********************************************************* -** -********************************************************************/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include "os.h" -#define USE_PSOUT_PRIVATE 1 -#include "psout.h" -#ifdef XP_USE_FREETYPE -#include -#include FT_FREETYPE_H -#endif /* XP_USE_FREETYPE */ -/* For VENDOR_STRING and VENDOR_RELEASE */ -#include "site.h" - -extern PsElmPtr PsCloneFillElementList(int nElms, PsElmPtr elms); -extern void PsDestroyFillElementList(int nElms, PsElmPtr elms); - -/* - * Standard definitions - */ - -static char *S_StandardDefs = "\ -/d{def}bind def\ -/b{bind}bind d\ -/bd{b d}b d\ -/x{exch}bd\ -/xd{x d}bd\ -/dp{dup}bd\ -/t{true}bd\ -/f{false}bd\ -/p{pop}bd\ -/r{roll}bd\ -/c{copy}bd\ -/i{index}bd\ -/rp{repeat}bd\ -/n{newpath}bd\ -/w{setlinewidth}bd\ -/lc{setlinecap}bd\ -/lj{setlinejoin}bd\ -/sml{setmiterlimit}bd\ -/ds{setdash}bd\ -/ie{ifelse}bd\ -/len{length}bd\ -/m{moveto}bd\ -/rm{rmoveto}bd\ -/l{lineto}bd\ -/rl{rlineto}bd\ -/a{arc}bd\ -/an{arcn}bd\ -/st{stroke}bd\ -/fl{fill}bd\ -/ef{eofill}bd\ -/sp{showpage}bd\ -/cp{closepath}bd\ -/clp{clippath}bd\ -/cl{clip}bd\ -/pb{pathbbox}bd\ -/tr{translate}bd\ -/rt{rotate}bd\ -/dv{div}bd\ -/ml{mul}bd\ -/ad{add}bd\ -/ng{neg}bd\ -/scl{scale}bd\ -/sc{setrgbcolor}bd\ -/g{setgray}bd\ -/gs{gsave}bd\ -/gr{grestore}bd\ -/sv{save}bd\ -/rs{restore}bd\ -/mx{matrix}bd\ -/cm{currentmatrix}bd\ -/sm{setmatrix}bd\ -/ccm{concatmatrix}bd\ -/cc{concat}bd\ -/ff{findfont}bd\ -/mf{makefont}bd\ -/sf{setfont}bd\ -/cft{currentfont}bd\ -/fd{FontDirectory}bd\ -/sh{show}bd\ -/stw{stringwidth}bd\ -/ci{colorimage}bd\ -/ig{image}bd\ -/im{imagemask}bd\ -/cf{currentfile}bd\ -/rh{readhexstring}bd\ -/str{string}bd\ -/al{aload}bd\ -/wh{where}bd\ -/kn{known}bd\ -/stp{stopped}bd\ -/bg{begin}bd\ -/ed{end}bd\ -/fa{forall}bd\ -/pi{putinterval}bd\ -/mk{mark}bd\ -/ctm{cleartomark}bd\ -/df{definefont}bd\ -/cd{currentdict}bd\ -/db{20 dict dp bg}bd\ -/de{ed}bd\ -/languagelevel wh{p languagelevel}{1}ie\ - 1 eq{/makepattern{p}bd/setpattern{p}bd/setpagedevice{p}bd}if\ -/mp{makepattern}bd\ -/spt{setpattern}bd\ -/spd{setpagedevice}bd\ -" -#ifdef XP_USE_FREETYPE -"/trmoveto{currentfont /FontMatrix get transform rm}d" -#endif /* XP_USE_FREETYPE */ -; - -/* - * Composite definitions - * - * - * XYr - Return X/Y dpi for device - * - * XYr - * - * Cs - Coordinate setup (for origin upper left) - * - * Cs - * - * P - Draw a point - * - * P - * - * R - Add rectangle to path - * - * R - * - * Ac - Add arc to path - * - * Ac - * - * An - Add arc to path (counterclockwise) - * - * An - * - * Tf - Set font - * - * Tf - * - * Tfm - Set font with matrix - * - * Tfm - * - * T - Draw text - * - * T - * - * Tb - Draw text with background color - * - * Tb - * - * Im1 - Image 1 bit monochrome imagemask - * - * Im1 - * - * Im24 - Image 24 bit RGB color - * - * Im24 - * - * Im1t - Image 1 bit monochrome imagemask (in tile) - * - * Im1t - * - * Im24t - Image 24 bit RGB color (in tile) - * - * Im24t - */ - -static char *S_CompositeDefs = "\ -/XYr{/currentpagedevice wh\ - {p currentpagedevice dp /HWResolution kn\ - {/HWResolution get al p}{p 300 300}ie}{300 300}ie}bd\ -/Cs{dp 0 eq{0 pHt tr XYr -1 x dv 72 ml x 1 x dv 72 ml x scl}if\ - dp 1 eq{90 rt XYr -1 x dv 72 ml x 1 x dv 72 ml x scl}if\ - dp 2 eq{pWd 0 tr XYr 1 x dv 72 ml x -1 x dv 72 ml x scl}if\ - 3 eq{pHt pWd tr 90 rt XYr 1 x dv 72 ml x -1 x dv 72 ml x scl}if}bd\ -/P{gs 1 w [] 0 ds 2 c m .1 ad x .1 ad x l st gr}bd\ -/R{4 2 r m 1 i 0 rl 0 x rl ng 0 rl cp}bd\ -/Ac{mx_ cm p 6 -2 r tr 4 2 r ng scl 0 0 .5 5 3 r a mx_ sm}bd\ -/An{mx_ cm p 6 -2 r tr 4 2 r ng scl 0 0 .5 5 3 r an mx_ sm}bd\ -/ISO{dp len dict bg{1 i/FID ne{d}{p p}ie}fa\ - /Encoding ISOLatin1Encoding d cd ed df}bd\ -/iN{dp len str cvs dp len x 1 i 3 ad str 2 c c p x p dp 3 -1 r(ISO)pi}bd\ -/Tp{{x dp iN dp fd x kn{x p dp/f_ x d ff}{dp/f_ x d x ff ISO}ie x}\ - {x dp/f_ x d ff x}ie}bd\ -/Tf{Tp[x 0 0 2 i ng 0 0] dp/fm_ x d mf sf}bd\ -/Tfm{Tp 1 -1 tm1_ scl tm2_ ccm dp/fm_ x d mf sf}bd\ -/T{m sh}bd\ -/Tb{gs sc f_ ff sf cft/FontMatrix get 3 get\ - cft/FontBBox get dp 1 get x 3 get 2 i ml 3 1 r ml\ - 0 0 m 4 i stw p 4 i 4 i m fm_ cc\ - 0 2 i rl dp 0 rl 0 2 i ng rl 0 3 i rl ng 0 rl cp fl p p\ - gr T}bd\ -/Im1{6 4 r tr scl t [3 i 0 0 5 i 0 0]{cf str1 rh p} im}bd\ -/Im1rev{6 4 r tr scl f [3 i 0 0 5 i 0 0]{cf str1 rh p} im}bd\ -/Im24{gs 6 4 r tr scl 8 [3 i 0 0 5 i 0 0]{cf str3 rh p} f 3 ci}bd\ -/Im1t{6 4 r tr scl t [3 i 0 0 5 i 0 0]{} im}bd\ -/Im24t{gs 6 4 r tr scl 8 [3 i 0 0 5 i 0 0]{} f 3 ci}bd\ -/ck2{/currentpagedevice wh \ -{p dp currentpagedevice dp 3 -1 r kn \ -{x get al p 3 -1 r eq 3 1 r eq and } \ -{p p p p t}ie} \ -{p p p t}ie}bd \ -/ck1{/currentpagedevice wh \ -{p dp currentpagedevice dp 3 -1 r kn \ -{x get eq} {p p p t}ie} \ -{p p t}ie}bd \ -/mtx{scl t [3 i 0 0 5 i 0 0]}bd \ -"; - -char *pg_orient[] = {"Portrait","Landscape","Reverse Portrait","Reverse Landscape"}; -/* - * Setup definitions - */ - -static char *S_SetupDefs = "\ - /mx_ mx d\ - /im_ mx d\ - /tm1_ mx d\ - /tm2_ mx d\ - /str3 3 str d\ - /str1 1 str d\ -"; - -/******************************************************************* - * PRIVATE FUNCTIONS * - *******************************************************************/ - -void -S_Flush(PsOutPtr self) -{ - int len; - - if( self->Buf[0] == '\0' ) - return; - - len = strlen(self->Buf); - - /* Append a newline char ('\n') if there isn't one there already */ - if( self->Buf[len-1] != '\n' ) - { - self->Buf[len++] = '\n'; - self->Buf[len] = '\0'; - } - - (void)fwrite(self->Buf, len, 1, self->Fp); - - self->Buf[0] = '\0'; -} - -static void -S_Comment(PsOutPtr self, char *comment) -{ - S_Flush(self); - strcpy(self->Buf, comment); - S_Flush(self); -} - -static void -S_OutDefs(PsOutPtr self, char *defs) -{ - int i, k=0; - S_Flush(self); - memset(self->Buf, 0, sizeof(self->Buf)); - for( i=0 ; defs[i]!='\0' ;) - { - if( k>70 && (i==0 || (i && defs[i-1]!='/')) && - (defs[i]==' ' || defs[i]=='/' || defs[i]=='{') ) - { - S_Flush(self); - k = 0; - memset(self->Buf, 0, sizeof(self->Buf)); - } - if( k && self->Buf[k-1]==' ' && defs[i]==' ' ) { i++; continue; } - self->Buf[k] = defs[i]; - k++; i++; - } - S_Flush(self); -} - -void -S_OutNum(PsOutPtr self, float num) -{ - int i; - char buf[64]; - int len; - - sprintf(buf, "%.3f", num); - - /* Remove any zeros at the end */ - for( i=strlen(buf)-1 ; buf[i]=='0' ; i-- ); buf[i+1] = '\0'; - /* Remove '.' if it is the last character */ - i = strlen(buf)-1; if( buf[i]=='.' ) buf[i] = '\0'; - - len = strlen(self->Buf); - if( len > 0 ) - { - self->Buf[len++] = ' '; - self->Buf[len] = '\0'; - } - strcpy(&self->Buf[len], buf); - if( (len+i)>70 ) S_Flush(self); -} - -static void -S_OutStr(PsOutPtr self, char *txt, int txtl) -{ - int i, k; - char buf[1024]; - for( i=0,k=0 ; i=' ' && txt[i]<='~') && - txt[i]!='(' && txt[i]!=')' && txt[i]!='\\' ) - { buf[k] = txt[i]; k++; continue; } - buf[k] = '\\'; k++; - sprintf(&buf[k], "%03o", txt[i]&0xFF); - /* Skip to the end of the buffer */ - while( buf[k] != '\0' ) - k++; - } - strcat(self->Buf, "("); - i = strlen(self->Buf); - memcpy(&self->Buf[i], buf, k); - self->Buf[i+k] = '\0'; - strcat(self->Buf, ")"); - if( strlen(self->Buf)>70 ) S_Flush(self); -} - -/* Same as S_OutStr() but takes |short *| instead of |char *| */ -static void -S_OutStr16(PsOutPtr self, unsigned short *txt, int txtl) -{ - int i, k; - char buf[2048]; - for( i=0,k=0 ; i=' ' && txt[i]<='~') && - txt[i]!='(' && txt[i]!=')' && txt[i]!='\\' ) - { buf[k] = txt[i]; k++; continue; } - buf[k] = '\\'; k++; - sprintf(&buf[k], "%03o", txt[i]&0xFFFF); - /* Skip to the end of the buffer */ - while( buf[k] != '\0' ) - k++; - } - strcat(self->Buf, "("); - i = strlen(self->Buf); - memcpy(&self->Buf[i], buf, k); - self->Buf[i+k] = '\0'; - strcat(self->Buf, ")"); - if( strlen(self->Buf)>70 ) S_Flush(self); -} - -void -S_OutTok(PsOutPtr self, char *tok, int cr) -{ - int len = strlen(self->Buf); - if( len > 0 ) - { - self->Buf[len++] = ' '; - self->Buf[len] = '\0'; - } - strcpy(&self->Buf[len], tok); - if( cr ) S_Flush(self); -} - -static void -S_Color(PsOutPtr self, PsOutColor clr) -{ - int ir, ig, ib; - ir = PSOUTCOLOR_TO_REDBITS(clr); - ig = PSOUTCOLOR_TO_GREENBITS(clr); - ib = PSOUTCOLOR_TO_BLUEBITS(clr); - if( ir==ig && ig==ib ) - { S_OutNum(self, PSOUTCOLOR_BITS_TO_PSFLOAT(ir)); S_OutTok(self, "g", 1); } - else - { - S_OutNum(self, PSOUTCOLOR_BITS_TO_PSFLOAT(ir)); - S_OutNum(self, PSOUTCOLOR_BITS_TO_PSFLOAT(ig)); - S_OutNum(self, PSOUTCOLOR_BITS_TO_PSFLOAT(ib)); - S_OutTok(self, "sc", 1); - } -} - -static void -S_SetPageDevice(PsOutPtr self, int orient, int count, int plex, int res, - int wd, int ht, int isPage) -{ - float fwd = ((float)wd/(float)res)*72.; - float fht = ((float)ht/(float)res)*72.; - -#define USE_WORKAROUND_COPY_COUNT_BUG 1 - -#ifdef USE_WORKAROUND_COPY_COUNT_BUG - /* Workaround (see http://xprint.mozdev.org/bugs/show_bug.cgi?id=1861 - - * 'Need workaround for bug 1378 ...') to avoid that we print n^2 copies - * instead of n copies. - * The problem is that we use both /NumCopies here but pass the - * %copy-count% to the spooler, too. - * But we only have to use _one_ way... - * - * The final fix for bug 1378 (http://xprint.mozdev.org/bugs/show_bug.cgi?id=1378 - - * "PS DDX creates n^2 copies of a job instead of n copies") will back this - * workaround out and replace it with a better solution. - * (see mozilla.org bug 140030 - * (http://bugzilla.mozilla.org/show_bug.cgi?id=140030 - "Setting number - * of copies causes too many copies to print") for the initial report for - * this issue...) - */ - count = 1; -#endif /* USE_WORKAROUND_COPY_COUNT_BUG */ - - S_OutTok(self, "/pWd", 0); - S_OutNum(self, fwd); - S_OutTok(self, "d /pHt", 0); - S_OutNum(self, fht); - S_OutTok(self, "d", 1); - - /* - * if these are page attributes, have PostScript check to see if they - * have changed. If not, don't do setpagedevice, since it will cause - * a page flush and screw up duplex printing. Having PostScript check - * means we don't have to keep track ourselves. - */ - if(isPage) { - S_OutNum(self, (float) orient); - S_OutTok(self, "/Orientation ck1", 0); - S_OutTok(self, "pWd pHt /PageSize ck2 and not {", 1); - } - S_OutTok(self, "{db", 0); - - S_OutTok(self, "/Orientation", 0); - S_OutNum(self, (float) orient); - S_OutTok(self, " d ", 0); - S_OutTok(self, "/PageSize [pWd pHt] d", 0); - - S_OutTok(self, " de spd", 0); - /* - * save a flag to show if we failed to set orientation... determined - * by both/either Orientation and/or PageSize, use this - * later to set/not set orientation using Cs command. - */ - S_OutTok(self,"}stp /orientationFailed x d", 1); - /* - * if these are page attributes, have PostScript check to see if they - * have changed. If not, don't do setpagedevice, since it will cause - * a page flush and screw up duplex printing. Having PostScript check - * means we don't have to keep track ourselves. - */ - if(isPage) - { - S_OutTok(self,"}if",1); - - S_OutTok(self, (plex==0)?"f":"t", 0); - S_OutTok(self, "/Duplex ck1 ", 0); - - S_OutTok(self, (plex==2)?"t":"f", 0); - S_OutTok(self, "/Tumble ck1 and ", 0); - - - S_OutNum(self, (float)res); - S_OutNum(self, (float)res); - S_OutTok(self, " /HWResolution ck2 and", 0); - - if( count>1 ) - { - S_OutNum(self, (float)count); - S_OutTok(self, " /NumCopies", 0); - S_OutTok(self, " ck1 and ", 0); - } - S_OutTok(self," not {",1); - } - S_OutTok(self, "{db", 0); - - S_OutTok(self, "/Duplex ", 0); - S_OutTok(self, (plex==0)?"f":"t", 0); - S_OutTok(self, " d ", 0); - - S_OutTok(self, "/Tumble ", 0); - S_OutTok(self, (plex==2)?"t":"f", 0); - S_OutTok(self, " d ", 0); - - S_OutTok(self, " /HWResolution [", 0); - S_OutNum(self, (float)res); - S_OutNum(self, (float)res); - S_OutTok(self, "] d ", 0); - - if( count>1 ) - { - S_OutTok(self, " /NumCopies", 0); - S_OutNum(self, (float)count); - S_OutTok(self, " d ", 0); - } - S_OutTok(self, " de spd}stp p", 1); - - if(isPage) - { - S_OutTok(self, "}if", 1); - } -} - -/******************************************************************* - * PUBLIC FUNCTIONS * - *******************************************************************/ - -FILE * -PsOut_ChangeFile(PsOutPtr self, FILE *fp) -{ - FILE *nfp; - - nfp = self->Fp; - - self->Fp = fp; - - return nfp; -} - -PsOutPtr -PsOut_BeginFile(FILE *fp, char *title, int orient, int count, int plex, int res, - int wd, int ht, Bool raw) -{ - int i; - char buffer[256+32]; /* enougth space for a title with 256 chars... */ -/* - * Get ready to output PostScript header - */ - PsOutPtr psout; - psout = (PsOutPtr)xalloc(sizeof(PsOutRec)); - memset(psout, 0, sizeof(PsOutRec)); - psout->Fp = fp; - psout->isRaw = raw; - psout->pagenum = 0; - - if (!raw) { -/* - * Output PostScript header - */ - /* GhostScript will rant about the missing BoundingBox if we use - * "%!PS-Adobe-3.0 EPSF-3.0" here... */ - S_Comment(psout, "%!PS-Adobe-3.0"); -#ifdef XP_USE_FREETYPE - { - FT_Int ftmajor = 0, - ftminor = 0, - ftpatch = 0; - extern FT_Library ftypeLibrary; /* defined in xc/lib/font/FreeType/ftfuncs.c */ - - FT_Library_Version(ftypeLibrary, &ftmajor, &ftminor, &ftpatch); - sprintf(buffer, - "%%%%Creator: The X Print Server's PostScript DDX " - "(%s, release %d, FreeType version %d.%d.%d)", - VENDOR_STRING, VENDOR_RELEASE, - (int)ftmajor, (int)ftminor, (int)ftpatch); - } -#else - sprintf(buffer, - "%%%%Creator: The X Print Server's PostScript DDX (%s, release %d)", - VENDOR_STRING, VENDOR_RELEASE); -#endif /* XP_USE_FREETYPE */ - S_Comment(psout, buffer); - - if (title) - { - sprintf(buffer, "%%%%Title: %.256s", title); - S_Comment(psout, buffer); - } - S_Comment(psout, "%%EndComments"); - S_Comment(psout, "%%BeginProlog"); - S_Comment(psout, "%%BeginProcSet: XServer_PS_Functions"); - S_OutDefs(psout, S_StandardDefs); - S_OutDefs(psout, S_CompositeDefs); - S_Comment(psout, "%%EndProcSet"); - S_Comment(psout, "%%EndProlog"); - S_Comment(psout, "%%BeginSetup"); - /* set document level page attributes */ - S_SetPageDevice(psout, orient, count, plex, res, wd, ht, 0); - S_Comment(psout, "%%Pages: atend"); - S_OutDefs(psout, S_SetupDefs); - S_Comment(psout, "%%EndSetup"); - } -/* - * Initialize the structure - */ - psout->CurColor = PSOUTCOLOR_NOCOLOR; - psout->LineWidth = 1; - psout->LineCap = PsCButt; - psout->LineJoin = PsJMiter; - psout->NDashes = 0; - psout->Dashes = (int *)0; - psout->FontName = (char *)0; - psout->FontSize = 0; - psout->start_image = 0; - for( i=0 ; i<4 ; i++ ) psout->FontMtx[i] = 0.; - psout->ImageFormat = 0; - return(psout); -} - -void -PsOut_EndFile(PsOutPtr self, int closeFile) -{ - char coms[50]; - int i; - - if (!self) - return; - - if (!self->isRaw) { - S_Comment(self,"%%Trailer"); - sprintf(coms,"%%%%Pages: %d", self->pagenum); - S_Comment(self, coms); - S_Comment(self, "%%EOF"); - } - if( self->NDashes && self->Dashes ) xfree(self->Dashes); - if( self->FontName ) xfree(self->FontName); - if( self->Patterns ) xfree(self->Patterns); - if( self->Clip.rects ) xfree(self->Clip.rects); - if( closeFile ) fclose(self->Fp); - xfree(self); -} - -void -PsOut_BeginPage(PsOutPtr self, int orient, int count, int plex, int res, - int wd, int ht) -{ - char coms[50]; - -/*** comment for pagenumbers *****/ - - S_Comment(self,"%%PageHeader"); - self->pagenum++; - sprintf(coms,"%%%%Page: %d %d", self->pagenum, self->pagenum); - S_Comment(self, coms); - sprintf(coms,"%%%%PageOrientation: %s",pg_orient[orient]); - S_Comment(self, coms); - -/*** end comment *****************/ - - /* set page level page attributes */ - S_SetPageDevice(self, orient, count, plex, res, wd, ht, 1); - - S_OutTok(self, "gs ", 0); - /* - * check to see if we set orientation already; if it wasn't set, - * use Cs to set orientation here. - */ - S_OutNum(self, (float)orient); - S_OutTok(self, "orientationFailed { ", 0); - S_OutNum(self, (float)orient); - S_OutTok(self, " } { 0 }ie Cs 100 sml gs", 1); -} - -void -PsOut_EndPage(PsOutPtr self) -{ - S_OutTok(self, "gr gr sp", 1); - - /* did grestore: mark attributes 'dirty' so they will be re-sent */ - PsOut_DirtyAttributes(self); - -/*** comment for pagenumbers *****/ - - S_Comment(self,"%%PageTrailer"); - -/*** end comment *****************/ -} - -void -PsOut_DirtyAttributes(PsOutPtr self) -{ - int i; - self->CurColor = PSOUTCOLOR_NOCOLOR; - self->LineWidth = -1; - self->LineCap = (PsCapEnum)-1; - self->LineJoin = (PsJoinEnum)-1; - self->NDashes = -1; - self->FontSize = -1; - for( i=0 ; i<4 ; i++ ) self->FontMtx[i] = -1.; - if( self->Dashes ) { xfree(self->Dashes); self->Dashes = (int *)0; } - if( self->FontName ) { xfree(self->FontName); self->FontName = (char *)0; } -} - -void -PsOut_Comment(PsOutPtr self, char *comment) -{ - S_Comment(self, comment); -} - -void -PsOut_Offset(PsOutPtr self, int x, int y) -{ - self->XOff = x; - self->YOff = y; -} - -void -PsOut_Clip(PsOutPtr self, int clpTyp, PsClipPtr clpinf) -{ - int i, k; - int changed = 0; - int xo = self->XOff; - int yo = self->YOff; - - if( self->InTile ) return; - if( self->InFrame ) xo = yo = 0; - if( clpTyp!=self->ClipType ) changed = 1; - else - { - if( clpinf->nRects!=self->Clip.nRects ) changed = 1; - else - { - if( clpinf->nOutterClips!=self->Clip.nOutterClips ) changed = 1; - else - { - for( i=0 ; inOutterClips ; i++ ) - { - if( memcmp(&clpinf->outterClips[i], &self->Clip.outterClips[i], - sizeof(PsRectRec))!=0 ) break; - } - if( inOutterClips ) changed = 1; - else - { - for( i=0 ; inRects ; i++ ) - { - if( memcmp(&clpinf->rects[i], &self->Clip.rects[i], - sizeof(PsRectRec))!=0 ) { changed = 1; break; } - } - } - } - } - if( clpinf->nElms!=self->Clip.nElms ) changed = 1; - else - { - for( i=0 ; inElms ; i++ ) - { - if( clpinf->elms[i].type!=PSOUT_POINTS ) - { - if( memcmp(&clpinf->elms[i], &self->Clip.elms[i], - sizeof(PsElmRec))!=0 ) { changed = 1; break; } - } - else - { - if( clpinf->elms[i].type!=self->Clip.elms[i].type || - clpinf->elms[i].nPoints!=self->Clip.elms[i].nPoints ) - { changed = 1; break; } - else - { - for( k=0 ; kelms[i].nPoints ; k++ ) - { - if( memcmp(&clpinf->elms[i].c.points[k], - &self->Clip.elms[i].c.points[k], sizeof(PsPointRec)) ) - { changed = 1; break; } - } - if( changed ) break; - } - } - } - } - } - - if( self->Clip.rects ) xfree(self->Clip.rects); - if( self->Clip.outterClips ) xfree(self->Clip.outterClips); - if( self->Clip.elms ) - PsDestroyFillElementList(self->Clip.nElms, self->Clip.elms); - self->ClipType = clpTyp; - self->Clip.nRects = clpinf->nRects; - self->Clip.nElms = clpinf->nElms; - self->Clip.nOutterClips = clpinf->nOutterClips; - if( clpinf->nRects ) - { - self->Clip.rects = (PsRectPtr)xalloc(clpinf->nRects*sizeof(PsRectRec)); - memcpy(self->Clip.rects, clpinf->rects, clpinf->nRects*sizeof(PsRectRec)); - } - else self->Clip.rects = 0; - if( clpinf->nOutterClips ) - { - self->Clip.outterClips = (PsRectPtr)xalloc(clpinf->nOutterClips* - sizeof(PsRectRec)); - memcpy(self->Clip.outterClips, clpinf->outterClips, - clpinf->nOutterClips*sizeof(PsRectRec)); - } - else self->Clip.outterClips = 0; - if( clpinf->nElms ) - self->Clip.elms = PsCloneFillElementList(clpinf->nElms, clpinf->elms); - else self->Clip.elms = 0; - - PsOut_DirtyAttributes(self); - S_OutTok(self, "gr gs", 1); - if( self->Clip.nOutterClips ) - { - for( i=0 ; iClip.nOutterClips ; i++ ) - { - S_OutNum(self, (float)(self->Clip.outterClips[i].x)); - S_OutNum(self, (float)(self->Clip.outterClips[i].y)); - S_OutNum(self, (float)self->Clip.outterClips[i].w); - S_OutNum(self, (float)self->Clip.outterClips[i].h); - S_OutTok(self, "R", 1); - } - S_OutTok(self, "cl n", 1); - } - if( self->Clip.nRects ) - { - for( i=0 ; iClip.nRects ; i++ ) - { - S_OutNum(self, (float)(self->Clip.rects[i].x+xo)); - S_OutNum(self, (float)(self->Clip.rects[i].y+yo)); - S_OutNum(self, (float)self->Clip.rects[i].w); - S_OutNum(self, (float)self->Clip.rects[i].h); - S_OutTok(self, "R", 1); - } - S_OutTok(self, "cl n", 1); - } - if( self->Clip.nElms ) - { - PsElmPtr elm = self->Clip.elms; - for( i=0 ; iClip.nElms ; i++,elm++ ) - { - switch(elm->type) - { - case PSOUT_POINTS: - for( k=0 ; knPoints ; k++ ) - { - S_OutNum(self, (float)elm->c.points[k].x+xo); - S_OutNum(self, (float)elm->c.points[k].y+yo); - if( k==0 ) S_OutTok(self, "m", 0); - else S_OutTok(self, "l", 0); - } - S_OutTok(self, "cp", 1); - break; - case PSOUT_RECT: - S_OutNum(self, (float)elm->c.rect.x+xo); - S_OutNum(self, (float)elm->c.rect.y+yo); - S_OutNum(self, (float)elm->c.rect.w); - S_OutNum(self, (float)elm->c.rect.h); - S_OutTok(self, "R", 1); - break; - case PSOUT_ARC: - if( elm->c.arc.style==PsPieSlice ) - { - S_OutNum(self, (float)elm->c.arc.x+xo+(float)elm->c.arc.w/2.); - S_OutNum(self, (float)elm->c.arc.y+yo+(float)elm->c.arc.h/2.); - S_OutTok(self, "m", 0); - } - S_OutNum(self, (float)elm->c.arc.x+xo+(float)elm->c.arc.w/2.); - S_OutNum(self, (float)elm->c.arc.y+yo+(float)elm->c.arc.h/2.); - S_OutNum(self, (float)elm->c.arc.w); - S_OutNum(self, (float)elm->c.arc.h); - S_OutNum(self, (float)elm->c.arc.a1/64.); - S_OutNum(self, (float)elm->c.arc.a1/64.+(float)elm->c.arc.a2/64.); - if( elm->c.arc.a2<0 ) S_OutTok(self, "An cp", 1); - else S_OutTok(self, "Ac cp", 1); - break; - } - } - S_OutTok(self, "cl n", 1); - } -} - -void -PsOut_Color(PsOutPtr self, PsOutColor clr) -{ - if( clr==self->CurColor || self->InTile>=PsStip ) return; - self->CurColor = clr; - S_Color(self, clr); -} - -void -PsOut_FillRule(PsOutPtr self, PsRuleEnum rule) -{ - self->FillRule = rule; -} - -void -PsOut_LineAttrs(PsOutPtr self, int wd, PsCapEnum cap, PsJoinEnum join, - int nDsh, int *dsh, int dshOff, PsOutColor bclr) -{ - int i; - int same = 1; - - if( wd!=self->LineWidth && wd>=0 ) - { - if( wd==0 ) wd = 1; - self->LineWidth = wd; - S_OutNum(self, (float)wd); S_OutTok(self, "w", 1); - } - if( cap!=self->LineCap ) - { - self->LineCap = cap; - S_OutNum(self, (float)cap); S_OutTok(self, "lc", 1); - } - if( join!=self->LineJoin ) - { - self->LineJoin = join; - S_OutNum(self, (float)join); S_OutTok(self, "lj", 1); - } - if( nDsh!=self->NDashes ) same = 0; - else if( dshOff!=self->DashOffset ) same = 0; - else if( nDsh ) - { - for( i=0 ; iDashes[i] ) break; } - if( iNDashes && self->Dashes ) - { xfree(self->Dashes); self->Dashes = (int *)0; } - self->NDashes = nDsh; - self->DashOffset = dshOff; - if( nDsh ) self->Dashes = (int *)xalloc(sizeof(int)*nDsh); - S_OutTok(self, "[", 0); - for( i=0 ; iDashes[i] = dsh[i]; - S_OutNum(self, (float)dsh[i]); - } - S_OutTok(self, "]", 0); - S_OutNum(self, (float)dshOff); - S_OutTok(self, "ds", 1); - } - - if( nDsh ) - self->LineBClr = bclr; - else - bclr = PSOUTCOLOR_NOCOLOR; -} - -void -PsOut_TextAttrs(PsOutPtr self, char *fnam, int siz, int iso) -{ - int i; - char buf[256]; - if( self->FontName && strcmp(fnam, self->FontName)==0 && - siz==self->FontSize ) return; - if( self->FontName ) xfree(self->FontName); - self->FontName = (char *)xalloc(strlen(fnam)+1); - strcpy(self->FontName, fnam); - self->FontSize = siz; - for( i=0 ; i<4 ; i++ ) self->FontMtx[i] = -1.; - strcpy(buf, "/"); strcat(buf, fnam); - S_OutTok(self, buf, 0); - S_OutNum(self, (float)siz); - if( iso ) S_OutTok(self, "t", 0); - else S_OutTok(self, "f", 0); - S_OutTok(self, "Tf", 1); -} - -void -PsOut_TextAttrsMtx(PsOutPtr self, char *fnam, float *mtx, int iso) -{ - int i; - char buf[256]; - if( self->FontName && strcmp(fnam, self->FontName)==0 && - mtx[0]==self->FontMtx[0] && mtx[1]==self->FontMtx[1] && - mtx[2]==self->FontMtx[2] && mtx[3]==self->FontMtx[3] ) return; - if( self->FontName ) xfree(self->FontName); - self->FontName = (char *)xalloc(strlen(fnam)+1); - strcpy(self->FontName, fnam); - for( i=0 ; i<4 ; i++ ) self->FontMtx[i] = mtx[i]; - self->FontSize = -1; - strcpy(buf, "/"); strcat(buf, fnam); strcat(buf, " ["); - S_OutTok(self, buf, 0); - for( i=0 ; i<4 ; i++ ) S_OutNum(self, mtx[i]); - S_OutTok(self, "0 0]", 0); - if( iso ) S_OutTok(self, "t", 0); - else S_OutTok(self, "f", 0); - S_OutTok(self, "Tfm", 1); -} - -void -PsOut_Polygon(PsOutPtr self, int nPts, PsPointPtr pts) -{ - int i; - int xo = self->XOff; - int yo = self->YOff; - - if( self->InFrame || self->InTile ) xo = yo = 0; - if( nPts<=2 ) return; - for( i=0 ; iFillRule==PsEvenOdd ) S_OutTok(self, "cp ef", 1); - else S_OutTok(self, "cp fl", 1); -} - -void -PsOut_FillRect(PsOutPtr self, int x, int y, int w, int h) -{ - int xo = self->XOff; - int yo = self->YOff; - - if( self->InFrame || self->InTile ) xo = yo = 0; - x += xo; y += yo; - S_OutNum(self, (float)x); - S_OutNum(self, (float)y); - S_OutNum(self, (float)w); - S_OutNum(self, (float)h); - S_OutTok(self, "R fl", 1); -} - -void -PsOut_FillArc(PsOutPtr self, int x, int y, int w, int h, - float ang1, float ang2, PsArcEnum style) -{ - int xo = self->XOff; - int yo = self->YOff; - - if( self->InFrame || self->InTile ) xo = yo = 0; - x += xo; y += yo; - if( style==PsPieSlice ) - { - S_OutNum(self, (float)x+(float)w/2.); - S_OutNum(self, (float)y+(float)h/2.); - S_OutTok(self, "m", 0); - } - S_OutNum(self, (float)x+(float)w/2.); - S_OutNum(self, (float)y+(float)h/2.); - S_OutNum(self, (float)w); - S_OutNum(self, (float)h); - S_OutNum(self, ang1); - S_OutNum(self, ang1+ang2); - if( ang2<0 ) S_OutTok(self, "An cp fl", 1); - else S_OutTok(self, "Ac cp fl", 1); -} - -void -PsOut_Lines(PsOutPtr self, int nPts, PsPointPtr pts) -{ - int i; - int xo = self->XOff; - int yo = self->YOff; - - if( self->InFrame || self->InTile ) xo = yo = 0; - if( nPts<1 ) return; - for( i=0 ; iLineBClr != PSOUTCOLOR_NOCOLOR ) - { - S_OutTok(self, "gs", 0); - S_Color(self, self->LineBClr); - S_OutTok(self, "[] 0 ds st gr", 0); - } - S_OutTok(self, "st", 1); -} - -void -PsOut_Points(PsOutPtr self, int nPts, PsPointPtr pts) -{ - int i; - int xo = self->XOff; - int yo = self->YOff; - - if( self->InFrame || self->InTile ) xo = yo = 0; - if( nPts<1 ) return; - for( i=0 ; iXOff; - int yo = self->YOff; - - if( self->InFrame || self->InTile ) xo = yo = 0; - x += xo; y += yo; - S_OutNum(self, (float)x); - S_OutNum(self, (float)y); - S_OutNum(self, (float)w); - S_OutNum(self, (float)h); - S_OutTok(self, "R", 0); - if( self->LineBClr != PSOUTCOLOR_NOCOLOR ) - { - S_OutTok(self, "gs", 0); - S_Color(self, self->LineBClr); - S_OutTok(self, "[] 0 ds st gr", 0); - } - S_OutTok(self, "st", 1); -} - -void -PsOut_DrawArc(PsOutPtr self, int x, int y, int w, int h, - float ang1, float ang2) -{ - int xo = self->XOff; - int yo = self->YOff; - - if( self->InFrame || self->InTile ) xo = yo = 0; - x += xo; y += yo; - S_OutNum(self, (float)x+(float)w/2.); - S_OutNum(self, (float)y+(float)h/2.); - S_OutNum(self, (float)w); - S_OutNum(self, (float)h); - S_OutNum(self, ang1); - S_OutNum(self, ang1+ang2); - if( ang2<0 ) S_OutTok(self, "An", 0); - else S_OutTok(self, "Ac", 0); - if( self->LineBClr != PSOUTCOLOR_NOCOLOR ) - { - S_OutTok(self, "gs", 0); - S_Color(self, self->LineBClr); - S_OutTok(self, "[] 0 ds st gr", 0); - } - S_OutTok(self, "st", 1); -} - -void -PsOut_Text(PsOutPtr self, int x, int y, char *text, int textl, PsOutColor bclr) -{ - int xo = self->XOff; - int yo = self->YOff; - - if( self->InFrame || self->InTile ) xo = yo = 0; - x += xo; y += yo; - S_OutStr(self, text, textl); - S_OutNum(self, (float)x); - S_OutNum(self, (float)y); - if( bclr == PSOUTCOLOR_NOCOLOR ) - S_OutTok(self, "T", 1); - else - { - int ir = PSOUTCOLOR_TO_REDBITS(bclr); - int ig = PSOUTCOLOR_TO_GREENBITS(bclr); - int ib = PSOUTCOLOR_TO_BLUEBITS(bclr); - - S_OutNum(self, PSOUTCOLOR_BITS_TO_PSFLOAT(ir)); - S_OutNum(self, PSOUTCOLOR_BITS_TO_PSFLOAT(ig)); - S_OutNum(self, PSOUTCOLOR_BITS_TO_PSFLOAT(ib)); - S_OutTok(self, "Tb", 1); - } -} - -void -PsOut_Text16(PsOutPtr self, int x, int y, unsigned short *text, int textl, PsOutColor bclr) -{ - int xo = self->XOff; - int yo = self->YOff; - - if( self->InFrame || self->InTile ) xo = yo = 0; - x += xo; y += yo; - S_OutStr16(self, text, textl); - S_OutNum(self, (float)x); - S_OutNum(self, (float)y); - if( bclr == PSOUTCOLOR_NOCOLOR ) - S_OutTok(self, "T", 1); - else - { - int ir = PSOUTCOLOR_TO_REDBITS(bclr); - int ig = PSOUTCOLOR_TO_GREENBITS(bclr); - int ib = PSOUTCOLOR_TO_BLUEBITS(bclr); - S_OutNum(self, PSOUTCOLOR_BITS_TO_PSFLOAT(ir)); - S_OutNum(self, PSOUTCOLOR_BITS_TO_PSFLOAT(ig)); - S_OutNum(self, PSOUTCOLOR_BITS_TO_PSFLOAT(ib)); - S_OutTok(self, "Tb", 1); - } -} - -#ifdef BM_CACHE -void /* new */ -PsOut_ImageCache(PsOutPtr self, int x, int y, long cache_id, PsOutColor bclr, PsOutColor fclr) -{ - char cacheID[10]; - int xo = self->XOff; - int yo = self->YOff; - - if( self->InFrame || self->InTile ) xo = yo = 0; - x += xo; y += yo; - sprintf(cacheID, "c%di", cache_id); - - S_OutNum(self, (float)x); - S_OutNum(self, (float)y); - - if( fclr==PSOUTCOLOR_WHITE ) - { - int ir = PSOUTCOLOR_TO_REDBITS(bclr); - int ig = PSOUTCOLOR_TO_GREENBITS(bclr); - int ib = PSOUTCOLOR_TO_BLUEBITS(bclr); - - if( ir==ig && ig==ib ) - S_OutNum(self, PSOUTCOLOR_BITS_TO_PSFLOAT(ir)); - else - S_OutNum(self, (float)0); - self->RevImage = 1; - } - else - { - int ir = PSOUTCOLOR_TO_REDBITS(fclr); - int ig = PSOUTCOLOR_TO_GREENBITS(fclr); - int ib = PSOUTCOLOR_TO_BLUEBITS(fclr); - - if( ir==ig && ig==ib ) - S_OutNum(self, PSOUTCOLOR_BITS_TO_PSFLOAT(ir)); - else - S_OutNum(self, (float)0); - } - - S_OutTok(self, cacheID, 1); -} /* new */ - -void /* new */ -PsOut_BeginImageCache(PsOutPtr self, long cache_id) -{ - char cacheID[10]; - - sprintf(cacheID, "/c%di {", cache_id); - - S_OutTok(self, cacheID, 0); -} /* new */ - -void /* new */ -PsOut_EndImageCache(PsOutPtr self) -{ - S_OutTok(self, "}bd", 1); -} /* new */ -#endif - -void -PsOut_BeginImage(PsOutPtr self, PsOutColor bclr, PsOutColor fclr, int x, int y, - int w, int h, int sw, int sh, int format) -{ - PsOutColor savClr = self->CurColor; - int xo = self->XOff; - int yo = self->YOff; - - if( self->InFrame || self->InTile ) xo = yo = 0; - x += xo; y += yo; - if( self->InTile ) - { - if( self->InTile>=PsStip && format!=1 ) { self->ImgSkip = 1; return; } - self->ImgBClr = bclr; self->ImgFClr = fclr; - self->ImgX = x; self->ImgY = y; - self->ImgW = w; self->ImgH = h; - self->SclW = sw; self->SclH = sh; - S_OutTok(self, "<", 0); - self->ImageFormat = format; - self->RevImage = 0; - if( self->InTile==PsTile && format==1 && fclr==PSOUTCOLOR_WHITE ) - self->RevImage = 1; - return; - } - - self->RevImage = 0; - if( format==1 ) - { - S_OutTok(self, "gs", 0); - if( fclr==PSOUTCOLOR_WHITE ) - { - PsOut_Color(self, fclr); - PsOut_FillRect(self, x, y, sw, sh); - PsOut_Color(self, bclr); - self->RevImage = 1; - } - else - { - PsOut_Color(self, bclr); - PsOut_FillRect(self, x, y, sw, sh); - PsOut_Color(self, fclr); - } - } - S_OutNum(self, (float)x); - S_OutNum(self, (float)y); - S_OutNum(self, (float)w); - S_OutNum(self, (float)h); - S_OutNum(self, (float)sw); - S_OutNum(self, (float)sh); - if( format==1 ) { - if(self->RevImage) - S_OutTok(self, "Im1rev", 1); - else - S_OutTok(self, "Im1", 1); - } - else S_OutTok(self, "Im24", 1); - self->ImageFormat = format; - self->CurColor = savClr; -} - -void -PsOut_BeginImageIM(PsOutPtr self, PsOutColor bclr, PsOutColor fclr, int x, int y, - int w, int h, int sw, int sh, int format) -{ - PsOutColor savClr = self->CurColor; - int xo = self->XOff; - int yo = self->YOff; - - if( self->InFrame || self->InTile ) xo = yo = 0; - x += xo; y += yo; - if( self->InTile ) - { - if( self->InTile>=PsStip && format!=1 ) { self->ImgSkip = 1; return; } - self->ImgBClr = bclr; self->ImgFClr = fclr; - self->ImgX = x; self->ImgY = y; - self->ImgW = w; self->ImgH = h; - self->SclW = sw; self->SclH = sh; - S_OutTok(self, "<", 0); - self->ImageFormat = format; - self->RevImage = 0; - if( self->InTile==PsTile && format==1 && fclr==PSOUTCOLOR_WHITE ) - self->RevImage = 1; - return; - } - - self->RevImage = 0; - if( format==1 ) - { - S_OutTok(self, "gs", 0); -#ifdef BM_CACHE - S_OutTok(self, "g", 1); -#else - if( fclr==PSOUTCOLOR_WHITE ) - { - PsOut_Color(self, bclr); - self->RevImage = 1; - } - else - { - PsOut_Color(self, fclr); - } -#endif - } - -#ifdef BM_CACHE - S_OutTok(self, "tr", 0); /* new */ -#else - S_OutNum(self, (float)x); - S_OutNum(self, (float)y); -#endif - S_OutNum(self, (float)w); - S_OutNum(self, (float)h); - S_OutNum(self, (float)sw); - S_OutNum(self, (float)sh); -#ifdef BM_CACHE - S_OutTok(self, "mtx", 1); /* new */ - S_OutTok(self, "<", 0); /* new */ - self->start_image = 1; -#else - if( format==1 ){ - if(self->RevImage) - S_OutTok(self, "Im1rev", 1); - else - S_OutTok(self, "Im1", 1); - } - else S_OutTok(self, "Im24", 1); -#endif - self->ImageFormat = format; - self->CurColor = savClr; -} - -void -PsOut_EndImage(PsOutPtr self) -{ - if( self->ImgSkip ) { self->ImgSkip = 0; return; } - if( self->InTile ) - { - S_OutTok(self, ">", 1); - if( self->ImageFormat==1 && self->InTile==PsTile ) - { - if( self->ImgFClr==PSOUTCOLOR_WHITE ) - { - PsOut_Color(self, self->ImgFClr); - PsOut_FillRect(self, self->ImgX, self->ImgY, self->SclW, self->SclH); - PsOut_Color(self, self->ImgBClr); - } - else - { - PsOut_Color(self, self->ImgBClr); - PsOut_FillRect(self, self->ImgX, self->ImgY, self->SclW, self->SclH); - PsOut_Color(self, self->ImgFClr); - } - } - S_OutNum(self, (float)self->ImgX); - S_OutNum(self, (float)self->ImgY); - S_OutNum(self, (float)self->ImgW); - S_OutNum(self, (float)self->ImgH); - S_OutNum(self, (float)self->SclW); - S_OutNum(self, (float)self->SclH); - if( self->ImageFormat==1 ) S_OutTok(self, "Im1t", 1); - else S_OutTok(self, "Im24t", 1); - self->ImageFormat = 0; - self->RevImage = 0; - return; - } - /* - * Bug 4639307: Move flush before "> im" to get all of bitmap into ps file. - */ - S_Flush(self); -#ifdef BM_CACHE - if(self->start_image) - S_OutTok(self, "> im", 1); /* new */ -#endif - self->ImageFormat = 0; - self->RevImage = 0; -#ifdef BM_CACHE - if(self->start_image) - { - self->start_image = 0; - S_OutTok(self, "gr", 0); - } - else - S_OutTok(self, "gr", 1); -#else - S_OutTok(self, "gr", 1); -#endif -} - -void -PsOut_OutImageBytes(PsOutPtr self, int nBytes, char *bytes) -{ - int i; - int b; - int len; - const char hex[] = { '0', '1', '2', '3', '4', '5', '6', '7', - '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; - - if( (!self->ImageFormat) || self->ImgSkip ) return; - - len = strlen(self->Buf); - - for( i=0 ; iRevImage ) b = (int)((bytes[i]^0xFF)&0xFF); - else b = (int)(bytes[i]&0xFF); - - self->Buf[len++] = hex[(b&0xF0) >> 4]; - self->Buf[len++] = hex[(b&0x0F)]; - self->Buf[len] = '\0'; - - if( len>70 ) - { - S_Flush(self); - len = 0; - } - } -} - -void -PsOut_BeginFrame(PsOutPtr self, int xoff, int yoff, int x, int y, - int w, int h) -{ - int xo = self->XOff; - int yo = self->YOff; - - if( self->InFrame ) xo = yo = 0; - S_OutTok(self, "gs", 0); - S_OutNum(self, (float)(x+xo)); - S_OutNum(self, (float)(y+yo)); - S_OutNum(self, (float)w); - S_OutNum(self, (float)h); - S_OutTok(self, "R cl n", 0); - xoff += xo; yoff += yo; - if( xoff || yoff ) - { - S_OutNum(self, (float)xoff); - S_OutNum(self, (float)yoff); - S_OutTok(self, "tr", 0); - } - S_OutTok(self, "gs", 1); - self->InFrame += 1; -} - -void -PsOut_EndFrame(PsOutPtr self) -{ - self->InFrame -= 1; - if( self->InFrame<0 ) self->InFrame = 0; - S_OutTok(self, "gr gr", 1); - PsOut_DirtyAttributes(self); -} - -int -PsOut_BeginPattern(PsOutPtr self, void *tag, int w, int h, PsFillEnum type, - PsOutColor bclr, PsOutColor fclr) -{ - int i; - char key[64]; - - for( i=0 ; iNPatterns ; i++ ) - { if( self->Patterns[i].tag==tag && self->Patterns[i].type==type ) break; } - if( iNPatterns ) return(1); - if( (self->NPatterns+1)>self->MxPatterns ) - { - if( self->Patterns ) - { - self->MxPatterns *= 2; - self->Patterns = - (PsPatPtr)xrealloc(self->Patterns, sizeof(PsPatRec)*self->MxPatterns); - } - else - { - self->MxPatterns = 64; - self->Patterns = (PsPatPtr)xalloc(sizeof(PsPatRec)*self->MxPatterns); - } - } - self->Patterns[self->NPatterns].tag = tag; - self->Patterns[self->NPatterns].type = type; - sprintf(key, "/ %d", (int)tag); - switch(type) { - case PsTile: key[1] = 't'; break; - case PsStip: key[1] = 's'; break; - case PsOpStip: key[1] = 'o'; break; } - S_OutTok(self, key, 0); - S_OutTok(self, "db/PatternType 1 d/PaintType 1 d", 0); - S_OutTok(self, "/TilingType 1 d/BBox[0 0", 0); - S_OutNum(self, (float)w); - S_OutNum(self, (float)h); - S_OutTok(self, "]d/XStep", 0); - S_OutNum(self, (float)w); - S_OutTok(self, "d/YStep", 0); - S_OutNum(self, (float)h); - S_OutTok(self, "d/PaintProc{bg sv", 1); - if( type==PsOpStip ) - { - S_Color(self, bclr); - S_OutTok(self, "0 0", 0); - S_OutNum(self, (float)w); - S_OutNum(self, (float)h); - S_OutTok(self, "R fl", 1); - } - if( type!=PsTile ) S_Color(self, fclr); - self->NPatterns += 1; - self->InTile = type; - return(0); -} - -void -PsOut_EndPattern(PsOutPtr self) -{ - self->InTile = PsSolid; - S_OutTok(self, "rs ed}d de im_ mp d", 1); -} - -void -PsOut_SetPattern(PsOutPtr self, void *tag, PsFillEnum type) -{ - int i; - char key[64]; - - for( i=0 ; iNPatterns ; i++ ) - { if( tag==self->Patterns[i].tag && type==self->Patterns[i].type ) break; } - if( i>=self->NPatterns ) return; - sprintf(key, " %d", (int)tag); - switch(type) { - case PsTile: key[0] = 't'; break; - case PsStip: key[0] = 's'; break; - case PsOpStip: key[0] = 'o'; break; } - S_OutTok(self, key, 0); - S_OutTok(self, "spt", 1); - self->CurColor = PSOUTCOLOR_NOCOLOR; -} - -void -PsOut_RawData(PsOutPtr self, char *data, int len) -{ - S_Flush(self); - if (!ferror(self->Fp)) { - (void) fwrite(data, 1, len, self->Fp); - } -} - -typedef enum PsDownfontFontType_ -{ - PsDFT_Type1PFA=0, - PsDFT_Type1PFB, - PsDFT_TrueType /* not implemented yet */ -} PsDownfontFontType; - -/* Download a PS Type1 font */ -int -PsOut_DownloadType1(PsOutPtr self, const char *auditmsg, const char *name, const char *fname) -{ - int i; - int stt; - char buf[256]; - FILE *fp; - PsDownfontFontType type; - - fp = fopen(fname, "r"); - if( !fp ) - return 0; - -#ifdef DEBUG_gisburn - /* This should be log-able! */ - fprintf(stderr, "PsOut_DownloadType1: %s: Downloading '%s' from '%s'\n", auditmsg, name, fname); -#endif /* DEBUG_gisburn */ - - fread(buf, 32, 1, fp); - fseek(fp, (long)0, 0); - - /* Is this a Adobe PostScript Type 1 binary font (PFB) ? */ - if( (buf[0]&0xFF)==0x80 && (buf[1]&0xFF)==0x01 ) - { - type = PsDFT_Type1PFB; - } - /* Is this a Adobe PostScript ASCII font (PFA) ? */ - else if (!strncmp(buf, "%!PS-AdobeFont", 14)) - { - type = PsDFT_Type1PFA; - } - else - { - /* This should be log-able! */ - fprintf(stderr, "PsOut_DownloadType1: Unknown font type for '%s'\n", fname); - return 0; - } - - S_Flush(self); - sprintf(buf, "%%%%BeginFont: %s", name); - S_Comment(self, buf); - - if( type == PsDFT_Type1PFB ) - { - char *buf, - *pt; - int len, - ch, - stype; - - ch = fgetc(fp); - /* Strip out the binary headers and de-binary it */ - while( (ch&0xFF) == 0x80 ) - { - stype = fgetc(fp); - if( stype==3 ) /* eof mark */ - break; - len = fgetc(fp); - len |= fgetc(fp)<<8; - len |= fgetc(fp)<<16; - len |= fgetc(fp)<<24; - buf = (char *)xalloc(len+1); - if( stype==1 ) - { - /* Process ASCII section */ - len = fread(buf, 1, len, fp); - /* convert any lone CRs (ie Mac eol) to LFs */ - for( pt = buf ; (pt = memchr(pt, '\r', len-(pt-buf))) != NULL ; pt++ ) - { - if ( pt[1]!='\n' ) - *pt = '\n'; - } - fwrite(buf, 1, len, self->Fp); - } - else if( stype==2 ) - { - int i; - - /* Process binary section */ - len = fread(buf, 1, len, fp); - for( i=0 ; i>4)&0xf) <= 9 ) - fputc('0'+((ch>>4)&0xf), self->Fp); - else - fputc('A'-10+((ch>>4)&0xf), self->Fp); - - if( (ch&0xf) <= 9 ) - fputc('0'+(ch&0xf), self->Fp); - else - fputc('A'-10+(ch&0xf), self->Fp); - - if( (i&0x1f)==0x1f ) - fputc('\n', self->Fp); - } - } - xfree(buf); - - /* Next block... */ - ch = fgetc(fp); - } - } - /* Is this a Adobe PostScript ASCII font (PFA) ? */ - else if (type == PsDFT_Type1PFA) - { - for(;;) - { - stt = fread(buf, 1, 256, fp); - if( stt<=0 ) break; - if (!ferror(self->Fp)) { - (void) fwrite(buf, 1, stt, self->Fp); - } - if( stt<256 ) - break; - } - } - fclose(fp); - S_Flush(self); - S_Comment(self, "%%EndFont"); - - /* Success... */ - return 1; -} - - - - - - diff --git a/nx-X11/programs/Xserver/Xprint/ps/psout.h b/nx-X11/programs/Xserver/Xprint/ps/psout.h deleted file mode 100644 index 8441d8d07..000000000 --- a/nx-X11/programs/Xserver/Xprint/ps/psout.h +++ /dev/null @@ -1,335 +0,0 @@ -/* $Xorg: psout.h,v 1.6 2001/02/09 02:04:37 xorgcvs Exp $ */ -/* - -Copyright 1996, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* - * (c) Copyright 1996 Hewlett-Packard Company - * (c) Copyright 1996 International Business Machines Corp. - * (c) Copyright 1996 Sun Microsystems, Inc. - * (c) Copyright 1996 Novell, Inc. - * (c) Copyright 1996 Digital Equipment Corp. - * (c) Copyright 1996 Fujitsu Limited - * (c) Copyright 1996 Hitachi, Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF - * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * Except as contained in this notice, the names of the copyright holders - * shall not be used in advertising or otherwise to promote the sale, use - * or other dealings in this Software without prior written authorization - * from said copyright holders. - */ - -/******************************************************************* -** -** ********************************************************* -** * -** * File: psout.h -** * -** * Contents: Include file for psout.c -** * -** * Created By: Roger Helmendach (Liberty Systems) -** * -** * Copyright: Copyright 1996 The Open Group, Inc. -** * -** ********************************************************* -** -********************************************************************/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifndef _psout_ -#define _psout_ - -#include - -typedef enum PsCapEnum_ { PsCButt=0, PsCRound, PsCSquare } PsCapEnum; -typedef enum PsJoinEnum_ { PsJMiter=0, PsJRound, PsJBevel } PsJoinEnum; -typedef enum PsArcEnum_ { PsChord, PsPieSlice } PsArcEnum; -typedef enum PsRuleEnum_ { PsEvenOdd, PsNZWinding } PsRuleEnum; -typedef enum PsFillEnum_ { PsSolid=0, PsTile, PsStip, PsOpStip } PsFillEnum; - -typedef struct PsPointRec_ -{ - int x; - int y; -} PsPointRec; - -typedef PsPointRec *PsPointPtr; - -typedef struct PsRectRec_ -{ - int x; - int y; - int w; - int h; -} PsRectRec; - -typedef PsRectRec *PsRectPtr; - -typedef struct PsArcRec_ -{ - int x; - int y; - int w; - int h; - int a1; - int a2; - PsArcEnum style; -} PsArcRec; - -typedef PsArcRec *PsArcPtr; - -#define PSOUT_RECT 0 -#define PSOUT_ARC 1 -#define PSOUT_POINTS 2 - -typedef struct PsElmRec_ -{ - int type; - int nPoints; - union - { - PsRectRec rect; - PsArcRec arc; - PsPointPtr points; - } c; -} PsElmRec; - -typedef PsElmRec *PsElmPtr; - -typedef struct PsClipRec_ -{ - int nRects; - PsRectPtr rects; - int nElms; - PsElmPtr elms; - int nOutterClips; - PsRectPtr outterClips; -} PsClipRec; - -typedef PsClipRec *PsClipPtr; - -typedef enum PsFTDownloadFontType_ -{ - PsFontBitmap=0, - PsFontType1, - PsFontType3 -} PsFTDownloadFontType; - -/* Define |PsOutColor| color type which can hold one RGB value - * (note: this needs to be |signed| long/long long to represent - * special values such as |PSOUTCOLOR_NOCOLOR|) - */ -#ifdef PSOUT_USE_DEEPCOLOR -/* 64bit |PsOutColor| which can hold 16bit R-,G-,B-values */ -#ifdef WIN32 -typedef signed __int64 PsOutColor; -#else -# if defined(__alpha__) || defined(__alpha) || \ - defined(ia64) || defined(__ia64__) || \ - defined(__sparc64__) || defined(_LP64) || \ - defined(__s390x__) || \ - defined(amd64) || defined (__amd64__) || \ - defined (__powerpc64__) || \ - (defined(sgi) && (_MIPS_SZLONG == 64)) -typedef signed long PsOutColor; -# else -typedef signed long long PsOutColor; -# endif /* native 64bit platform */ -#endif /* WIN32 */ - -#define PSOUTCOLOR_TO_REDBITS(clr) ((clr) >> 32) -#define PSOUTCOLOR_TO_GREENBITS(clr) (((clr) >> 16) & 0xFFFF) -#define PSOUTCOLOR_TO_BLUEBITS(clr) ((clr) & 0xFFFF) -#define PSOUTCOLOR_BITS_TO_PSFLOAT(b) ((float)(b) / 65535.) -#define PSOUTCOLOR_WHITE (0xFFFFFFFFFFFFLL) -#define PSOUTCOLOR_NOCOLOR (-1LL) -#define PSOUTCOLOR_TO_RGB24BIT(clr) (((PSOUTCOLOR_TO_REDBITS(clr) >> 8) << 16) | \ - ((PSOUTCOLOR_TO_GREENBITS(clr) >> 8) << 8) | \ - ((PSOUTCOLOR_TO_BLUEBITS(clr) >> 8) << 0)) -#else -/* 32bit |PsOutColor| which can hold 8bit R-,G-,B-values */ -typedef signed long PsOutColor; -#define PSOUTCOLOR_TO_REDBITS(clr) ((clr) >> 16) -#define PSOUTCOLOR_TO_GREENBITS(clr) (((clr) >> 8) & 0xFF) -#define PSOUTCOLOR_TO_BLUEBITS(clr) ((clr) & 0xFF) -#define PSOUTCOLOR_BITS_TO_PSFLOAT(b) ((float)(b) / 255.) -#define PSOUTCOLOR_WHITE (0xFFFFFF) -#define PSOUTCOLOR_NOCOLOR (-1) -#define PSOUTCOLOR_TO_RGB24BIT(clr) ((PSOUTCOLOR_TO_REDBITS(clr) << 16) | \ - (PSOUTCOLOR_TO_GREENBITS(clr) << 8) | \ - (PSOUTCOLOR_TO_BLUEBITS(clr) << 0)) -#endif /* PSOUT_USE_DEEPCOLOR */ - -#ifdef USE_PSOUT_PRIVATE -typedef void *voidPtr; - -typedef struct PsPatRec_ -{ - PsFillEnum type; - voidPtr tag; -} PsPatRec; - -typedef PsPatRec *PsPatPtr; - -typedef struct PsOutRec_ -{ - FILE *Fp; - char Buf[16384]; - PsOutColor CurColor; - int LineWidth; - PsCapEnum LineCap; - PsJoinEnum LineJoin; - int NDashes; - int *Dashes; - int DashOffset; - PsOutColor LineBClr; - PsRuleEnum FillRule; - char *FontName; - int FontSize; - float FontMtx[4]; - int ImageFormat; - int RevImage; - int NPatterns; - int MxPatterns; - PsPatPtr Patterns; - int ClipType; - PsClipRec Clip; - int InFrame; - int XOff; - int YOff; - - PsFillEnum InTile; - int ImgSkip; - PsOutColor ImgBClr; - PsOutColor ImgFClr; - int ImgX; - int ImgY; - int ImgW; - int ImgH; - int SclW; - int SclH; - - Bool isRaw; - - int pagenum; - - int start_image; -} PsOutRec; - -typedef struct PsOutRec_ *PsOutPtr; - -extern void S_Flush(PsOutPtr self); -extern void S_OutNum(PsOutPtr self, float num); -extern void S_OutTok(PsOutPtr self, char *tok, int cr); -#else -typedef struct PsOutRec_ *PsOutPtr; -#endif /* USE_PSOUT_PRIVATE */ - -extern PsOutPtr PsOut_BeginFile(FILE *fp, char *title, int orient, int count, int plex, - int res, int wd, int ht, Bool raw); -extern void PsOut_EndFile(PsOutPtr self, int closeFile); -extern void PsOut_BeginPage(PsOutPtr self, int orient, int count, int plex, - int res, int wd, int ht); -extern void PsOut_EndPage(PsOutPtr self); -extern void PsOut_DirtyAttributes(PsOutPtr self); -extern void PsOut_Comment(PsOutPtr self, char *comment); -extern void PsOut_Offset(PsOutPtr self, int x, int y); - -extern void PsOut_Clip(PsOutPtr self, int clpTyp, PsClipPtr clpinf); - -extern void PsOut_Color(PsOutPtr self, PsOutColor clr); -extern void PsOut_FillRule(PsOutPtr self, PsRuleEnum rule); -extern void PsOut_LineAttrs(PsOutPtr self, int wd, PsCapEnum cap, - PsJoinEnum join, int nDsh, int *dsh, int dshOff, - PsOutColor bclr); -extern void PsOut_TextAttrs(PsOutPtr self, char *fnam, int siz, int iso); -extern void PsOut_TextAttrsMtx(PsOutPtr self, char *fnam, float *mtx, int iso); - -extern void PsOut_Polygon(PsOutPtr self, int nPts, PsPointPtr pts); -extern void PsOut_FillRect(PsOutPtr self, int x, int y, int w, int h); -extern void PsOut_FillArc(PsOutPtr self, int x, int y, int w, int h, - float ang1, float ang2, PsArcEnum style); - -extern void PsOut_Lines(PsOutPtr self, int nPts, PsPointPtr pts); -extern void PsOut_Points(PsOutPtr self, int nPts, PsPointPtr pts); -extern void PsOut_DrawRect(PsOutPtr self, int x, int y, int w, int h); -extern void PsOut_DrawArc(PsOutPtr self, int x, int y, int w, int h, - float ang1, float ang2); - -extern void PsOut_Text(PsOutPtr self, int x, int y, char *text, int textl, - PsOutColor bclr); -extern void PsOut_Text16(PsOutPtr self, int x, int y, unsigned short *text, int textl, PsOutColor bclr); - -extern void PsOut_BeginImage(PsOutPtr self, PsOutColor bclr, PsOutColor fclr, int x, int y, - int w, int h, int sw, int sh, int format); -extern void PsOut_BeginImageIM(PsOutPtr self, PsOutColor bclr, PsOutColor fclr, int x, int y, - int w, int h, int sw, int sh, int format); -extern void PsOut_EndImage(PsOutPtr self); -extern void PsOut_OutImageBytes(PsOutPtr self, int nBytes, char *bytes); - -extern void PsOut_BeginFrame(PsOutPtr self, int xoff, int yoff, int x, int y, - int w, int h); -extern void PsOut_EndFrame(PsOutPtr self); - -extern int PsOut_BeginPattern(PsOutPtr self, void *tag, int w, int h, - PsFillEnum type, PsOutColor bclr, PsOutColor fclr); -extern void PsOut_EndPattern(PsOutPtr self); -extern void PsOut_SetPattern(PsOutPtr self, void *tag, PsFillEnum type); - -extern void PsOut_RawData(PsOutPtr self, char *data, int len); - -extern int PsOut_DownloadType1(PsOutPtr self, const char *auditmsg, const char *name, const char *fname); - -extern int PsOut_DownloadFreeType1(PsOutPtr self, const char *psfontname, FontPtr pFont, long block_offset); -extern int PsOut_DownloadFreeType3(PsOutPtr self, const char *psfontname, FontPtr pFont, long block_offset); - -extern int PsOut_DownloadFreeType(PsOutPtr self, PsFTDownloadFontType downloadfonttype, const char *psfontname, FontPtr pFont, long block_offset); -extern void PsOut_Get_FreeType_Glyph_Name( char *destbuf, FontPtr pFont, unsigned long x11fontindex); -extern void PsOut_FreeType_Text(FontPtr pFont, PsOutPtr self, int x, int y, char *text, int textl); -extern void PsOut_FreeType_Text16(FontPtr pFont, PsOutPtr self, int x, int y, unsigned short *text, int textl); - -extern void PsOut_FreeType_TextAttrs16(PsOutPtr self, char *fnam, int siz, int iso); -extern void PsOut_FreeType_TextAttrsMtx16(PsOutPtr self, char *fnam, float *mtx, int iso); -#endif diff --git a/nx-X11/programs/Xserver/Xprint/ps/psout_ft.c b/nx-X11/programs/Xserver/Xprint/ps/psout_ft.c deleted file mode 100644 index 34cb6a54d..000000000 --- a/nx-X11/programs/Xserver/Xprint/ps/psout_ft.c +++ /dev/null @@ -1,335 +0,0 @@ - -/* -Copyright (c) 2003-2004 Roland Mainz - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include "os.h" -#define USE_PSOUT_PRIVATE 1 -#include "psout.h" - -#include -#include FT_FREETYPE_H -#include FT_TYPE1_TABLES_H - -#include -#include -#include -#include -#include -#include -#include "ft.h" -#define NOT_IN_FTFUNCS -#include "ftfuncs.h" -#include "servermd.h" /* needed for endian test (IMAGE_BYTE_ORDER) */ - -#define USE_FT_PS_NAMES 1 - -#ifdef USE_FT_PS_NAMES -void PsOut_Get_FreeType_Glyph_Name( char *destbuf, FontPtr pFont, unsigned long x11fontindex) -{ - FTFontPtr tf = (FTFontPtr)pFont->fontPrivate; - FT_Face ttface = tf->instance->face->face; - FT_Error error; - char buf[256]; - unsigned long ftindex; - - /* Remap X11 font index to FreeType font index */ - ftindex = FTRemap(ttface, &tf->mapping, x11fontindex); - - if( FT_Has_PS_Glyph_Names(ttface) ) - { - error = FT_Get_Glyph_Name(ttface, ftindex, buf, 64); - } - else - { - error = 1; - } - - if( error ) - { - /* Check for unicode mapping - * See Adobe document "Unicode and Glyph Names" - * (http://partners.adobe.com/asn/tech/type/unicodegn.jsp) - */ - if( (tf->mapping.mapping->type == FONT_ENCODING_UNICODE) && - (ftindex < 0xFFFE) ) - { - sprintf(buf, "uni%04lx", ftindex); - } - else - { - sprintf(buf, "ch%02lx", ftindex); - } - } - - strcpy(destbuf, buf); -} -#endif /* USE_FT_PS_NAMES */ - -int PsOut_DownloadFreeType(PsOutPtr self, PsFTDownloadFontType downloadfonttype, const char *psfontname, FontPtr pFont, long block_offset) -{ - switch(downloadfonttype) - { - case PsFontType3: - return PsOut_DownloadFreeType3(self, psfontname, pFont, block_offset); - case PsFontType1: - return PsOut_DownloadFreeType1(self, psfontname, pFont, block_offset); - default: - FatalError("PS DDX: PsOut_DownloadFreeType(downloadfonttype='%d' not implemented\n", - (int)downloadfonttype); - return 0; /* NO-OP, FatalError() will call |exit()| */ - } -} - -/* cloned from |PsOut_TextAttrs16| */ -void -PsOut_FreeType_TextAttrs16(PsOutPtr self, char *fnam, int siz, int iso) -{ - int i; - if( self->FontName && strcmp(fnam, self->FontName)==0 && - siz==self->FontSize ) return; - if( self->FontName ) xfree(self->FontName); - self->FontName = (char *)xalloc(strlen(fnam)+1); - strcpy(self->FontName, fnam); - self->FontSize = siz; - for( i=0 ; i<4 ; i++ ) self->FontMtx[i] = -1.; -} - -/* cloned from |PsOut_TextAttrsMtx16| */ -void -PsOut_FreeType_TextAttrsMtx16(PsOutPtr self, char *fnam, float *mtx, int iso) -{ - int i; - if( self->FontName && strcmp(fnam, self->FontName)==0 && - mtx[0]==self->FontMtx[0] && mtx[1]==self->FontMtx[1] && - mtx[2]==self->FontMtx[2] && mtx[3]==self->FontMtx[3] ) return; - if( self->FontName ) xfree(self->FontName); - self->FontName = (char *)xalloc(strlen(fnam)+1); - strcpy(self->FontName, fnam); - for( i=0 ; i<4 ; i++ ) self->FontMtx[i] = mtx[i]; - self->FontSize = -1; -} - -static -int FT_Get_CharcellMetricsCharacterHeight(FontPtr pFont) -{ - FTFontPtr ftfont = (FTFontPtr)pFont->fontPrivate; - - return ftfont->instance->charcellMetrics->ascent + - ftfont->instance->charcellMetrics->descent; -} - -static -int FT_Get_CharcellMetricsCharacterWidth(FontPtr pFont) -{ - FTFontPtr ftfont = (FTFontPtr)pFont->fontPrivate; - - if( ftfont->instance->spacing != FT_PROPORTIONAL ) - { - int width = ftfont->instance->charcellMetrics->characterWidth; - - /* If the font uses a matrix make sure we transform the |characterWidth| - * back to it's original value since we download the untransformed font - * and use a PostScript transformation matrix to transform the font when - * rendering the text - */ - if( ftfont->instance->transformation.nonIdentity ) - { - FT_Vector v; - - FT_Matrix m = ftfont->instance->transformation.matrix; - (void)FT_Matrix_Invert(&m); /* FixMe: We should check the return code */ - v.x = width; - v.y = FT_Get_CharcellMetricsCharacterHeight(pFont); - FT_Vector_Transform(&v, &m); - width = v.x; - } - - return width; - } - - return 0; -} - -void -PsOut_FreeType_Text(FontPtr pFont, PsOutPtr self, int x, int y, char *text, int textl) -{ - int i; - int xo = self->XOff, - yo = self->YOff; - char buf[256]; - int cwidth = FT_Get_CharcellMetricsCharacterWidth(pFont); - - if( self->InFrame || self->InTile ) xo = yo = 0; - x += xo; y += yo; - - S_OutNum(self, (float)x); - S_OutNum(self, (float)y); - S_OutTok(self, "moveto", 1); - - S_OutTok(self, "[ ", 0); - - for( i = 0 ; i < textl ; i++ ) - { -#ifdef USE_FT_PS_NAMES - char namebuf[256]; - unsigned int ch = text[i]&0xFF; - unsigned long block_offset = 0; - PsOut_Get_FreeType_Glyph_Name(namebuf, pFont, ch+block_offset); - - sprintf(buf, "/%s ", namebuf); -#else - sprintf(buf, "/ch%02x ", text[i]&0xFF); -#endif /* USE_FT_PS_NAMES */ - S_OutTok(self, buf, 0); - } - - /* Check whether we have any special spacing requirements (e.g. non-proportional fonts) ... */ - if( cwidth != 0 ) - { - /* If the we use a matrix to render the font (instead of using |self->FontSize|) - * we must apply the matrix to the "rmoveto" which is used to force the exact - * character width. The "trmoveto" macro will do that for us... - */ - if( self->FontSize == -1 ) - { - sprintf(buf, "]{gs glyphshow gr %d 0 trmoveto}fa", cwidth); - } - else - { - sprintf(buf, "]{gs glyphshow gr %d 0 rm}fa", cwidth); - } - } - else - { - sprintf(buf, "]{glyphshow}fa"); - } - S_OutTok(self, buf, 0); -} - -/* XXX: |PsOut_FreeType_Text16| should be rewritten - currently it uses lame, - * slow hacks and makes some risky assumtions about how |PsOut_Text16| - * allocates memory */ -void -PsOut_FreeType_Text16(FontPtr pFont, PsOutPtr self, int x, int y, unsigned short *text, int textl) -{ - int i; - int xo = self->XOff, - yo = self->YOff; - unsigned short c, - c_hiByte, - c_lowByte, - fontPage; - long lastFontPage = -1; - char baseFontName[256]; - char buf[256]; - - if( self->InFrame || self->InTile ) xo = yo = 0; - x += xo; y += yo; - - strcpy(baseFontName, self->FontName); - - S_OutNum(self, (float)x); - S_OutNum(self, (float)y); - S_OutTok(self, "moveto", 1); - - for( i = 0 ; i < textl ; i++ ) - { - c = text[i]; -#if IMAGE_BYTE_ORDER == LSBFirst - c_hiByte = c & 0x00FF; - c_lowByte = (c >> 8) & 0x00FF; -#elif IMAGE_BYTE_ORDER == MSBFirst - c_hiByte = (c >> 8) & 0x00FF; - c_lowByte = c & 0x00FF; -#else -#error Unsupported byte order -#endif - fontPage = c_hiByte; - - if( fontPage != lastFontPage ) - { - if( fontPage > 0 ) - { - sprintf(buf, "%s_%x", baseFontName, fontPage); - } - else - { - sprintf(buf, "%s", baseFontName); - } - - if( self->FontSize == -1 ) - { - PsOut_TextAttrsMtx(self, buf, self->FontMtx, FALSE); - } - else - { - PsOut_TextAttrs(self, buf, self->FontSize, FALSE); - } - lastFontPage = fontPage; - } - -#ifdef USE_FT_PS_NAMES - { - char namebuf[256]; - unsigned int ch = c_lowByte; - unsigned long block_offset = c_hiByte * 0x100 /* same as c_hiByte << 8 */; - int cwidth = FT_Get_CharcellMetricsCharacterWidth(pFont); - PsOut_Get_FreeType_Glyph_Name(namebuf, pFont, ch+block_offset); - - /* Check whether we have any special spacing requirements (e.g. non-proportional fonts) ... */ - if( cwidth != 0 ) - { - /* If the we use a matrix to render the font (instead of using |self->FontSize|) - * we must apply the matrix to the "rmoveto" which is used to force the exact - * character width. The "trmoveto" macro will do that for us... - */ - if( self->FontSize == -1 ) - { - sprintf(buf, "gs /%s glyphshow gr %d 0 trmoveto", namebuf, cwidth); - } - else - { - sprintf(buf, "gs /%s glyphshow gr %d 0 rm", namebuf, cwidth); - } - } - else - { - sprintf(buf, "/%s glyphshow", namebuf); - } - } -#else - sprintf(buf, "/ch%02x glyphshow", c_lowByte); -#endif /* USE_FT_PS_NAMES */ - S_OutTok(self, buf, 1); - } - - if( self->FontName ) xfree(self->FontName); - self->FontName = (char *)xalloc(strlen(baseFontName)+1); - strcpy(self->FontName, baseFontName); -} - diff --git a/nx-X11/programs/Xserver/Xprint/ps/psout_ftpstype1.c b/nx-X11/programs/Xserver/Xprint/ps/psout_ftpstype1.c deleted file mode 100644 index 19e1bde18..000000000 --- a/nx-X11/programs/Xserver/Xprint/ps/psout_ftpstype1.c +++ /dev/null @@ -1,185 +0,0 @@ - -/* -Copyright (c) 2003-2004 Roland Mainz - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include -#include - -#include "os.h" -#define USE_PSOUT_PRIVATE 1 -#include "psout.h" - -#include -#include FT_FREETYPE_H - -#include -#include -#include -#include -#include -#include -#include "ft.h" -#define NOT_IN_FTFUNCS -#include "ftfuncs.h" - -int do_debug_ft2pt1 = FALSE; -int do_enable_ft2pt1_optimizer = FALSE; - -/* Defined in ttf2pt1.c */ -int ft2pt1_main(int argc, char **argv, - FTFontPtr tf, const char *download_psfontname, unsigned long download_font_block_offset); - -/* Download FreeType outlines as PS Type1 font */ -int PsOut_DownloadFreeType1(PsOutPtr self, const char *psfontname, FontPtr pFont, long block_offset) -{ - FTFontPtr tf; - FT_Face face; - int ft2pt1_numargs = 0; - char *ft2pt1_args[40]; - char *pstype1filename_prefix; - char pstype1filename[PATH_MAX+1]; - int ft2pt1_main_retval; - pid_t childpid; - - tf = (FTFontPtr)pFont->fontPrivate; - face = tf->instance->face->face; - - /* Set debugging flags */ - do_debug_ft2pt1 = (getenv("XPRT_PSDDX_DO_DEBUG_FT2PT1") != NULL); - do_enable_ft2pt1_optimizer = (getenv("XPRT_PSDDX_DO_ENABLE_FT2PT1_OPTIMIZER") != NULL); - - if( do_debug_ft2pt1 ) - { - fprintf(stderr, "# Converting FT2 font to PS Type1 filename='%s', ttface=%lx\n", tf->instance->face->filename, (long)face); - } - - pstype1filename_prefix = tempnam(NULL, "Xprt_"); - - ft2pt1_args[ft2pt1_numargs] = "ft2pt1"; ft2pt1_numargs++; - ft2pt1_args[ft2pt1_numargs] = "-Ob"; ft2pt1_numargs++; - ft2pt1_args[ft2pt1_numargs] = "-e"; ft2pt1_numargs++; - ft2pt1_args[ft2pt1_numargs] = "-a"; ft2pt1_numargs++; - ft2pt1_args[ft2pt1_numargs] = "-Ga"; ft2pt1_numargs++; - if( do_enable_ft2pt1_optimizer ) - { - /* Scale fonts to a 1000x1000 matrix */ - ft2pt1_args[ft2pt1_numargs] = "-Ot"; ft2pt1_numargs++; - } - else - { - /* Disable the ttf2pt1 optimisations */ - ft2pt1_args[ft2pt1_numargs] = "-Ou"; ft2pt1_numargs++; - ft2pt1_args[ft2pt1_numargs] = "-Oo"; ft2pt1_numargs++; - ft2pt1_args[ft2pt1_numargs] = "-Os"; ft2pt1_numargs++; - ft2pt1_args[ft2pt1_numargs] = "-Oh"; ft2pt1_numargs++; - } - - if( !do_debug_ft2pt1 ) - { - ft2pt1_args[ft2pt1_numargs] = "-W 0"; ft2pt1_numargs++; - } - ft2pt1_args[ft2pt1_numargs] = tf->instance->face->filename; ft2pt1_numargs++; - ft2pt1_args[ft2pt1_numargs] = pstype1filename_prefix; ft2pt1_numargs++; - ft2pt1_args[ft2pt1_numargs] = NULL; - -/* XXX: ttf2pt1 has lots of leaks and global vars which are not cleaned-up - * As long this problem exists we will simply fork() and call the converter - * from the child process (all resources are free'ed when the child process - * exists) as a workaround. - */ -#define FT2PT1_NEEDS_SEPERATE_PROCESS 1 - -#ifdef FT2PT1_NEEDS_SEPERATE_PROCESS - /* Flush internal buffer and then the stdio stream before fork()! */ - S_Flush(self); - fflush(self->Fp); - - childpid = fork(); - switch(childpid) - { - case -1: - FatalError("PS DDX internal error: Cannot fork() converter child process, errno=%d\n", (int)errno); - break; - case 0: /* child */ - fclose(self->Fp); - self->Fp = NULL; - - ft2pt1_main_retval = ft2pt1_main(ft2pt1_numargs, ft2pt1_args, tf, psfontname, block_offset); - if( do_debug_ft2pt1 ) - { - fprintf(stderr, "## ft2pt1_main returned %d (child)\n", ft2pt1_main_retval); - } - exit(ft2pt1_main_retval); - break; - default: /* parent */ - waitpid(childpid, &ft2pt1_main_retval, 0); - break; - } - - if( do_debug_ft2pt1 ) - { - fprintf(stderr, "## ft2pt1_main returned %d (parent)\n", ft2pt1_main_retval); - } -#else - S_Flush(self); - - ft2pt1_main_retval = ft2pt1_main(ft2pt1_numargs, ft2pt1_args, tf, psfontname, block_offset); - if( do_debug_ft2pt1 ) - { - fprintf(stderr, "## ft2pt1_main returned %d (child)\n", ft2pt1_main_retval); - } -#endif /* FT2PT1_NEEDS_SEPERATE_PROCESS */ - - if( ft2pt1_main_retval != EXIT_SUCCESS ) - { - FatalError("PS DDX internal error while converting FreeType font '%s' to PS Type1, error=%d\n", - tf->instance->face->filename, ft2pt1_main_retval); - } - - sprintf(pstype1filename, "%s.pfa", pstype1filename_prefix); - if( do_debug_ft2pt1 ) - { - fprintf(stderr, "# Downloading converted FT2/PS Type1 filename='%s'\n", pstype1filename); - } - - PsOut_DownloadType1(self, "PsOut_DownloadFreeType1", psfontname, pstype1filename); - - if( !do_debug_ft2pt1 ) - { - unlink(pstype1filename); - } - - free(pstype1filename_prefix); - - S_Flush(self); - - return 0; -} - - diff --git a/nx-X11/programs/Xserver/Xprint/ps/psout_ftpstype3.c b/nx-X11/programs/Xserver/Xprint/ps/psout_ftpstype3.c deleted file mode 100644 index e9782e499..000000000 --- a/nx-X11/programs/Xserver/Xprint/ps/psout_ftpstype3.c +++ /dev/null @@ -1,468 +0,0 @@ - -/* -Copyright (c) 2003-2004 Roland Mainz - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include "os.h" -#define USE_PSOUT_PRIVATE 1 -#include "psout.h" - -#include -#include FT_FREETYPE_H -#include FT_TRUETYPE_TABLES_H -#include FT_BBOX_H -#include FT_GLYPH_H - -#include FT_CONFIG_CONFIG_H -#include FT_CONFIG_OPTIONS_H -#include FT_ERRORS_H -#include FT_SYSTEM_H -#include FT_IMAGE_H -#include FT_TYPES_H -#include FT_OUTLINE_H -#include FT_MODULE_H -#include FT_RENDER_H -#include FT_TYPE1_TABLES_H -#include FT_TRUETYPE_IDS_H -#include FT_TRUETYPE_TAGS_H -#include FT_CACHE_H -#include FT_CACHE_IMAGE_H -#include FT_CACHE_SMALL_BITMAPS_H -#include FT_MULTIPLE_MASTERS_H -#include FT_SFNT_NAMES_H - -#define USE_FT_INTERNALS 1 -#ifdef USE_FT_INTERNALS -#include FT_INTERNAL_TYPE1_TYPES_H -#include "t42types.h" -#include FT_INTERNAL_OBJECTS_H -#endif /* USE_FT_INTERNALS */ - -#include -#include -#include -#include -#include -#include -#include "ft.h" -#define NOT_IN_FTFUNCS -#include "ftfuncs.h" - -struct ft2info -{ - FontPtr pFont; - FTFontPtr tf; - FT_Face ttface; - struct - { - char *full_name; - char *copyright; - char *family; - char *subfamily; - char *version; - } nameid; - TT_Postscript *ttpostscript; - TT_Header *ttheader; -}; - -/* Local prototypes */ -static FT_Error PSType3_createOutlineGlyphs(FILE *out, struct ft2info *ti, unsigned long unicode, const char *psglyphname); -static int PSType3_generateOutlineFont(FILE *out, const char *psfontname, struct ft2info *ti, long block_offset); - -extern FT_Library ftypeLibrary; /* defined in xc/lib/font/FreeType/ftfuncs.c */ - -#define USE_FT_PS_NAMES 1 - -static -FT_Error PSType3_createOutlineGlyphs( FILE *out, struct ft2info *ti, unsigned long x11fontindex, const char *psglyphname ) -{ - unsigned long ftindex; - FT_BBox bbox; - FT_Error error; - FT_Outline outline; - - /* Remap X11 font index to FreeType font index */ - ftindex = FTRemap(ti->ttface, &ti->tf->mapping, x11fontindex); - - error = FT_Load_Glyph(ti->ttface, ftindex, (FT_LOAD_NO_BITMAP | FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING)); - if( error ) - { - fprintf(stderr, "PSType3_createOutlineGlyphs: FT_Load_Glyph() failure, error=%d\n", (int)error); - return error; - } - - outline = ti->ttface->glyph->outline; - - FT_Outline_Get_CBox(&outline, &bbox); - - fprintf(out, "/%s {\n", psglyphname); - fprintf(out, "%ld 0 %ld %ld %ld %ld setcachedevice\n", - (signed long)ti->ttface->glyph->metrics.horiAdvance, - (long)bbox.xMin, - (long)bbox.yMin, - (long)bbox.xMax, - (long)bbox.yMax); - - if( outline.n_contours > 0 ) - { - long i, - j, - k, k1, - cs, ce, - nguide, - contour_start, - contour_end, - last_point; - Bool first; - FT_Vector *vec; - - contour_start = ce = 0; - - vec = outline.points; - last_point = outline.n_points; - - i = j = k = 0; - first = TRUE; - - while( i <= outline.contours[outline.n_contours - 1] ) - { - contour_end = outline.contours[j]; - - if( first ) - { - fprintf(out, "%ld %ld moveto\n", vec[i].x, vec[i].y); - contour_start = i; - first = FALSE; - } - else if( outline.tags[i] & FT_CURVE_TAG_ON ) - { - fprintf(out, "%ld %ld lineto\n", vec[i].x, vec[i].y); - } - else - { - Bool finished = FALSE; - - cs = i-1; - nguide = 0; - while( !finished ) - { - if( i == contour_end+1 ) - { - ce = contour_start; - finished = TRUE; - } - else if( outline.tags[i] & FT_CURVE_TAG_ON ) - { - ce = i; - finished = TRUE; - } - else - { - i++; - nguide++; - } - } - - switch( nguide ) - { - case 0: - fprintf(out, "%ld %ld lineto\n", vec[ce].x, vec[ce].y); - break; - - case 1: - fprintf(out, "%ld %ld %ld %ld %ld %ld curveto\n", - (vec[cs].x+2*vec[cs+1].x)/3, - (vec[cs].y+2*vec[cs+1].y)/3, - (2*vec[cs+1].x+vec[ce].x)/3, - (2*vec[cs+1].y+vec[ce].y)/3, - vec[ce].x, vec[ce].y); - break; - - case 2: - fprintf(out, "%ld %ld %ld %ld %ld %ld curveto\n", - (-vec[cs].x+4*vec[cs+1].x)/3, - (-vec[cs].y+4*vec[cs+1].y)/3, - (4*vec[cs+2].x-vec[ce].x)/3, - (4*vec[cs+2].y-vec[ce].y)/3, - vec[ce].x, vec[ce].y); - break; - - case 3: - fprintf(out, "%ld %ld %ld %ld %ld %ld curveto\n", - (vec[cs].x+2*vec[cs+1].x)/3, - (vec[cs].y+2*vec[cs+1].y)/3, - (5*vec[cs+1].x+vec[cs+2].x)/6, - (5*vec[cs+1].y+vec[cs+2].y)/6, - (vec[cs+1].x+vec[cs+2].x)/2, - (vec[cs+1].y+vec[cs+2].y)/2); - - fprintf(out, "%ld %ld %ld %ld %ld %ld curveto\n", - (vec[cs+1].x+5*vec[cs+2].x)/6, - (vec[cs+1].y+5*vec[cs+2].y)/6, - (5*vec[cs+2].x+vec[cs+3].x)/6, - (5*vec[cs+2].y+vec[cs+3].y)/6, - (vec[cs+3].x+vec[cs+2].x)/2, - (vec[cs+3].y+vec[cs+2].y)/2); - - fprintf(out, "%ld %ld %ld %ld %ld %ld curveto\n", - (vec[cs+2].x+5*vec[cs+3].x)/6, - (vec[cs+2].y+5*vec[cs+3].y)/6, - (2*vec[cs+3].x+vec[ce].x)/3, - (2*vec[cs+3].y+vec[ce].y)/3, - vec[ce].x, vec[ce].y); - break; - - default: /* anything |nguide > 3| */ - k1 = cs + nguide; - - fprintf(out, "%ld %ld %ld %ld %ld %ld curveto\n", - (vec[cs].x+2*vec[cs+1].x)/3, - (vec[cs].y+2*vec[cs+1].y)/3, - (5*vec[cs+1].x+vec[cs+2].x)/6, - (5*vec[cs+1].y+vec[cs+2].y)/6, - (vec[cs+1].x+vec[cs+2].x)/2, - (vec[cs+1].y+vec[cs+2].y)/2); - - for( k = cs+2 ; k <= k1-1 ; k++ ) - { - fprintf(out, "%ld %ld %ld %ld %ld %ld curveto\n", - (vec[k-1].x+5*vec[k].x)/6, - (vec[k-1].y+5*vec[k].y)/6, - (5*vec[k].x+vec[k+1].x)/6, - (5*vec[k].y+vec[k+1].y)/6, - (vec[k].x+vec[k+1].x)/2, - (vec[k].y+vec[k+1].y)/2); - } - - fprintf(out, "%ld %ld %ld %ld %ld %ld curveto\n", - (vec[k1-1].x+5*vec[k1].x)/6, - (vec[k1-1].y+5*vec[k1].y)/6, - (2*vec[k1].x+vec[ce].x)/3, - (2*vec[k1].y+vec[ce].y)/3, - vec[ce].x, vec[ce].y); - break; - } - } - - if( i >= contour_end ) - { - fprintf(out, "closepath\n"); - first = TRUE; - i = contour_end + 1; - j++; - } - else - { - i++; - } - } - } - - fprintf(out, "fill } bind def\n"); - - return 0; -} - -#ifdef USE_FT_INTERNALS -static FT_BBox * -FT_Get_PS_Font_BBox( FT_Face face ) -{ - const char *driver_name; - FT_BBox *font_bbox = NULL; - - if ( face && face->driver && face->driver->root.clazz ) - { - driver_name = face->driver->root.clazz->module_name; - if ( ft_strcmp( driver_name, "type1" ) == 0 ) - font_bbox = &(((T1_Face)face)->type1.font_bbox); - else if ( ft_strcmp( driver_name, "t1cid" ) == 0 ) - font_bbox = &(((CID_Face)face)->cid.font_bbox); - else if ( ft_strcmp( driver_name, "type42" ) == 0 ) - font_bbox = &(((T42_Face)face)->type1.font_bbox); - } - - return font_bbox; -} -#endif /* USE_FT_INTERNALS */ - -static -int PSType3_generateOutlineFont(FILE *out, const char *psfontname, struct ft2info *ti, long block_offset) -{ - long i; - double scaler; - const int numchars = 256; -#ifdef USE_FT_PS_NAMES - int linewidth = 0; -#endif /* USE_FT_PS_NAMES */ - - fprintf(out, "%%%%BeginFont: %s\n", psfontname); - fprintf(out, "22 dict begin\n"); - fprintf(out, "/FontType 3 def\n"); - fprintf(out, "/StrokeWidth 0 def\n"); - fprintf(out, "/PaintType 0 def\n"); - fprintf(out, "/FontName (%s) def\n", psfontname); - fprintf(out, "/FontInfo 9 dict dup begin\n"); - fprintf(out, " /FullName (%s) def\n", ti->nameid.full_name?ti->nameid.full_name:psfontname); - fprintf(out, " /Notice (%s) def\n", ti->nameid.copyright?ti->nameid.copyright:"nothing here"); - fprintf(out, " /FamilyName (%s) def\n", ti->nameid.family?ti->nameid.family:psfontname); - fprintf(out, " /Weight (%s) def\n", ti->nameid.subfamily?ti->nameid.subfamily:"Regular"); - fprintf(out, " /version (%s) def\n", ti->nameid.version?ti->nameid.version:"0.1"); - - if( ti->ttpostscript ) - { - fprintf(out, " /italicAngle %.9g def\n", (double)ti->ttpostscript->italicAngle); - fprintf(out, " /underlineThickness %d def\n", (int)ti->ttpostscript->underlineThickness); - fprintf(out, " /underlinePosition %d def\n", (int)ti->ttpostscript->underlinePosition); - fprintf(out, " /isFixedPitch %s def\n", ((ti->ttpostscript->isFixedPitch)?("true"):("false"))); - } - else - { - fprintf(out, " /italicAngle %.9g def\n", 0.0); - fprintf(out, " /underlineThickness %d def\n", 100); - fprintf(out, " /underlinePosition %d def\n", 0); - fprintf(out, " /isFixedPitch false def\n"); - } - - fprintf(out, "end def\n"); - - scaler = (1000.0 / (double)ti->ttface->units_per_EM) / 1000.0; - fprintf(out, "/FontMatrix [%.9g 0 0 %.9g 0 0] def\n", scaler, scaler); - - if( ti->ttheader ) - { - fprintf(out, "/FontBBox [%d %d %d %d] def\n", - (int)ti->ttheader->xMin, - (int)ti->ttheader->yMin, - (int)ti->ttheader->xMax, - (int)ti->ttheader->yMax); - } - else - { - FT_BBox *font_bbox = FT_Get_PS_Font_BBox(ti->ttface); - fprintf(out, "/FontBBox [%d %d %d %d] def\n", - (int)font_bbox->xMin, - (int)font_bbox->yMin, - (int)font_bbox->xMax, - (int)font_bbox->yMax); - } - - fprintf(out, "/Encoding [\n"); - for( i = 0 ; i < 256 ; i++ ) - { -#ifdef USE_FT_PS_NAMES - char namebuf[256]; - PsOut_Get_FreeType_Glyph_Name(namebuf, ti->pFont, i+block_offset); - linewidth += strlen(namebuf) + 2; - fprintf(out, "/%s%s", namebuf, (linewidth > 70)?(linewidth = 0, "\n"):(" ")); -#else - fprintf(out, "/ch%02x%s", i, (((i % 10) == 9)?("\n"):(" "))); -#endif /* USE_FT_PS_NAMES */ - } - fprintf(out, "] def\n"); - - fprintf(out, "/CharProcs %d dict def CharProcs begin\n", (int)(numchars + 1)); - fprintf(out, "/.notdef {\n" - "1000 0 0 0 0 0 setcachedevice\n" - "fill } bind def\n"); - for( i = 0 ; i < numchars ; i++ ) - { - char buf[32]; -#ifdef USE_FT_PS_NAMES - char namebuf[256]; - PsOut_Get_FreeType_Glyph_Name(namebuf, ti->pFont, i+block_offset); - sprintf(buf, "%s ", namebuf); -#else - sprintf(buf, "ch%02lx ", i); -#endif /* USE_FT_PS_NAMES */ - PSType3_createOutlineGlyphs(out, ti, i+block_offset, buf); - } - fprintf(out, "end\n" - "/BuildGlyph {\n" - " exch /CharProcs get exch\n" - " 2 copy known not {pop /.notdef} if get exec } bind def\n" - "/BuildChar { 1 index /Encoding get exch get\n" - " 1 index /Encoding get exec } bind def\n"); - fprintf(out, "currentdict end /%s exch definefont pop\n", psfontname); - fprintf(out, "%%EndFont\n"); - - return 0; -} - -static -char *FT_Get_TT_NAME_ID(FT_Face ttface, int index) -{ - FT_SfntName name; - char *s; - - if( index >= FT_Get_Sfnt_Name_Count(ttface) ) - return NULL; - - FT_Get_Sfnt_Name(ttface, index, &name); - s = (char *)malloc(name.string_len+2); - if( !s ) - return NULL; - memcpy(s, (char *)name.string, name.string_len); - s[name.string_len] = '\0'; - return s; -} - -int PsOut_DownloadFreeType3(PsOutPtr self, const char *psfontname, FontPtr pFont, long block_offset) -{ - struct ft2info cft2info = { 0 }; - struct ft2info *ti = &cft2info; - - S_Flush(self); - - ti->tf = (FTFontPtr)pFont->fontPrivate; - ti->ttface = ti->tf->instance->face->face; - ti->pFont = pFont; -#ifdef DEBUG_gisburn - fprintf(stderr, "# Downloading FT2 font filename='%s', ttface=%lx\n", ti->tf->instance->face->filename, (long)ti->ttface); -#endif /* DEBUG_gisburn */ - - ti->nameid.full_name = FT_Get_TT_NAME_ID(ti->ttface, TT_NAME_ID_FULL_NAME); - ti->nameid.copyright = FT_Get_TT_NAME_ID(ti->ttface, TT_NAME_ID_COPYRIGHT); - ti->nameid.family = FT_Get_TT_NAME_ID(ti->ttface, TT_NAME_ID_FONT_FAMILY); - ti->nameid.subfamily = FT_Get_TT_NAME_ID(ti->ttface, TT_NAME_ID_FONT_SUBFAMILY); - ti->nameid.version = FT_Get_TT_NAME_ID(ti->ttface, TT_NAME_ID_VERSION_STRING); - - ti->ttheader = (TT_Header *)FT_Get_Sfnt_Table(ti->ttface, ft_sfnt_head); - ti->ttpostscript = (TT_Postscript *)FT_Get_Sfnt_Table(ti->ttface, ft_sfnt_post); - - PSType3_generateOutlineFont(self->Fp, psfontname, ti, block_offset); - - free(ti->nameid.full_name); - free(ti->nameid.copyright); - free(ti->nameid.family); - free(ti->nameid.subfamily); - free(ti->nameid.version); - - S_Flush(self); - - return 0; -} - diff --git a/nx-X11/programs/Xserver/Xprint/ps/ttf2pt1wrap.c b/nx-X11/programs/Xserver/Xprint/ps/ttf2pt1wrap.c deleted file mode 100644 index 57bb777d2..000000000 --- a/nx-X11/programs/Xserver/Xprint/ps/ttf2pt1wrap.c +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Wrapper to add missing symbol to externally supplied code - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifdef Lynx -extern int optind; -extern char *optarg; -#endif - -#include "ttf2pt1.c" diff --git a/nx-X11/programs/Xserver/Xprint/raster/Imakefile b/nx-X11/programs/Xserver/Xprint/raster/Imakefile deleted file mode 100644 index e2112c00b..000000000 --- a/nx-X11/programs/Xserver/Xprint/raster/Imakefile +++ /dev/null @@ -1,28 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:48:11 cpqbld Exp $ - -#include - -SRCS1 = Raster.c RasterAttVal.c -OBJS1 = Raster.o RasterAttVal.o - -SRCS = $(SRCS1) - -OBJS = $(OBJS1) - - INCLUDES = -I. -I$(XINCLUDESRC) -I.. -I$(LIBSRC) \ - -I../../cfb -I../../mfb -I../../mi \ - -I../../include -I$(TOP)/include -I$(FONTINCSRC) - - - LINTLIBS = ../../dix/llib-ldix.ln ../../os/llib-los.ln \ - ../../mfb/llib-lmfb.ln ../../mi/llib-lmi.ln \ - ../../cfb/llib-lcfb.ln - - DEFINES = -D_XP_PRINT_SERVER_ -UXFree86LOADER - -NormalLibraryObjectRule() - -NormalLibraryTarget(raster,$(OBJS)) -NormalLintTarget($(SRCS1) $(SRCS2)) - -DependTarget() diff --git a/nx-X11/programs/Xserver/Xprint/raster/Raster.c b/nx-X11/programs/Xserver/Xprint/raster/Raster.c deleted file mode 100644 index 781327b33..000000000 --- a/nx-X11/programs/Xserver/Xprint/raster/Raster.c +++ /dev/null @@ -1,1580 +0,0 @@ -/* $Xorg: Raster.c,v 1.4 2001/03/14 18:46:12 pookie Exp $ */ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ - -/* $XFree86: xc/programs/Xserver/Xprint/raster/Raster.c,v 1.11tsi Exp $ */ - -/******************************************************************* -** -** ********************************************************* -** * -** * File: printer/Raster.c -** * -** * Contents: -** * Raster driver for the print server. -** * -** * Copyright: Copyright 1993, 1995 Hewlett-Packard Company -** * -** ********************************************************* -** -********************************************************************/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include /* for SIGCLD on pre-POSIX systems */ -#define NEED_EVENTS -#include -#undef NEED_EVENTS -#include -#include "misc.h" -#include "dixstruct.h" -#include "scrnintstr.h" -#include "screenint.h" -#include "colormapst.h" -#include "windowstr.h" -#include "propertyst.h" -#include "servermd.h" /* needed for IMAGE_BUFSIZE */ -#include "mfb.h" -#include "mi.h" - -#include -#include "Raster.h" - -#include "attributes.h" -#include "AttrValid.h" -#include "DiPrint.h" - -static void AllocateRasterPrivates( - ScreenPtr pScreen); -static Bool RasterChangeWindowAttributes( - WindowPtr pWin, - unsigned long mask); -static int StartJob( - XpContextPtr pCon, - Bool sendClientData, - ClientPtr client); -static int StartPage( - XpContextPtr pCon, - WindowPtr pWin); -static int StartDoc( - XpContextPtr pCon, - XPDocumentType type); -static int EndDoc( - XpContextPtr pCon, - Bool cancel); -static int EndJob( - XpContextPtr pCon, - Bool cancel); -static int EndPage( - XpContextPtr pCon, - WindowPtr pWin); -static int DocumentData( - XpContextPtr pCon, - DrawablePtr pDraw, - char *pData, - int len_data, - char *pDoc_fmt, - int len_fmt, - char *pOptions, - int len_options, - ClientPtr client); -static int GetDocumentData( - XpContextPtr pContext, - ClientPtr client, - int maxBufferSize); -static void FreePageFiles( - RasterContextPrivPtr pWinPriv); -static int SystemCmd( - char *pCommand); -static Bool RasterCloseScreen( - int index, - ScreenPtr pScreen); -static int RasterInitContext(XpContextPtr pCon); -static Bool RasterDestroyContext(XpContextPtr pCon); -static char *RasterGetAttributes( - XpContextPtr pContext, - XPAttributes class); -static char *RasterGetOneAttribute(XpContextPtr pCon, - XPAttributes class, - char *attribute); -static int RasterSetAttributes(XpContextPtr pCon, - XPAttributes class, - char *attributes); -static int RasterAugmentAttributes(XpContextPtr pCon, - XPAttributes class, - char *attributes); -static int RasterMediumDimensions(XpContextPtr pCon, - CARD16 *width, - CARD16 *height); -static int RasterReproducibleArea(XpContextPtr pCon, - xRectangle *pRect); - -#define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#define DOC_PCL 1 -#define DOC_RASTER 2 - -static int RasterScreenPrivateIndex, RasterContextPrivateIndex; -static int RasterGeneration = 0; -static char RASTER_DRIV_NAME[] = "XP-RASTER"; -static int doc_type = DOC_RASTER; - -#define ABSOLUTE_PCLCOMP_PATH1 "/usr/openwin/bin/pclcomp" -#define ABSOLUTE_PCLCOMP_PATH2 "/usr/X11/bin/pclcomp" - -static char *pcl3_output_cmds[] = { - "xpr -device ljet -rv -landscape < %(InFile)% | pclcomp -0 > %(OutFile)%", - "xpr -device ljet -rv -landscape < %(InFile)% | pclcomp -01 > %(OutFile)%", - "xpr -device ljet -rv -landscape < %(InFile)% | pclcomp -02 > %(OutFile)%", - "xpr -device ljet -rv -landscape < %(InFile)% | pclcomp -03 > %(OutFile)%", - "xpr -device ljet -rv -landscape < %(InFile)% | pclcomp -012 > %(OutFile)%", - "xpr -device ljet -rv -landscape < %(InFile)% | pclcomp -013 > %(OutFile)%", - "xpr -device ljet -rv -landscape < %(InFile)% | pclcomp -023 > %(OutFile)%", - "xpr -device ljet -rv -landscape < %(InFile)% | pclcomp -0123 > %(OutFile)%", - "xpr -device ljet -rv -landscape < %(InFile)% > %(OutFile)%", - "xpr -device ljet -rv < %(InFile)% | pclcomp -0 > %(OutFile)%", - "xpr -device ljet -rv < %(InFile)% | pclcomp -01 > %(OutFile)%", - "xpr -device ljet -rv < %(InFile)% | pclcomp -02 > %(OutFile)%", - "xpr -device ljet -rv < %(InFile)% | pclcomp -03 > %(OutFile)%", - "xpr -device ljet -rv < %(InFile)% | pclcomp -012 > %(OutFile)%", - "xpr -device ljet -rv < %(InFile)% | pclcomp -013 > %(OutFile)%", - "xpr -device ljet -rv < %(InFile)% | pclcomp -023 > %(OutFile)%", - "xpr -device ljet -rv < %(InFile)% | pclcomp -0123 > %(OutFile)%", - "xpr -device ljet -rv < %(InFile)% > %(OutFile)%"}; - -Bool -InitializeRasterDriver( - int ndx, - ScreenPtr pScreen, - int argc, - char **argv) -{ - int xRes, yRes; - int maxRes, maxDim, numBytes; - RasterScreenPrivPtr pPriv; - - /* - * Register this driver's InitContext function with the print extension. - * This is a bit - * sleazy, as the extension hasn't yet been initialized, but the - * extension needs to know this, and this seems the best time to - * provide the information. - */ - XpRegisterInitFunc( pScreen, RASTER_DRIV_NAME, RasterInitContext ); - - /* - * Create and load the devPrivate for the printer layer. - */ - AllocateRasterPrivates(pScreen); - - pPriv = (RasterScreenPrivPtr) - pScreen->devPrivates[RasterScreenPrivateIndex].ptr; - - maxDim = MAX( pScreen->height, pScreen->width ); - numBytes = maxDim + BITMAP_SCANLINE_PAD - 1; /* pixels per row */ - numBytes *= maxDim; - numBytes /= 8; /* bytes per row */ - xRes = pScreen->width / (pScreen->mmWidth / 25.4); - yRes = pScreen->height / (pScreen->mmHeight / 25.4); - maxRes = MAX( xRes, yRes ); - - pPriv->pBits = (char *)xalloc(numBytes); - - /* - * Have to allocate maxDim X maxDim to allow for landscape mode. - */ - mfbScreenInit(pScreen, pPriv->pBits, maxDim, maxDim, maxRes, - maxRes, maxDim); - miInitializeBackingStore(pScreen); - pScreen->blackPixel = 1; - pScreen->whitePixel = 0; - if(mfbCreateDefColormap(pScreen) == FALSE) - ; /* XXX what do I do if it fails? */ - - /* - cfbScreenInit(pScreen, pPriv->pBits, maxWidth, maxHeight, maxXres, - maxYres, maxWidth); - miInitializeBackingStore(pScreen); - scalingScreenInit(pScreen); - */ - - pScreen->SaveScreen = (SaveScreenProcPtr)_XpBoolNoop; - pPriv->ChangeWindowAttributes = pScreen->ChangeWindowAttributes; - pScreen->ChangeWindowAttributes = RasterChangeWindowAttributes; - pPriv->CloseScreen = pScreen->CloseScreen; - pScreen->CloseScreen = RasterCloseScreen; - - return TRUE; -} - -/* - * GetPropString searches the context's config database for a property - * by the name of propName. If found, it returns the property's - * value, otherwise it returns NULL unless the requested attribute - * is RASTER_PRINT_PAGE_COMMAND, in which case it returns a hard-coded - * default string to invoke xpr to produce a PostScript(tm) formatted - * raster. - */ - -static char * -GetPropString( - XpContextPtr pCon, - char *propName) -{ - RasterContextPrivPtr pConPriv = (RasterContextPrivPtr) - pCon->devPrivates[RasterContextPrivateIndex].ptr; - char *type; - XrmValue val; - struct stat status; - int pclcomp_exists = 0; - - if( XrmGetResource(pConPriv->config, propName, propName, &type, &val) == - True ) - return (char *)val.addr; - - if( !strcmp( propName, RASTER_PRINT_PAGE_COMMAND ) ) - if( doc_type == DOC_RASTER ) - return "xpr -device ps %(InFile)% > %(OutFile)%"; - else - { - XpOid orientation; - XpOid compression; - int pcl3_output_index = 0; - - orientation = XpGetContentOrientation(pCon); - compression = XpGetAvailableCompression(pCon); - - switch(orientation) { - case xpoid_val_content_orientation_landscape: - pcl3_output_index = 0; - break; - default: - pcl3_output_index += 9; - break; - } - - if(stat(ABSOLUTE_PCLCOMP_PATH1, &status) != -1) - pclcomp_exists = 1; - else if(stat(ABSOLUTE_PCLCOMP_PATH2, &status) != -1) - pclcomp_exists = 1; - - if(pclcomp_exists) - switch(compression) { - case xpoid_val_available_compressions_0: - pcl3_output_index += 0; - break; - case xpoid_val_available_compressions_01: - pcl3_output_index += 1; - break; - case xpoid_val_available_compressions_02: - pcl3_output_index += 2; - break; - case xpoid_val_available_compressions_03: - pcl3_output_index += 3; - break; - case xpoid_val_available_compressions_012: - pcl3_output_index += 4; - break; - case xpoid_val_available_compressions_013: - pcl3_output_index += 5; - break; - case xpoid_val_available_compressions_023: - pcl3_output_index += 6; - break; - default: - pcl3_output_index += 7; - break; - } - else - pcl3_output_index += 8; - - return pcl3_output_cmds[pcl3_output_index]; - } - else - return NULL; -} - -static void -SetDocumentType( - XpContextPtr pCon) -{ - XpOidList* attrs_supported; - - /* - * only validate attributes found in document-attributes-supported - */ - attrs_supported = - XpGetListAttr(pCon, XPPrinterAttr, - xpoid_att_document_attributes_supported, - (const XpOidList*)NULL); - - if(XpOidListHasOid(attrs_supported, xpoid_att_document_format)) - { - const char* value_in; - XpOidDocFmt *f; - - value_in = XpGetStringAttr(pCon, XPDocAttr, xpoid_att_document_format); - - f = XpOidDocFmtNew( value_in ); - - if( f != NULL ) - { - if( !strcmp( f->format, "PCL" ) ) - doc_type = DOC_PCL; - else - doc_type = DOC_RASTER; - - XpOidDocFmtDelete( f ); - } - } - - /* - * clean up - */ - XpOidListDelete(attrs_supported); -} - -static int -StartJob( - XpContextPtr pCon, - Bool sendClientData, - ClientPtr client) -{ - RasterContextPrivPtr pConPriv = (RasterContextPrivPtr) - pCon->devPrivates[RasterContextPrivateIndex].ptr; - - SetDocumentType( pCon ); - - /* - * Check for existing page file, and delete it if it exists. - */ - if(pConPriv->pageFileName != (char *)NULL) - { - if(pConPriv->pPageFile != (FILE *)NULL) - { - fclose(pConPriv->pPageFile); - pConPriv->pPageFile = (FILE *)NULL; - } - unlink(pConPriv->pageFileName); - Xfree(pConPriv->pageFileName); - pConPriv->pageFileName = (char *)NULL; - } - - /* - * Create a temporary file to store the printer output. - */ - if(!sendClientData) - { - /* - * Create a temporary file to store the printer output. - */ - if (!XpOpenTmpFile("w", &pConPriv->jobFileName, &pConPriv->pJobFile)) - return BadAlloc; - } - - return Success; -} - -/* - * StartDoc and EndDoc are just no-ops in this implementation, since - * our view of the spooler really doesn't recognize documents. - */ - -static int -StartDoc( - XpContextPtr pCon, - XPDocumentType type) -{ - return Success; -} - -static int EndDoc( - XpContextPtr pCon, - Bool cancel) -{ - return Success; -} - -#if 0 - -/* XXX Not used. */ - -/* - * BuidArgVector takes a pointer to a comma-separated list of command - * options and splits it out into an array of argument pointers. The - * caller must not free the optionList after calling this function until - * the returned arg vector is no longer needed, at which time the arg - * vector should also be freed. - */ - -#define SEPARATOR_CHAR (char)',' - -static char ** -BuildArgVector( - char *optionList, - char **argVector, - int argCount) -{ - char *curArg, *lastChar, *endArg; - - curArg = optionList; - lastChar = optionList + strlen(optionList); /* includes final NULL */ - - while(curArg != (char *)NULL && curArg < lastChar) - { - /* strip leading white space */ - while(curArg < lastChar && isascii((int)*curArg) && - isspace((int)*curArg)) - curArg++; - - if(curArg < lastChar) - { - argVector = (char **)Xrealloc(argVector, - sizeof(char *) * (argCount + 2)); - argVector[argCount] = curArg; - argVector[++argCount] = (char *)NULL; - - endArg = strchr(curArg, SEPARATOR_CHAR); - - /* Should I strip trailing white space ??? */ - - if(endArg != (char *)NULL) - { - *endArg = (char)'\0'; - curArg = endArg + 1; - } - else - curArg = (char *)NULL; - } - } - - return argVector; -} -#endif - -static int -EndJob( - XpContextPtr pCon, - Bool cancel) -{ - RasterContextPrivPtr pConPriv = (RasterContextPrivPtr) - pCon->devPrivates[RasterContextPrivateIndex].ptr; - - if( cancel == True ) - { - if(pConPriv->getDocClient != (ClientPtr)NULL) { - XpFinishDocData(pConPriv->getDocClient); - - pConPriv->getDocClient = (ClientPtr)NULL; - pConPriv->getDocBufSize = 0; - } - - if(pConPriv->jobFileName != (char *)NULL) - { - unlink(pConPriv->jobFileName); - Xfree(pConPriv->jobFileName); - pConPriv->jobFileName = (char *)NULL; - } - - return Success; - } - - if(pConPriv->getDocClient != (ClientPtr)NULL&&pConPriv->getDocBufSize > 0) - { - XpFinishDocData(pConPriv->getDocClient); - - pConPriv->getDocClient = (ClientPtr)NULL; - pConPriv->getDocBufSize = 0; - - return Success; - } - - if(pConPriv->pJobFile != (FILE *)NULL) - { - fclose(pConPriv->pJobFile); - pConPriv->pJobFile = (FILE *)NULL; - - if(pConPriv->jobFileName != (char *)NULL) - { - XpSubmitJob( pConPriv->jobFileName, pCon ); - unlink(pConPriv->jobFileName); - Xfree(pConPriv->jobFileName); - pConPriv->jobFileName = (char *)NULL; - } - } - - return Success; -} - -/* StartPage - * - * If page file exists - * close page file - * set page file pointer = NULL - * unlink page file - */ -static int -StartPage( - XpContextPtr pCon, - WindowPtr pWin) -{ - RasterContextPrivPtr pConPriv = (RasterContextPrivPtr) - pCon->devPrivates[RasterContextPrivateIndex].ptr; - - if(pConPriv->pPageFile != (FILE *)NULL) - { - fclose(pConPriv->pPageFile); - pConPriv->pPageFile = (FILE *)NULL; - } - if(pConPriv->pageFileName != (char *)NULL) - { - unlink(pConPriv->pageFileName); - pConPriv->pageFileName = (char *)NULL; - } - - return Success; -} - -#include "X11/XWDFile.h" - - -#define lowbit(x) ((x) & (~(x) + 1)) - -/* - * Get the XWDColors of all pixels in colormap - returns # of colors - */ -static XWDColor * -Get_XWDColors( - ColormapPtr pCmap) -{ - int i, ncolors; - xrgb *prgbList; - Pixel *pPixels; - XWDColor *colors; - - ncolors = pCmap->pVisual->ColormapEntries; - if (!(colors = (XWDColor *) malloc (sizeof(XWDColor) * ncolors))) - return (XWDColor *) NULL; - if (!(prgbList = (xrgb*) malloc(sizeof(xrgb) * ncolors))) - { - Xfree(colors); - return (XWDColor *) NULL; - } - if (!(pPixels = (Pixel*) malloc(sizeof(Pixel) * ncolors))) - { - Xfree(colors); - Xfree(prgbList); - return (XWDColor *) NULL; - } - - if (pCmap->pVisual->class == DirectColor || - pCmap->pVisual->class == TrueColor) { - Pixel red, green, blue, red1, green1, blue1; - - red = green = blue = 0; - red1 = lowbit(pCmap->pVisual->redMask); - green1 = lowbit(pCmap->pVisual->greenMask); - blue1 = lowbit(pCmap->pVisual->blueMask); - for (i=0; i pCmap->pVisual->redMask) - red = 0; - green += green1; - if (green > pCmap->pVisual->greenMask) - green = 0; - blue += blue1; - if (blue > pCmap->pVisual->blueMask) - blue = 0; - } - } else { - for (i=0; idrawable; - XWDFileHeader header; - int win_name_size; - int header_size; - int ncolors, i; - char *win_name; - VisualPtr pVisual; - ColormapPtr pCmap; - XWDColor *pColors; - unsigned long swaptest = 1; - - widthBytesLine = PixmapBytePad(pWin->drawable.width, pWin->drawable.depth); - length = widthBytesLine * pWin->drawable.height; - height = pWin->drawable.height; - - if(length <= 0) - return Success; - - if (widthBytesLine >= IMAGE_BUFSIZE) - linesPerBuf = 1; - else - { - linesPerBuf = IMAGE_BUFSIZE / widthBytesLine; - if (linesPerBuf > height) - linesPerBuf = height; - } - length = linesPerBuf * widthBytesLine; - if (linesPerBuf < height) - { - /* we have to make sure intermediate buffers don't need padding */ - while ((linesPerBuf > 1) && (length & 3)) - { - linesPerBuf--; - length -= widthBytesLine; - } - while (length & 3) - { - linesPerBuf++; - length += widthBytesLine; - } - } - if(!(pBuf = (char *) Xalloc(length))) - return (BadAlloc); - - /* - * Start of Xwd header code. - */ - - /* - * XXX - Should we use the real window name??? - */ - win_name = "xwdump"; - /* sizeof(char) is included for the null string terminator. */ - win_name_size = strlen(win_name) + sizeof(char); - - pCmap = (ColormapPtr)LookupIDByType(wColormap (pWin), RT_COLORMAP); - pVisual = pCmap->pVisual; - if((pColors = Get_XWDColors(pCmap)) == (XWDColor *)NULL) - { - Xfree(pBuf); - return (BadAlloc); - } - - /* - * Write out header information. - */ - header_size = sizeof(header) + win_name_size; - header.header_size = (CARD32) header_size; - header.file_version = (CARD32) XWD_FILE_VERSION; - header.pixmap_format = (CARD32) ZPixmap; /* Must match GetImage below */ - header.pixmap_depth = (CARD32) pDraw->depth; - header.pixmap_width = (CARD32) pDraw->width; - header.pixmap_height = (CARD32) pDraw->height; - header.xoffset = (CARD32) 0; - header.byte_order = (CARD32) screenInfo.imageByteOrder; - header.bitmap_unit = (CARD32) screenInfo.bitmapScanlineUnit; - header.bitmap_bit_order = (CARD32) screenInfo.bitmapBitOrder; - header.bitmap_pad = (CARD32) screenInfo.bitmapScanlinePad; - header.bits_per_pixel = (CARD32) pDraw->bitsPerPixel; - header.bytes_per_line = (CARD32) widthBytesLine; - header.visual_class = (CARD32) pVisual->class; - header.red_mask = (CARD32) pVisual->redMask; - header.green_mask = (CARD32) pVisual->greenMask; - header.blue_mask = (CARD32) pVisual->blueMask; - header.bits_per_rgb = (CARD32) pVisual->bitsPerRGBValue; - header.colormap_entries = (CARD32) pVisual->ColormapEntries; - header.ncolors = ncolors = (CARD32) pVisual->ColormapEntries; - header.window_width = (CARD32) pDraw->width; - header.window_height = (CARD32) pDraw->height; - header.window_x = 0; - header.window_y = 0; - header.window_bdrwidth = (CARD32) 0; - - if (*(char *) &swaptest) { - _swaplong((char *) &header, sizeof(header)); - for (i = 0; i < ncolors; i++) { - _swaplong((char *) &pColors[i].pixel, sizeof(long)); - _swapshort((char *) &pColors[i].red, 3 * sizeof(short)); - } - } - - (void) fwrite((char *)&header, sizeof(header), 1, pRasterFile); - (void) fwrite(win_name, win_name_size, 1, pRasterFile); - (void) fwrite((char *) pColors, sizeof(XWDColor), ncolors, pRasterFile); - - Xfree(pColors); - - /* - * End of Xwd header code. - */ - - linesDone = 0; - while(height - linesDone > 0) - { - nlines = min(linesPerBuf, height - linesDone); - (*pDraw->pScreen->GetImage) (pDraw, - 0, - linesDone, - pWin->drawable.width, - nlines, - ZPixmap, - ~0, - pBuf); - - if(fwrite(pBuf, sizeof(char), (size_t)(nlines * widthBytesLine), - pRasterFile) != - (size_t)(nlines * widthBytesLine)) - { - Xfree(pBuf); - return BadAlloc; - } - linesDone += nlines; - } - Xfree(pBuf); - return Success; -} - - -static int -SendPage( XpContextPtr pCon ) -{ - struct stat statBuf; - RasterContextPrivPtr pConPriv = (RasterContextPrivPtr) - pCon->devPrivates[RasterContextPrivateIndex].ptr; - - if(stat(pConPriv->pageFileName, &statBuf) < 0) - return BadAlloc; - - return XpSendDocumentData(pConPriv->getDocClient, - pConPriv->pPageFile, (int)statBuf.st_size, - pConPriv->getDocBufSize); -} - -/* - * EndPage: - * - * If page file doesn't exist: - * { - * Create page file - * Open page file - * Write page header to page file - * if(preRasterFile exists) - * copy preRasterFile contents to page file - * if(noRasterFile exists) - * write noRasterFile contents to page file - * else - * Create raster image file - * Open raster image file - * GetImage data - * Write Image data to raster image file - * invoke page_command on raster image file - * Write raster image file contents to page file - * Unlink tempPage file - * if(postRasterFile exists) - * write postRasterFile contents to page file - * Write page trailer to page file - * } - * Write page file to job file - */ -static int -EndPage( - XpContextPtr pCon, - WindowPtr pWin) -{ - RasterContextPrivPtr pConPriv = (RasterContextPrivPtr) - pCon->devPrivates[RasterContextPrivateIndex].ptr; - struct stat statBuf; - char *rasterFileName = (char *)NULL, *pCommand = (char *)NULL; - FILE *pRasterFile = (FILE *)NULL; - - if(pConPriv->pageFileName == (char *)NULL) - { - /* - * Open the page file. - */ - if (!XpOpenTmpFile("w+", &pConPriv->pageFileName, - &pConPriv->pPageFile)) - goto BAD_PAGE_ALLOC; - - /* - * Copy any pre-raster document data to the page file. - */ - if(pConPriv->pPreRasterFile != (FILE *)NULL) - { - if(CopyContentsAndDelete(&pConPriv->pPreRasterFile, - &pConPriv->preRasterFileName, - pConPriv->pPageFile) == FALSE) - goto BAD_PAGE_ALLOC; - } - - /* - * Copy either the no-raster document data, or the raster - * data itself to the page file. - * If the no-raster file exists, then we don't process the - * actual window raster bits. - */ - if(pConPriv->pNoRasterFile != (FILE *)NULL) - { - if(CopyContentsAndDelete(&pConPriv->pNoRasterFile, - &pConPriv->noRasterFileName, - pConPriv->pPageFile) == FALSE) - goto BAD_PAGE_ALLOC; - } - else - { - /* - * Open the raster image file. - */ - if (!XpOpenTmpFile("w", &rasterFileName, &pRasterFile)) - goto BAD_PAGE_ALLOC; - - /* - * Write the page image data to the raster image file. - */ - if(WriteWindowRaster(pWin, pRasterFile) != Success) - goto BAD_PAGE_ALLOC; - - /* - * Invoke the page_command on the raster image file. - */ - if((pCommand = GetPropString(pCon, RASTER_PRINT_PAGE_COMMAND)) != - (char *)NULL) - { - char *outFileName; - FILE *pOutFile; - - if (!XpOpenTmpFile("w", &outFileName, &pOutFile)) - goto BAD_PAGE_ALLOC; - fclose(pOutFile); - - pCommand = ReplaceFileString(strdup(pCommand), rasterFileName, - outFileName); - fclose(pRasterFile); - SystemCmd(pCommand); - free(pCommand); - /* - * Delete the unprocessed raster file. - */ - unlink(rasterFileName); - Xfree(rasterFileName); - rasterFileName = outFileName; - if((pRasterFile = fopen(rasterFileName, "r")) == (FILE *)NULL) - goto BAD_PAGE_ALLOC; - } - else - { - fclose(pRasterFile); - if((pRasterFile = fopen(rasterFileName, "r")) == (FILE *)NULL) - goto BAD_PAGE_ALLOC; - } - - /* - * Copy the raster image file contents to the page file. - * Note that pRasterFile must be set to the start of the - * raster file. - */ - if(CopyContentsAndDelete(&pRasterFile, - &rasterFileName, - pConPriv->pPageFile) == FALSE) - goto BAD_PAGE_ALLOC; - } - - /* - * Copy any post-raster document data to the page file. - */ - if(pConPriv->pPostRasterFile != (FILE *)NULL) - { - if(CopyContentsAndDelete(&pConPriv->pPostRasterFile, - &pConPriv->postRasterFileName, - pConPriv->pPageFile) == FALSE) - goto BAD_PAGE_ALLOC; - } - - } - - /* - * Write the page file contents to the job file or to the client - * performing GetDocumentData. - * pConPriv->pPageFile must first be set to the start of the page file. - */ - rewind(pConPriv->pPageFile); - if(stat(pConPriv->pageFileName, &statBuf) < 0) - goto BAD_PAGE_ALLOC; - - /* - * Send the page data to whatever client has called GetDocumentData. - */ - if(pConPriv->getDocClient != (ClientPtr)NULL&&pConPriv->getDocBufSize > 0) - { - int retval; - /* - * We should do something like the following: suspend the - * caller until we can gracefully write all the data in small - * chunks to the receiver, but for now we'll just call WriteToClient - * on the huge chunk - */ - retval = SendPage(pCon); - fclose(pConPriv->pPageFile); - pConPriv->pPageFile = (FILE *)NULL; - unlink(pConPriv->pageFileName); - free(pConPriv->pageFileName); - pConPriv->pageFileName = (char *)NULL; - return retval; - } - - if(pConPriv->pJobFile == (FILE *)NULL) - { - /* - * This shouldn't be necessary. I believe we only get here if - * someone calls "EndPage" prior to "StartJob". This error - * condition should probably be trapped at a higher level. - */ - - if(pConPriv->jobFileName != (char *)NULL) - Xfree(pConPriv->jobFileName); - /* - * Create a temporary file to store the printer output. - */ - if (!XpOpenTmpFile("w", &pConPriv->jobFileName, &pConPriv->pJobFile)) - goto BAD_PAGE_ALLOC; - } - - if(TransferBytes(pConPriv->pPageFile, pConPriv->pJobFile, - (int)statBuf.st_size) != (int)statBuf.st_size) - goto BAD_PAGE_ALLOC; - - fclose(pConPriv->pPageFile); - pConPriv->pPageFile = (FILE *)NULL; - unlink(pConPriv->pageFileName); - free(pConPriv->pageFileName); - pConPriv->pageFileName = (char *)NULL; - - return Success; - - BAD_PAGE_ALLOC: - - FreePageFiles(pConPriv); - - if(pRasterFile != (FILE *)NULL) - fclose(pRasterFile); - if(rasterFileName != (char *)NULL) - { - unlink(rasterFileName); - Xfree(rasterFileName); - } - return BadAlloc; -} - -static int -DocumentData( - XpContextPtr pCon, - DrawablePtr pDraw, - char *pData, - int len_data, - char *pDoc_fmt, - int len_fmt, - char *pOptions, - int len_options, - ClientPtr client) -{ - RasterContextPrivPtr pConPriv = (RasterContextPrivPtr) - pCon->devPrivates[RasterContextPrivateIndex].ptr; - char *preRasterStr = PRE_RASTER, *postRasterStr = POST_RASTER, - *noRasterStr = NO_RASTER; - - /* - * Check that options equals either PRE_RASTER or POST_RASTER. - */ - if(len_options == strlen(preRasterStr) && - strncmp(pOptions, preRasterStr, strlen(preRasterStr)) == 0) - { - if(pConPriv->pPreRasterFile == (FILE *)NULL) - { - if (!XpOpenTmpFile("w+", &pConPriv->preRasterFileName, - &pConPriv->pPreRasterFile)) - return BadAlloc; - } - if(fwrite(pData, sizeof(char), (size_t)len_data, - pConPriv->pPreRasterFile) != (size_t)len_data) - return BadAlloc; - fflush(pConPriv->pPreRasterFile); - } - else if(len_options == strlen(postRasterStr) && - strncmp(pOptions, postRasterStr, strlen(postRasterStr)) == 0) - { - if(pConPriv->pPostRasterFile == (FILE *)NULL) - { - if (!XpOpenTmpFile("w+", &pConPriv->postRasterFileName, - &pConPriv->pPostRasterFile)) - return BadAlloc; - } - if(fwrite(pData, sizeof(char), (size_t)len_data, - pConPriv->pPostRasterFile) != (size_t)len_data) - return BadAlloc; - fflush(pConPriv->pPostRasterFile); - } - else if(len_options == strlen(noRasterStr) && - strncmp(pOptions, noRasterStr, strlen(noRasterStr)) == 0) - { - if(pConPriv->pNoRasterFile == (FILE *)NULL) - { - if (!XpOpenTmpFile("w+", &pConPriv->noRasterFileName, - &pConPriv->pNoRasterFile)) - return BadAlloc; - } - if(fwrite(pData, sizeof(char), (size_t)len_data, - pConPriv->pNoRasterFile) != (size_t)len_data) - return BadAlloc; - fflush(pConPriv->pNoRasterFile); - } - else - return BadValue; - - return Success; -} - -/* - * GetDocumentData notes which client is requesting the document data for - * a particular context. The Raster driver's EndPage function causes the - * data to be written to the proper client. - */ -static int -GetDocumentData( - XpContextPtr pContext, - ClientPtr client, - int maxBufferSize) -{ - RasterContextPrivPtr pConPriv = (RasterContextPrivPtr) - pContext->devPrivates[RasterContextPrivateIndex].ptr; - - pConPriv->getDocClient = client; - pConPriv->getDocBufSize = maxBufferSize; - return Success; -} - -static void -AllocateRasterPrivates( - ScreenPtr pScreen) -{ - if(RasterGeneration != serverGeneration) - { - RasterScreenPrivateIndex = AllocateScreenPrivateIndex(); - RasterContextPrivateIndex = XpAllocateContextPrivateIndex(); - XpAllocateContextPrivate( RasterContextPrivateIndex, - sizeof( RasterContextPrivRec ) ); - - RasterGeneration = serverGeneration; - } - pScreen->devPrivates[RasterScreenPrivateIndex].ptr = (pointer)Xalloc( - sizeof(RasterScreenPrivRec)); -} - -/* - * RasterChangeWindowAttributes - Make sure that the window's backing - * store is turned on. - */ -static Bool -RasterChangeWindowAttributes( - WindowPtr pWin, - unsigned long mask) -{ - Bool status = Success; - ScreenPtr pScreen = pWin->drawable.pScreen; - RasterScreenPrivPtr pScreenPriv = (RasterScreenPrivPtr) - pScreen->devPrivates[RasterScreenPrivateIndex].ptr; - - if(pWin->backingStore == NotUseful) - { - pWin->backingStore = WhenMapped; - mask |= CWBackingStore; - } - - if(pScreenPriv->ChangeWindowAttributes != NULL) - { - pScreen->ChangeWindowAttributes = pScreenPriv->ChangeWindowAttributes; - status = pScreen->ChangeWindowAttributes(pWin, mask); - pScreen->ChangeWindowAttributes = RasterChangeWindowAttributes; - } - return status; -} - -/* - * RasterValidateDocFormats - Inspects the files available in the - * ddx-config/XP-RASTER directory to find the names of PDLs for which - * we have processing commands. These names are then intersected with - * the contents of the printer's document-formats-supported attribute, - * and the result is stored back into document-formats-supported. - * We have hard-coded knowledge of how to produce PS, so we always - * leave that in, if it's listed in document-formats-supported, - * even if we don't have a configuration file. If there is a - * configuration file for PS, then its contents will override our default. - */ -static void -RasterValidateDocFormats( - XpContextPtr pCon) -{ -} - -/* - * RasterValidateAttrs - Inspects and Corrects the attribute values - * in the specified context. - */ -static void -RasterValidateAttrs( - XpContextPtr pCon) -{ - RasterValidateDocFormats(pCon); - XpValidatePrinterPool(pCon, &RasterValidatePoolsRec); - XpValidateJobPool(pCon, &RasterValidatePoolsRec); - XpValidateDocumentPool(pCon, &RasterValidatePoolsRec); -} - -/* - * RasterInitContext - Establish the appropriate values for a - * PrintContext used with the Raster Driver. - */ -static char DOC_ATT_SUPP[]="document-attributes-supported:\tdefault-medium document-format"; -static char JOB_ATT_SUPP[]="job-attributes-supported:\t"; -static char DDX_DIR[]="ddx-config"; - -static int -RasterInitContext( - XpContextPtr pCon) -{ - char *configFileName, *val, *attrStr; - RasterContextPrivPtr pConPriv; - XpDriverFuncsPtr pFuncs; - - /* - * Initialize the attribute store for this printer. - */ - XpInitAttributes( pCon ); - - /* - * Validate the attributes - */ - RasterValidateAttrs( pCon ); - - - /* - * Initialize the function pointers - */ - pFuncs = &( pCon->funcs ); - pFuncs->StartJob = StartJob; - pFuncs->EndJob = EndJob; - pFuncs->StartDoc = StartDoc; - pFuncs->EndDoc = EndDoc; - pFuncs->StartPage = StartPage; - pFuncs->EndPage = EndPage; - pFuncs->PutDocumentData = DocumentData; - pFuncs->GetDocumentData = GetDocumentData; - pFuncs->DestroyContext = RasterDestroyContext; - pFuncs->GetAttributes = RasterGetAttributes; - pFuncs->GetOneAttribute = RasterGetOneAttribute; - pFuncs->SetAttributes = RasterSetAttributes; - pFuncs->AugmentAttributes = RasterAugmentAttributes; - pFuncs->GetMediumDimensions = RasterMediumDimensions; - pFuncs->GetReproducibleArea = RasterReproducibleArea; - - /* - * Set up the context privates - */ - pConPriv = (RasterContextPrivPtr) - pCon->devPrivates[RasterContextPrivateIndex].ptr; - - pConPriv->jobFileName = (char *)NULL; - pConPriv->pageFileName = (char *)NULL; - pConPriv->preRasterFileName = (char *)NULL; - pConPriv->postRasterFileName = (char *)NULL; - pConPriv->noRasterFileName = (char *)NULL; - pConPriv->pJobFile = (FILE *)NULL; - pConPriv->pPageFile = (FILE *)NULL; - pConPriv->pPreRasterFile = (FILE *)NULL; - pConPriv->pPostRasterFile = (FILE *)NULL; - pConPriv->pNoRasterFile = (FILE *)NULL; - - pConPriv->getDocClient = (ClientPtr)NULL; - pConPriv->getDocBufSize = 0; - - /* - * Get the configuration information for the context's printer - */ - configFileName = XpGetOneAttribute( pCon, XPPrinterAttr, - "xp-ddx-config-file-name" ); - if(configFileName && strlen(configFileName)) - { - if( configFileName[0] == '/' ) - pConPriv->config = XrmGetFileDatabase( configFileName ); - else - { - char *configDir, *configFilePath; - - configDir = XpGetConfigDir(FALSE); - configFilePath = (char *)malloc((strlen(configDir) + - strlen(DDX_DIR) + - strlen(RASTER_DRIV_NAME) + - strlen(configFileName) + - 4)* sizeof(char)); - sprintf(configFilePath, "%s/%s/%s/%s", configDir, DDX_DIR, - RASTER_DRIV_NAME, configFileName); - pConPriv->config = XrmGetFileDatabase(configFilePath); - free(configDir); - free(configFilePath); - } - } - else - pConPriv->config = (XrmDatabase)NULL; - - /* - * Add our own attribute initialization - */ - /* - * document-attributes-supported - */ - val = XpGetOneAttribute(pCon, XPServerAttr, "document-attributes-supported"); - if((attrStr = (char *)xalloc(strlen(val) + strlen(DOC_ATT_SUPP) + 4)) == - (char *)NULL) - return BadAlloc; - sprintf(attrStr, "*%s %s", DOC_ATT_SUPP, val); - XpAugmentAttributes(pCon, XPPrinterAttr, attrStr); - xfree(attrStr); - - /* - * job-attributes-supported - */ - val = XpGetOneAttribute(pCon, XPServerAttr, "job-attributes-supported"); - if((attrStr = (char *)xalloc(strlen(val) + strlen(JOB_ATT_SUPP) + 4)) == - (char *)NULL) - return BadAlloc; - sprintf(attrStr, "*%s %s", JOB_ATT_SUPP, val); - XpAugmentAttributes(pCon, XPPrinterAttr, attrStr); - xfree(attrStr); - - /* - * PageAttributesSupported - */ - XpAugmentAttributes(pCon, XPPrinterAttr, "*xp-page-attributes-supported:"); - - return Success; -} - - - -static Bool -RasterDestroyContext( - XpContextPtr pCon) -{ - RasterContextPrivPtr pConPriv = (RasterContextPrivPtr) - pCon->devPrivates[RasterContextPrivateIndex].ptr; - - /* - * Clean up the temporary files - */ - FreePageFiles( pConPriv ); - - if( pConPriv->pJobFile != (FILE *)NULL ) - { - fclose( pConPriv->pJobFile ); - pConPriv->pJobFile = (FILE *)NULL; - } - if( pConPriv->jobFileName != (char *)NULL ) - { - unlink( pConPriv->jobFileName ); - Xfree( pConPriv->jobFileName ); - } - if(pConPriv->config) - { - XrmDestroyDatabase(pConPriv->config); - pConPriv->config = (XrmDatabase)NULL; - } - - XpDestroyAttributes( pCon ); - return Success; -} - -static char * -RasterGetAttributes( - XpContextPtr pContext, - XPAttributes class) -{ - return XpGetAttributes( pContext, class ); -} - -static char * -RasterGetOneAttribute( - XpContextPtr pContext, - XPAttributes class, - char *attr) -{ - return XpGetOneAttribute( pContext, class, attr ); -} - -static int -RasterSetAttributes(XpContextPtr pCon, - XPAttributes class, - char *attributes) -{ - return XpSetAttributes( pCon, class, attributes ); -} - -static int -RasterAugmentAttributes( - XpContextPtr pCon, - XPAttributes class, - char *attributes) -{ - return XpAugmentAttributes( pCon, class, attributes ); -} - -static void -FreePageFiles( - RasterContextPrivPtr pConPriv) -{ - if(pConPriv->pPageFile != (FILE *)NULL) - { - fclose(pConPriv->pPageFile); - pConPriv->pPageFile = (FILE *)NULL; - } - if(pConPriv->pageFileName != (char *)NULL) - { - unlink(pConPriv->pageFileName); - Xfree(pConPriv->pageFileName); - pConPriv->pageFileName = (char *)NULL; - } - if(pConPriv->pPreRasterFile != (FILE *)NULL) - { - fclose(pConPriv->pPreRasterFile); - pConPriv->pPreRasterFile = (FILE *)NULL; - } - if(pConPriv->preRasterFileName != (char *)NULL) - { - unlink(pConPriv->preRasterFileName); - Xfree(pConPriv->preRasterFileName); - pConPriv->preRasterFileName = (char *)NULL; - } - if(pConPriv->pPostRasterFile != (FILE *)NULL) - { - fclose(pConPriv->pPostRasterFile); - pConPriv->pPostRasterFile = (FILE *)NULL; - } - if(pConPriv->postRasterFileName != (char *)NULL) - { - unlink(pConPriv->postRasterFileName); - Xfree(pConPriv->postRasterFileName); - pConPriv->postRasterFileName = (char *)NULL; - } - if(pConPriv->pNoRasterFile != (FILE *)NULL) - { - fclose(pConPriv->pNoRasterFile); - pConPriv->pNoRasterFile = (FILE *)NULL; - } - if(pConPriv->noRasterFileName != (char *)NULL) - { - unlink(pConPriv->noRasterFileName); - Xfree(pConPriv->noRasterFileName); - pConPriv->noRasterFileName = (char *)NULL; - } -} - -/* - * RasterCloseScreen - Call any wrapped CloseScreen function, - * and free the screen memory. - */ -static Bool -RasterCloseScreen( - int index, - ScreenPtr pScreen) -{ - Bool status = Success; - RasterScreenPrivPtr pScreenPriv = (RasterScreenPrivPtr) - pScreen->devPrivates[RasterScreenPrivateIndex].ptr; - - /* - * Call any wrapped CloseScreen proc. - */ - if(pScreenPriv->CloseScreen != NULL) - { - pScreen->CloseScreen = pScreenPriv->CloseScreen; - status = pScreen->CloseScreen(index, pScreen); - pScreen->CloseScreen = RasterCloseScreen; - } - - Xfree(pScreenPriv->pBits); - Xfree(pScreenPriv); - - return status; -} - -#include - -/* ARGSUSED */ -static void SigchldHndlr (int dummy) -{ - int status; - int olderrno = errno; - struct sigaction act; - sigfillset(&act.sa_mask); - act.sa_flags = 0; - act.sa_handler = SigchldHndlr; - - (void) wait (&status); - - /* - * Is this really necessary? - */ - sigaction(SIGCHLD, &act, (struct sigaction *)NULL); - errno = olderrno; -} - -/* - * SystemCmd provides a wrapper for the 'system' library call. The call - * appears to be sensitive to the handling of SIGCHLD, so this wrapper - * sets the status to SIG_DFL, and then resets the established handler - * after system returns. - */ -static int -SystemCmd(char *cmdStr) -{ - int status; - struct sigaction newAct, oldAct; - sigfillset(&newAct.sa_mask); - newAct.sa_flags = 0; - newAct.sa_handler = SIG_DFL; - sigfillset(&oldAct.sa_mask); - oldAct.sa_flags = 0; - oldAct.sa_handler = SigchldHndlr; - - /* - * get the old handler, and set the action to IGN - */ - sigaction(SIGCHLD, &newAct, &oldAct); - - status = system (cmdStr); - - sigaction(SIGCHLD, &oldAct, (struct sigaction *)NULL); - return status; -} - -/* - * RasterMediumDimensions is installed in the GetMediumDimensions field - * of each raster-initialized context. - */ -static int -RasterMediumDimensions(XpContextPtr pCon, - CARD16 *width, - CARD16 *height) -{ - XpGetMediumDimensions(pCon, width, height); - return Success; -} - -/* - * RasterReproducibleArea is installed in the GetReproducibleArea field - * of each raster-initialized context. - */ -static int -RasterReproducibleArea(XpContextPtr pCon, - xRectangle *pRect) -{ - XpGetReproductionArea(pCon, pRect); - return Success; -} diff --git a/nx-X11/programs/Xserver/Xprint/raster/Raster.h b/nx-X11/programs/Xserver/Xprint/raster/Raster.h deleted file mode 100644 index 25da756e5..000000000 --- a/nx-X11/programs/Xserver/Xprint/raster/Raster.h +++ /dev/null @@ -1,118 +0,0 @@ -/* $Xorg: Raster.h,v 1.3 2000/08/17 19:48:12 cpqbld Exp $ */ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ -/******************************************************************* -** -** ********************************************************* -** * -** * File: printer/Raster.h -** * -** * Contents: defines and includes for the raster layer -** * for a printing X server. -** * -** * Copyright: Copyright 1993 Hewlett-Packard Company -** * -** ********************************************************* -** -********************************************************************/ -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifndef _RASTER_H_ -#define _RASTER_H_ - -/* - * Some sleazes to force the XrmDB stuff into the server - */ -#ifndef HAVE_XPointer -#define HAVE_XPointer 1 -typedef char *XPointer; -#endif -#define Status int -#define True 1 -#define False 0 -#include "misc.h" -#include -#include -#include "attributes.h" - -#include - -#define MAX_TOKEN_LEN 512 - -#define RASTER_PRINT_PAGE_COMMAND "_XP_RASTER_PAGE_PROC_COMMAND" - -#define RASTER_IN_FILE_STRING "%(InFile)%" -#define RASTER_OUT_FILE_STRING "%(OutFile)%" - -#define RASTER_ALLOWED_COMMANDS_FILE "printCommands" - -/* - * Defines for the "options" in DtPrintDocumentData. - */ -#define PRE_RASTER "PRE-RASTER" -#define POST_RASTER "POST-RASTER" -#define NO_RASTER "NO-RASTER" - - -typedef struct { - char *pBits; - CreateWindowProcPtr CreateWindow; - ChangeWindowAttributesProcPtr ChangeWindowAttributes; - DestroyWindowProcPtr DestroyWindow; - CloseScreenProcPtr CloseScreen; -} RasterScreenPrivRec, *RasterScreenPrivPtr; - -typedef struct { - XrmDatabase config; - char *jobFileName; - FILE *pJobFile; - char *pageFileName; - FILE *pPageFile; - char *preRasterFileName; /* Pre-raster document data */ - FILE *pPreRasterFile; - char *noRasterFileName; /* Raster replacement document data */ - FILE *pNoRasterFile; - char *postRasterFileName; /* Post-raster document data */ - FILE *pPostRasterFile; - ClientPtr getDocClient; - int getDocBufSize; -} RasterContextPrivRec, *RasterContextPrivPtr; - - -extern XpValidatePoolsRec RasterValidatePoolsRec; - -extern Bool InitializeRasterDriver(int ndx, ScreenPtr pScreen, int argc, - char **argv); - -#endif /* _RASTER_H_ */ diff --git a/nx-X11/programs/Xserver/Xprint/raster/RasterAttVal.c b/nx-X11/programs/Xserver/Xprint/raster/RasterAttVal.c deleted file mode 100644 index fc00cde5a..000000000 --- a/nx-X11/programs/Xserver/Xprint/raster/RasterAttVal.c +++ /dev/null @@ -1,269 +0,0 @@ -/* $Xorg: RasterAttVal.c,v 1.4 2001/03/14 18:46:34 pookie Exp $ */ -/* -(c) Copyright 1996 Hewlett-Packard Company -(c) Copyright 1996 International Business Machines Corp. -(c) Copyright 1996 Sun Microsystems, Inc. -(c) Copyright 1996 Novell, Inc. -(c) Copyright 1996 Digital Equipment Corp. -(c) Copyright 1996 Fujitsu Limited -(c) Copyright 1996 Hitachi, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ -/* $XFree86: xc/programs/Xserver/Xprint/raster/RasterAttVal.c,v 1.3 2001/10/31 22:50:29 tsi Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include "misc.h" -#include "dixstruct.h" -#include "scrnintstr.h" -#include "screenint.h" -#include -#include "Raster.h" - -#include "attributes.h" -#include "AttrValid.h" - -/* - * define valid values and defaults for Printer pool - */ -static XpOid ValidContentOrientationsOids[] = { - xpoid_val_content_orientation_portrait, - xpoid_val_content_orientation_landscape -}; -static XpOidList ValidContentOrientations = { - ValidContentOrientationsOids, XpNumber(ValidContentOrientationsOids) -}; - -static XpOid DefaultContentOrientationsOids[] = { - xpoid_val_content_orientation_portrait, - xpoid_val_content_orientation_landscape -}; -static XpOidList DefaultContentOrientations = { - DefaultContentOrientationsOids, XpNumber(DefaultContentOrientationsOids) -}; - -static XpOid ValidPlexesOids[] = { - xpoid_val_plex_simplex -}; -static XpOidList ValidPlexes = { - ValidPlexesOids, XpNumber(ValidPlexesOids) -}; - -static XpOid DefaultPlexesOids[] = { - xpoid_val_plex_simplex -}; -static XpOidList DefaultPlexes = { - DefaultPlexesOids, XpNumber(DefaultPlexesOids) -}; - -static unsigned long ValidPrinterResolutionsCards[] = { - 150, 300, 600 -}; -static XpOidCardList ValidPrinterResolutions = { - ValidPrinterResolutionsCards, XpNumber(ValidPrinterResolutionsCards) -}; - -static unsigned long DefaultPrinterResolutionsCards[] = { - 300 -}; -static XpOidCardList DefaultPrinterResolutions = { - DefaultPrinterResolutionsCards, XpNumber(DefaultPrinterResolutionsCards) -}; - -static XpOid ValidListfontsModesOids[] = { - xpoid_val_xp_list_glyph_fonts -}; -static XpOidList ValidListfontsModes = { - ValidListfontsModesOids, XpNumber(ValidListfontsModesOids) -}; - -static XpOid DefaultListfontsModesOids[] = { - xpoid_val_xp_list_glyph_fonts -}; -static XpOidList DefaultListfontsModes = { - DefaultListfontsModesOids, XpNumber(DefaultListfontsModesOids) -}; - -static XpOid ValidSetupProvisoOids[] = { - xpoid_val_xp_setup_mandatory, xpoid_val_xp_setup_optional -}; -static XpOidList ValidSetupProviso = { - ValidSetupProvisoOids, XpNumber(ValidSetupProvisoOids) -}; - -static XpOidDocFmt ValidDocFormatsSupportedFmts[] = { - { "Postscript", "2", NULL }, - { "PCL", "3", NULL } -}; -static XpOidDocFmtList ValidDocFormatsSupported = { - ValidDocFormatsSupportedFmts, XpNumber(ValidDocFormatsSupportedFmts) -}; - -static XpOidDocFmt DefaultDocFormatsSupportedFmts[] = { - { "Postscript", "2", NULL } -}; -static XpOidDocFmtList DefaultDocFormatsSupported = { - DefaultDocFormatsSupportedFmts, XpNumber(DefaultDocFormatsSupportedFmts) -}; - -static XpOidDocFmtList ValidEmbeddedFormatsSupported = { - (XpOidDocFmt *)NULL, 0 -}; - -static XpOidDocFmtList DefaultEmbeddedFormatsSupported = { - (XpOidDocFmt *)NULL, 0 -}; - -static XpOidDocFmt ValidRawFormatsSupportedFmts[] = { - { "Postscript", "2", NULL }, - { "PCL", "3", NULL } -}; -static XpOidDocFmtList ValidRawFormatsSupported = { - ValidRawFormatsSupportedFmts, XpNumber(ValidRawFormatsSupportedFmts) -}; - -static XpOidDocFmt DefaultRawFormatsSupportedFmts[] = { - { "Postscript", "2", NULL } -}; -static XpOidDocFmtList DefaultRawFormatsSupported = { - DefaultRawFormatsSupportedFmts, XpNumber(DefaultRawFormatsSupportedFmts) -}; - -static XpOidList ValidInputTrays = { - (XpOid *)NULL, 0 -}; - -static XpOid ValidMediumSizesOids[] = { - xpoid_val_medium_size_iso_a0, - xpoid_val_medium_size_iso_a1, - xpoid_val_medium_size_iso_a2, - xpoid_val_medium_size_iso_a3, - xpoid_val_medium_size_iso_a4, - xpoid_val_medium_size_iso_a5, - xpoid_val_medium_size_iso_a6, - xpoid_val_medium_size_iso_a7, - xpoid_val_medium_size_iso_a8, - xpoid_val_medium_size_iso_a9, - xpoid_val_medium_size_iso_a10, - xpoid_val_medium_size_iso_b0, - xpoid_val_medium_size_iso_b1, - xpoid_val_medium_size_iso_b2, - xpoid_val_medium_size_iso_b3, - xpoid_val_medium_size_iso_b4, - xpoid_val_medium_size_iso_b5, - xpoid_val_medium_size_iso_b6, - xpoid_val_medium_size_iso_b7, - xpoid_val_medium_size_iso_b8, - xpoid_val_medium_size_iso_b9, - xpoid_val_medium_size_iso_b10, - xpoid_val_medium_size_na_letter, - xpoid_val_medium_size_na_legal, - xpoid_val_medium_size_executive, - xpoid_val_medium_size_folio, - xpoid_val_medium_size_invoice, - xpoid_val_medium_size_ledger, - xpoid_val_medium_size_quarto, - xpoid_val_medium_size_iso_c3, - xpoid_val_medium_size_iso_c4, - xpoid_val_medium_size_iso_c5, - xpoid_val_medium_size_iso_c6, - xpoid_val_medium_size_iso_designated_long, - xpoid_val_medium_size_na_10x13_envelope, - xpoid_val_medium_size_na_9x12_envelope, - xpoid_val_medium_size_na_number_10_envelope, - xpoid_val_medium_size_na_7x9_envelope, - xpoid_val_medium_size_na_9x11_envelope, - xpoid_val_medium_size_na_10x14_envelope, - xpoid_val_medium_size_na_number_9_envelope, - xpoid_val_medium_size_monarch_envelope, - xpoid_val_medium_size_a, - xpoid_val_medium_size_b, - xpoid_val_medium_size_c, - xpoid_val_medium_size_d, - xpoid_val_medium_size_e, - xpoid_val_medium_size_jis_b0, - xpoid_val_medium_size_jis_b1, - xpoid_val_medium_size_jis_b2, - xpoid_val_medium_size_jis_b3, - xpoid_val_medium_size_jis_b4, - xpoid_val_medium_size_jis_b5, - xpoid_val_medium_size_jis_b6, - xpoid_val_medium_size_jis_b7, - xpoid_val_medium_size_jis_b8, - xpoid_val_medium_size_jis_b9, - xpoid_val_medium_size_jis_b10 -}; -static XpOidList ValidMediumSizes = { - ValidMediumSizesOids, XpNumber(ValidMediumSizesOids) -}; - -static XpOidDocFmt DefaultDocumentFormat = { - "Postscript", "2", NULL -}; - -static XpOid ValidAvailableCompressionsOids[] = { - xpoid_val_available_compressions_0, - xpoid_val_available_compressions_01, - xpoid_val_available_compressions_02, - xpoid_val_available_compressions_03, - xpoid_val_available_compressions_012, - xpoid_val_available_compressions_013, - xpoid_val_available_compressions_023, - xpoid_val_available_compressions_0123 -}; - -static XpOidList ValidAvailableCompressions = { - ValidAvailableCompressionsOids, XpNumber(ValidAvailableCompressionsOids) -}; - -static XpOid DefaultAvailableCompressionsOids[] = { - xpoid_val_available_compressions_0123, - xpoid_val_available_compressions_0 -}; - -static XpOidList DefaultAvailableCompressions = { - DefaultAvailableCompressionsOids, XpNumber(DefaultAvailableCompressionsOids) -}; - - -/* - * init struct for XpValidate*Pool - */ -XpValidatePoolsRec RasterValidatePoolsRec = { - &ValidContentOrientations, &DefaultContentOrientations, - &ValidDocFormatsSupported, &DefaultDocFormatsSupported, - &ValidInputTrays, &ValidMediumSizes, - &ValidPlexes, &DefaultPlexes, - &ValidPrinterResolutions, &DefaultPrinterResolutions, - &ValidEmbeddedFormatsSupported, &DefaultEmbeddedFormatsSupported, - &ValidListfontsModes, &DefaultListfontsModes, - &ValidRawFormatsSupported, &DefaultRawFormatsSupported, - &ValidSetupProviso, - &DefaultDocumentFormat, - &ValidAvailableCompressions, &DefaultAvailableCompressions -}; diff --git a/nx-X11/programs/Xserver/Xprint/spooler.c b/nx-X11/programs/Xserver/Xprint/spooler.c deleted file mode 100644 index f709c57ab..000000000 --- a/nx-X11/programs/Xserver/Xprint/spooler.c +++ /dev/null @@ -1,204 +0,0 @@ - -/* $Xorg: spooler.c,v 1.1 2003/09/14 1:19:56 gisburn Exp $ */ -/* -Copyright (c) 2003-2004 Roland Mainz -Copyright (c) 2004 Sun Microsystems, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef __hpux -#include -#endif - -#include "spooler.h" - -/* - * The string LIST_QUEUES_* is fed to a shell to generate an ordered - * list of available printers on the system. These string definitions - * are taken from the file PrintSubSys.C within the code for the - * dtprintinfo program. - */ -#define LIST_QUEUES_AIX4 \ - "lsallq | grep -v '^bsh$' | sort | uniq" - -#define LIST_QUEUES_HPUX \ - "LANG=C lpstat -v | " \ - "awk '" \ - " $2 == \"for\" " \ - " { " \ - " x = match($3, /:/); " \ - " print substr($3, 1, x-1)" \ - " }' | sort | uniq" - -#define LIST_QUEUES_OSF \ - "LANG=C lpstat -v | " \ - "nawk '" \ - " $2 == \"for\" " \ - " { print $4 }' " \ - " | sort | uniq" - -#define LIST_QUEUES_UXP \ - "LANG=C lpstat -v |" \ - "nawk '" \ - " $4 == \"for\" " \ - " { " \ - " x = match($5, /:/); " \ - " print substr($5, 1, x-1)" \ - " }' | sort | uniq" - -/* Support both normal and LPRng output of "lpc status" */ -#define LIST_QUEUES_BSD \ - "PATH=\"${PATH}:/usr/bin:/usr/sbin:/bin:/sbin\"\n" \ - "export PATH\n" \ - \ - "which_tool()\n" \ - "{\n" \ - " echo \"${PATH}\" | tr \":\" \"\n\" | while read i ; do ls -1ad \"${i}/${1}\" 2>/dev/null ; done\n" \ - "}\n" \ - \ - "(\n" \ - "WHICH_LPC=\"`which_tool lpc`\"\n" \ - \ - "if [ \"`which_tool nawk`\" != \"\" ] ; then\n" \ - " NAWK=\"nawk\"\n" \ - "else\n" \ - " NAWK=\"awk\"\n" \ - "fi\n" \ - \ - "[ \"${WHICH_LPC}\" != \"\" ] && (LANG=C lpc status | ${NAWK} '/^[^ ]*:$/ && !/@/ && !/ / { print $1 }' | sed -e /:/s///)\n" \ - "[ \"${WHICH_LPC}\" != \"\" ] && (LANG=C lpc -a status | ${NAWK} '/^[^ ]*@[^ ]/ && !/:$/ { split( $1, name, \"@\" ); print name[1]; }')\n" \ - ") | egrep -v -i \" |^all$\" | sort | uniq" - -#define LIST_QUEUES_SYSV \ - "PATH=\"${PATH}:/usr/bin:/usr/sbin:/bin:/sbin\"\n" \ - "export PATH\n" \ - \ - "which_tool()\n" \ - "{\n" \ - " echo \"${PATH}\" | tr \":\" \"\n\" | while read i ; do ls -1ad \"${i}/${1}\" 2>/dev/null ; done\n" \ - "}\n" \ - \ - "(\n" \ - "WHICH_LPSTAT=\"`which_tool lpstat`\"\n" \ - \ - "if [ \"`which_tool nawk`\" != \"\" ] ; then\n" \ - " NAWK=\"nawk\"\n" \ - "else\n" \ - " NAWK=\"awk\"\n" \ - "fi\n" \ - \ - "[ \"${WHICH_LPSTAT}\" != \"\" ] && (LANG=C lpstat -v | ${NAWK} ' $2 == \"for\" { x = match($3, /:/); print substr($3, 1, x-1) }')\n" \ - ") | egrep -v -i \" |^all$\" | sort | uniq" - -#define LIST_QUEUES_SOLARIS "LANG=C lpget -k description " \ - "`lpstat -v " \ - "| nawk '$2 == \"for\" { x = match($3, /:/); print substr($3, 1,x-1) }' " \ - "| sort -u` " \ - "| nawk -F: ' NF == 2 { name=$1 } " \ - " NF == 1 { sub(\"^.*description\\( - undefined|=\\)\",\"\"); " \ - " printf \"%s\txp-printerattr.descriptor=%s\\n\", name, $1 } '" - -#define LIST_QUEUES_OTHER \ - "LANG=C lpstat -v | " \ - "nawk '" \ - " $2 == \"for\" " \ - " { " \ - " x = match($3, /:/); " \ - " print substr($3, 1, x-1)" \ - " }' | sort | uniq" - -#define DEFAULT_SPOOL_COMMAND_HPUX "/usr/bin/lp -d %printer-name% -o raw -n %copy-count% -t %job-name% %options%" -#define DEFAULT_SPOOL_COMMAND_BSD "/usr/bin/lpr -P %printer-name% -#%copy-count% -T %job-name% %options%" -#define DEFAULT_SPOOL_COMMAND_SYSV "/usr/bin/lp -d %printer-name% -n %copy-count% -t %job-name% %options%" -#define DEFAULT_SPOOL_COMMAND_SOLARIS "/usr/bin/lp -d %printer-name% -n %copy-count% -t %job-name% %options%" -#define DEFAULT_SPOOL_COMMAND_OTHER "/usr/bin/lp -d %printer-name% -n %copy-count% -t %job-name% %options%" - - -/* List of spooler types and the commands used to enumerate - * print queues and submit print jobs */ -XpSpoolerType xpstm[] = -{ - /* OS-specific spoolers */ - { "aix", LIST_QUEUES_AIX4, DEFAULT_SPOOL_COMMAND_OTHER }, - { "aix4", LIST_QUEUES_AIX4, DEFAULT_SPOOL_COMMAND_OTHER }, - { "bsd", LIST_QUEUES_BSD, DEFAULT_SPOOL_COMMAND_BSD }, - { "osf", LIST_QUEUES_OSF, DEFAULT_SPOOL_COMMAND_OTHER }, - { "solaris", LIST_QUEUES_SOLARIS, DEFAULT_SPOOL_COMMAND_SOLARIS }, - { "sysv", LIST_QUEUES_SYSV, DEFAULT_SPOOL_COMMAND_SYSV }, - { "uxp", LIST_QUEUES_UXP, DEFAULT_SPOOL_COMMAND_OTHER }, - /* crossplatform spoolers */ - { "cups", LIST_QUEUES_SYSV, DEFAULT_SPOOL_COMMAND_SYSV }, - { "lprng", LIST_QUEUES_BSD, DEFAULT_SPOOL_COMMAND_BSD }, - /* misc */ - { "other", LIST_QUEUES_OTHER, DEFAULT_SPOOL_COMMAND_OTHER }, - { "none", NULL, NULL }, - { NULL, NULL, NULL } -}; - -/* Used by Init.c and attributes.c */ -XpSpoolerTypePtr spooler_type = NULL; - -XpSpoolerTypePtr XpSpoolerNameToXpSpoolerType(char *name) -{ - XpSpoolerTypePtr curr = xpstm; - - while( curr->name != NULL ) - { - if( !strcasecmp(name, curr->name) ) - return curr; - - curr++; - } - - return NULL; -} - -static char *spooler_namelist = NULL; - -char *XpGetSpoolerTypeNameList(void) -{ - if( spooler_namelist ) - return spooler_namelist; - - return XPDEFAULTSPOOLERNAMELIST; -} - -void XpSetSpoolerTypeNameList(char *namelist) -{ - spooler_namelist = namelist; -} - - diff --git a/nx-X11/programs/Xserver/Xprint/spooler.h b/nx-X11/programs/Xserver/Xprint/spooler.h deleted file mode 100644 index 4e9b4aefc..000000000 --- a/nx-X11/programs/Xserver/Xprint/spooler.h +++ /dev/null @@ -1,76 +0,0 @@ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifndef SPOOLER_H -#define SPOOLER_H 1 - -/* $Xorg: spooler.h,v 1.1 2003/09/14 1:19:56 gisburn Exp $ */ -/* -Copyright (c) 2003-2004 Roland Mainz - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from said -copyright holders. -*/ - -/* - * Define platform-specific default spooler type - */ -#if defined(sun) -#define XPDEFAULTSPOOLERNAMELIST "solaris" -#elif defined(AIXV4) -#define XPDEFAULTSPOOLERNAMELIST "aix4" -#elif defined(hpux) -#define XPDEFAULTSPOOLERNAMELIST "hpux" -#elif defined(__osf__) -#define XPDEFAULTSPOOLERNAMELIST "osf" -#elif defined(__uxp__) -#define XPDEFAULTSPOOLERNAMELIST "uxp" -#elif defined(CSRG_BASED) || defined(linux) -/* ToDo: This should be "cups:bsd" in the future, but for now - * the search order first-bsd-then-cups is better for backwards - * compatibility. - */ -#define XPDEFAULTSPOOLERNAMELIST "bsd:cups" -#else -#define XPDEFAULTSPOOLERNAMELIST "other" -#endif - -typedef struct -{ - const char *name; - const char *list_queues_command; - const char *spool_command; -} XpSpoolerType, *XpSpoolerTypePtr; - -/* prototypes */ -extern XpSpoolerTypePtr XpSpoolerNameToXpSpoolerType(char *name); -extern void XpSetSpoolerTypeNameList(char *namelist); -extern char *XpGetSpoolerTypeNameList(void); - -/* global vars */ -extern XpSpoolerTypePtr spooler_type; -extern XpSpoolerType xpstm[]; - -#endif /* !SPOOLER_H */ - diff --git a/nx-X11/programs/Xserver/Xprint/svg/README b/nx-X11/programs/Xserver/Xprint/svg/README deleted file mode 100644 index 3ac0950c1..000000000 --- a/nx-X11/programs/Xserver/Xprint/svg/README +++ /dev/null @@ -1 +0,0 @@ -Tracking bug for this work is http://xprint.mozdev.org/bugs/show_bug.cgi?id=5401 diff --git a/nx-X11/programs/Xserver/Xprint/windows/README b/nx-X11/programs/Xserver/Xprint/windows/README deleted file mode 100644 index 90cba8d04..000000000 --- a/nx-X11/programs/Xserver/Xprint/windows/README +++ /dev/null @@ -1 +0,0 @@ -Tracking bug for this work is http://xprint.mozdev.org/bugs/show_bug.cgi?id=3530 diff --git a/nx-X11/programs/Xserver/Xvfb.def b/nx-X11/programs/Xserver/Xvfb.def deleted file mode 100644 index 0f3d138b9..000000000 --- a/nx-X11/programs/Xserver/Xvfb.def +++ /dev/null @@ -1,4 +0,0 @@ -NAME Xvfb WINDOWCOMPAT -DESCRIPTION "@#XFREE86:4.4.0#@ $XFree86: xc/programs/Xserver/Xvfb.def,v 3.3 2002/05/31 18:45:53 dawes Exp $" -PROTMODE -EXETYPE OS2 diff --git a/nx-X11/programs/Xserver/afb/Imakefile b/nx-X11/programs/Xserver/afb/Imakefile deleted file mode 100644 index 340f3ba2e..000000000 --- a/nx-X11/programs/Xserver/afb/Imakefile +++ /dev/null @@ -1,67 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/afb/Imakefile,v 3.6 1999/08/14 10:49:26 dawes Exp $ -XCOMM $XConsortium: Imakefile,v 1.38 94/03/11 18:47:47 dpw Exp $ -#define IHaveModules -#include - -#if (defined(XFree86Version) || defined(XorgVersion)) -#if DoLoadableServer -MODSRC = afbmodule.c -MODOBJ = afbmodule.o -#endif -#endif - -SRCS1 = afbgc.c afbwindow.c afbfont.c afbfillrct.c afbpntwin.c afbpixmap.c \ - afbimage.c afbline.c afbbres.c afbhrzvert.c afbbresd.c afbpushpxl.c \ - afbzerarc.c afbfillarc.c afbfillsp.c afbsetsp.c afbscrinit.c \ - afbclip.c afbbitblt.c afbgetsp.c afbpolypnt.c afbbltC.c afbbltX.c \ - afbbltCI.c afbbltO.c afbbltG.c afbcmap.c afbtileC.c afbtileG.c \ - afbmisc.c afbbstore.c - -SRCS = $(SRCS1) afbseg.c afbbltC.c afbbltX.c afbbltCI.c afbbltO.c afbbltG.c \ - afbtileC.c afbtileG.c $(MODSRC) - -OBJS = afbgc.o afbwindow.o afbfont.o afbpixmap.o afbfillsp.o afbsetsp.o \ - afbscrinit.o afbclip.o afbbitblt.o afbgetsp.o afbbltC.o afbbltX.o \ - afbbltCI.o afbbltO.o afbbltG.o afbcmap.o afbimage.o afbzerarc.o \ - afbfillarc.o afbply1rct.o afbtileC.o afbtileG.o afbfillrct.o \ - afbpolypnt.o afbmisc.o afbbstore.o afbbresd.o afbimggblt.o \ - afbpushpxl.o afbplygblt.o afbtegblt.o afbpntwin.o afbpntarea.o \ - afbbres.o afbhrzvert.o afbline.o afbseg.o $(MODOBJ) - -INCLUDES = -I. -I../cfb -I../mfb -I../mi -I../include -I$(XINCLUDESRC) \ - -I$(FONTINCSRC) $(EXTRAINCLUDES) -LINTDEFS = -DMFBPOLYGLYPHBLT=afbPolyGlyphBltWhite \ - -DMFBIMAGEGLYPHBLT=afbImageGlyphBltWhite \ - -DEQWHOLEWORD=MFB_EQWHOLEWORD_WHITE -DOPEQ=MFB_OPEQ_WHITE - -LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln \ - ../mfb/llib-lmfb.ln ../mi/llib-lmi.ln - -ModuleObjectRule() -LibraryModuleTarget(afb,$(OBJS)) -LintLibraryTarget(afb,$(SRCS1)) -NormalLintTarget($(LINTDEFS) $(SRCS1)) - -ObjectFromSpecialSource(afbseg,afbline,-DPOLYSEGMENT) - -ObjectFromSpecialSource(afbbltC,afbblt,-DMROP=Mcopy) - -ObjectFromSpecialSource(afbbltX,afbblt,-DMROP=Mxor) - -ObjectFromSpecialSource(afbbltCI,afbblt,-DMROP=McopyInverted) - -ObjectFromSpecialSource(afbbltO,afbblt,-DMROP=Mor) - -ObjectFromSpecialSource(afbbltG,afbblt,-DMROP=0) - -ObjectFromSpecialSource(afbtileC,afbtile,-DMROP=Mcopy) - -ObjectFromSpecialSource(afbtileG,afbtile,-DMROP=0) - -InstallLibraryModule(afb,$(MODULEDIR),.) - -DependTarget() - -InstallDriverSDKLibraryModule(afb,$(DRIVERSDKMODULEDIR),.) - -InstallDriverSDKNonExecFile(afb.h,$(DRIVERSDKINCLUDEDIR)) diff --git a/nx-X11/programs/Xserver/afb/README b/nx-X11/programs/Xserver/afb/README deleted file mode 100644 index 5c9586013..000000000 --- a/nx-X11/programs/Xserver/afb/README +++ /dev/null @@ -1,10 +0,0 @@ - -All stuff in this directory is based on Xdaniver (read Xdaniver.doc). - -Actually this is the same code as in the ilbm directory, except that here the -conversion from normal bitplanes to interleaved bitplanes didn't happen. - --- -Geert Uytterhoeven Geert.Uytterhoeven@cs.kuleuven.ac.be -Wavelets, Linux/m68k on Amiga http://www.cs.kuleuven.ac.be/~geert/ -Department of Computer Science -- Katholieke Universiteit Leuven -- Belgium diff --git a/nx-X11/programs/Xserver/afb/Xdaniver.doc b/nx-X11/programs/Xserver/afb/Xdaniver.doc deleted file mode 100644 index 1c8ad5ad4..000000000 --- a/nx-X11/programs/Xserver/afb/Xdaniver.doc +++ /dev/null @@ -1,218 +0,0 @@ - -What is it? ------------ - -Xdaniver is a fast, colour X11R6 server for the Amiga's custom chip set -under NetBSD 1.0 and NetBSD-current, supporting all the Amiga's display -depths from 1 to 4 (upto 16 colours) on ECS machines and 1 to 8 (upto 256 -colours) on AGA machines (though, not all resolutions are available, see -General Information below). - -Xdaniver is designed to be a drop-in replacement for the Xmono server provided -with the X11R6 binary distribution supplied by Bernd Ernesti available from -ftp.uni-regensburg.de or one of its mirrors. - -Unlike previous colour X servers for the Amiga that emulate a chunky pixel -screen in fast RAM, use the standard frame buffer drivers provided with the -X11R6 source code to draw and then use a chunky to planar conversion routine -to write the results to the screen (all very slow), Xdaniver uses a heavily -modified mono frame buffer driver to draw directly using the Amiga's planar -format. The net result is much faster drawing and support for all the Amiga's -custom display depths but, as usual, the fewer planes used, the faster the -drawing operations of the X server. Even so, on my A1200 with a 33Mhz 68030, -I'm getting reasonable performance when using 8 bit planes in Dbl NTSC mode. - -Installation ------------- - -You will need to have first obtained and installed the X11R6 binary -distribution available from ftp.uni-regensburg.de in -/pub/NetBSD-Amiga/contrib/X11 or one of its mirrors. Xdaniver has been -compiled to expect font and configuration files sitting under -/usr/local/X11R6, if your setup is different you will need to provide a -symbolic link from /usr/local/X11R6 to where your tree resides or supply -several command line flags to the server. - -To get Xdaniver running as the default X server, copy the uncompressed binary -into /usr/local/X11R6/bin, remove the current X file from that directory -(which is a symbolic link to Xmono) and replace it with a link to Xdaniver: - - gzip -d < X11R6.Xdaniver.1.01.tar.gz | tar xvf - - mv Xdaniver /usr/local/X11R6/bin - cd /usr/local/X11R6/bin - rm X - ln -s Xdaniver X - -Note that on some setups, the devices /dev/kbd, /dev/mouse and /dev/view?? -have been created to be accessable only by superuser; Xdaniver needs to open -these devices. To workaround this problem, log on as superuser and then -either make Xdaniver setuid root: - - chown root Xdaniver - chmod 4755 Xdaniver - -or give everyone access the devices: - - chmod 666 /dev/kbd /dev/mouse /dev/view?? - -the latter option is a possible cause of a security hole if your machine is -ever used multi-user. - -General Information -------------------- - -The default resolution of the server is 700x430 and the default depth 4. AGA -users might what to increase the display depth by editing the startx script -and providing a -depth argument to Xdaniver on the xinit line of the -script. As always, the lower the depth, the faster the drawing and window -manipulation of the server. - -The resolution can be altered similarly by suppling -width and --height arguments to the server. - -The NetBSD kernel selects actual screen modes by picking a mode who's -natural, non-overscanned size best-fits the requested resolution. -Unfortunately, for AGA users, the 1.0 kernel only has support for the -Dbl-NTSC AGA display mode and only this mode has support for depths greater -than 4. The NetBSD-current (work-in-progress) kernel also has support for -Dbl-PAL but still no support for the Super72 or other super-hires modes -(perhaps some kind, kernel-hacker could add support for them ?). - -If you have a 2 button mouse (like me) you might want to try and use the 3 -button mouse emulation. On other systems, it is usual for the left and right -buttons to be provided and emulate the middle button by pressing both -buttons together, however, the middle button is tends to be used more than -the right button so I have provided two options: - --emulateright (or -3), the two physical mouse buttons act as left and middle -and pressing them both together emulates the right button. - --emulatemiddle (or -2), the two physical mouse buttons act as left and right -and pressing them both together emulated the middle button. - -When using screen depths of less than 6 (4 is the maximum for ECS machines) -the lack of possible colours on screen at once causes problems for many X -applications. Specifying -cc 2 as a command line argument to Xdaniver -causes the server to switch the default visual type from PsuedoColor to -StaticColor; to put it simply, the server prefills the colormap with a -selection of 16 colours (depth 4) and when an application asks for a -particular colour, its gets allocated one that is closest to one from the -selection of 16. This removes the 'WARNING: Cannot allocate colormap entry -for "XXX"' errors but at the expense of applications not being able to get -the precise colour they wanted. Also, some badly written X applications fail -altogether when presented with a StaticColor visual. - -Bugs/Limitations ----------------- - -The limited choice of display resolutions for AGA/ECS machines is a real -pain - requires a kernel change to fix. Worse still, the kernel specifies -the maximum overscan resolution on the Dbl-NTSC to be 724x482 but selecting -anything more than 702x430 on my machine causes the screen either sheer -diagonally (as if the bytes per row calculation in Xdaniver or the kernel is -wrong) or completely loose sync (suggesting a custom chip register sync -calculation bug). As other, non-aga modes aren't affected when selection -overscan both problems seem to point to a kernel driver bug. Also, depths -greater than 4 for AGA users are only supported by the kernel in the Dbl-NTSC -mode (and Dbl-PAL with the current-NetBSD kernel). - -I know of one bug so-far (there will be more), The PutImage request of an XY -format image expects the bitplane order to be the reverse of that specified -in the X protocol but since virtually all applications use the Z (chunky) -format, you are unlikely to come across this problem. - -The PutImage request of Z format images is a little slow - when I have time -I'll try and add one of the fast assembly chunky-to-planar routines developed -for doom style games/demos. Unfortunately, the current crop all require a -picture size that is a multiple of 32 pixels and so cannot be used out-of-the- -box. - -Some extra performance could easily be squeezed out of the terminal font -drawing code (used by xterm) - when I have time I'll add the code. - -The Amiga's blitter and sprites are totally unused and will remain so -until/if someone else adds support to the kernel. The blitter would help -speed up screen scrolling and window manipulation and sprite support could -be used for the X pointer shape (if small enough) which would speed up all -drawing operations (no need to remove the software based pointer shape -first, draw, then replace the pointer shape). - -I removed the X image extension (XIE) from the X server as it increased the -size of the binary by some 400k. I haven't come across any applications that -need it yet (I haven't been looking!) so if you need the extension for some -reason send me e-mail and I'll build a server with the extension included. - -The 3 button mouse emulation is very simple - to emulate the 3rd button you -have to press both button precisely at the same moment - I've got quite good -at it now. When I have some spare time I'll add a timer so you will have a -few milli-seconds between one button being pressed and the next and it still -being registered as the emulated button. - -AGA users don't forget to provide the -A flag to loadbsd to enable the one -AGA mode in the 1.0 kernel but only if you have a VGA, multisync or dual-scan -monitor, of course ! - -Xdaniver has been tested on: - -A1200, 33Mhz 68030, 8Mb RAM and NetBSD 1.0 by myself. -A4000/40, 12Mb RAM and NetBSD 1.0 by Andreas Holzhammer. -A3000, 12Mb RAM and NetBSD 1.0 by Charlie Root, Stuart Park and others. -A3000, 25Mhz 68040, 18Mb RAM and NetBSD-current by Michael K. Sanders. -A2000, 8Mb RAM and NetBSD (version unknown) by Hubert Feyrer. - -Release and Bug Fix History ---------------------------- - -1.0 - First release - -1.01 Bugs fixed: - - Narrow (<32 pixels) Z format GetImage requests corrupted the stack - and could cause the server to core dump. (Xpaint caused this problem) - - Drawing dots (PolyPoint request) into a clipped window caused a - c pointer to go out of range, causing a core dump (xv showed this - problem). - - New features: - - Simple 3 button mouse emulation using a 2 button mouse; specify - -emulate_middle (or -2) or -emulate_right (or -3) on the server's - command line and press both mouse buttons together emulate the 'missing' - button. - - Basic beep sound support added by sending bell characters to the - console. - - Source code released. - -Disclaimer and Copyright Notices --------------------------------- - -Multi-depth planar frame buffer code: -Copyright (c) 1995 by Daniver Limited. - -Large portions: -Copyright (c) 1994 by Eduardo Horvath. -Copyright (c) 1987-1995 by the Regents of the University of California. -Copyright (c) 1987 by Sun Microsystems, Inc. Mountain View, CA. -Copyright (c) 1987-1995 by X Consortium. -Copyright (c) 1987, 1989 by Digital Equipment Corporation, Maynard, Massachusetts. -Copyright (c) 1989 Network Computing Devices, Inc., Mountain View, California. - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, provided -that the above copyright notice appear in all copies. The Daniver Limited, -the above companies and individuals makes no representations about the -suitability of this software for any purpose. It is provided "as is" without -express or implied warranty. - -Credits -------- - -Thanks to Bernd Ernesti for making the operating system server source code -available for others to use and Eduardo Horvath and Andy Heffernan, who (I -think) did the original Xmono server port. - -Also, many thanks to the first brave users who tested Xdaniver for me on other -Amiga setups and found a few bugs in the process. - -Gary Henderson. - -Daytime: garyh@wet.sbi.com -Home: gary@daniver.demon.co.uk diff --git a/nx-X11/programs/Xserver/afb/afb.h b/nx-X11/programs/Xserver/afb/afb.h deleted file mode 100644 index 708fe7643..000000000 --- a/nx-X11/programs/Xserver/afb/afb.h +++ /dev/null @@ -1,1132 +0,0 @@ -/* $XFree86: xc/programs/Xserver/afb/afb.h,v 3.10 2003/10/29 22:15:19 tsi Exp $ */ -/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */ -/*********************************************************** - -Copyright (c) 1987 X Consortium - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of the X Consortium shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from the X Consortium. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XConsortium: afb.h,v 5.31 94/04/17 20:28:15 dpw Exp $ */ -/* Monochrome Frame Buffer definitions - written by drewry, september 1986 -*/ - -#include "pixmap.h" -#include "region.h" -#include "gc.h" -#include "colormap.h" -#include "regionstr.h" -#include "mibstore.h" -#include "mfb.h" - -extern int afbInverseAlu[]; -extern int afbScreenPrivateIndex; -/* warning: PixelType definition duplicated in maskbits.h */ -#ifndef PixelType -#define PixelType CARD32 -#endif /* PixelType */ - -#define AFB_MAX_DEPTH 8 - -/* afbbitblt.c */ - -extern void afbDoBitblt( - DrawablePtr /*pSrc*/, - DrawablePtr /*pDst*/, - int /*alu*/, - RegionPtr /*prgnDst*/, - DDXPointPtr /*pptSrc*/, - unsigned long /*planemask*/ -); - -extern RegionPtr afbBitBlt( - DrawablePtr /*pSrc*/, - DrawablePtr /*pDst*/, - GCPtr /*pGC*/, - int /*srcx*/, - int /*srcy*/, - int /*width*/, - int /*height*/, - int /*dstx*/, - int /*dsty*/, - void (*doBitBlt)( - DrawablePtr /*pSrc*/, - DrawablePtr /*pDst*/, - int /*alu*/, - RegionPtr /*prgnDst*/, - DDXPointPtr /*pptSrc*/, - unsigned long /*planemask*/ - ), - unsigned long /*planemask*/ -); - -extern RegionPtr afbCopyArea( - DrawablePtr /*pSrcDrawable*/, - DrawablePtr /*pDstDrawable*/, - GCPtr/*pGC*/, - int /*srcx*/, - int /*srcy*/, - int /*width*/, - int /*height*/, - int /*dstx*/, - int /*dsty*/ -); - -extern RegionPtr afbCopyPlane( - DrawablePtr /*pSrcDrawable*/, - DrawablePtr /*pDstDrawable*/, - GCPtr/*pGC*/, - int /*srcx*/, - int /*srcy*/, - int /*width*/, - int /*height*/, - int /*dstx*/, - int /*dsty*/, - unsigned long /*plane*/ -); - -extern void afbCopy1ToN( - DrawablePtr /*pSrc*/, - DrawablePtr /*pDst*/, - int /*alu*/, - RegionPtr /*prgnDst*/, - DDXPointPtr /*pptSrc*/, - unsigned long /*planemask*/ -); -/* afbbltC.c */ - -extern void afbDoBitbltCopy( - DrawablePtr /*pSrc*/, - DrawablePtr /*pDst*/, - int /*alu*/, - RegionPtr /*prgnDst*/, - DDXPointPtr /*pptSrc*/, - unsigned long /*planemask*/ -); -/* afbbltCI.c */ - -extern void afbDoBitbltCopyInverted( - DrawablePtr /*pSrc*/, - DrawablePtr /*pDst*/, - int /*alu*/, - RegionPtr /*prgnDst*/, - DDXPointPtr /*pptSrc*/, - unsigned long /*planemask*/ -); -/* afbbltG.c */ - -extern void afbDoBitbltGeneral( - DrawablePtr /*pSrc*/, - DrawablePtr /*pDst*/, - int /*alu*/, - RegionPtr /*prgnDst*/, - DDXPointPtr /*pptSrc*/, - unsigned long /*planemask*/ -); -/* afbbltO.c */ - -extern void afbDoBitbltOr( - DrawablePtr /*pSrc*/, - DrawablePtr /*pDst*/, - int /*alu*/, - RegionPtr /*prgnDst*/, - DDXPointPtr /*pptSrc*/, - unsigned long /*planemask*/ -); -/* afbbltX.c */ - -extern void afbDoBitbltXor( - DrawablePtr /*pSrc*/, - DrawablePtr /*pDst*/, - int /*alu*/, - RegionPtr /*prgnDst*/, - DDXPointPtr /*pptSrc*/, - unsigned long /*planemask*/ -); -/* afbbres.c */ - -extern void afbBresS( - PixelType * /*addrl*/, - int /*nlwidth*/, - int /*sizeDst*/, - int /*depthDst*/, - int /*signdx*/, - int /*signdy*/, - int /*axis*/, - int /*x1*/, - int /*y1*/, - int /*e*/, - int /*e1*/, - int /*e2*/, - int /*len*/, - unsigned char * /*rrops*/ -); -/* afbbresd.c */ - -extern void afbBresD( - int * /*pdashIndex*/, - unsigned char * /*pDash*/, - int /*numInDashList*/, - int * /*pdashOffset*/, - int /*isDoubleDash*/, - PixelType * /*addrl*/, - int /*nlwidth*/, - int /*sizeDst*/, - int /*depthDst*/, - int /*signdx*/, - int /*signdy*/, - int /*axis*/, - int /*x1*/, - int /*y1*/, - int /*e*/, - int /*e1*/, - int /*e2*/, - int /*len*/, - unsigned char * /*rrops*/, - unsigned char * /*bgrrops*/ -); -/* afbbstore.c */ - -extern void afbSaveAreas( - PixmapPtr /*pPixmap*/, - RegionPtr /*prgnSave*/, - int /*xorg*/, - int /*yorg*/, - WindowPtr /*pWin*/ -); - -extern void afbRestoreAreas( - PixmapPtr /*pPixmap*/, - RegionPtr /*prgnRestore*/, - int /*xorg*/, - int /*yorg*/, - WindowPtr /*pWin*/ -); -/* afbclip.c */ - -extern RegionPtr afbPixmapToRegion( - PixmapPtr /*pPix*/ -); - -/* afbcmap.c */ - -extern int afbListInstalledColormaps( - ScreenPtr /*pScreen*/, - Colormap * /*pmaps*/ -); - -extern void afbInstallColormap( - ColormapPtr /*pmap*/ -); - -extern void afbUninstallColormap( - ColormapPtr /*pmap*/ -); - -extern void afbResolveColor( - unsigned short * /*pred*/, - unsigned short * /*pgreen*/, - unsigned short * /*pblue*/, - VisualPtr /*pVisual*/ -); - -extern Bool afbInitializeColormap( - ColormapPtr /*pmap*/ -); - -extern int afbExpandDirectColors( - ColormapPtr /*pmap*/, - int /*ndefs*/, - xColorItem * /*indefs*/, - xColorItem * /*outdefs*/ -); - -extern Bool afbCreateDefColormap( - ScreenPtr /*pScreen*/ -); - -extern Bool afbSetVisualTypes( - int /*depth*/, - int /*visuals*/, - int /*bitsPerRGB*/ -); - -extern Bool afbInitVisuals( - VisualPtr * /*visualp*/, - DepthPtr * /*depthp*/, - int * /*nvisualp*/, - int * /*ndepthp*/, - int * /*rootDepthp*/, - VisualID * /*defaultVisp*/, - unsigned long /*sizes*/, - int /*bitsPerRGB*/ -); - -/* afbfillarc.c */ - -extern void afbPolyFillArcSolid( - DrawablePtr /*pDraw*/, - GCPtr /*pGC*/, - int /*narcs*/, - xArc * /*parcs*/ -); -/* afbfillrct.c */ - -extern void afbPolyFillRect( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*nrectFill*/, - xRectangle * /*prectInit*/ -); - -/* afbply1rct.c */ -extern void afbFillPolygonSolid( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*mode*/, - int /*shape*/, - int /*count*/, - DDXPointPtr /*ptsIn*/ -); - -/* afbfillsp.c */ - -extern void afbSolidFS( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*nInit*/, - DDXPointPtr /*pptInit*/, - int * /*pwidthInit*/, - int /*fSorted*/ -); - -extern void afbStippleFS( - DrawablePtr /*pDrawable*/, - GCPtr/*pGC*/, - int /*nInit*/, - DDXPointPtr /*pptInit*/, - int * /*pwidthInit*/, - int /*fSorted*/ -); - -extern void afbTileFS( - DrawablePtr /*pDrawable*/, - GCPtr/*pGC*/, - int /*nInit*/, - DDXPointPtr /*pptInit*/, - int * /*pwidthInit*/, - int /*fSorted*/ -); - -extern void afbUnnaturalTileFS( - DrawablePtr /*pDrawable*/, - GCPtr/*pGC*/, - int /*nInit*/, - DDXPointPtr /*pptInit*/, - int * /*pwidthInit*/, - int /*fSorted*/ -); - -extern void afbUnnaturalStippleFS( - DrawablePtr /*pDrawable*/, - GCPtr/*pGC*/, - int /*nInit*/, - DDXPointPtr /*pptInit*/, - int * /*pwidthInit*/, - int /*fSorted*/ -); - -extern void afbOpaqueStippleFS( - DrawablePtr /*pDrawable*/, - GCPtr/*pGC*/, - int /*nInit*/, - DDXPointPtr /*pptInit*/, - int * /*pwidthInit*/, - int /*fSorted*/ -); - -extern void afbUnnaturalOpaqueStippleFS( - DrawablePtr /*pDrawable*/, - GCPtr/*pGC*/, - int /*nInit*/, - DDXPointPtr /*pptInit*/, - int * /*pwidthInit*/, - int /*fSorted*/ -); - -/* afbfont.c */ - -extern Bool afbRealizeFont( - ScreenPtr /*pscr*/, - FontPtr /*pFont*/ -); - -extern Bool afbUnrealizeFont( - ScreenPtr /*pscr*/, - FontPtr /*pFont*/ -); -/* afbgc.c */ - -extern Bool afbCreateGC( - GCPtr /*pGC*/ -); - -extern void afbValidateGC( - GCPtr /*pGC*/, - unsigned long /*changes*/, - DrawablePtr /*pDrawable*/ -); - -extern void afbDestroyGC( - GCPtr /*pGC*/ -); - -extern void afbReduceRop( - int /*alu*/, - Pixel /*src*/, - unsigned long /*planemask*/, - int /*depth*/, - unsigned char * /*rrops*/ -); - -extern void afbReduceOpaqueStipple ( - Pixel /*fg*/, - Pixel /*bg*/, - unsigned long /*planemask*/, - int /*depth*/, - unsigned char * /*rrops*/ -); - -extern void afbComputeCompositeClip( - GCPtr /*pGC*/, - DrawablePtr /*pDrawable*/ -); - -/* afbgetsp.c */ - -extern void afbGetSpans( - DrawablePtr /*pDrawable*/, - int /*wMax*/, - DDXPointPtr /*ppt*/, - int * /*pwidth*/, - int /*nspans*/, - char * /*pdstStart*/ -); -/* afbhrzvert.c */ - -extern void afbHorzS( - PixelType * /*addrl*/, - int /*nlwidth*/, - int /*sizeDst*/, - int /*depthDst*/, - int /*x1*/, - int /*y1*/, - int /*len*/, - unsigned char * /*rrops*/ -); - -extern void afbVertS( - PixelType * /*addrl*/, - int /*nlwidth*/, - int /*sizeDst*/, - int /*depthDst*/, - int /*x1*/, - int /*y1*/, - int /*len*/, - unsigned char * /*rrops*/ -); -/* afbigbblak.c */ - -extern void afbImageGlyphBlt ( - DrawablePtr /*pDrawable*/, - GCPtr/*pGC*/, - int /*x*/, - int /*y*/, - unsigned int /*nglyph*/, - CharInfoPtr * /*ppci*/, - pointer /*pglyphBase*/ -); -/* afbigbwht.c */ - -/* afbimage.c */ - -extern void afbPutImage( - DrawablePtr /*dst*/, - GCPtr /*pGC*/, - int /*depth*/, - int /*x*/, - int /*y*/, - int /*w*/, - int /*h*/, - int /*leftPad*/, - int /*format*/, - char * /*pImage*/ -); - -extern void afbGetImage( - DrawablePtr /*pDrawable*/, - int /*sx*/, - int /*sy*/, - int /*w*/, - int /*h*/, - unsigned int /*format*/, - unsigned long /*planeMask*/, - char * /*pdstLine*/ -); -/* afbline.c */ - -extern void afbLineSS( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*mode*/, - int /*npt*/, - DDXPointPtr /*pptInit*/ -); - -extern void afbLineSD( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*mode*/, - int /*npt*/, - DDXPointPtr /*pptInit*/ -); - -/* afbmisc.c */ - -extern void afbQueryBestSize( - int /*class*/, - unsigned short * /*pwidth*/, - unsigned short * /*pheight*/, - ScreenPtr /*pScreen*/ -); -/* afbpntarea.c */ - -extern void afbSolidFillArea( - DrawablePtr /*pDraw*/, - int /*nbox*/, - BoxPtr /*pbox*/, - unsigned char * /*rrops*/ -); - -extern void afbStippleAreaPPW( - DrawablePtr /*pDraw*/, - int /*nbox*/, - BoxPtr /*pbox*/, - PixmapPtr /*pstipple*/, - unsigned char * /*rrops*/ -); -extern void afbStippleArea( - DrawablePtr /*pDraw*/, - int /*nbox*/, - BoxPtr /*pbox*/, - PixmapPtr /*pstipple*/, - int /*xOff*/, - int /*yOff*/, - unsigned char * /*rrops*/ -); -/* afbplygblt.c */ - -extern void afbPolyGlyphBlt( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*x*/, - int /*y*/, - unsigned int /*nglyph*/, - CharInfoPtr * /*ppci*/, - pointer /*pglyphBase*/ -); - -/* afbpixmap.c */ - -extern PixmapPtr afbCreatePixmap( - ScreenPtr /*pScreen*/, - int /*width*/, - int /*height*/, - int /*depth*/ -); - -extern Bool afbDestroyPixmap( - PixmapPtr /*pPixmap*/ -); - -extern PixmapPtr afbCopyPixmap( - PixmapPtr /*pSrc*/ -); - -extern void afbPadPixmap( - PixmapPtr /*pPixmap*/ -); - -extern void afbXRotatePixmap( - PixmapPtr /*pPix*/, - int /*rw*/ -); - -extern void afbYRotatePixmap( - PixmapPtr /*pPix*/, - int /*rh*/ -); - -extern void afbCopyRotatePixmap( - PixmapPtr /*psrcPix*/, - PixmapPtr * /*ppdstPix*/, - int /*xrot*/, - int /*yrot*/ -); -extern void afbPaintWindow( - WindowPtr /*pWin*/, - RegionPtr /*pRegion*/, - int /*what*/ -); -/* afbpolypnt.c */ - -extern void afbPolyPoint( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*mode*/, - int /*npt*/, - xPoint * /*pptInit*/ -); -/* afbpushpxl.c */ - -extern void afbPushPixels( - GCPtr /*pGC*/, - PixmapPtr /*pBitMap*/, - DrawablePtr /*pDrawable*/, - int /*dx*/, - int /*dy*/, - int /*xOrg*/, - int /*yOrg*/ -); -/* afbscrclse.c */ - -extern Bool afbCloseScreen( - int /*index*/, - ScreenPtr /*pScreen*/ -); -/* afbscrinit.c */ - -extern Bool afbAllocatePrivates( - ScreenPtr /*pScreen*/, - int * /*pWinIndex*/, - int * /*pGCIndex*/ -); - -extern Bool afbScreenInit( - ScreenPtr /*pScreen*/, - pointer /*pbits*/, - int /*xsize*/, - int /*ysize*/, - int /*dpix*/, - int /*dpiy*/, - int /*width*/ -); - -extern PixmapPtr afbGetWindowPixmap( - WindowPtr /*pWin*/ -); - -extern void afbSetWindowPixmap( - WindowPtr /*pWin*/, - PixmapPtr /*pPix*/ -); - -/* afbseg.c */ - -extern void afbSegmentSS( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*nseg*/, - xSegment * /*pSeg*/ -); - -extern void afbSegmentSD( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*nseg*/, - xSegment * /*pSeg*/ -); -/* afbsetsp.c */ - -extern void afbSetScanline( - int /*y*/, - int /*xOrigin*/, - int /*xStart*/, - int /*xEnd*/, - PixelType * /*psrc*/, - int /*alu*/, - PixelType * /*pdstBase*/, - int /*widthDst*/, - int /*sizeDst*/, - int /*depthDst*/, - int /*sizeSrc*/ -); - -extern void afbSetSpans( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - char * /*psrc*/, - DDXPointPtr /*ppt*/, - int * /*pwidth*/, - int /*nspans*/, - int /*fSorted*/ -); -/* afbtegblt.c */ - -extern void afbTEGlyphBlt( - DrawablePtr /*pDrawable*/, - GCPtr/*pGC*/, - int /*x*/, - int /*y*/, - unsigned int /*nglyph*/, - CharInfoPtr * /*ppci*/, - pointer /*pglyphBase*/ -); -/* afbtileC.c */ - -extern void afbTileAreaPPWCopy( - DrawablePtr /*pDraw*/, - int /*nbox*/, - BoxPtr /*pbox*/, - int /*alu*/, - PixmapPtr /*ptile*/, - unsigned long /*planemask*/ -); -/* afbtileG.c */ - -extern void afbTileAreaPPWGeneral( - DrawablePtr /*pDraw*/, - int /*nbox*/, - BoxPtr /*pbox*/, - int /*alu*/, - PixmapPtr /*ptile*/, - unsigned long /*planemask*/ -); - -extern void afbTileAreaCopy( - DrawablePtr /*pDraw*/, - int /*nbox*/, - BoxPtr /*pbox*/, - int /*alu*/, - PixmapPtr /*ptile*/, - int /*xOff*/, - int /*yOff*/, - unsigned long /*planemask*/ -); -/* afbtileG.c */ - -extern void afbTileAreaGeneral( - DrawablePtr /*pDraw*/, - int /*nbox*/, - BoxPtr /*pbox*/, - int /*alu*/, - PixmapPtr /*ptile*/, - int /*xOff*/, - int /*yOff*/, - unsigned long /*planemask*/ -); - -extern void afbOpaqueStippleAreaPPWCopy( - DrawablePtr /*pDraw*/, - int /*nbox*/, - BoxPtr /*pbox*/, - int /*alu*/, - PixmapPtr /*ptile*/, - unsigned char */*rropsOS*/, - unsigned long /*planemask*/ -); -/* afbtileG.c */ - -extern void afbOpaqueStippleAreaPPWGeneral( - DrawablePtr /*pDraw*/, - int /*nbox*/, - BoxPtr /*pbox*/, - int /*alu*/, - PixmapPtr /*ptile*/, - unsigned char */*rropsOS*/, - unsigned long /*planemask*/ -); - -extern void afbOpaqueStippleAreaCopy( - DrawablePtr /*pDraw*/, - int /*nbox*/, - BoxPtr /*pbox*/, - int /*alu*/, - PixmapPtr /*ptile*/, - int /*xOff*/, - int /*yOff*/, - unsigned char */*rropsOS*/, - unsigned long /*planemask*/ -); -/* afbtileG.c */ - -extern void afbOpaqueStippleAreaGeneral( - DrawablePtr /*pDraw*/, - int /*nbox*/, - BoxPtr /*pbox*/, - int /*alu*/, - PixmapPtr /*ptile*/, - int /*xOff*/, - int /*yOff*/, - unsigned char */*rropsOS*/, - unsigned long /*planemask*/ -); - -/* afbwindow.c */ - -extern Bool afbCreateWindow( - WindowPtr /*pWin*/ -); - -extern Bool afbDestroyWindow( - WindowPtr /*pWin*/ -); - -extern Bool afbMapWindow( - WindowPtr /*pWindow*/ -); - -extern Bool afbPositionWindow( - WindowPtr /*pWin*/, - int /*x*/, - int /*y*/ -); - -extern Bool afbUnmapWindow( - WindowPtr /*pWindow*/ -); - -extern void afbCopyWindow( - WindowPtr /*pWin*/, - DDXPointRec /*ptOldOrg*/, - RegionPtr /*prgnSrc*/ -); - -extern Bool afbChangeWindowAttributes( - WindowPtr /*pWin*/, - unsigned long /*mask*/ -); -/* afbzerarc.c */ - -extern void afbZeroPolyArcSS( - DrawablePtr /*pDraw*/, - GCPtr /*pGC*/, - int /*narcs*/, - xArc * /*parcs*/ -); - -/* - private field of pixmap - pixmap.devPrivate = (PixelType *)pointer_to_bits - pixmap.devKind = width_of_pixmap_in_bytes - - private field of screen - a pixmap, for which we allocate storage. devPrivate is a pointer to -the bits in the hardware framebuffer. note that devKind can be poked to -make the code work for framebuffers that are wider than their -displayable screen (e.g. the early vsII, which displayed 960 pixels -across, but was 1024 in the hardware.) - - private field of GC -*/ - -typedef struct { - unsigned char rrops[AFB_MAX_DEPTH]; /* reduction of rasterop to 1 of 3 */ - unsigned char rropOS[AFB_MAX_DEPTH]; /* rop for opaque stipple */ -} afbPrivGC; -typedef afbPrivGC *afbPrivGCPtr; - -extern int afbGCPrivateIndex; /* index into GC private array */ -extern int afbWindowPrivateIndex; /* index into Window private array */ -#ifdef PIXMAP_PER_WINDOW -extern int frameWindowPrivateIndex; /* index into Window private array */ -#endif - -#define afbGetGCPrivate(pGC) \ - ((afbPrivGC *)((pGC)->devPrivates[afbGCPrivateIndex].ptr)) - -/* private field of window */ -typedef struct { - unsigned char fastBorder; /* non-zero if border tile is 32 bits wide */ - unsigned char fastBackground; - unsigned short unused; /* pad for alignment with Sun compiler */ - DDXPointRec oldRotate; - PixmapPtr pRotatedBackground; - PixmapPtr pRotatedBorder; -} afbPrivWin; - -/* Common macros for extracting drawing information */ - -#define afbGetTypedWidth(pDrawable,wtype)( \ - (((pDrawable)->type == DRAWABLE_WINDOW) ? \ - (int)(((PixmapPtr)((pDrawable)->pScreen->devPrivates[afbScreenPrivateIndex].ptr))->devKind) : \ - (int)(((PixmapPtr)pDrawable)->devKind)) / sizeof (wtype)) - -#define afbGetByteWidth(pDrawable) afbGetTypedWidth(pDrawable, unsigned char) - -#define afbGetPixelWidth(pDrawable) afbGetTypedWidth(pDrawable, PixelType) - -#define afbGetTypedWidthAndPointer(pDrawable, width, pointer, wtype, ptype) {\ - PixmapPtr _pPix; \ - if ((pDrawable)->type == DRAWABLE_WINDOW) \ - _pPix = (PixmapPtr)(pDrawable)->pScreen->devPrivates[afbScreenPrivateIndex].ptr; \ - else \ - _pPix = (PixmapPtr)(pDrawable); \ - (pointer) = (ptype *) _pPix->devPrivate.ptr; \ - (width) = ((int) _pPix->devKind) / sizeof (wtype); \ -} - -#define afbGetPixelWidthSizeDepthAndPointer(pDrawable, width, size, dep, pointer) {\ - PixmapPtr _pPix; \ - if ((pDrawable)->type == DRAWABLE_WINDOW) \ - _pPix = (PixmapPtr)(pDrawable)->pScreen->devPrivates[afbScreenPrivateIndex].ptr; \ - else \ - _pPix = (PixmapPtr)(pDrawable); \ - (pointer) = (PixelType *)_pPix->devPrivate.ptr; \ - (width) = ((int)_pPix->devKind) / sizeof (PixelType); \ - (size) = (width) * _pPix->drawable.height; \ - (dep) = _pPix->drawable.depth; (void)(dep); \ -} - -#define afbGetByteWidthAndPointer(pDrawable, width, pointer) \ - afbGetTypedWidthAndPointer(pDrawable, width, pointer, unsigned char, unsigned char) - -#define afbGetPixelWidthAndPointer(pDrawable, width, pointer) \ - afbGetTypedWidthAndPointer(pDrawable, width, pointer, PixelType, PixelType) - -#define afbGetWindowTypedWidthAndPointer(pWin, width, pointer, wtype, ptype) {\ - PixmapPtr _pPix = (PixmapPtr)(pWin)->drawable.pScreen->devPrivates[afbScreenPrivateIndex].ptr; \ - (pointer) = (ptype *) _pPix->devPrivate.ptr; \ - (width) = ((int) _pPix->devKind) / sizeof (wtype); \ -} - -#define afbGetWindowPixelWidthAndPointer(pWin, width, pointer) \ - afbGetWindowTypedWidthAndPointer(pWin, width, pointer, PixelType, PixelType) - -#define afbGetWindowByteWidthAndPointer(pWin, width, pointer) \ - afbGetWindowTypedWidthAndPointer(pWin, width, pointer, char, char) - -/* afb uses the following macros to calculate addresses in drawables. - * To support banked framebuffers, the macros come in four flavors. - * All four collapse into the same definition on unbanked devices. - * - * afbScanlineFoo - calculate address and do bank switching - * afbScanlineFooNoBankSwitch - calculate address, don't bank switch - * afbScanlineFooSrc - calculate address, switch source bank - * afbScanlineFooDst - calculate address, switch destination bank - */ - -/* The NoBankSwitch versions are the same for banked and unbanked cases */ - -#define afbScanlineIncNoBankSwitch(_ptr, _off) _ptr += (_off) -#define afbScanlineOffsetNoBankSwitch(_ptr, _off) ((_ptr) + (_off)) -#define afbScanlineDeltaNoBankSwitch(_ptr, _y, _w) \ - afbScanlineOffsetNoBankSwitch(_ptr, (_y) * (_w)) -#define afbScanlineNoBankSwitch(_ptr, _x, _y, _w) \ - afbScanlineOffsetNoBankSwitch(_ptr, (_y) * (_w) + ((_x) >> MFB_PWSH)) - -#ifdef MFB_LINE_BANK - -#include "afblinebank.h" /* get macro definitions from this file */ - -#else /* !MFB_LINE_BANK - unbanked case */ - -#define afbScanlineInc(_ptr, _off) afbScanlineIncNoBankSwitch(_ptr, _off) -#define afbScanlineIncSrc(_ptr, _off) afbScanlineInc(_ptr, _off) -#define afbScanlineIncDst(_ptr, _off) afbScanlineInc(_ptr, _off) - -#define afbScanlineOffset(_ptr, _off) afbScanlineOffsetNoBankSwitch(_ptr, _off) -#define afbScanlineOffsetSrc(_ptr, _off) afbScanlineOffset(_ptr, _off) -#define afbScanlineOffsetDst(_ptr, _off) afbScanlineOffset(_ptr, _off) - -#define afbScanlineSrc(_ptr, _x, _y, _w) afbScanline(_ptr, _x, _y, _w) -#define afbScanlineDst(_ptr, _x, _y, _w) afbScanline(_ptr, _x, _y, _w) - -#define afbScanlineDeltaSrc(_ptr, _y, _w) afbScanlineDelta(_ptr, _y, _w) -#define afbScanlineDeltaDst(_ptr, _y, _w) afbScanlineDelta(_ptr, _y, _w) - -#endif /* MFB_LINE_BANK */ - -#define afbScanlineDelta(_ptr, _y, _w) \ - afbScanlineOffset(_ptr, (_y) * (_w)) - -#define afbScanline(_ptr, _x, _y, _w) \ - afbScanlineOffset(_ptr, (_y) * (_w) + ((_x) >> MFB_PWSH)) - -/* precomputed information about each glyph for GlyphBlt code. - this saves recalculating the per glyph information for each box. -*/ - -typedef struct _afbpos{ - int xpos; /* xposition of glyph's origin */ - int xchar; /* x position mod 32 */ - int leftEdge; - int rightEdge; - int topEdge; - int bottomEdge; - PixelType *pdstBase; /* longword with character origin */ - int widthGlyph; /* width in bytes of this glyph */ -} afbTEXTPOS; - -/* reduced raster ops for afb */ -#define RROP_BLACK GXclear -#define RROP_WHITE GXset -#define RROP_NOP GXnoop -#define RROP_INVERT GXinvert -#define RROP_COPY GXcopy - -/* macros for afbbitblt.c, afbfillsp.c - these let the code do one switch on the rop per call, rather - than a switch on the rop per item (span or rectangle.) -*/ - -#define fnCLEAR(src, dst) (0) -#define fnAND(src, dst) (src & dst) -#define fnANDREVERSE(src, dst) (src & ~dst) -#define fnCOPY(src, dst) (src) -#define fnANDINVERTED(src, dst) (~src & dst) -#define fnNOOP(src, dst) (dst) -#define fnXOR(src, dst) (src ^ dst) -#define fnOR(src, dst) (src | dst) -#define fnNOR(src, dst) (~(src | dst)) -#define fnEQUIV(src, dst) (~src ^ dst) -#define fnINVERT(src, dst) (~dst) -#define fnORREVERSE(src, dst) (src | ~dst) -#define fnCOPYINVERTED(src, dst) (~src) -#define fnORINVERTED(src, dst) (~src | dst) -#define fnNAND(src, dst) (~(src & dst)) -#undef fnSET -#define fnSET(src, dst) (~0) - -/* Using a "switch" statement is much faster in most cases - * since the compiler can do a look-up table or multi-way branch - * instruction, depending on the architecture. The result on - * A Sun 3/50 is at least 2.5 times faster, assuming a uniform - * distribution of RasterOp operation types. - * - * However, doing some profiling on a running system reveals - * GXcopy is the operation over 99.5% of the time and - * GXxor is the next most frequent (about .4%), so we make special - * checks for those first. - * - * Note that this requires a change to the "calling sequence" - * since we can't engineer a "switch" statement to have an lvalue. - */ -#undef DoRop -#define DoRop(result, alu, src, dst) \ -{ \ - if (alu == GXcopy) \ - result = fnCOPY (src, dst); \ - else if (alu == GXxor) \ - result = fnXOR (src, dst); \ - else \ - switch (alu) { \ - case GXclear: \ - result = fnCLEAR (src, dst); \ - break; \ - case GXand: \ - result = fnAND (src, dst); \ - break; \ - case GXandReverse: \ - result = fnANDREVERSE (src, dst); \ - break; \ - case GXandInverted: \ - result = fnANDINVERTED (src, dst); \ - break; \ - default: \ - case GXnoop: \ - result = fnNOOP (src, dst); \ - break; \ - case GXor: \ - result = fnOR (src, dst); \ - break; \ - case GXnor: \ - result = fnNOR (src, dst); \ - break; \ - case GXequiv: \ - result = fnEQUIV (src, dst); \ - break; \ - case GXinvert: \ - result = fnINVERT (src, dst); \ - break; \ - case GXorReverse: \ - result = fnORREVERSE (src, dst); \ - break; \ - case GXcopyInverted: \ - result = fnCOPYINVERTED (src, dst); \ - break; \ - case GXorInverted: \ - result = fnORINVERTED (src, dst); \ - break; \ - case GXnand: \ - result = fnNAND (src, dst); \ - break; \ - case GXset: \ - result = fnSET (src, dst); \ - break; \ - } \ -} - - -/* C expression fragments for various operations. These get passed in - * as -D's on the compile command line. See afb/Imakefile. This - * fixes XBUG 6319. - * - * This seems like a good place to point out that afb's use of the - * words black and white is an unfortunate misnomer. In afb code, black - * means zero, and white means one. - */ -#define MFB_OPEQ_WHITE |= -#define MFB_OPEQ_BLACK &=~ -#define MFB_OPEQ_INVERT ^= -#define MFB_EQWHOLEWORD_WHITE =~0 -#define MFB_EQWHOLEWORD_BLACK =0 -#define MFB_EQWHOLEWORD_INVERT ^=~0 -#define MFB_OP_WHITE /* nothing */ -#define MFB_OP_BLACK ~ - -#ifdef XFree86LOADER -#include "xf86_ansic.h" -#endif - diff --git a/nx-X11/programs/Xserver/afb/afbbitblt.c b/nx-X11/programs/Xserver/afb/afbbitblt.c deleted file mode 100644 index 0c1c6bb9f..000000000 --- a/nx-X11/programs/Xserver/afb/afbbitblt.c +++ /dev/null @@ -1,477 +0,0 @@ -/* $XFree86: xc/programs/Xserver/afb/afbbitblt.c,v 3.5tsi Exp $ */ -/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */ -/*********************************************************** - -Copyright (c) 1987 X Consortium - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of the X Consortium shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from the X Consortium. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XConsortium: afbbitblt.c,v 5.25 94/04/17 20:28:16 dpw Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include - -#include "regionstr.h" -#include "gcstruct.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "scrnintstr.h" - -#include "mi.h" - -#include "afb.h" -#include "maskbits.h" - - -static unsigned char afbRropsOS[AFB_MAX_DEPTH]; - -/* CopyArea and CopyPlane for a monchrome frame buffer - - - clip the source rectangle to the source's available bits. (this -avoids copying unnecessary pieces that will just get exposed anyway.) -this becomes the new shape of the destination. - clip the destination region to the composite clip in the -GC. this requires translating the destination region to (dstx, dsty). - build a list of source points, one for each rectangle in the -destination. this is a simple translation. - go do the multiple rectangle copies - do graphics exposures -*/ -/** Optimized for drawing pixmaps into windows, especially when drawing into - ** unobscured windows. Calls to the general-purpose region code were - ** replaced with rectangle-to-rectangle clipping comparisions. This is - ** possible, since the pixmap is a single rectangle. In an unobscured - ** window, the destination clip is also a single rectangle, and region - ** code can be avoided entirely. This is a big savings, since the region - ** code uses XAlloc() and makes many function calls. - ** - ** In addition, if source is a pixmap, there is no need to call the - ** expensive miHandleExposures() routine. Instead, we simply return NULL. - ** - ** Previously, drawing a pixmap into an unobscured window executed at least - ** 8 XAlloc()'s, 30 function calls, and hundreds of lines of code. - ** - ** Now, the same operation requires no XAlloc()'s, no region function calls, - ** and much less overhead. Nice for drawing lots of small pixmaps. - */ - -void -afbDoBitblt(pSrc, pDst, alu, prgnDst, pptSrc, planemask) - DrawablePtr pSrc, pDst; - int alu; - RegionPtr prgnDst; - DDXPointPtr pptSrc; - unsigned long planemask; -{ - switch (alu) { - case GXcopy: - afbDoBitbltCopy(pSrc, pDst, alu, prgnDst, pptSrc, planemask); - break; - case GXxor: - afbDoBitbltXor(pSrc, pDst, alu, prgnDst, pptSrc, planemask); - break; - case GXcopyInverted: - afbDoBitbltCopyInverted(pSrc, pDst, alu, prgnDst, pptSrc, planemask); - break; - case GXor: - afbDoBitbltOr(pSrc, pDst, alu, prgnDst, pptSrc, planemask); - break; - default: - afbDoBitbltGeneral(pSrc, pDst, alu, prgnDst, pptSrc, planemask); - break; - } -} - -RegionPtr -afbCopyArea(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height, - dstx, dsty) - DrawablePtr pSrcDrawable; - DrawablePtr pDstDrawable; - GC *pGC; - int srcx, srcy; - int width, height; - int dstx, dsty; -{ - void (*doBitBlt)(); - - switch (pGC->alu) { - case GXcopy: - doBitBlt = afbDoBitbltCopy; - break; - case GXxor: - doBitBlt = afbDoBitbltXor; - break; - case GXcopyInverted: - doBitBlt = afbDoBitbltCopyInverted; - break; - case GXor: - doBitBlt = afbDoBitbltOr; - break; - default: - doBitBlt = afbDoBitbltGeneral; - break; - } - - return(afbBitBlt(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, - width, height, dstx, dsty, doBitBlt, pGC->planemask)); -} - -RegionPtr -afbBitBlt(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height, - dstx, dsty, doBitBlt, planemask) - register DrawablePtr pSrcDrawable; - register DrawablePtr pDstDrawable; - register GC *pGC; - int srcx, srcy; - int width, height; - int dstx, dsty; - void (*doBitBlt)(); - unsigned long planemask; -{ - RegionPtr prgnSrcClip = NULL; /* may be a new region, or just a copy */ - Bool freeSrcClip = FALSE; - - RegionPtr prgnExposed; - RegionRec rgnDst; - DDXPointPtr pptSrc; - register DDXPointPtr ppt; - register BoxPtr pbox; - int i; - register int dx; - register int dy; - xRectangle origSource; - DDXPointRec origDest; - int numRects; - BoxRec fastBox; - int fastClip = 0; /* for fast clipping with pixmap source */ - int fastExpose = 0; /* for fast exposures with pixmap source */ - - origSource.x = srcx; - origSource.y = srcy; - origSource.width = width; - origSource.height = height; - origDest.x = dstx; - origDest.y = dsty; - - if ((pSrcDrawable != pDstDrawable) && pSrcDrawable->pScreen->SourceValidate) - (*pSrcDrawable->pScreen->SourceValidate)(pSrcDrawable, srcx, srcy, width, - height); - - srcx += pSrcDrawable->x; - srcy += pSrcDrawable->y; - - /* clip the source */ - - if (pSrcDrawable->type == DRAWABLE_PIXMAP) - if ((pSrcDrawable == pDstDrawable) && (pGC->clientClipType == CT_NONE)) - prgnSrcClip = pGC->pCompositeClip; - else - fastClip = 1; - else if (pGC->subWindowMode == IncludeInferiors) - if (!((WindowPtr)pSrcDrawable)->parent) - /* - * special case bitblt from root window in - * IncludeInferiors mode; just like from a pixmap - */ - fastClip = 1; - else if ((pSrcDrawable == pDstDrawable) && (pGC->clientClipType == CT_NONE)) - prgnSrcClip = pGC->pCompositeClip; - else { - prgnSrcClip = NotClippedByChildren((WindowPtr)pSrcDrawable); - freeSrcClip = TRUE; - } - else - prgnSrcClip = &((WindowPtr)pSrcDrawable)->clipList; - - fastBox.x1 = srcx; - fastBox.y1 = srcy; - fastBox.x2 = srcx + width; - fastBox.y2 = srcy + height; - - /* Don't create a source region if we are doing a fast clip */ - if (fastClip) { - fastExpose = 1; - /* - * clip the source; if regions extend beyond the source size, - * make sure exposure events get sent - */ - if (fastBox.x1 < pSrcDrawable->x) { - fastBox.x1 = pSrcDrawable->x; - fastExpose = 0; - } - if (fastBox.y1 < pSrcDrawable->y) { - fastBox.y1 = pSrcDrawable->y; - fastExpose = 0; - } - if (fastBox.x2 > pSrcDrawable->x + (int)pSrcDrawable->width) { - fastBox.x2 = pSrcDrawable->x + (int)pSrcDrawable->width; - fastExpose = 0; - } - if (fastBox.y2 > pSrcDrawable->y + (int)pSrcDrawable->height) { - fastBox.y2 = pSrcDrawable->y + (int)pSrcDrawable->height; - fastExpose = 0; - } - } else { - REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1); - REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, prgnSrcClip); - } - - dstx += pDstDrawable->x; - dsty += pDstDrawable->y; - - if (pDstDrawable->type == DRAWABLE_WINDOW) - if (!((WindowPtr)pDstDrawable)->realized) { - if (!fastClip) - REGION_UNINIT(pGC->pScreen, &rgnDst); - if (freeSrcClip) - REGION_DESTROY(pGC->pScreen, prgnSrcClip); - return NULL; - } - - dx = srcx - dstx; - dy = srcy - dsty; - - /* Translate and clip the dst to the destination composite clip */ - if (fastClip) { - RegionPtr cclip; - - /* Translate the region directly */ - fastBox.x1 -= dx; - fastBox.x2 -= dx; - fastBox.y1 -= dy; - fastBox.y2 -= dy; - - /* If the destination composite clip is one rectangle we can - do the clip directly. Otherwise we have to create a full - blown region and call intersect */ - cclip = pGC->pCompositeClip; - if (REGION_NUM_RECTS(cclip) == 1) { - BoxPtr pBox = REGION_RECTS(cclip); - - if (fastBox.x1 < pBox->x1) - fastBox.x1 = pBox->x1; - if (fastBox.x2 > pBox->x2) - fastBox.x2 = pBox->x2; - if (fastBox.y1 < pBox->y1) - fastBox.y1 = pBox->y1; - if (fastBox.y2 > pBox->y2) - fastBox.y2 = pBox->y2; - - /* Check to see if the region is empty */ - if (fastBox.x1 >= fastBox.x2 || fastBox.y1 >= fastBox.y2) { - REGION_NULL(pGC->pScreen, &rgnDst); - } else { - REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1); - } - } else { - /* We must turn off fastClip now, since we must create - a full blown region. It is intersected with the - composite clip below. */ - fastClip = 0; - REGION_INIT(pGC->pScreen, &rgnDst, &fastBox,1); - } - } else - REGION_TRANSLATE(pGC->pScreen, &rgnDst, -dx, -dy); - - if (!fastClip) { - REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, - pGC->pCompositeClip); - } - - /* Do bit blitting */ - numRects = REGION_NUM_RECTS(&rgnDst); - if (numRects && width && height) { - if(!(pptSrc = (DDXPointPtr)ALLOCATE_LOCAL(numRects * - sizeof(DDXPointRec)))) { - REGION_UNINIT(pGC->pScreen, &rgnDst); - if (freeSrcClip) - REGION_DESTROY(pGC->pScreen, prgnSrcClip); - return NULL; - } - pbox = REGION_RECTS(&rgnDst); - ppt = pptSrc; - for (i = numRects; --i >= 0; pbox++, ppt++) { - ppt->x = pbox->x1 + dx; - ppt->y = pbox->y1 + dy; - } - - (*doBitBlt)(pSrcDrawable, pDstDrawable, pGC->alu, &rgnDst, pptSrc, - planemask); - - DEALLOCATE_LOCAL(pptSrc); - } - - prgnExposed = NULL; - if (pGC->fExpose) { - /* Pixmap sources generate a NoExposed (we return NULL to do this) */ - if (!fastExpose) - prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, - origSource.x, origSource.y, - (int)origSource.width, - (int)origSource.height, origDest.x, - origDest.y, (unsigned long)0); - } - REGION_UNINIT(pGC->pScreen, &rgnDst); - if (freeSrcClip) - REGION_DESTROY(pGC->pScreen, prgnSrcClip); - return prgnExposed; -} - -RegionPtr -afbCopyPlane(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height, - dstx, dsty, plane) -DrawablePtr pSrcDrawable, pDstDrawable; -register GC *pGC; -int srcx, srcy; -int width, height; -int dstx, dsty; -unsigned long plane; -{ - int alu; - RegionPtr prgnExposed = NULL; - unsigned long old_planemask; - - if (pDstDrawable->depth == 1) { - old_planemask = pGC->planemask; - pGC->planemask = plane; - if ((pGC->fgPixel & 1) == 1 && (pGC->bgPixel & 1) == 0) { - prgnExposed = (*pGC->ops->CopyArea)(pSrcDrawable, pDstDrawable, - pGC, srcx, srcy, width, height, dstx, dsty); - } else if ((pGC->fgPixel & 1) == (pGC->bgPixel & 1)) { - unsigned char rop; - - afbReduceRop(pGC->alu, pGC->fgPixel, 1, 1, &rop); - alu = pGC->alu; - pGC->alu = rop; - prgnExposed = (*pGC->ops->CopyArea)(pSrcDrawable, pDstDrawable, pGC, - srcx, srcy, width, height, dstx, - dsty); - pGC->alu = alu; - } else { /* need to invert the src */ - alu = pGC->alu; - pGC->alu = afbInverseAlu[alu]; - prgnExposed = (*pGC->ops->CopyArea)(pSrcDrawable, pDstDrawable, pGC, - srcx, srcy, width, height, dstx, - dsty); - pGC->alu = alu; - } - pGC->planemask = old_planemask; - } else { - int free_pixmap = FALSE; - PixmapPtr pBitmap = (PixmapPtr)pSrcDrawable; - ScreenPtr pScreen = pSrcDrawable->pScreen; - GCPtr pGC1 = NULL; - - if (pSrcDrawable == pDstDrawable || - pSrcDrawable->type == DRAWABLE_WINDOW || pSrcDrawable->depth != 1) { - /* Copy a plane from source drawable to a tmp 1-bit deep pixmap */ - /* XXX: Range check width and height */ - pBitmap = (*pScreen->CreatePixmap)(pScreen, width, height, 1); - - if (!pBitmap) - return(NULL); - pGC1 = GetScratchGC(1, pScreen); - if (!pGC1) { - (*pScreen->DestroyPixmap)(pBitmap); - return(NULL); - } - ValidateGC((DrawablePtr)pBitmap, pGC1); - (void)afbBitBlt(pSrcDrawable, (DrawablePtr)pBitmap, pGC1, srcx, srcy, - width, height, 0, 0, afbDoBitbltCopy, plane); - free_pixmap = TRUE; - } -#if 0 - else { - /* XXX: could cope with N-deep pixmap source case without using tmp - * src bitmap by setting up a scratch pixmap header and fiddle - * around with the pbits pointer. - */ - } -#endif - afbReduceOpaqueStipple(pGC->fgPixel, pGC->bgPixel, pGC->planemask, - pGC->depth, afbRropsOS); - (void)afbBitBlt((DrawablePtr)pBitmap, pDstDrawable, pGC, 0, 0, width, - height, dstx, dsty, afbCopy1ToN, pGC->planemask); - if (free_pixmap) { - (*pScreen->DestroyPixmap)(pBitmap); - FreeScratchGC(pGC1); - } - - if (pGC->fExpose) - prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, srcx, - srcy, width, height, dstx, dsty, - plane); - } - return prgnExposed; -} - -void -afbCopy1ToN(pSrc, pDst, alu, prgnDst, pptSrc, planemask) - DrawablePtr pSrc, pDst; - int alu; - RegionPtr prgnDst; - DDXPointPtr pptSrc; - unsigned long planemask; -{ - int numRects = REGION_NUM_RECTS(prgnDst); - BoxPtr pbox = REGION_RECTS(prgnDst); - int r; - - for (r = 0; r < numRects; r++, pbox++, pptSrc++) { - int dx = pptSrc->x; - int dy = pptSrc->y; - - if (alu == GXcopy) - afbOpaqueStippleAreaCopy(pDst, 1, pbox, alu, (PixmapPtr)pSrc, dx, dy, - afbRropsOS, planemask); - else - afbOpaqueStippleAreaGeneral(pDst, 1, pbox, alu, (PixmapPtr)pSrc, dx, - dy, afbRropsOS, planemask); - } -} diff --git a/nx-X11/programs/Xserver/afb/afbblt.c b/nx-X11/programs/Xserver/afb/afbblt.c deleted file mode 100644 index 6cbb0a878..000000000 --- a/nx-X11/programs/Xserver/afb/afbblt.c +++ /dev/null @@ -1,563 +0,0 @@ -/* $XFree86: xc/programs/Xserver/afb/afbblt.c,v 3.0 1996/08/18 01:45:24 dawes Exp $ */ -/* - * afb copy area - */ - -/* - -Copyright (c) 1989 X Consortium - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of the X Consortium shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from the X Consortium. - -Author: Keith Packard - -*/ -/* $XConsortium: afbblt.c,v 1.11 94/04/17 20:28:16 dpw Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include -#include "afb.h" -#include "gcstruct.h" -#include "windowstr.h" -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "regionstr.h" -#include "maskbits.h" -#include "fastblt.h" -#include "mergerop.h" - -void -MROP_NAME(afbDoBitblt)(pSrc, pDst, alu, prgnDst, pptSrc, planemask) - DrawablePtr pSrc, pDst; - int alu; - RegionPtr prgnDst; - DDXPointPtr pptSrc; - unsigned long planemask; -{ - PixelType *psrcBase, *pdstBase; /* start of src and dst bitmaps */ - int widthSrc, widthDst; /* add to get to same position in next line */ - int sizeSrc, sizeDst; - - BoxPtr pbox; - int nbox; - - BoxPtr pboxTmp, pboxNext, pboxBase, pboxNew1, pboxNew2; - /* temporaries for shuffling rectangles */ - DDXPointPtr pptTmp, pptNew1, pptNew2; - /* shuffling boxes entails shuffling the - source points too */ - int w, h; - int xdir; /* 1 = left right, -1 = right left/ */ - int ydir; /* 1 = top down, -1 = bottom up */ - - PixelType *psrcLine, *pdstLine; - /* pointers to line with current src and dst */ - register PixelType *psrc; /* pointer to current src longword */ - register PixelType *pdst; /* pointer to current dst longword */ - - MROP_DECLARE_REG() - - /* following used for looping through a line */ - PixelType startmask, endmask; /* masks for writing ends of dst */ - int nlMiddle; /* whole longwords in dst */ - int xoffSrc, xoffDst; - register int leftShift, rightShift; - register PixelType bits; - register PixelType bits1; - register int nl; /* temp copy of nlMiddle */ - - int careful; - int depthSrc; - int depthDst; - - MROP_INITIALIZE(alu,0); - - afbGetPixelWidthSizeDepthAndPointer(pSrc, widthSrc, sizeSrc, depthSrc, - psrcBase); - afbGetPixelWidthSizeDepthAndPointer(pDst, widthDst, sizeDst, depthDst, - pdstBase); - - /* Special case where depth of dest pixmap is 1 but source pixmap isn't - * Used for GetImage to copy a plane from a source pixmap to a particular - * dest pixmap plane. - * Note: planemask should have only one bit set or several planes from - * the source will be copied to the same dest plane. - */ - if (depthDst == 1 && depthDst != depthSrc) - sizeDst = 0; - - /* XXX we have to err on the side of safety when both are windows, - * because we don't know if IncludeInferiors is being used. - */ - careful = ((pSrc == pDst) || - ((pSrc->type == DRAWABLE_WINDOW) && - (pDst->type == DRAWABLE_WINDOW))); - - pbox = REGION_RECTS(prgnDst); - nbox = REGION_NUM_RECTS(prgnDst); - - pboxNew1 = NULL; - pptNew1 = NULL; - pboxNew2 = NULL; - pptNew2 = NULL; - if (careful && (pptSrc->y < pbox->y1)) { - /* walk source botttom to top */ - ydir = -1; - widthSrc = -widthSrc; - widthDst = -widthDst; - - if (nbox > 1) { - /* keep ordering in each band, reverse order of bands */ - pboxNew1 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec)*nbox); - if(!pboxNew1) - return; - pptNew1 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec)*nbox); - if(!pptNew1) { - DEALLOCATE_LOCAL(pboxNew1); - return; - } - pboxBase = pboxNext = pbox+nbox-1; - while (pboxBase >= pbox) { - while ((pboxNext >= pbox) && - (pboxBase->y1 == pboxNext->y1)) - pboxNext--; - pboxTmp = pboxNext+1; - pptTmp = pptSrc + (pboxTmp - pbox); - while (pboxTmp <= pboxBase) { - *pboxNew1++ = *pboxTmp++; - *pptNew1++ = *pptTmp++; - } - pboxBase = pboxNext; - } - pboxNew1 -= nbox; - pbox = pboxNew1; - pptNew1 -= nbox; - pptSrc = pptNew1; - } - } else { - /* walk source top to bottom */ - ydir = 1; - } - - if (careful && (pptSrc->x < pbox->x1)) { - /* walk source right to left */ - xdir = -1; - - if (nbox > 1) { - /* reverse order of rects in each band */ - pboxNew2 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox); - pptNew2 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox); - if(!pboxNew2 || !pptNew2) { - if (pptNew2) - DEALLOCATE_LOCAL(pptNew2); - if (pboxNew2) - DEALLOCATE_LOCAL(pboxNew2); - if (pboxNew1) { - DEALLOCATE_LOCAL(pptNew1); - DEALLOCATE_LOCAL(pboxNew1); - } - return; - } - pboxBase = pboxNext = pbox; - while (pboxBase < pbox+nbox) { - while ((pboxNext < pbox+nbox) && (pboxNext->y1 == pboxBase->y1)) - pboxNext++; - pboxTmp = pboxNext; - pptTmp = pptSrc + (pboxTmp - pbox); - while (pboxTmp != pboxBase) { - *pboxNew2++ = *--pboxTmp; - *pptNew2++ = *--pptTmp; - } - pboxBase = pboxNext; - } - pboxNew2 -= nbox; - pbox = pboxNew2; - pptNew2 -= nbox; - pptSrc = pptNew2; - } - } else { - /* walk source left to right */ - xdir = 1; - } - - while(nbox--) { - int d; - for (d = 0; d < depthSrc; d++) { - PixelType *psrcB; - PixelType *pdstB; - - if (!(planemask & (1 << d))) - continue; - - psrcB = psrcBase + sizeSrc * d; /* @@@ NEXT PLANE @@@ */ - pdstB = pdstBase + sizeDst * d; /* @@@ NEXT PLANE @@@ */ - - w = pbox->x2 - pbox->x1; - h = pbox->y2 - pbox->y1; - - if (ydir == -1) { /* start at last scanline of rectangle */ - psrcLine = afbScanlineDeltaSrc(psrcB, -(pptSrc->y+h-1), widthSrc); - pdstLine = afbScanlineDeltaDst(pdstB, -(pbox->y2-1), widthDst); - } else { /* start at first scanline */ - psrcLine = afbScanlineDeltaSrc(psrcB, pptSrc->y, widthSrc); - pdstLine = afbScanlineDeltaDst(pdstB, pbox->y1, widthDst); - } - if ((pbox->x1 & PIM) + w <= PPW) { - maskpartialbits (pbox->x1, w, startmask); - endmask = 0; - nlMiddle = 0; - } else { - maskbits(pbox->x1, w, startmask, endmask, nlMiddle); - } - if (xdir == 1) { - xoffSrc = pptSrc->x & PIM; - xoffDst = pbox->x1 & PIM; - pdstLine += (pbox->x1 >> PWSH); - psrcLine += (pptSrc->x >> PWSH); -#ifdef DO_UNALIGNED_BITBLT - nl = xoffSrc - xoffDst; - psrcLine = (PixelType *)(((unsigned char *) psrcLine) + nl); -#else - if (xoffSrc == xoffDst) -#endif - { - while (h--) { - psrc = psrcLine; - pdst = pdstLine; - if (startmask) { - *pdst = MROP_MASK(*psrc, *pdst, startmask); - psrc++; - pdst++; - } - nl = nlMiddle; - -#ifdef LARGE_INSTRUCTION_CACHE -#ifdef FAST_CONSTANT_OFFSET_MODE - - psrc += nl & (UNROLL-1); - pdst += nl & (UNROLL-1); - -#define BodyOdd(n) pdst[-n] = MROP_SOLID (psrc[-n], pdst[-n]); -#define BodyEven(n) pdst[-n] = MROP_SOLID (psrc[-n], pdst[-n]); - -#define LoopReset \ -pdst += UNROLL; \ -psrc += UNROLL; - -#else - -#define BodyOdd(n) *pdst = MROP_SOLID (*psrc, *pdst); pdst++; psrc++; -#define BodyEven(n) BodyOdd(n) - -#define LoopReset ; - -#endif - PackedLoop - -#undef BodyOdd -#undef BodyEven -#undef LoopReset - -#else -#ifdef NOTDEF - /* you'd think this would be faster -- - * a single instruction instead of 6 - * but measurements show it to be ~15% slower - */ - while ((nl -= 6) >= 0) { - asm ("moveml %1+,#0x0c0f;moveml#0x0c0f,%0" - : "=m" (*(char *)pdst) - : "m" (*(char *)psrc) - : "d0", "d1", "d2", "d3", - "a2", "a3"); - pdst += 6; - } - nl += 6; - while (nl--) - *pdst++ = *psrc++; -#endif - DuffL(nl, label1, - *pdst = MROP_SOLID (*psrc, *pdst); - pdst++; psrc++;) -#endif - - if (endmask) - *pdst = MROP_MASK(*psrc, *pdst, endmask); - afbScanlineIncDst(pdstLine, widthDst); - afbScanlineIncSrc(psrcLine, widthSrc); - } - } -#ifndef DO_UNALIGNED_BITBLT - else { - if (xoffSrc > xoffDst) { - leftShift = (xoffSrc - xoffDst); - rightShift = PPW - leftShift; - } else { - rightShift = (xoffDst - xoffSrc); - leftShift = PPW - rightShift; - } - while (h--) { - psrc = psrcLine; - pdst = pdstLine; - bits = 0; - if (xoffSrc > xoffDst) - bits = *psrc++; - if (startmask) { - bits1 = BitLeft(bits,leftShift); - bits = *psrc++; - bits1 |= BitRight(bits,rightShift); - *pdst = MROP_MASK(bits1, *pdst, startmask); - pdst++; - } - nl = nlMiddle; - -#ifdef LARGE_INSTRUCTION_CACHE - bits1 = bits; - -#ifdef FAST_CONSTANT_OFFSET_MODE - - psrc += nl & (UNROLL-1); - pdst += nl & (UNROLL-1); - -#define BodyOdd(n) \ -bits = psrc[-n]; \ -pdst[-n] = MROP_SOLID(BitLeft(bits1, leftShift) | BitRight(bits, rightShift), pdst[-n]); - -#define BodyEven(n) \ -bits1 = psrc[-n]; \ -pdst[-n] = MROP_SOLID(BitLeft(bits, leftShift) | BitRight(bits1, rightShift), pdst[-n]); - -#define LoopReset \ -pdst += UNROLL; \ -psrc += UNROLL; - -#else - -#define BodyOdd(n) \ -bits = *psrc++; \ -*pdst = MROP_SOLID(BitLeft(bits1, leftShift) | BitRight(bits, rightShift), *pdst); \ -pdst++; - -#define BodyEven(n) \ -bits1 = *psrc++; \ -*pdst = MROP_SOLID(BitLeft(bits, leftShift) | BitRight(bits1, rightShift), *pdst); \ -pdst++; - -#define LoopReset ; - -#endif /* !FAST_CONSTANT_OFFSET_MODE */ - - PackedLoop - -#undef BodyOdd -#undef BodyEven -#undef LoopReset - -#else - DuffL(nl,label2, - bits1 = BitLeft(bits, leftShift); - bits = *psrc++; - *pdst = MROP_SOLID (bits1 | BitRight(bits, rightShift), *pdst); - pdst++; - ) -#endif - - if (endmask) { - bits1 = BitLeft(bits, leftShift); - if (BitLeft(endmask, rightShift)) { - bits = *psrc; - bits1 |= BitRight(bits, rightShift); - } - *pdst = MROP_MASK (bits1, *pdst, endmask); - } - afbScanlineIncDst(pdstLine, widthDst); - afbScanlineIncSrc(psrcLine, widthSrc); - } - } -#endif /* DO_UNALIGNED_BITBLT */ - } else { /* xdir == -1 */ - xoffSrc = (pptSrc->x + w - 1) & PIM; - xoffDst = (pbox->x2 - 1) & PIM; - pdstLine += ((pbox->x2-1) >> PWSH) + 1; - psrcLine += ((pptSrc->x+w - 1) >> PWSH) + 1; -#ifdef DO_UNALIGNED_BITBLT - nl = xoffSrc - xoffDst; - psrcLine = (PixelType *) - (((unsigned char *) psrcLine) + nl); -#else - if (xoffSrc == xoffDst) -#endif - { - while (h--) { - psrc = psrcLine; - pdst = pdstLine; - if (endmask) { - pdst--; - psrc--; - *pdst = MROP_MASK (*psrc, *pdst, endmask); - } - nl = nlMiddle; - -#ifdef LARGE_INSTRUCTION_CACHE -#ifdef FAST_CONSTANT_OFFSET_MODE - psrc -= nl & (UNROLL - 1); - pdst -= nl & (UNROLL - 1); - -#define BodyOdd(n) pdst[n-1] = MROP_SOLID (psrc[n-1], pdst[n-1]); - -#define BodyEven(n) BodyOdd(n) - -#define LoopReset \ -pdst -= UNROLL;\ -psrc -= UNROLL; - -#else - -#define BodyOdd(n) --pdst; --psrc; *pdst = MROP_SOLID(*psrc, *pdst); -#define BodyEven(n) BodyOdd(n) -#define LoopReset ; - -#endif - PackedLoop - -#undef BodyOdd -#undef BodyEven -#undef LoopReset - -#else - DuffL(nl,label3, - --pdst; --psrc; *pdst = MROP_SOLID (*psrc, *pdst);) -#endif - - if (startmask) { - --pdst; - --psrc; - *pdst = MROP_MASK(*psrc, *pdst, startmask); - } - afbScanlineIncDst(pdstLine, widthDst); - afbScanlineIncSrc(psrcLine, widthSrc); - } - } -#ifndef DO_UNALIGNED_BITBLT - else { - if (xoffDst > xoffSrc) { - rightShift = (xoffDst - xoffSrc); - leftShift = PPW - rightShift; - } else { - leftShift = (xoffSrc - xoffDst); - rightShift = PPW - leftShift; - } - while (h--) { - psrc = psrcLine; - pdst = pdstLine; - bits = 0; - if (xoffDst > xoffSrc) - bits = *--psrc; - if (endmask) { - bits1 = BitRight(bits, rightShift); - bits = *--psrc; - bits1 |= BitLeft(bits, leftShift); - pdst--; - *pdst = MROP_MASK(bits1, *pdst, endmask); - } - nl = nlMiddle; - -#ifdef LARGE_INSTRUCTION_CACHE - bits1 = bits; -#ifdef FAST_CONSTANT_OFFSET_MODE - psrc -= nl & (UNROLL - 1); - pdst -= nl & (UNROLL - 1); - -#define BodyOdd(n) \ -bits = psrc[n-1]; \ -pdst[n-1] = MROP_SOLID(BitRight(bits1, rightShift) | BitLeft(bits, leftShift),pdst[n-1]); - -#define BodyEven(n) \ -bits1 = psrc[n-1]; \ -pdst[n-1] = MROP_SOLID(BitRight(bits, rightShift) | BitLeft(bits1, leftShift),pdst[n-1]); - -#define LoopReset \ -pdst -= UNROLL; \ -psrc -= UNROLL; - -#else - -#define BodyOdd(n) \ -bits = *--psrc; --pdst; \ -*pdst = MROP_SOLID(BitRight(bits1, rightShift) | BitLeft(bits, leftShift),*pdst); - -#define BodyEven(n) \ -bits1 = *--psrc; --pdst; \ -*pdst = MROP_SOLID(BitRight(bits, rightShift) | BitLeft(bits1, leftShift),*pdst); - -#define LoopReset ; - -#endif - - PackedLoop - -#undef BodyOdd -#undef BodyEven -#undef LoopReset - -#else - DuffL(nl, label4, - bits1 = BitRight(bits, rightShift); - bits = *--psrc; - --pdst; - *pdst = MROP_SOLID(bits1 | BitLeft(bits, leftShift),*pdst); - ) -#endif - - if (startmask) { - bits1 = BitRight(bits, rightShift); - if (BitRight (startmask, leftShift)) { - bits = *--psrc; - bits1 |= BitLeft(bits, leftShift); - } - --pdst; - *pdst = MROP_MASK(bits1, *pdst, startmask); - } - afbScanlineIncDst(pdstLine, widthDst); - afbScanlineIncSrc(psrcLine, widthSrc); - } - } -#endif - } - } - pbox++; - pptSrc++; - } - if (pboxNew2) { - DEALLOCATE_LOCAL(pptNew2); - DEALLOCATE_LOCAL(pboxNew2); - } - if (pboxNew1) { - DEALLOCATE_LOCAL(pptNew1); - DEALLOCATE_LOCAL(pboxNew1); - } -} diff --git a/nx-X11/programs/Xserver/afb/afbbres.c b/nx-X11/programs/Xserver/afb/afbbres.c deleted file mode 100644 index 6ee09b9e4..000000000 --- a/nx-X11/programs/Xserver/afb/afbbres.c +++ /dev/null @@ -1,325 +0,0 @@ -/* $XFree86$ */ -/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */ -/*********************************************************** - -Copyright (c) 1987 X Consortium - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of the X Consortium shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from the X Consortium. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XConsortium: afbbres.c,v 1.22 94/04/17 20:28:17 dpw Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include "misc.h" -#include "afb.h" -#include "maskbits.h" -#include "miline.h" - -/* Solid bresenham line */ -/* NOTES - e2 is used less often than e1, so it's not in a register -*/ - -void -afbBresS(addrlbase, nlwidth, sizeDst, depthDst, signdx, signdy, axis, x1, y1, - e, e1, e2, len, rrops) -PixelType *addrlbase; /* pointer to base of bitmap */ -int nlwidth; /* width in longwords of bitmap */ -int sizeDst; -int depthDst; -int signdx, signdy; /* signs of directions */ -int axis; /* major axis (Y_AXIS or X_AXIS) */ -int x1, y1; /* initial point */ -register int e; /* error accumulator */ -register int e1; /* bresenham increments */ -int e2; -int len; /* length of line */ -unsigned char *rrops; -{ - register int yinc; /* increment to next scanline, in bytes */ - register PixelType *addrl; /* bitmask long pointer */ - register PixelType bit; /* current bit being set/cleared/etc. */ - PixelType leftbit = mfbGetmask(0); /* leftmost bit to process in new word */ - PixelType rightbit = mfbGetmask(PPW-1); /* rightmost bit to process in new word */ - - register int e3 = e2-e1; - PixelType tmp; - int saveE; - int saveLen; - int d; - - /* point to longword containing first point */ - yinc = signdy * nlwidth; - e = e-e1; /* to make looping easier */ - - if (!len) - return; - - saveLen = len; - saveE = e; - - for (d = 0; d < depthDst; d++) { - addrl = afbScanline(addrlbase, x1, y1, nlwidth); - addrlbase += sizeDst; /* @@@ NEXT PLANE @@@ */ - len = saveLen; - e = saveE; - bit = mfbGetmask(x1 & PIM); - - switch (rrops[d]) { - case RROP_BLACK: - if (axis == X_AXIS) { - if (signdx > 0) { - tmp = *addrl; - for (;;) { - tmp &= ~bit; - if (!--len) - break; - bit = SCRRIGHT(bit,1); - e += e1; - if (e >= 0) { - *addrl = tmp; - afbScanlineInc(addrl, yinc); - e += e3; - if (!bit) { - bit = leftbit; - addrl ++; - } - tmp = *addrl; - } else if (!bit) { - *addrl = tmp; - bit = leftbit; - addrl ++; - tmp = *addrl; - } - } - *addrl = tmp; - } else { - tmp = *addrl; - for (;;) { - tmp &= ~bit; - if (!--len) - break; - e += e1; - bit = SCRLEFT(bit,1); - if (e >= 0) { - *addrl = tmp; - afbScanlineInc(addrl, yinc); - e += e3; - if (!bit) { - bit = rightbit; - addrl --; - } - tmp = *addrl; - } else if (!bit) { - *addrl = tmp; - bit = rightbit; - addrl --; - tmp = *addrl; - } - } - *addrl = tmp; - } - } /* if X_AXIS */ else { - if (signdx > 0) { - while(len--) { - *addrl &= ~bit; - e += e1; - if (e >= 0) { - bit = SCRRIGHT(bit,1); - if (!bit) { bit = leftbit;addrl ++; } - e += e3; - } - afbScanlineInc(addrl, yinc); - } - } else { - while(len--) { - *addrl &= ~bit; - e += e1; - if (e >= 0) { - bit = SCRLEFT(bit,1); - if (!bit) { bit = rightbit;addrl --; } - e += e3; - } - afbScanlineInc(addrl, yinc); - } - } - } /* else Y_AXIS */ - break; - - case RROP_WHITE: - if (axis == X_AXIS) { - if (signdx > 0) { - tmp = *addrl; - for (;;) { - tmp |= bit; - if (!--len) - break; - e += e1; - bit = SCRRIGHT(bit,1); - if (e >= 0) { - *addrl = tmp; - afbScanlineInc(addrl, yinc); - e += e3; - if (!bit) { - bit = leftbit; - addrl ++; - } - tmp = *addrl; - } else if (!bit) { - *addrl = tmp; - bit = leftbit; - addrl ++; - tmp = *addrl; - } - } - *addrl = tmp; - } else { - tmp = *addrl; - for (;;) { - tmp |= bit; - if (!--len) - break; - e += e1; - bit = SCRLEFT(bit,1); - if (e >= 0) { - *addrl = tmp; - afbScanlineInc(addrl, yinc); - e += e3; - if (!bit) { - bit = rightbit; - addrl --; - } - tmp = *addrl; - } else if (!bit) { - *addrl = tmp; - bit = rightbit; - addrl --; - tmp = *addrl; - } - } - *addrl = tmp; - } - } /* if X_AXIS */ else { - if (signdx > 0) { - while(len--) { - *addrl |= bit; - e += e1; - if (e >= 0) { - bit = SCRRIGHT(bit,1); - if (!bit) { bit = leftbit;addrl ++; } - e += e3; - } - afbScanlineInc(addrl, yinc); - } - } else { - while(len--) { - *addrl |= bit; - e += e1; - if (e >= 0) { - bit = SCRLEFT(bit,1); - if (!bit) { bit = rightbit;addrl --; } - e += e3; - } - afbScanlineInc(addrl, yinc); - } - } - } /* else Y_AXIS */ - break; - - case RROP_INVERT: - if (axis == X_AXIS) { - if (signdx > 0) { - while(len--) { - *addrl ^= bit; - e += e1; - if (e >= 0) { - afbScanlineInc(addrl, yinc); - e += e3; - } - bit = SCRRIGHT(bit,1); - if (!bit) { bit = leftbit;addrl ++; } - } - } else { - while(len--) { - *addrl ^= bit; - e += e1; - if (e >= 0) { - afbScanlineInc(addrl, yinc); - e += e3; - } - bit = SCRLEFT(bit,1); - if (!bit) { bit = rightbit;addrl --; } - } - } - } /* if X_AXIS */ else { - if (signdx > 0) { - while(len--) { - *addrl ^= bit; - e += e1; - if (e >= 0) { - bit = SCRRIGHT(bit,1); - if (!bit) { bit = leftbit;addrl ++; } - e += e3; - } - afbScanlineInc(addrl, yinc); - } - } else { - while(len--) { - *addrl ^= bit; - e += e1; - if (e >= 0) { - bit = SCRLEFT(bit,1); - if (!bit) { bit = rightbit; addrl --; } - e += e3; - } - afbScanlineInc(addrl, yinc); - } - } - } /* else Y_AXIS */ - } /* switch */ - } /* for (d = ... ) */ -} diff --git a/nx-X11/programs/Xserver/afb/afbbresd.c b/nx-X11/programs/Xserver/afb/afbbresd.c deleted file mode 100644 index 52cb62cab..000000000 --- a/nx-X11/programs/Xserver/afb/afbbresd.c +++ /dev/null @@ -1,216 +0,0 @@ -/* $XFree86$ */ -/*********************************************************** - -Copyright (c) 1987 X Consortium - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of the X Consortium shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from the X Consortium. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XConsortium: afbbresd.c,v 1.10 94/04/17 20:28:18 dpw Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include "misc.h" -#include "afb.h" -#include "maskbits.h" -#include "miline.h" - -/* Dashed bresenham line */ - -#define StepDash\ - if (!--dashRemaining) { \ - if (++ dashIndex == numInDashList) \ - dashIndex = 0; \ - dashRemaining = pDash[dashIndex]; \ - rop = fgrop; \ - if (dashIndex & 1) \ - rop = bgrop; \ - } - -void -afbBresD(pdashIndex, pDash, numInDashList, pdashOffset, isDoubleDash, - addrlbase, nlwidth, sizeDst, depthDst, - signdx, signdy, axis, x1, y1, e, e1, e2, len, rrops, bgrrops) -int *pdashIndex; /* current dash */ -unsigned char *pDash; /* dash list */ -int numInDashList; /* total length of dash list */ -int *pdashOffset; /* offset into current dash */ -int isDoubleDash; -PixelType *addrlbase; /* pointer to base of bitmap */ -int nlwidth; /* width in longwords of bitmap */ -int sizeDst; -int depthDst; -int signdx, signdy; /* signs of directions */ -int axis; /* major axis (Y_AXIS or X_AXIS) */ -int x1, y1; /* initial point */ -register int e; /* error accumulator */ -register int e1; /* bresenham increments */ -int e2; -int len; /* length of line */ -unsigned char *rrops; -unsigned char *bgrrops; -{ - register int yinc; /* increment to next scanline, in bytes */ - register PixelType *addrl; - register int e3 = e2-e1; - register unsigned long bit; - PixelType leftbit = mfbGetmask(0); /* leftmost bit to process in new word */ - PixelType rightbit = mfbGetmask(PPW-1); /* rightmost bit to process in new word */ - int dashIndex; - int dashOffset; - int dashRemaining; - int rop; - int fgrop; - int bgrop; - int saveE; - int saveLen; - int d; - - dashOffset = *pdashOffset; - dashIndex = *pdashIndex; - dashRemaining = pDash[dashIndex] - dashOffset; - /* point to longword containing first point */ - - yinc = signdy * nlwidth; - e = e-e1; /* to make looping easier */ - - saveE = e; - saveLen = len; - - for (d = 0; d < depthDst; d++) { - addrl = afbScanline(addrlbase, x1, y1, nlwidth); - addrlbase += sizeDst; /* @@@ NEXT PLANE @@@ */ - - fgrop = rrops[d]; - bgrop = bgrrops[d]; - - e = saveE; - len = saveLen; - bit = mfbGetmask(x1 & PIM); - - rop = fgrop; - if (!isDoubleDash) - bgrop = -1; - if (dashIndex & 1) - rop = bgrop; - - if (axis == X_AXIS) { - if (signdx > 0) { - while(len--) { - if (rop == RROP_BLACK) - *addrl &= ~bit; - else if (rop == RROP_WHITE) - *addrl |= bit; - else if (rop == RROP_INVERT) - *addrl ^= bit; - e += e1; - if (e >= 0) { - afbScanlineInc(addrl, yinc); - e += e3; - } - bit = SCRRIGHT(bit,1); - if (!bit) { bit = leftbit;addrl ++; } - StepDash - } - } else { - while(len--) { - if (rop == RROP_BLACK) - *addrl &= ~bit; - else if (rop == RROP_WHITE) - *addrl |= bit; - else if (rop == RROP_INVERT) - *addrl ^= bit; - e += e1; - if (e >= 0) { - afbScanlineInc(addrl, yinc); - e += e3; - } - bit = SCRLEFT(bit,1); - if (!bit) { bit = rightbit;addrl --; } - StepDash - } - } - } /* if X_AXIS */ else { - if (signdx > 0) { - while(len--) { - if (rop == RROP_BLACK) - *addrl &= ~bit; - else if (rop == RROP_WHITE) - *addrl |= bit; - else if (rop == RROP_INVERT) - *addrl ^= bit; - e += e1; - if (e >= 0) { - bit = SCRRIGHT(bit,1); - if (!bit) { bit = leftbit;addrl ++; } - e += e3; - } - afbScanlineInc(addrl, yinc); - StepDash - } - } else { - while(len--) { - if (rop == RROP_BLACK) - *addrl &= ~bit; - else if (rop == RROP_WHITE) - *addrl |= bit; - else if (rop == RROP_INVERT) - *addrl ^= bit; - e += e1; - if (e >= 0) { - bit = SCRLEFT(bit,1); - if (!bit) { bit = rightbit;addrl --; } - e += e3; - } - afbScanlineInc(addrl, yinc); - StepDash - } - } - } /* else Y_AXIS */ - } /* for (d = ...) */ - *pdashIndex = dashIndex; - *pdashOffset = pDash[dashIndex] - dashRemaining; -} diff --git a/nx-X11/programs/Xserver/afb/afbbstore.c b/nx-X11/programs/Xserver/afb/afbbstore.c deleted file mode 100644 index a74a9d9b8..000000000 --- a/nx-X11/programs/Xserver/afb/afbbstore.c +++ /dev/null @@ -1,156 +0,0 @@ -/* $XFree86$ */ -/* $XConsortium: afbbstore.c,v 5.7 94/04/17 20:28:18 dpw Exp $ */ -/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */ -/* - -Copyright (c) 1987 X Consortium - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of the X Consortium shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from the X Consortium. - -*/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "afb.h" -#include -#include "mibstore.h" -#include "regionstr.h" -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "windowstr.h" - -/*- - *----------------------------------------------------------------------- - * afbSaveAreas -- - * Function called by miSaveAreas to actually fetch the areas to be - * saved into the backing pixmap. This is very simple to do, since - * afbDoBitblt is designed for this very thing. The region to save is - * already destination-relative and we're given the offset to the - * window origin, so we have only to create an array of points of the - * u.l. corners of the boxes in the region translated to the screen - * coordinate system and fetch the screen pixmap out of its devPrivate - * field.... - * - * Results: - * None. - * - * Side Effects: - * Data are copied from the screen into the pixmap. - * - *----------------------------------------------------------------------- - */ -void -afbSaveAreas(pPixmap, prgnSave, xorg, yorg, pWin) - PixmapPtr pPixmap; /* Backing pixmap */ - RegionPtr prgnSave; /* Region to save (pixmap-relative) */ - int xorg; /* X origin of region */ - int yorg; /* Y origin of region */ - WindowPtr pWin; -{ - register DDXPointPtr pPt; - DDXPointPtr pPtsInit; - register BoxPtr pBox; - register int numRects; - - numRects = REGION_NUM_RECTS(prgnSave); - pPtsInit = (DDXPointPtr)ALLOCATE_LOCAL(numRects * sizeof(DDXPointRec)); - if (!pPtsInit) - return; - - pBox = REGION_RECTS(prgnSave); - pPt = pPtsInit; - while (numRects--) { - pPt->x = pBox->x1 + xorg; - pPt->y = pBox->y1 + yorg; - pPt++; - pBox++; - } - - afbDoBitblt((DrawablePtr)pPixmap->drawable.pScreen->devPrivates[afbScreenPrivateIndex].ptr, - (DrawablePtr)pPixmap, - GXcopy, - prgnSave, - pPtsInit, wBackingBitPlanes (pWin)); - - DEALLOCATE_LOCAL(pPtsInit); -} - -/*- - *----------------------------------------------------------------------- - * afbRestoreAreas -- - * Function called by miRestoreAreas to actually fetch the areas to be - * restored from the backing pixmap. This is very simple to do, since - * afbDoBitblt is designed for this very thing. The region to restore is - * already destination-relative and we're given the offset to the - * window origin, so we have only to create an array of points of the - * u.l. corners of the boxes in the region translated to the pixmap - * coordinate system and fetch the screen pixmap out of its devPrivate - * field.... - * - * Results: - * None. - * - * Side Effects: - * Data are copied from the pixmap into the screen. - * - *----------------------------------------------------------------------- - */ -void -afbRestoreAreas(pPixmap, prgnRestore, xorg, yorg, pWin) - PixmapPtr pPixmap; /* Backing pixmap */ - RegionPtr prgnRestore; /* Region to restore (screen-relative)*/ - int xorg; /* X origin of window */ - int yorg; /* Y origin of window */ - WindowPtr pWin; -{ - register DDXPointPtr pPt; - DDXPointPtr pPtsInit; - register BoxPtr pBox; - register int numRects; - - numRects = REGION_NUM_RECTS(prgnRestore); - pPtsInit = (DDXPointPtr)ALLOCATE_LOCAL(numRects*sizeof(DDXPointRec)); - if (!pPtsInit) - return; - - pBox = REGION_RECTS(prgnRestore); - pPt = pPtsInit; - while (numRects--) { - pPt->x = pBox->x1 - xorg; - pPt->y = pBox->y1 - yorg; - pPt++; - pBox++; - } - - afbDoBitblt((DrawablePtr)pPixmap, - (DrawablePtr)pPixmap->drawable.pScreen->devPrivates[afbScreenPrivateIndex].ptr, - GXcopy, - prgnRestore, - pPtsInit, wBackingBitPlanes (pWin)); - - DEALLOCATE_LOCAL(pPtsInit); -} diff --git a/nx-X11/programs/Xserver/afb/afbclip.c b/nx-X11/programs/Xserver/afb/afbclip.c deleted file mode 100644 index ea7413233..000000000 --- a/nx-X11/programs/Xserver/afb/afbclip.c +++ /dev/null @@ -1,248 +0,0 @@ -/* $XFree86: xc/programs/Xserver/afb/afbclip.c,v 3.2 2001/10/28 03:32:57 tsi Exp $ */ -/*********************************************************** - -Copyright (c) 1987 X Consortium - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of the X Consortium shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from the X Consortium. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XConsortium: afbclip.c,v 5.6 94/04/17 20:28:19 dpw Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include "regionstr.h" -#include "pixmapstr.h" -#include "scrnintstr.h" -#include "gc.h" -#include "maskbits.h" -#include "mi.h" -#include "afb.h" - -#define ADDRECT(reg,r,fr,rx1,ry1,rx2,ry2) \ -if (((rx1) < (rx2)) && ((ry1) < (ry2)) && \ - (!((reg)->data->numRects && \ - ((r-1)->y1 == (ry1)) && \ - ((r-1)->y2 == (ry2)) && \ - ((r-1)->x1 <= (rx1)) && \ - ((r-1)->x2 >= (rx2))))) \ -{ \ - if ((reg)->data->numRects == (reg)->data->size) \ - { \ - miRectAlloc(reg, 1); \ - fr = REGION_BOXPTR(reg); \ - r = fr + (reg)->data->numRects; \ - } \ - r->x1 = (rx1); \ - r->y1 = (ry1); \ - r->x2 = (rx2); \ - r->y2 = (ry2); \ - (reg)->data->numRects++; \ - if(r->x1 < (reg)->extents.x1) \ - (reg)->extents.x1 = r->x1; \ - if(r->x2 > (reg)->extents.x2) \ - (reg)->extents.x2 = r->x2; \ - r++; \ -} - -/* Convert bitmap clip mask into clipping region. - * First, goes through each line and makes boxes by noting the transitions - * from 0 to 1 and 1 to 0. - * Then it coalesces the current line with the previous if they have boxes - * at the same X coordinates. - */ -RegionPtr -afbPixmapToRegion(pPix) - PixmapPtr pPix; -{ - register RegionPtr pReg; - register PixelType *pw, w; - register int ib; - int width, h, base, rx1 = 0, crects; - PixelType *pwLineEnd; - int irectPrevStart, irectLineStart; - register BoxPtr prectO, prectN; - BoxPtr FirstRect, rects, prectLineStart; - Bool fInBox, fSame; - register PixelType mask0 = mfbGetmask(0); - PixelType *pwLine; - int nWidth; - - pReg = REGION_CREATE(pPix->drawable.pScreen, NULL, 1); - if(!pReg) - return NullRegion; - FirstRect = REGION_BOXPTR(pReg); - rects = FirstRect; - - pwLine = (PixelType *) pPix->devPrivate.ptr; - nWidth = pPix->devKind / PGSZB; - - width = pPix->drawable.width; - pReg->extents.x1 = width - 1; - pReg->extents.x2 = 0; - irectPrevStart = -1; - for(h = 0; h < pPix->drawable.height; h++) { - pw = pwLine; - pwLine += nWidth; - irectLineStart = rects - FirstRect; - /* If the Screen left most bit of the word is set, we're starting in - * a box */ - if(*pw & mask0) { - fInBox = TRUE; - rx1 = 0; - } - else - fInBox = FALSE; - /* Process all words which are fully in the pixmap */ - pwLineEnd = pw + (width >> PWSH); - for (base = 0; pw < pwLineEnd; base += PPW) { - w = *pw++; - if (fInBox) { - if (!~w) - continue; - } else { - if (!w) - continue; - } - for(ib = 0; ib < PPW; ib++) { - /* If the Screen left most bit of the word is set, we're - * starting a box */ - if(w & mask0) { - if(!fInBox) { - rx1 = base + ib; - /* start new box */ - fInBox = TRUE; - } - } else { - if(fInBox) { - /* end box */ - ADDRECT(pReg, rects, FirstRect, - rx1, h, base + ib, h + 1); - fInBox = FALSE; - } - } - /* Shift the word VISUALLY left one. */ - w = SCRLEFT(w, 1); - } - } - if(width & PIM) { - /* Process final partial word on line */ - w = *pw++; - for(ib = 0; ib < (width & PIM); ib++) { - /* If the Screen left most bit of the word is set, we're - * starting a box */ - if(w & mask0) { - if(!fInBox) { - rx1 = base + ib; - /* start new box */ - fInBox = TRUE; - } - } else { - if(fInBox) { - /* end box */ - ADDRECT(pReg, rects, FirstRect, - rx1, h, base + ib, h + 1); - fInBox = FALSE; - } - } - /* Shift the word VISUALLY left one. */ - w = SCRLEFT(w, 1); - } - } - /* If scanline ended with last bit set, end the box */ - if(fInBox) { - ADDRECT(pReg, rects, FirstRect, - rx1, h, base + (width & PIM), h + 1); - } - /* if all rectangles on this line have the same x-coords as - * those on the previous line, then add 1 to all the previous y2s and - * throw away all the rectangles from this line - */ - fSame = FALSE; - if(irectPrevStart != -1) { - crects = irectLineStart - irectPrevStart; - if(crects == ((rects - FirstRect) - irectLineStart)) { - prectO = FirstRect + irectPrevStart; - prectN = prectLineStart = FirstRect + irectLineStart; - fSame = TRUE; - while(prectO < prectLineStart) { - if((prectO->x1 != prectN->x1) || (prectO->x2 != prectN->x2)) { - fSame = FALSE; - break; - } - prectO++; - prectN++; - } - if (fSame) { - prectO = FirstRect + irectPrevStart; - while(prectO < prectLineStart) { - prectO->y2 += 1; - prectO++; - } - rects -= crects; - pReg->data->numRects -= crects; - } - } - } - if(!fSame) - irectPrevStart = irectLineStart; - } - if (!pReg->data->numRects) - pReg->extents.x1 = pReg->extents.x2 = 0; - else - { - pReg->extents.y1 = REGION_BOXPTR(pReg)->y1; - pReg->extents.y2 = REGION_END(pReg)->y2; - if (pReg->data->numRects == 1) { - xfree(pReg->data); - pReg->data = (RegDataPtr)NULL; - } - } -#ifdef DEBUG - if (!miValidRegion(pReg)) - FatalError("Assertion failed file %s, line %d: expr\n", __FILE__, __LINE__); -#endif - return(pReg); -} diff --git a/nx-X11/programs/Xserver/afb/afbcmap.c b/nx-X11/programs/Xserver/afb/afbcmap.c deleted file mode 100644 index 69b5d7ca4..000000000 --- a/nx-X11/programs/Xserver/afb/afbcmap.c +++ /dev/null @@ -1,125 +0,0 @@ -/* $XFree86: xc/programs/Xserver/afb/afbcmap.c,v 3.0 1996/08/18 01:45:30 dawes Exp $ */ -/* $XConsortium: afbcmap.c,v 4.19 94/04/17 20:28:46 dpw Exp $ */ -/************************************************************ -Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this -software and its documentation for any purpose and without -fee is hereby granted, provided that the above copyright no- -tice appear in all copies and that both that copyright no- -tice and this permission notice appear in supporting docu- -mentation, and that the names of Sun or X Consortium -not be used in advertising or publicity pertaining to -distribution of the software without specific prior -written permission. Sun and X Consortium make no -representations about the suitability of this software for -any purpose. It is provided "as is" without any express or -implied warranty. - -SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT- -NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE LI- -ABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR -PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH -THE USE OR PERFORMANCE OF THIS SOFTWARE. - -********************************************************/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include "scrnintstr.h" -#include "colormapst.h" -#include "resource.h" -#include "micmap.h" - -int -afbListInstalledColormaps(pScreen, pmaps) - ScreenPtr pScreen; - Colormap *pmaps; -{ - return miListInstalledColormaps(pScreen, pmaps); -} - - -void -afbInstallColormap(pmap) - ColormapPtr pmap; -{ - miInstallColormap(pmap); -} - -void -afbUninstallColormap(pmap) - ColormapPtr pmap; -{ - miUninstallColormap(pmap); -} - -void -afbResolveColor(pred, pgreen, pblue, pVisual) - unsigned short *pred, *pgreen, *pblue; - register VisualPtr pVisual; -{ - miResolveColor(pred, pgreen, pblue, pVisual); -} - -Bool -afbInitializeColormap(pmap) - register ColormapPtr pmap; -{ - return miInitializeColormap(pmap); -} - -int -afbExpandDirectColors(pmap, ndef, indefs, outdefs) - ColormapPtr pmap; - int ndef; - xColorItem *indefs, *outdefs; -{ - return miExpandDirectColors(pmap, ndef, indefs, outdefs); -} - -Bool -afbCreateDefColormap(pScreen) - ScreenPtr pScreen; -{ - return miCreateDefColormap(pScreen); -} - -Bool -afbSetVisualTypes(depth, visuals, bitsPerRGB) - int depth; - int visuals; - int bitsPerRGB; -{ - return miSetVisualTypes(depth, visuals, bitsPerRGB, -1); -} - -/* - * Given a list of formats for a screen, create a list - * of visuals and depths for the screen which correspond to - * the set which can be used with this version of afb. - */ - -Bool -afbInitVisuals(visualp, depthp, nvisualp, ndepthp, rootDepthp, defaultVisp, - sizes, bitsPerRGB) - VisualPtr *visualp; - DepthPtr *depthp; - int *nvisualp, *ndepthp; - int *rootDepthp; - VisualID *defaultVisp; - unsigned long sizes; - int bitsPerRGB; -{ - return miInitVisuals(visualp, depthp, nvisualp, ndepthp, rootDepthp, - defaultVisp, sizes, bitsPerRGB, -1); -} diff --git a/nx-X11/programs/Xserver/afb/afbfillarc.c b/nx-X11/programs/Xserver/afb/afbfillarc.c deleted file mode 100644 index 17b4902d9..000000000 --- a/nx-X11/programs/Xserver/afb/afbfillarc.c +++ /dev/null @@ -1,359 +0,0 @@ -/* $XFree86: xc/programs/Xserver/afb/afbfillarc.c,v 3.1 1998/03/20 21:04:54 hohndel Exp $ */ -/************************************************************ - -Copyright (c) 1989 X Consortium - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of the X Consortium shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from the X Consortium. - -********************************************************/ - -/* $XConsortium: afbfillarc.c,v 5.14 94/04/17 20:28:20 dpw Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include "regionstr.h" -#include "gcstruct.h" -#include "pixmapstr.h" -#include "scrnintstr.h" -#include "afb.h" -#include "maskbits.h" -#include "mifillarc.h" -#include "mi.h" - -static void -afbFillEllipseSolid(pDraw, arc, rrops) - DrawablePtr pDraw; - xArc *arc; - register unsigned char *rrops; -{ - int x, y, e; - int yk, xk, ym, xm, dx, dy, xorg, yorg; - register int slw; - miFillArcRec info; - PixelType *addrlt, *addrlb; - register PixelType *pdst; - PixelType *addrl; - register int n; - register int d; - int nlwidth; - register int xpos; - PixelType startmask, endmask; - int nlmiddle; - int depthDst; - int sizeDst; - - afbGetPixelWidthSizeDepthAndPointer(pDraw, nlwidth, sizeDst, depthDst, - addrlt); - miFillArcSetup(arc, &info); - MIFILLARCSETUP(); - xorg += pDraw->x; - yorg += pDraw->y; - addrlb = addrlt; - addrlt += nlwidth * (yorg - y); - addrlb += nlwidth * (yorg + y + dy); - while (y) { - addrlt += nlwidth; - addrlb -= nlwidth; - MIFILLARCSTEP(slw); - if (!slw) - continue; - xpos = xorg - x; - pdst = addrl = afbScanlineOffset(addrlt, (xpos >> PWSH)); - if (((xpos & PIM) + slw) < PPW) { - maskpartialbits(xpos, slw, startmask); - for (d = 0; d < depthDst; d++, pdst += sizeDst) { /* @@@ NEXT PLANE @@@ */ - switch (rrops[d]) { - case RROP_BLACK: - *pdst &= ~startmask; - break; - case RROP_WHITE: - *pdst |= startmask; - break; - case RROP_INVERT: - *pdst ^= startmask; - break; - case RROP_NOP: - break; - } - } - if (miFillArcLower(slw)) { - pdst = afbScanlineOffset(addrlb, (xpos >> PWSH)); - - for (d = 0; d < depthDst; d++, pdst += sizeDst) { /* @@@ NEXT PLANE @@@ */ - switch (rrops[d]) { - case RROP_BLACK: - *pdst &= ~startmask; - break; - case RROP_WHITE: - *pdst |= startmask; - break; - case RROP_INVERT: - *pdst ^= startmask; - break; - case RROP_NOP: - break; - } - } - } - continue; - } - maskbits(xpos, slw, startmask, endmask, nlmiddle); - for (d = 0; d < depthDst; d++, addrl += sizeDst) { /* @@@ NEXT PLANE @@@ */ - n = nlmiddle; - pdst = addrl; - - switch (rrops[d]) { - case RROP_BLACK: - if (startmask) - *pdst++ &= ~startmask; - while (n--) - *pdst++ = 0; - if (endmask) - *pdst &= ~endmask; - break; - - case RROP_WHITE: - if (startmask) - *pdst++ |= startmask; - while (n--) - *pdst++ = ~0; - if (endmask) - *pdst |= endmask; - break; - - case RROP_INVERT: - if (startmask) - *pdst++ ^= startmask; - while (n--) - *pdst++ ^= ~0; - if (endmask) - *pdst ^= endmask; - break; - - case RROP_NOP: - break; - } - } - if (!miFillArcLower(slw)) - continue; - addrl = afbScanlineOffset(addrlb, (xpos >> PWSH)); - for (d = 0; d < depthDst; d++, addrl += sizeDst) { /* @@@ NEXT PLANE @@@ */ - n = nlmiddle; - pdst = addrl; - - switch (rrops[d]) { - case RROP_BLACK: - if (startmask) - *pdst++ &= ~startmask; - while (n--) - *pdst++ = 0; - if (endmask) - *pdst &= ~endmask; - break; - - case RROP_WHITE: - if (startmask) - *pdst++ |= startmask; - while (n--) - *pdst++ = ~0; - if (endmask) - *pdst |= endmask; - break; - - case RROP_INVERT: - if (startmask) - *pdst++ ^= startmask; - while (n--) - *pdst++ ^= ~0; - if (endmask) - *pdst ^= endmask; - break; - - case RROP_NOP: - break; - } - } - } -} - -#define FILLSPAN(xl,xr,addr) \ - if (xr >= xl) { \ - width = xr - xl + 1; \ - addrl = afbScanlineOffset(addr, (xl >> PWSH)); \ - if (((xl & PIM) + width) < PPW) { \ - maskpartialbits(xl, width, startmask); \ - for (pdst = addrl, d = 0; d < depthDst; d++, pdst += sizeDst) { /* @@@ NEXT PLANE @@@ */ \ - switch (rrops[d]) { \ - case RROP_BLACK: \ - *pdst &= ~startmask; \ - break; \ - case RROP_WHITE: \ - *pdst |= startmask; \ - break; \ - case RROP_INVERT: \ - *pdst ^= startmask; \ - break; \ - case RROP_NOP: \ - break; \ - } \ - } \ - } else { \ - maskbits(xl, width, startmask, endmask, nlmiddle); \ - for (d = 0; d < depthDst; d++, addrl += sizeDst) { /* @@@ NEXT PLANE @@@ */ \ - n = nlmiddle; \ - pdst = addrl; \ - switch (rrops[d]) { \ - case RROP_BLACK: \ - if (startmask) \ - *pdst++ &= ~startmask; \ - while (n--) \ - *pdst++ = 0; \ - if (endmask) \ - *pdst &= ~endmask; \ - break; \ - case RROP_WHITE: \ - if (startmask) \ - *pdst++ |= startmask; \ - while (n--) \ - *pdst++ = ~0; \ - if (endmask) \ - *pdst |= endmask; \ - break; \ - case RROP_INVERT: \ - if (startmask) \ - *pdst++ ^= startmask; \ - while (n--) \ - *pdst++ ^= ~0; \ - if (endmask) \ - *pdst ^= endmask; \ - break; \ - case RROP_NOP: \ - break; \ - } \ - } \ - } \ - } - -#define FILLSLICESPANS(flip,addr) \ - if (!flip) { \ - FILLSPAN(xl, xr, addr); \ - } else { \ - xc = xorg - x; \ - FILLSPAN(xc, xr, addr); \ - xc += slw - 1; \ - FILLSPAN(xl, xc, addr); \ - } - -static void -afbFillArcSliceSolidCopy(pDraw, pGC, arc, rrops) - DrawablePtr pDraw; - GCPtr pGC; - xArc *arc; - register unsigned char *rrops; -{ - PixelType *addrl; - register PixelType *pdst; - register int n; - register int d; - int yk, xk, ym, xm, dx, dy, xorg, yorg, slw; - register int x, y, e; - miFillArcRec info; - miArcSliceRec slice; - int xl, xr, xc; - PixelType *addrlt, *addrlb; - int nlwidth; - int width; - PixelType startmask, endmask; - int nlmiddle; - int sizeDst; - int depthDst; - - afbGetPixelWidthSizeDepthAndPointer(pDraw, nlwidth, sizeDst, depthDst, - addrlt); - miFillArcSetup(arc, &info); - miFillArcSliceSetup(arc, &slice, pGC); - MIFILLARCSETUP(); - xorg += pDraw->x; - yorg += pDraw->y; - addrlb = addrlt; - addrlt = afbScanlineDeltaNoBankSwitch(addrlt, yorg - y, nlwidth); - addrlb = afbScanlineDeltaNoBankSwitch(addrlb, yorg + y + dy, nlwidth); - slice.edge1.x += pDraw->x; - slice.edge2.x += pDraw->x; - while (y > 0) { - afbScanlineIncNoBankSwitch(addrlt, nlwidth); - afbScanlineIncNoBankSwitch(addrlb, -nlwidth); - MIFILLARCSTEP(slw); - MIARCSLICESTEP(slice.edge1); - MIARCSLICESTEP(slice.edge2); - if (miFillSliceUpper(slice)) { - MIARCSLICEUPPER(xl, xr, slice, slw); - FILLSLICESPANS(slice.flip_top, addrlt); - } - if (miFillSliceLower(slice)) { - MIARCSLICELOWER(xl, xr, slice, slw); - FILLSLICESPANS(slice.flip_bot, addrlb); - } - } -} - -void -afbPolyFillArcSolid(pDraw, pGC, narcs, parcs) - register DrawablePtr pDraw; - GCPtr pGC; - int narcs; - xArc *parcs; -{ - afbPrivGC *priv; - register xArc *arc; - register int i; - BoxRec box; - RegionPtr cclip; - unsigned char *rrops; - - priv = (afbPrivGC *) pGC->devPrivates[afbGCPrivateIndex].ptr; - rrops = priv->rrops; - cclip = pGC->pCompositeClip; - for (arc = parcs, i = narcs; --i >= 0; arc++) { - if (miFillArcEmpty(arc)) - continue; - if (miCanFillArc(arc)) { - box.x1 = arc->x + pDraw->x; - box.y1 = arc->y + pDraw->y; - box.x2 = box.x1 + (int)arc->width + 1; - box.y2 = box.y1 + (int)arc->height + 1; - if (RECT_IN_REGION(pDraw->pScreen, cclip, &box) == rgnIN) { - if ((arc->angle2 >= FULLCIRCLE) || - (arc->angle2 <= -FULLCIRCLE)) - afbFillEllipseSolid(pDraw, arc, rrops); - else - afbFillArcSliceSolidCopy(pDraw, pGC, arc, rrops); - continue; - } - } - miPolyFillArc(pDraw, pGC, 1, arc); - } -} diff --git a/nx-X11/programs/Xserver/afb/afbfillrct.c b/nx-X11/programs/Xserver/afb/afbfillrct.c deleted file mode 100644 index 3646d78c6..000000000 --- a/nx-X11/programs/Xserver/afb/afbfillrct.c +++ /dev/null @@ -1,294 +0,0 @@ -/* $XFree86: xc/programs/Xserver/afb/afbfillrct.c,v 3.2tsi Exp $ */ -/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */ -/*********************************************************** - -Copyright (c) 1987 X Consortium - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of the X Consortium shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from the X Consortium. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XConsortium: afbfillrct.c,v 5.10 94/04/17 20:28:21 dpw Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include "pixmapstr.h" -#include "gcstruct.h" -#include "windowstr.h" -#include "regionstr.h" -#include "scrnintstr.h" - -#include "afb.h" -#include "maskbits.h" - -#define MODEQ(a, b) ((a) %= (b)) -void afbPaintOddSize(); - -/* - filled rectangles. - translate the rectangles, clip them, and call the -helper function in the GC. -*/ - -#define NUM_STACK_RECTS 1024 - -void -afbPolyFillRect(pDrawable, pGC, nrectFill, prectInit) - DrawablePtr pDrawable; - GCPtr pGC; - int nrectFill; /* number of rectangles to fill */ - xRectangle *prectInit; /* Pointer to first rectangle to fill */ -{ - xRectangle *prect; - RegionPtr prgnClip; - register BoxPtr pbox; - register BoxPtr pboxClipped; - BoxPtr pboxClippedBase; - BoxPtr pextent; - BoxRec stackRects[NUM_STACK_RECTS]; - int numRects; - int n; - int xorg, yorg; - afbPrivGC *priv; - unsigned char *rrops; - unsigned char *rropsOS; - - priv = (afbPrivGC *)pGC->devPrivates[afbGCPrivateIndex].ptr; - prgnClip = pGC->pCompositeClip; - rrops = priv->rrops; - rropsOS = priv->rropOS; - - prect = prectInit; - xorg = pDrawable->x; - yorg = pDrawable->y; - if (xorg || yorg) { - prect = prectInit; - n = nrectFill; - Duff(n, prect->x += xorg; prect->y += yorg; prect++); - } - - prect = prectInit; - - numRects = REGION_NUM_RECTS(prgnClip) * nrectFill; - if (numRects > NUM_STACK_RECTS) { - pboxClippedBase = (BoxPtr)ALLOCATE_LOCAL(numRects * sizeof(BoxRec)); - if (!pboxClippedBase) - return; - } - else - pboxClippedBase = stackRects; - - pboxClipped = pboxClippedBase; - - if (REGION_NUM_RECTS(prgnClip) == 1) { - int x1, y1, x2, y2, bx2, by2; - - pextent = REGION_RECTS(prgnClip); - x1 = pextent->x1; - y1 = pextent->y1; - x2 = pextent->x2; - y2 = pextent->y2; - while (nrectFill--) { - if ((pboxClipped->x1 = prect->x) < x1) - pboxClipped->x1 = x1; - - if ((pboxClipped->y1 = prect->y) < y1) - pboxClipped->y1 = y1; - - bx2 = (int) prect->x + (int) prect->width; - if (bx2 > x2) - bx2 = x2; - pboxClipped->x2 = bx2; - - by2 = (int) prect->y + (int) prect->height; - if (by2 > y2) - by2 = y2; - pboxClipped->y2 = by2; - - prect++; - if ((pboxClipped->x1 < pboxClipped->x2) && - (pboxClipped->y1 < pboxClipped->y2)) { - pboxClipped++; - } - } - } else { - int x1, y1, x2, y2, bx2, by2; - - pextent = REGION_EXTENTS(pGC->pScreen, prgnClip); - x1 = pextent->x1; - y1 = pextent->y1; - x2 = pextent->x2; - y2 = pextent->y2; - while (nrectFill--) { - BoxRec box; - - if ((box.x1 = prect->x) < x1) - box.x1 = x1; - - if ((box.y1 = prect->y) < y1) - box.y1 = y1; - - bx2 = (int) prect->x + (int) prect->width; - if (bx2 > x2) - bx2 = x2; - box.x2 = bx2; - - by2 = (int) prect->y + (int) prect->height; - if (by2 > y2) - by2 = y2; - box.y2 = by2; - - prect++; - - if ((box.x1 >= box.x2) || (box.y1 >= box.y2)) - continue; - - n = REGION_NUM_RECTS (prgnClip); - pbox = REGION_RECTS(prgnClip); - - /* clip the rectangle to each box in the clip region - this is logically equivalent to calling Intersect() - */ - while(n--) { - pboxClipped->x1 = max(box.x1, pbox->x1); - pboxClipped->y1 = max(box.y1, pbox->y1); - pboxClipped->x2 = min(box.x2, pbox->x2); - pboxClipped->y2 = min(box.y2, pbox->y2); - pbox++; - - /* see if clipping left anything */ - if(pboxClipped->x1 < pboxClipped->x2 && - pboxClipped->y1 < pboxClipped->y2) { - pboxClipped++; - } - } - } - } - if (pboxClipped != pboxClippedBase) { - switch (pGC->fillStyle) { - case FillSolid: - afbSolidFillArea(pDrawable, pboxClipped-pboxClippedBase, - pboxClippedBase, rrops); - break; - case FillTiled: - switch (pGC->alu) { - case GXcopy: - if (pGC->pRotatedPixmap) - afbTileAreaPPWCopy(pDrawable, pboxClipped-pboxClippedBase, - pboxClippedBase, GXcopy, - pGC->pRotatedPixmap, pGC->planemask); - else - afbTileAreaCopy (pDrawable, pboxClipped-pboxClippedBase, - pboxClippedBase, GXcopy, - pGC->tile.pixmap, - pGC->patOrg.x, pGC->patOrg.y, - pGC->planemask); - break; - - default: - if (pGC->pRotatedPixmap) - afbTileAreaPPWGeneral(pDrawable, pboxClipped-pboxClippedBase, - pboxClippedBase, pGC->alu, - pGC->pRotatedPixmap, - pGC->planemask); - else - afbTileAreaGeneral(pDrawable, pboxClipped-pboxClippedBase, - pboxClippedBase, pGC->alu, - pGC->tile.pixmap, - pGC->patOrg.x, pGC->patOrg.y, - pGC->planemask); - break; - } /* switch (alu) */ - break; - - case FillStippled: - if (pGC->pRotatedPixmap) - afbStippleAreaPPW(pDrawable, pboxClipped-pboxClippedBase, - pboxClippedBase, pGC->pRotatedPixmap, rrops); - else - afbStippleArea(pDrawable, pboxClipped-pboxClippedBase, - pboxClippedBase, pGC->stipple, - pGC->patOrg.x, pGC->patOrg.y, rrops); - break; - - case FillOpaqueStippled: - switch (pGC->alu) { - case GXcopy: - if (pGC->pRotatedPixmap) - afbOpaqueStippleAreaPPWCopy(pDrawable, pboxClipped-pboxClippedBase, - pboxClippedBase, GXcopy, - pGC->pRotatedPixmap, - rropsOS, pGC->planemask); - else - afbOpaqueStippleAreaCopy(pDrawable, pboxClipped-pboxClippedBase, - pboxClippedBase, GXcopy, - pGC->stipple, - pGC->patOrg.x, pGC->patOrg.y, rropsOS, - pGC->planemask); - break; - - default: - if (pGC->pRotatedPixmap) - afbOpaqueStippleAreaPPWGeneral(pDrawable, pboxClipped-pboxClippedBase, - pboxClippedBase, pGC->alu, - pGC->pRotatedPixmap, - rropsOS, - pGC->planemask); - else - afbOpaqueStippleAreaGeneral(pDrawable, pboxClipped-pboxClippedBase, - pboxClippedBase, pGC->alu, - pGC->stipple, - pGC->patOrg.x, pGC->patOrg.y, - rropsOS, - pGC->planemask); - break; - } /* switch (alu) */ - break; - } - } - if (pboxClippedBase != stackRects) - DEALLOCATE_LOCAL(pboxClippedBase); -} diff --git a/nx-X11/programs/Xserver/afb/afbfillsp.c b/nx-X11/programs/Xserver/afb/afbfillsp.c deleted file mode 100644 index ffb633409..000000000 --- a/nx-X11/programs/Xserver/afb/afbfillsp.c +++ /dev/null @@ -1,1131 +0,0 @@ -/* $XFree86: xc/programs/Xserver/afb/afbfillsp.c,v 3.3 2000/11/22 00:58:12 tsi Exp $ */ -/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */ -/*********************************************************** - -Copyright (c) 1987 X Consortium - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of the X Consortium shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from the X Consortium. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XConsortium: afbfillsp.c,v 5.13 94/04/17 20:28:21 dpw Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include "gcstruct.h" -#include "window.h" -#include "pixmapstr.h" -#include "scrnintstr.h" -#include "windowstr.h" -#include "afb.h" - -#include "maskbits.h" - -#include "mergerop.h" - -#include "servermd.h" -#include "mi.h" -#include "mispans.h" - -/* scanline filling for monochrome frame buffer - written by drewry, oct 1986 - - these routines all clip. they assume that anything that has called -them has already translated the points (i.e. pGC->miTranslate is -non-zero, which is howit gets set in afbCreateGC().) - - the number of new scnalines created by clipping == -MaxRectsPerBand * nSpans. - -*/ - - -void -afbSolidFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) - DrawablePtr pDrawable; - GCPtr pGC; - int nInit; /* number of spans to fill */ - DDXPointPtr pptInit; /* pointer to list of start points */ - int *pwidthInit; /* pointer to list of n widths */ - int fSorted; -{ - /* next three parameters are post-clip */ - int n; /* number of spans to fill */ - register DDXPointPtr ppt; /* pointer to list of start points */ - register int *pwidth; /* pointer to list of n widths */ - PixelType *addrlBase; /* pointer to start of bitmap */ - PixelType *pBase; - int nlwidth; /* width in longwords of bitmap */ - register PixelType *addrl;/* pointer to current longword in bitmap */ - register int nlmiddle; - register PixelType startmask; - register PixelType endmask; - int *pwidthFree; /* copies of the pointers to free */ - DDXPointPtr pptFree; - int depthDst; - int sizeDst; - int d; - unsigned char *rrops; - - n = nInit * miFindMaxBand(pGC->pCompositeClip); - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); - if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); - return; - } - pwidth = pwidthFree; - ppt = pptFree; - n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit, - ppt, pwidth, fSorted); - - afbGetPixelWidthSizeDepthAndPointer(pDrawable, nlwidth, sizeDst, depthDst, - pBase); - rrops = ((afbPrivGC *)(pGC->devPrivates[afbGCPrivateIndex].ptr))->rrops; - while (n--) { - addrlBase = afbScanline(pBase, ppt->x, ppt->y, nlwidth); - - for (d = 0; d < depthDst; d++, addrlBase += sizeDst) { /* @@@ NEXT PLANE @@@ */ - if (*pwidth) { - addrl = addrlBase; - - switch (rrops[d]) { - case RROP_BLACK: - if ( ((ppt->x & PIM) + *pwidth) < PPW) { - /* all bits inside same longword */ - maskpartialbits(ppt->x, *pwidth, startmask); - *addrl &= ~startmask; - } else { - maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle); - if (startmask) - *addrl++ &= ~startmask; - Duff (nlmiddle, *addrl++ = 0x0); - if (endmask) - *addrl &= ~endmask; - } - break; - - case RROP_WHITE: - if ( ((ppt->x & PIM) + *pwidth) < PPW) { - /* all bits inside same longword */ - maskpartialbits(ppt->x, *pwidth, startmask); - *addrl |= startmask; - } else { - maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle); - if (startmask) - *addrl++ |= startmask; - Duff (nlmiddle, *addrl++ = ~0); - if (endmask) - *addrl |= endmask; - } - break; - case RROP_INVERT: - if ( ((ppt->x & PIM) + *pwidth) < PPW) { - /* all bits inside same longword */ - maskpartialbits(ppt->x, *pwidth, startmask); - *addrl ^= startmask; - } else { - maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle); - if (startmask) - *addrl++ ^= startmask; - Duff (nlmiddle, *addrl++ ^= ~0); - if (endmask) - *addrl ^= endmask; - } - break; - case RROP_NOP: - break; - } - } - } - pwidth++; - ppt++; - } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); -} - -void -afbStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) - DrawablePtr pDrawable; - GC *pGC; - int nInit; /* number of spans to fill */ - DDXPointPtr pptInit; /* pointer to list of start points */ - int *pwidthInit; /* pointer to list of n widths */ - int fSorted; -{ - /* next three parameters are post-clip */ - int n; /* number of spans to fill */ - register DDXPointPtr ppt; /* pointer to list of start points */ - register int *pwidth; /* pointer to list of n widths */ - PixelType *addrlBase; /* pointer to start of bitmap */ - PixelType *pBase; - int nlwidth; /* width in longwords of bitmap */ - register PixelType *addrl;/* pointer to current longword in bitmap */ - register PixelType src; - register int nlmiddle; - register PixelType startmask; - register PixelType endmask; - PixmapPtr pStipple; - PixelType *psrc; - int tileHeight; - int *pwidthFree; /* copies of the pointers to free */ - DDXPointPtr pptFree; - int d; - int depthDst; - int sizeDst; - unsigned char *rrops; - - n = nInit * miFindMaxBand(pGC->pCompositeClip); - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); - if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); - return; - } - pwidth = pwidthFree; - ppt = pptFree; - n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit, - ppt, pwidth, fSorted); - - afbGetPixelWidthSizeDepthAndPointer(pDrawable, nlwidth, sizeDst, depthDst, - pBase); - - pStipple = pGC->pRotatedPixmap; - tileHeight = pStipple->drawable.height; - psrc = (PixelType *)(pStipple->devPrivate.ptr); - - rrops = ((afbPrivGC *)(pGC->devPrivates[afbGCPrivateIndex].ptr))->rrops; - - while (n--) { - src = psrc[ppt->y % tileHeight]; - addrlBase = afbScanline(pBase, ppt->x, ppt->y, nlwidth); - for (d = 0; d < depthDst; d++, addrlBase += sizeDst) { /* @@@ NEXT PLANE @@@ */ - addrl = addrlBase; - - switch (rrops[d]) { - case RROP_BLACK: - /* all bits inside same longword */ - if ( ((ppt->x & PIM) + *pwidth) < PPW) { - maskpartialbits(ppt->x, *pwidth, startmask); - *addrl &= ~(src & startmask); - } else { - maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle); - if (startmask) - *addrl++ &= ~(src & startmask); - Duff (nlmiddle, *addrl++ &= ~src); - if (endmask) - *addrl &= ~(src & endmask); - } - break; - case RROP_WHITE: - /* all bits inside same longword */ - if ( ((ppt->x & PIM) + *pwidth) < PPW) { - maskpartialbits(ppt->x, *pwidth, startmask); - *addrl |= (src & startmask); - } else { - maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle); - if (startmask) - *addrl++ |= (src & startmask); - Duff (nlmiddle, *addrl++ |= src); - if (endmask) - *addrl |= (src & endmask); - } - break; - case RROP_INVERT: - /* all bits inside same longword */ - if ( ((ppt->x & PIM) + *pwidth) < PPW) { - maskpartialbits(ppt->x, *pwidth, startmask); - *addrl ^= (src & startmask); - } else { - maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle); - if (startmask) - *addrl++ ^= (src & startmask); - Duff (nlmiddle, *addrl++ ^= src); - if (endmask) - *addrl ^= (src & endmask); - } - break; - - case RROP_NOP: - break; - } - } - pwidth++; - ppt++; - } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); -} - -void -afbTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) - DrawablePtr pDrawable; - GC *pGC; - int nInit; /* number of spans to fill */ - DDXPointPtr pptInit; /* pointer to list of start points */ - int *pwidthInit; /* pointer to list of n widths */ - int fSorted; -{ - /* next three parameters are post-clip */ - int n; /* number of spans to fill */ - register DDXPointPtr ppt; /* pointer to list of start points */ - register int *pwidth; /* pointer to list of n widths */ - PixelType *addrlBase; /* pointer to start of bitmap */ - PixelType *pBase; - int nlwidth; /* width in longwords of bitmap */ - register PixelType *addrl; /* pointer to current longword in bitmap */ - register PixelType src; - register int nlmiddle; - register PixelType startmask; - register PixelType endmask; - PixmapPtr pTile; - PixelType *psrc; - int tileHeight; - int rop; - int *pwidthFree; /* copies of the pointers to free */ - DDXPointPtr pptFree; - int sizeDst; - int depthDst; - int d; - - n = nInit * miFindMaxBand(pGC->pCompositeClip); - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); - if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); - return; - } - pwidth = pwidthFree; - ppt = pptFree; - n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit, - ppt, pwidth, fSorted); - - afbGetPixelWidthSizeDepthAndPointer(pDrawable, nlwidth, sizeDst, depthDst, - pBase); - - pTile = pGC->pRotatedPixmap; - tileHeight = pTile->drawable.height; - psrc = (PixelType *)(pTile->devPrivate.ptr); - rop = pGC->alu; - - switch(rop) { - case GXcopy: -#define DoMaskCopyRop(src,dst,mask) (((dst) & ~(mask)) | ((src) & (mask))) - while (n--) { - if (*pwidth) { - addrlBase = afbScanline(pBase, ppt->x, ppt->y, nlwidth); - - for (d = 0; d < depthDst; d++, addrlBase += sizeDst) { /* @@@ NEXT PLANE @@@ */ - if (!(pGC->planemask & (1 << d))) - continue; - - addrl = addrlBase; - src = psrc[ppt->y % tileHeight + tileHeight * d]; - if ( ((ppt->x & PIM) + *pwidth) < PPW) { - maskpartialbits(ppt->x, *pwidth, startmask); - *addrl = DoMaskCopyRop (src, *addrl, startmask); - } else { - maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle); - if (startmask) { - *addrl = DoMaskCopyRop (src, *addrl, startmask); - addrl++; - } - while (nlmiddle--) { - *addrl = src; - addrl++; - } - if (endmask) - *addrl = DoMaskCopyRop (src, *addrl, endmask); - } - } - } - pwidth++; - ppt++; - } - break; - - default: - { - register DeclareMergeRop (); - - InitializeMergeRop(rop,~0); - while (n--) { - if (*pwidth) { - addrlBase = afbScanline(pBase, ppt->x, ppt->y, nlwidth); - for (d = 0; d < depthDst; d++, addrlBase += sizeDst) { /* @@@ NEXT PLANE @@@ */ - if (!(pGC->planemask & (1 << d))) - continue; - - addrl = addrlBase; - - src = psrc[ppt->y % tileHeight + tileHeight * d]; - if ( ((ppt->x & PIM) + *pwidth) < PPW) { - maskpartialbits(ppt->x, *pwidth, startmask); - *addrl = DoMaskMergeRop (src, *addrl, startmask); - } else { - maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle); - if (startmask) { - *addrl = DoMaskMergeRop (src, *addrl, startmask); - addrl++; - } - while (nlmiddle--) { - *addrl = DoMergeRop (src, *addrl); - addrl++; - } - if (endmask) - *addrl = DoMaskMergeRop (src, *addrl, endmask); - } - } - } - pwidth++; - ppt++; - } - break; - } - } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); -} - -void -afbOpaqueStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) - DrawablePtr pDrawable; - GC *pGC; - int nInit; /* number of spans to fill */ - DDXPointPtr pptInit; /* pointer to list of start points */ - int *pwidthInit; /* pointer to list of n widths */ - int fSorted; -{ - /* next three parameters are post-clip */ - int n; /* number of spans to fill */ - register DDXPointPtr ppt; /* pointer to list of start points */ - register int *pwidth; /* pointer to list of n widths */ - PixelType *addrlBase; /* pointer to start of bitmap */ - PixelType *pBase; - int nlwidth; /* width in longwords of bitmap */ - register PixelType *addrl; /* pointer to current longword in bitmap */ - register PixelType src = 0; - register int nlmiddle; - register PixelType startmask; - register PixelType endmask; - PixmapPtr pTile; - PixelType *psrc; - int tileHeight; - int rop; - unsigned char *rropsOS; - int *pwidthFree; /* copies of the pointers to free */ - DDXPointPtr pptFree; - int sizeDst; - int depthDst; - int d; - - n = nInit * miFindMaxBand(pGC->pCompositeClip); - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); - if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); - return; - } - pwidth = pwidthFree; - ppt = pptFree; - n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit, - ppt, pwidth, fSorted); - - afbGetPixelWidthSizeDepthAndPointer(pDrawable, nlwidth, sizeDst, depthDst, - pBase); - - pTile = pGC->pRotatedPixmap; - tileHeight = pTile->drawable.height; - psrc = (PixelType *)(pTile->devPrivate.ptr); - rop = pGC->alu; - rropsOS = ((afbPrivGC *)(pGC->devPrivates[afbGCPrivateIndex].ptr))->rropOS; - - switch(rop) { - case GXcopy: - while (n--) { - addrlBase = afbScanline(pBase, ppt->x, ppt->y, nlwidth); - if (*pwidth) { - for (d = 0; d < depthDst; d++, addrlBase += sizeDst) { /* @@@ NEXT PLANE @@@ */ - switch (rropsOS[d]) { - case RROP_BLACK: - src = 0; - break; - case RROP_WHITE: - src = ~0; - break; - case RROP_INVERT: - src = ~psrc[ppt->y % tileHeight]; - break; - case RROP_COPY: - src = psrc[ppt->y % tileHeight]; - break; - case RROP_NOP: - continue; - } - - addrl = addrlBase; - - if ( ((ppt->x & PIM) + *pwidth) < PPW) { - maskpartialbits(ppt->x, *pwidth, startmask); - *addrl = DoMaskCopyRop (src, *addrl, startmask); - } else { - maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle); - if (startmask) { - *addrl = DoMaskCopyRop (src, *addrl, startmask); - addrl++; - } - while (nlmiddle--) { - *addrl = src; - addrl++; - } - if (endmask) - *addrl = DoMaskCopyRop (src, *addrl, endmask); - } - } /* for (d = ...) */ - } - - pwidth++; - ppt++; - } - break; - - default: - { - register DeclareMergeRop (); - - InitializeMergeRop(rop,~0); - while (n--) { - addrlBase = afbScanline(pBase, ppt->x, ppt->y, nlwidth); - if (*pwidth) { - for (d = 0; d < depthDst; d++, addrlBase += sizeDst) { /* @@@ NEXT PLANE @@@ */ - switch (rropsOS[d]) { - case RROP_BLACK: - src = 0; - break; - case RROP_WHITE: - src = ~0; - break; - case RROP_INVERT: - src = ~psrc[ppt->y % tileHeight]; - break; - case RROP_COPY: - src = psrc[ppt->y % tileHeight]; - break; - case RROP_NOP: - continue; - } - - addrl = addrlBase; - - if ( ((ppt->x & PIM) + *pwidth) < PPW) { - maskpartialbits(ppt->x, *pwidth, startmask); - *addrl = DoMaskMergeRop (src, *addrl, startmask); - } else { - maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle); - if (startmask) { - *addrl = DoMaskMergeRop (src, *addrl, startmask); - addrl++; - } - while (nlmiddle--) { - *addrl = DoMergeRop (src, *addrl); - addrl++; - } - if (endmask) - *addrl = DoMaskMergeRop (src, *addrl, endmask); - } - } /* for (d = ...) */ - } - pwidth++; - ppt++; - } /* while (n) */ - break; - } - } /* switch (rop) */ - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); -} - -/* Fill spans with tiles that aren't PPW bits wide */ -void -afbUnnaturalTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) - DrawablePtr pDrawable; - GC *pGC; - int nInit; /* number of spans to fill */ - DDXPointPtr pptInit; /* pointer to list of start points */ - int *pwidthInit; /* pointer to list of n widths */ - int fSorted; -{ - int iline; /* first line of tile to use */ - /* next three parameters are post-clip */ - int n; /* number of spans to fill */ - register DDXPointPtr ppt; /* pointer to list of start points */ - register int *pwidth; /* pointer to list of n widths */ - PixelType *addrlBase; /* pointer to start of bitmap */ - PixelType *pBase; - int nlwidth; /* width in longwords of bitmap */ - register PixelType *pdst;/* pointer to current word in bitmap */ - register PixelType *psrc;/* pointer to current word in tile */ - register int nlMiddle; - register int rop, nstart; - PixelType startmask; - PixmapPtr pTile; /* pointer to tile we want to fill with */ - int w, width, x, xSrc, ySrc, srcStartOver, nend; - int tlwidth, rem, tileWidth, tileHeight, endinc; - PixelType endmask, *psrcT; - int *pwidthFree; /* copies of the pointers to free */ - DDXPointPtr pptFree; - int sizeDst; - int sizeTile; - int depthDst; - register int d; - - n = nInit * miFindMaxBand(pGC->pCompositeClip); - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); - if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); - return; - } - pwidth = pwidthFree; - ppt = pptFree; - n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit, - ppt, pwidth, fSorted); - - pTile = pGC->tile.pixmap; - tlwidth = pTile->devKind / PGSZB; - rop = pGC->alu; - - xSrc = pDrawable->x; - ySrc = pDrawable->y; - - afbGetPixelWidthSizeDepthAndPointer(pDrawable, nlwidth, sizeDst, depthDst, - pBase); - - tileWidth = pTile->drawable.width; - tileHeight = pTile->drawable.height; - sizeTile = tlwidth * tileHeight; - - /* this replaces rotating the tile. Instead we just adjust the offset - * at which we start grabbing bits from the tile. - * Ensure that ppt->x - xSrc >= 0 and ppt->y - ySrc >= 0, - * so that iline and rem always stay within the tile bounds. - */ - xSrc += (pGC->patOrg.x % tileWidth) - tileWidth; - ySrc += (pGC->patOrg.y % tileHeight) - tileHeight; - - while (n--) { - iline = (ppt->y - ySrc) % tileHeight; - psrcT = (PixelType *) pTile->devPrivate.ptr + (iline * tlwidth); - addrlBase = afbScanline(pBase, ppt->x, ppt->y, nlwidth); - - for (d = 0; d < depthDst; d++, psrcT += sizeTile, addrlBase += sizeDst) { /* @@@ NEXT PLANE @@@ */ - if (!(pGC->planemask & (1 << d))) - continue; - - if (*pwidth) { - x = ppt->x; - pdst = addrlBase; - width = *pwidth; - while(width > 0) { - psrc = psrcT; - w = min(tileWidth, width); - if((rem = (x - xSrc) % tileWidth) != 0) { - /* if we're in the middle of the tile, get - as many bits as will finish the span, or - as many as will get to the left edge of the tile, - or a longword worth, starting at the appropriate - offset in the tile. - */ - w = min(min(tileWidth - rem, width), BITMAP_SCANLINE_PAD); - endinc = rem / BITMAP_SCANLINE_PAD; - getandputrop((psrc+endinc), (rem&PIM), (x & PIM), w, pdst, rop); - if((x & PIM) + w >= PPW) - pdst++; - } else if(((x & PIM) + w) < PPW) { - /* doing < PPW bits is easy, and worth special-casing */ - putbitsrop(*psrc, x & PIM, w, pdst, rop); - } else { - /* start at the left edge of the tile, - and put down as much as we can - */ - maskbits(x, w, startmask, endmask, nlMiddle); - - if (startmask) - nstart = PPW - (x & PIM); - else - nstart = 0; - if (endmask) - nend = (x + w) & PIM; - else - nend = 0; - - srcStartOver = nstart > PLST; - - if(startmask) { - putbitsrop(*psrc, (x & PIM), nstart, pdst, rop); - pdst++; - if(srcStartOver) - psrc++; - } - - while(nlMiddle--) { - getandputrop0(psrc, nstart, PPW, pdst, rop); - pdst++; - psrc++; - } - if(endmask) { - getandputrop0(psrc, nstart, nend, pdst, rop); - } - } - x += w; - width -= w; - } - } - } - ppt++; - pwidth++; - } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); -} - -/* Fill spans with stipples that aren't PPW bits wide */ -void -afbUnnaturalStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) - DrawablePtr pDrawable; - GC *pGC; - int nInit; /* number of spans to fill */ - DDXPointPtr pptInit; /* pointer to list of start points */ - int *pwidthInit; /* pointer to list of n widths */ - int fSorted; -{ - /* next three parameters are post-clip */ - int n; /* number of spans to fill */ - register DDXPointPtr ppt; /* pointer to list of start points */ - register int *pwidth; /* pointer to list of n widths */ - int iline; /* first line of tile to use */ - PixelType *addrlBase; /* pointer to start of bitmap */ - PixelType *pBase; - int nlwidth; /* width in longwords of bitmap */ - register PixelType *pdst; /* pointer to current word in bitmap */ - register PixelType *psrc; /* pointer to current word in tile */ - register int nlMiddle; - register int rop, nstart; - PixelType startmask; - PixmapPtr pTile; /* pointer to tile we want to fill with */ - int w, width, x, xSrc, ySrc, srcStartOver, nend; - PixelType endmask, *psrcT; - int tlwidth, rem, tileWidth, endinc; - int tileHeight; - int *pwidthFree; /* copies of the pointers to free */ - DDXPointPtr pptFree; - unsigned char *rrops; - register int d; - int sizeDst; - int depthDst; - - n = nInit * miFindMaxBand(pGC->pCompositeClip); - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); - if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); - return; - } - pwidth = pwidthFree; - ppt = pptFree; - n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit, - ppt, pwidth, fSorted); - - pTile = pGC->stipple; - tlwidth = pTile->devKind / PGSZB; - xSrc = pDrawable->x; - ySrc = pDrawable->y; - afbGetPixelWidthSizeDepthAndPointer(pDrawable, nlwidth, sizeDst, depthDst, - pBase); - - tileWidth = pTile->drawable.width; - tileHeight = pTile->drawable.height; - rrops = ((afbPrivGC *)(pGC->devPrivates[afbGCPrivateIndex].ptr))->rrops; - - /* this replaces rotating the stipple. Instead, we just adjust the offset - * at which we start grabbing bits from the stipple. - * Ensure that ppt->x - xSrc >= 0 and ppt->y - ySrc >= 0, - * so that iline and rem always stay within the tile bounds. - */ - xSrc += (pGC->patOrg.x % tileWidth) - tileWidth; - ySrc += (pGC->patOrg.y % tileHeight) - tileHeight; - while (n--) { - iline = (ppt->y - ySrc) % tileHeight; - psrcT = (PixelType *) pTile->devPrivate.ptr + (iline * tlwidth); - addrlBase = afbScanline(pBase, ppt->x, ppt->y, nlwidth); - - for (d = 0; d < depthDst; d++, addrlBase += sizeDst) { /* @@@ NEXT PLANE @@@ */ - rop = rrops[d]; - if (rop == RROP_NOP) - continue; - - pdst = addrlBase; - x = ppt->x; - - if (*pwidth) { - width = *pwidth; - while(width > 0) { - psrc = psrcT; - w = min(tileWidth, width); - if((rem = (x - xSrc) % tileWidth) != 0) { - /* if we're in the middle of the tile, get - as many bits as will finish the span, or - as many as will get to the left edge of the tile, - or a longword worth, starting at the appropriate - offset in the tile. - */ - w = min(min(tileWidth - rem, width), BITMAP_SCANLINE_PAD); - endinc = rem / BITMAP_SCANLINE_PAD; - getandputrrop((psrc + endinc), (rem & PIM), (x & PIM), - w, pdst, rop) - if((x & PIM) + w >= PPW) - pdst++; - } else if(((x & PIM) + w) < PPW) { - /* doing < PPW bits is easy, and worth special-casing */ - putbitsrrop(*psrc, x & PIM, w, pdst, rop); - } else { - /* start at the left edge of the tile, - and put down as much as we can - */ - maskbits(x, w, startmask, endmask, nlMiddle); - - if (startmask) - nstart = PPW - (x & PIM); - else - nstart = 0; - if (endmask) - nend = (x + w) & PIM; - else - nend = 0; - - srcStartOver = nstart > PLST; - - if(startmask) { - putbitsrrop(*psrc, (x & PIM), nstart, pdst, rop); - pdst++; - if(srcStartOver) - psrc++; - } - - while(nlMiddle--) { - getandputrrop0(psrc, nstart, PPW, pdst, rop); - pdst++; - psrc++; - } - if(endmask) { - getandputrrop0(psrc, nstart, nend, pdst, rop); - } - } - x += w; - width -= w; - } - } - } - ppt++; - pwidth++; - } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); -} - -/* Fill spans with OpaqueStipples that aren't PPW bits wide */ -void -afbUnnaturalOpaqueStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) - DrawablePtr pDrawable; - GC *pGC; - int nInit; /* number of spans to fill */ - DDXPointPtr pptInit; /* pointer to list of start points */ - int *pwidthInit; /* pointer to list of n widths */ - int fSorted; -{ - int iline; /* first line of tile to use */ - /* next three parameters are post-clip */ - int n; /* number of spans to fill */ - register DDXPointPtr ppt; /* pointer to list of start points */ - register int *pwidth; /* pointer to list of n widths */ - PixelType *addrlBase; /* pointer to start of bitmap */ - PixelType *pBase; - int nlwidth; /* width in longwords of bitmap */ - register PixelType *pdst;/* pointer to current word in bitmap */ - register PixelType *psrc;/* pointer to current word in tile */ - register int nlMiddle; - register int d; - register PixelType tmpsrc = 0; - register PixelType tmpdst; - register int alu, nstart; - register unsigned char *rropsOS; - PixelType startmask; - PixmapPtr pTile; /* pointer to tile we want to fill with */ - int w, width, x, xSrc, ySrc, srcStartOver, nend; - int tlwidth, rem, tileWidth, tileHeight, endinc; - PixelType endmask, *psrcT; - int *pwidthFree; /* copies of the pointers to free */ - DDXPointPtr pptFree; - int sizeDst; - int depthDst; - - n = nInit * miFindMaxBand(pGC->pCompositeClip); - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); - if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); - return; - } - pwidth = pwidthFree; - ppt = pptFree; - n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit, - ppt, pwidth, fSorted); - - pTile = pGC->stipple; - tlwidth = pTile->devKind / PGSZB; - alu = pGC->alu; - - xSrc = pDrawable->x; - ySrc = pDrawable->y; - - afbGetPixelWidthSizeDepthAndPointer(pDrawable, nlwidth, sizeDst, depthDst, - pBase); - - tileWidth = pTile->drawable.width; - tileHeight = pTile->drawable.height; - rropsOS = afbGetGCPrivate(pGC)->rropOS; - - /* this replaces rotating the tile. Instead we just adjust the offset - * at which we start grabbing bits from the tile. - * Ensure that ppt->x - xSrc >= 0 and ppt->y - ySrc >= 0, - * so that iline and rem always stay within the tile bounds. - */ - xSrc += (pGC->patOrg.x % tileWidth) - tileWidth; - ySrc += (pGC->patOrg.y % tileHeight) - tileHeight; - - while (n--) { - iline = (ppt->y - ySrc) % tileHeight; - psrcT = (PixelType *) pTile->devPrivate.ptr + (iline * tlwidth); - addrlBase = afbScanline(pBase, ppt->x, ppt->y, nlwidth); - - for (d = 0; d < depthDst; d++, addrlBase += sizeDst) { /* @@@ NEXT PLANE @@@ */ - if (!(pGC->planemask & (1 << d))) - continue; - - if (*pwidth) { - x = ppt->x; - pdst = addrlBase; - width = *pwidth; - while(width > 0) { - psrc = psrcT; - w = min(tileWidth, width); - if((rem = (x - xSrc) % tileWidth) != 0) { - /* if we're in the middle of the tile, get - as many bits as will finish the span, or - as many as will get to the left edge of the tile, - or a longword worth, starting at the appropriate - offset in the tile. - */ - w = min(min(tileWidth - rem, width), BITMAP_SCANLINE_PAD); - endinc = rem / BITMAP_SCANLINE_PAD; - switch (rropsOS[d]) { - case RROP_BLACK: - tmpsrc = 0; - break; - case RROP_WHITE: - tmpsrc = ~0; - break; - - case RROP_COPY: - getbits ((psrc+endinc), (rem&PIM), w, tmpsrc); - break; - - case RROP_INVERT: - getbits ((psrc+endinc), (rem&PIM), w, tmpsrc); - tmpsrc = ~tmpsrc; - break; - } - - if (alu != GXcopy) { - getbits (pdst, (x & PIM), w, tmpdst); - DoRop (tmpsrc, alu, tmpsrc, tmpdst); - } - - putbits (tmpsrc, (x & PIM), w, pdst); - if((x & PIM) + w >= PPW) - pdst++; - } else if(((x & PIM) + w) < PPW) { - /* doing < PPW bits is easy, and worth special-casing */ - switch (rropsOS[d]) { - case RROP_BLACK: - tmpsrc = 0; - break; - case RROP_WHITE: - tmpsrc = ~0; - break; - case RROP_COPY: - tmpsrc = *psrc; - break; - case RROP_INVERT: - tmpsrc = ~*psrc; - break; - } - if (alu != GXcopy) { - getbits (pdst, (x & PIM), w, tmpdst); - DoRop (tmpsrc, alu, tmpsrc, tmpdst); - } - putbits (tmpsrc, (x & PIM), w, pdst); - } else { - /* start at the left edge of the tile, - and put down as much as we can - */ - maskbits(x, w, startmask, endmask, nlMiddle); - - if (startmask) - nstart = PPW - (x & PIM); - else - nstart = 0; - if (endmask) - nend = (x + w) & PIM; - else - nend = 0; - - srcStartOver = nstart > PLST; - - if(startmask) { - switch (rropsOS[d]) { - case RROP_BLACK: - tmpsrc = 0; - break; - case RROP_WHITE: - tmpsrc = ~0; - break; - case RROP_COPY: - tmpsrc = *psrc; - break; - case RROP_INVERT: - tmpsrc = ~*psrc; - break; - } - if (alu != GXcopy) { - getbits (pdst, (x & PIM), nstart, tmpdst); - DoRop (tmpsrc, alu, tmpsrc, tmpdst); - } - putbits (tmpsrc, (x & PIM), nstart, pdst); - pdst++; - if(srcStartOver) - psrc++; - } - - while(nlMiddle--) { - switch (rropsOS[d]) { - case RROP_BLACK: - tmpsrc = 0; - break; - case RROP_WHITE: - tmpsrc = ~0; - break; - case RROP_COPY: - getbits (psrc, nstart, PPW, tmpsrc); - break; - case RROP_INVERT: - getbits (psrc, nstart, PPW, tmpsrc); - tmpsrc = ~tmpsrc; - break; - } - if (alu != GXcopy) { - tmpdst = *pdst; - DoRop (tmpsrc, alu, tmpsrc, tmpdst); - } - *pdst++ = tmpsrc; - /*putbits (tmpsrc, 0, PPW, pdst); - pdst++;*/ - psrc++; - } - if(endmask) { - switch (rropsOS[d]) { - case RROP_BLACK: - tmpsrc = 0; - break; - case RROP_WHITE: - tmpsrc = ~0; - break; - - case RROP_COPY: - getbits (psrc, nstart, nend, tmpsrc); - break; - - case RROP_INVERT: - getbits (psrc, nstart, nend, tmpsrc); - tmpsrc = ~tmpsrc; - break; - } - if (alu != GXcopy) { - tmpdst = *pdst; - DoRop (tmpsrc, alu, tmpsrc, tmpdst); - } - putbits (tmpsrc, 0, nend, pdst); - } - } - x += w; - width -= w; - } - } - } - ppt++; - pwidth++; - } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); -} diff --git a/nx-X11/programs/Xserver/afb/afbfont.c b/nx-X11/programs/Xserver/afb/afbfont.c deleted file mode 100644 index bf77825f1..000000000 --- a/nx-X11/programs/Xserver/afb/afbfont.c +++ /dev/null @@ -1,79 +0,0 @@ -/* $XFree86$ */ -/* - -Copyright (c) 1987 X Consortium - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of the X Consortium shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from the X Consortium. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XConsortium: afbfont.c,v 1.18 94/04/17 20:28:22 keith Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include -#include "afb.h" -#include -#include "dixfontstr.h" -#include "scrnintstr.h" - -/*ARGSUSED*/ -Bool -afbRealizeFont( pscr, pFont) - ScreenPtr pscr; - FontPtr pFont; -{ - return (TRUE); -} - -/*ARGSUSED*/ -Bool -afbUnrealizeFont( pscr, pFont) - ScreenPtr pscr; - FontPtr pFont; -{ - return (TRUE); -} diff --git a/nx-X11/programs/Xserver/afb/afbgc.c b/nx-X11/programs/Xserver/afb/afbgc.c deleted file mode 100644 index e9f4c52b7..000000000 --- a/nx-X11/programs/Xserver/afb/afbgc.c +++ /dev/null @@ -1,711 +0,0 @@ -/* $XFree86: xc/programs/Xserver/afb/afbgc.c,v 3.2 1999/06/20 15:02:46 dawes Exp $ */ -/*********************************************************** - -Copyright (c) 1987 X Consortium - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of the X Consortium shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from the X Consortium. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XConsortium: afbgc.c,v 5.35 94/04/17 20:28:23 dpw Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include -#include "afb.h" -#include "dixfontstr.h" -#include -#include "gcstruct.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "scrnintstr.h" -#include "region.h" - -#include "mistruct.h" -#include "migc.h" - -#include "maskbits.h" - -static GCFuncs afbFuncs = { - afbValidateGC, - miChangeGC, - miCopyGC, - afbDestroyGC, - miChangeClip, - miDestroyClip, - miCopyClip -}; - -static GCOps afbGCOps = { - afbSolidFS, - afbSetSpans, - afbPutImage, - afbCopyArea, - miCopyPlane, - afbPolyPoint, - afbLineSS, - afbSegmentSS, - miPolyRectangle, - afbZeroPolyArcSS, - afbFillPolygonSolid, - afbPolyFillRect, - afbPolyFillArcSolid, - miPolyText8, - miPolyText16, - miImageText8, - miImageText16, - afbTEGlyphBlt, - afbPolyGlyphBlt, - afbPushPixels -#ifdef NEED_LINEHELPER - ,NULL -#endif -}; - - -Bool -afbCreateGC(pGC) - register GCPtr pGC; -{ - afbPrivGC *pPriv; - - pGC->clientClip = NULL; - pGC->clientClipType = CT_NONE; - - /* some of the output primitives aren't really necessary, since - they will be filled in ValidateGC because of dix/CreateGC() - setting all the change bits. Others are necessary because although - they depend on being a monochrome frame buffer, they don't change - */ - - pGC->ops = &afbGCOps; - pGC->funcs = &afbFuncs; - - /* afb wants to translate before scan convesion */ - pGC->miTranslate = 1; - - pPriv = (afbPrivGC *)(pGC->devPrivates[afbGCPrivateIndex].ptr); - afbReduceRop(pGC->alu, pGC->fgPixel, pGC->planemask, pGC->depth, - pPriv->rrops); - afbReduceOpaqueStipple(pGC->fgPixel, pGC->bgPixel, pGC->planemask, - pGC->depth, pPriv->rropOS); - - pGC->fExpose = TRUE; - pGC->pRotatedPixmap = NullPixmap; - pGC->freeCompClip = FALSE; - return TRUE; -} - -/* Clipping conventions - if the drawable is a window - CT_REGION ==> pCompositeClip really is the composite - CT_other ==> pCompositeClip is the window clip region - if the drawable is a pixmap - CT_REGION ==> pCompositeClip is the translated client region - clipped to the pixmap boundary - CT_other ==> pCompositeClip is the pixmap bounding box -*/ - -/*ARGSUSED*/ -void -afbValidateGC(pGC, changes, pDrawable) - register GCPtr pGC; - unsigned long changes; - DrawablePtr pDrawable; -{ - register afbPrivGCPtr devPriv; - int mask; /* stateChanges */ - int index; /* used for stepping through bitfields */ - int xrot, yrot; /* rotations for tile and stipple pattern */ - /* flags for changing the proc vector - and updating things in devPriv - */ - int new_rotate, new_rrop, new_line, new_text, new_fill; - DDXPointRec oldOrg; /* origin of thing GC was last used with */ - - oldOrg = pGC->lastWinOrg; - - pGC->lastWinOrg.x = pDrawable->x; - pGC->lastWinOrg.y = pDrawable->y; - - /* we need to re-rotate the tile if the previous window/pixmap - origin (oldOrg) differs from the new window/pixmap origin - (pGC->lastWinOrg) - */ - new_rotate = (oldOrg.x != pGC->lastWinOrg.x) || - (oldOrg.y != pGC->lastWinOrg.y); - - - devPriv = ((afbPrivGCPtr)(pGC->devPrivates[afbGCPrivateIndex].ptr)); - - - /* - if the client clip is different or moved OR - the subwindowMode has changed OR - the window's clip has changed since the last validation - we need to recompute the composite clip - */ - if ((changes & (GCClipXOrigin|GCClipYOrigin|GCClipMask|GCSubwindowMode)) || - (pDrawable->serialNumber != (pGC->serialNumber & DRAWABLE_SERIAL_BITS))) - afbComputeCompositeClip(pGC, pDrawable); - - new_rrop = FALSE; - new_line = FALSE; - new_text = FALSE; - new_fill = FALSE; - - mask = changes; - while (mask) { - index = lowbit(mask); - mask &= ~index; - - /* this switch acculmulates a list of which procedures - might have to change due to changes in the GC. in - some cases (e.g. changing one 16 bit tile for another) - we might not really need a change, but the code is - being paranoid. - this sort of batching wins if, for example, the alu - and the font have been changed, or any other pair - of items that both change the same thing. - */ - switch (index) { - case GCPlaneMask: - case GCFunction: - case GCForeground: - new_rrop = TRUE; - break; - case GCBackground: - new_rrop = TRUE; /* for opaque stipples */ - break; - case GCLineStyle: - case GCLineWidth: - case GCJoinStyle: - new_line = TRUE; - break; - case GCCapStyle: - break; - case GCFillStyle: - new_fill = TRUE; - break; - case GCFillRule: - break; - case GCTile: - if(pGC->tileIsPixel) - break; - new_rotate = TRUE; - new_fill = TRUE; - break; - - case GCStipple: - if(pGC->stipple == (PixmapPtr)NULL) - break; - new_rotate = TRUE; - new_fill = TRUE; - break; - - case GCTileStipXOrigin: - new_rotate = TRUE; - break; - - case GCTileStipYOrigin: - new_rotate = TRUE; - break; - - case GCFont: - new_text = TRUE; - break; - case GCSubwindowMode: - break; - case GCGraphicsExposures: - break; - case GCClipXOrigin: - break; - case GCClipYOrigin: - break; - case GCClipMask: - break; - case GCDashOffset: - break; - case GCDashList: - break; - case GCArcMode: - break; - default: - break; - } - } - - /* deal with the changes we've collected . - new_rrop must be done first because subsequent things - depend on it. - */ - - if(new_rotate || new_fill) { - Bool new_pix = FALSE; - - /* figure out how much to rotate */ - xrot = pGC->patOrg.x; - yrot = pGC->patOrg.y; - xrot += pDrawable->x; - yrot += pDrawable->y; - - switch (pGC->fillStyle) { - case FillTiled: - /* copy current tile and stipple */ - if (!pGC->tileIsPixel && - (pGC->tile.pixmap->drawable.width <= PPW) && - !(pGC->tile.pixmap->drawable.width & - (pGC->tile.pixmap->drawable.width - 1))) { - afbCopyRotatePixmap(pGC->tile.pixmap, &pGC->pRotatedPixmap, - xrot, yrot); - new_pix = TRUE; - } - break; - case FillStippled: - case FillOpaqueStippled: - if (pGC->stipple && (pGC->stipple->drawable.width <= PPW) && - !(pGC->stipple->drawable.width & - (pGC->stipple->drawable.width - 1))) { - afbCopyRotatePixmap(pGC->stipple, &pGC->pRotatedPixmap, - xrot, yrot); - new_pix = TRUE; - } - } - /* destroy any previously rotated tile or stipple */ - if (!new_pix && pGC->pRotatedPixmap) { - (*pDrawable->pScreen->DestroyPixmap)(pGC->pRotatedPixmap); - pGC->pRotatedPixmap = (PixmapPtr)NULL; - } - } - - /* - * duck out here when the GC is unchanged - */ - - if (!changes) - return; - - if (new_rrop || new_fill) { - afbReduceRop(pGC->alu, pGC->fgPixel, pGC->planemask, pDrawable->depth, - devPriv->rrops); - afbReduceOpaqueStipple(pGC->fgPixel, pGC->bgPixel, pGC->planemask, - pGC->depth, devPriv->rropOS); - new_fill = TRUE; - } - - if (new_line || new_fill || new_text) { - if (!pGC->ops->devPrivate.val) { - pGC->ops = miCreateGCOps(pGC->ops); - pGC->ops->devPrivate.val = 1; - } - } - - if (new_line || new_fill) { - if (pGC->lineWidth == 0) { - if (pGC->lineStyle == LineSolid && pGC->fillStyle == FillSolid) - pGC->ops->PolyArc = afbZeroPolyArcSS; - else - pGC->ops->PolyArc = miZeroPolyArc; - } else - pGC->ops->PolyArc = miPolyArc; - if (pGC->lineStyle == LineSolid) { - if(pGC->lineWidth == 0) { - if (pGC->fillStyle == FillSolid) { - pGC->ops->PolySegment = afbSegmentSS; - pGC->ops->Polylines = afbLineSS; - } - else - { - pGC->ops->PolySegment = miPolySegment; - pGC->ops->Polylines = miZeroLine; - } - } else { - pGC->ops->PolySegment = miPolySegment; - pGC->ops->Polylines = miWideLine; - } - } else { - if(pGC->lineWidth == 0 && pGC->fillStyle == FillSolid) { - pGC->ops->PolySegment = afbSegmentSD; - pGC->ops->Polylines = afbLineSD; - } else { - pGC->ops->PolySegment = miPolySegment; - pGC->ops->Polylines = miWideDash; - } - } - } - - if (new_text || new_fill) { - if ((pGC->font) && - (FONTMAXBOUNDS(pGC->font,rightSideBearing) - - FONTMINBOUNDS(pGC->font,leftSideBearing) > 32 || - FONTMINBOUNDS(pGC->font,characterWidth) < 0)) { - pGC->ops->PolyGlyphBlt = miPolyGlyphBlt; - pGC->ops->ImageGlyphBlt = miImageGlyphBlt; - } else { - /* special case ImageGlyphBlt for terminal emulator fonts */ - if ((pGC->font) && - TERMINALFONT(pGC->font)) { - pGC->ops->ImageGlyphBlt = afbTEGlyphBlt; - } else { - pGC->ops->ImageGlyphBlt = afbImageGlyphBlt; - } - - /* now do PolyGlyphBlt */ - if (pGC->fillStyle == FillSolid) { - pGC->ops->PolyGlyphBlt = afbPolyGlyphBlt; - } else { - pGC->ops->PolyGlyphBlt = miPolyGlyphBlt; - } - } - } - - if (new_fill) { - /* install a suitable fillspans and pushpixels */ - pGC->ops->PushPixels = afbPushPixels; - pGC->ops->FillPolygon = miFillPolygon; - pGC->ops->PolyFillArc = miPolyFillArc; - - switch (pGC->fillStyle) { - case FillSolid: - pGC->ops->FillSpans = afbSolidFS; - pGC->ops->FillPolygon = afbFillPolygonSolid; - pGC->ops->PolyFillArc = afbPolyFillArcSolid; - break; - case FillTiled: - if (pGC->pRotatedPixmap) - pGC->ops->FillSpans = afbTileFS; - else - pGC->ops->FillSpans = afbUnnaturalTileFS; - break; - case FillOpaqueStippled: - if (pGC->pRotatedPixmap) - pGC->ops->FillSpans = afbOpaqueStippleFS; - else - pGC->ops->FillSpans = afbUnnaturalOpaqueStippleFS; - break; - - case FillStippled: - if (pGC->pRotatedPixmap) - pGC->ops->FillSpans = afbStippleFS; - else - pGC->ops->FillSpans = afbUnnaturalStippleFS; - break; - } - } /* end of new_fill */ -} - -void -afbDestroyGC(pGC) - GCPtr pGC; -{ - if (pGC->pRotatedPixmap) - (*pGC->pScreen->DestroyPixmap)(pGC->pRotatedPixmap); - if (pGC->freeCompClip) - REGION_DESTROY(pGC->pScreen, pGC->pCompositeClip); - miDestroyGCOps(pGC->ops); -} - -/* table to map alu(src, dst) to alu(~src, dst) */ -int afbInverseAlu[16] = { - GXclear, - GXandInverted, - GXnor, - GXcopyInverted, - GXand, - GXnoop, - GXequiv, - GXorInverted, - GXandReverse, - GXxor, - GXinvert, - GXnand, - GXcopy, - GXor, - GXorReverse, - GXset -}; - -void -afbReduceOpaqueStipple(fg, bg, planemask, depth, rop) -register PixelType fg; -register PixelType bg; -register unsigned long planemask; -int depth; -register unsigned char *rop; -{ - register int d; - register Pixel mask = 1; - - bg ^= fg; - - for (d = 0; d < depth; d++, mask <<= 1) { - if (!(planemask & mask)) - rop[d] = RROP_NOP; - else if (!(bg & mask)) { - /* Both fg and bg have a 0 or 1 in this plane */ - if (fg & mask) - rop[d] = RROP_WHITE; - else - rop[d] = RROP_BLACK; - } else { - /* Both fg and bg have different bits on this plane */ - if (fg & mask) - rop[d] = RROP_COPY; - else - rop[d] = RROP_INVERT; - } - } -} - -void -afbReduceRop(alu, src, planemask, depth, rop) - register int alu; - register Pixel src; - register unsigned long planemask; - int depth; - register unsigned char *rop; -{ - register int d; - register Pixel mask = 1; - - for (d = 0; d < depth; d++, mask <<= 1) { - if (!(planemask & mask)) - rop[d] = RROP_NOP; - else if ((src & mask) == 0) /* src is black */ - switch (alu) { - case GXclear: - rop[d] = RROP_BLACK; - break; - case GXand: - rop[d] = RROP_BLACK; - break; - case GXandReverse: - rop[d] = RROP_BLACK; - break; - case GXcopy: - rop[d] = RROP_BLACK; - break; - case GXandInverted: - rop[d] = RROP_NOP; - break; - case GXnoop: - rop[d] = RROP_NOP; - break; - case GXxor: - rop[d] = RROP_NOP; - break; - case GXor: - rop[d] = RROP_NOP; - break; - case GXnor: - rop[d] = RROP_INVERT; - break; - case GXequiv: - rop[d] = RROP_INVERT; - break; - case GXinvert: - rop[d] = RROP_INVERT; - break; - case GXorReverse: - rop[d] = RROP_INVERT; - break; - case GXcopyInverted: - rop[d] = RROP_WHITE; - break; - case GXorInverted: - rop[d] = RROP_WHITE; - break; - case GXnand: - rop[d] = RROP_WHITE; - break; - case GXset: - rop[d] = RROP_WHITE; - break; - } - else /* src is white */ - switch (alu) { - case GXclear: - rop[d] = RROP_BLACK; - break; - case GXand: - rop[d] = RROP_NOP; - break; - case GXandReverse: - rop[d] = RROP_INVERT; - break; - case GXcopy: - rop[d] = RROP_WHITE; - break; - case GXandInverted: - rop[d] = RROP_BLACK; - break; - case GXnoop: - rop[d] = RROP_NOP; - break; - case GXxor: - rop[d] = RROP_INVERT; - break; - case GXor: - rop[d] = RROP_WHITE; - break; - case GXnor: - rop[d] = RROP_BLACK; - break; - case GXequiv: - rop[d] = RROP_NOP; - break; - case GXinvert: - rop[d] = RROP_INVERT; - break; - case GXorReverse: - rop[d] = RROP_WHITE; - break; - case GXcopyInverted: - rop[d] = RROP_BLACK; - break; - case GXorInverted: - rop[d] = RROP_NOP; - break; - case GXnand: - rop[d] = RROP_INVERT; - break; - case GXset: - rop[d] = RROP_WHITE; - break; - } - } -} - -void -afbComputeCompositeClip(pGC, pDrawable) - GCPtr pGC; - DrawablePtr pDrawable; -{ - if (pDrawable->type == DRAWABLE_WINDOW) { - WindowPtr pWin = (WindowPtr) pDrawable; - RegionPtr pregWin; - Bool freeTmpClip, freeCompClip; - - if (pGC->subWindowMode == IncludeInferiors) { - pregWin = NotClippedByChildren(pWin); - freeTmpClip = TRUE; - } else { - pregWin = &pWin->clipList; - freeTmpClip = FALSE; - } - freeCompClip = pGC->freeCompClip; - - /* - * if there is no client clip, we can get by with just keeping the - * pointer we got, and remembering whether or not should destroy (or - * maybe re-use) it later. this way, we avoid unnecessary copying of - * regions. (this wins especially if many clients clip by children - * and have no client clip.) - */ - if (pGC->clientClipType == CT_NONE) { - if (freeCompClip) - REGION_DESTROY(pGC->pScreen, pGC->pCompositeClip); - pGC->pCompositeClip = pregWin; - pGC->freeCompClip = freeTmpClip; - } else { - /* - * we need one 'real' region to put into the composite clip. if - * pregWin the current composite clip are real, we can get rid of - * one. if pregWin is real and the current composite clip isn't, - * use pregWin for the composite clip. if the current composite - * clip is real and pregWin isn't, use the current composite - * clip. if neither is real, create a new region. - */ - - REGION_TRANSLATE(pGC->pScreen, pGC->clientClip, - pDrawable->x + pGC->clipOrg.x, - pDrawable->y + pGC->clipOrg.y); - - if (freeCompClip) { - REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip, pregWin, - pGC->clientClip); - if (freeTmpClip) - REGION_DESTROY(pGC->pScreen, pregWin); - } else if (freeTmpClip) { - REGION_INTERSECT(pGC->pScreen, pregWin, pregWin, pGC->clientClip); - pGC->pCompositeClip = pregWin; - } else { - pGC->pCompositeClip = REGION_CREATE(pGC->pScreen, NullBox, 0); - REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip, - pregWin, pGC->clientClip); - } - pGC->freeCompClip = TRUE; - REGION_TRANSLATE(pGC->pScreen, pGC->clientClip, - -(pDrawable->x + pGC->clipOrg.x), - -(pDrawable->y + pGC->clipOrg.y)); - } - } /* end of composite clip for a window */ - else { - BoxRec pixbounds; - - /* XXX should we translate by drawable.x/y here ? */ - pixbounds.x1 = 0; - pixbounds.y1 = 0; - pixbounds.x2 = pDrawable->width; - pixbounds.y2 = pDrawable->height; - - if (pGC->freeCompClip) { - REGION_RESET(pGC->pScreen, pGC->pCompositeClip, &pixbounds); - } else { - pGC->freeCompClip = TRUE; - pGC->pCompositeClip = REGION_CREATE(pGC->pScreen, &pixbounds, 1); - } - - if (pGC->clientClipType == CT_REGION) { - REGION_TRANSLATE(pGC->pScreen, pGC->pCompositeClip, -pGC->clipOrg.x, - -pGC->clipOrg.y); - REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip, - pGC->pCompositeClip, pGC->clientClip); - REGION_TRANSLATE(pGC->pScreen, pGC->pCompositeClip, pGC->clipOrg.x, - pGC->clipOrg.y); - } - } /* end of composite clip for pixmap */ -} /* end afbComputeCompositeClip */ diff --git a/nx-X11/programs/Xserver/afb/afbgetsp.c b/nx-X11/programs/Xserver/afb/afbgetsp.c deleted file mode 100644 index 3cc2e2f6e..000000000 --- a/nx-X11/programs/Xserver/afb/afbgetsp.c +++ /dev/null @@ -1,167 +0,0 @@ -/* $XFree86: xc/programs/Xserver/afb/afbgetsp.c,v 3.0 1996/08/18 01:45:37 dawes Exp $ */ -/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */ -/*********************************************************** - -Copyright (c) 1987 X Consortium - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of the X Consortium shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from the X Consortium. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XConsortium: afbgetsp.c,v 5.10 94/04/17 20:28:24 dpw Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include - -#include "misc.h" -#include "region.h" -#include "gc.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "scrnintstr.h" - -#include "afb.h" -#include "maskbits.h" - -#include "servermd.h" - -/* GetSpans -- for each span, gets bits from drawable starting at ppt[i] - * and continuing for pwidth[i] bits - * Each scanline returned will be server scanline padded, i.e., it will come - * out to an integral number of words. - */ -/*ARGSUSED*/ -void -afbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pchardstStart) - DrawablePtr pDrawable; /* drawable from which to get bits */ - int wMax; /* largest value of all *pwidths */ - register DDXPointPtr ppt; /* points to start copying from */ - int *pwidth; /* list of number of bits to copy */ - int nspans; /* number of scanlines to copy */ - char *pchardstStart; /* where to put the bits */ -{ - PixelType *pdstStart = (PixelType *)pchardstStart; - register PixelType *pdst; /* where to put the bits */ - register PixelType *psrc; /* where to get the bits */ - register PixelType tmpSrc; /* scratch buffer for bits */ - PixelType *psrcBase; /* start of src bitmap */ - int widthSrc; /* width of pixmap in bytes */ - int sizeSrc; - int depthSrc; - register DDXPointPtr pptLast; /* one past last point to get */ - int xEnd; /* last pixel to copy from */ - register int nstart; - register int d; - int nend = 0; - int srcStartOver; - PixelType startmask, endmask; - unsigned int srcBit; - int nlMiddle, nl; - int w; - - pptLast = ppt + nspans; - - afbGetPixelWidthSizeDepthAndPointer(pDrawable, widthSrc, sizeSrc, depthSrc, - psrcBase); - pdst = pdstStart; - - while(ppt < pptLast) { - /* XXX should this really be << PWSH, or * 8, or * PGSZB? */ - xEnd = min(ppt->x + *pwidth, widthSrc << PWSH); - pwidth++; - for (d = 0; d < depthSrc; d++) { - psrc = afbScanline(psrcBase, ppt->x, ppt->y, widthSrc); - psrcBase += sizeSrc; /* @@@ NEXT PLANE @@@ */ - w = xEnd - ppt->x; - srcBit = ppt->x & PIM; - - if (srcBit + w <= PPW) - { - getandputbits0(psrc, srcBit, w, pdst); - pdst++; - } - else - { - - maskbits(ppt->x, w, startmask, endmask, nlMiddle); - if (startmask) - nstart = PPW - srcBit; - else - nstart = 0; - if (endmask) - nend = xEnd & PIM; - srcStartOver = srcBit + nstart > PLST; - if (startmask) - { - getandputbits0(psrc, srcBit, nstart, pdst); - if(srcStartOver) - psrc++; - } - nl = nlMiddle; -#ifdef FASTPUTBITS - Duff(nl, putbits(*psrc, nstart, PPW, pdst); psrc++; pdst++;); -#else - while (nl--) - { - tmpSrc = *psrc; - putbits(tmpSrc, nstart, PPW, pdst); - psrc++; - pdst++; - } -#endif - if (endmask) - { - putbits(*psrc, nstart, nend, pdst); - if(nstart + nend > PPW) - pdst++; - } - if (startmask || endmask) - pdst++; - } - } - ppt++; - } -} diff --git a/nx-X11/programs/Xserver/afb/afbhrzvert.c b/nx-X11/programs/Xserver/afb/afbhrzvert.c deleted file mode 100644 index d7ddce1a1..000000000 --- a/nx-X11/programs/Xserver/afb/afbhrzvert.c +++ /dev/null @@ -1,211 +0,0 @@ -/* $XFree86: xc/programs/Xserver/afb/afbhrzvert.c,v 3.0 1996/08/18 01:45:38 dawes Exp $ */ -/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */ -/*********************************************************** - -Copyright (c) 1987 X Consortium - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of the X Consortium shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from the X Consortium. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XConsortium: afbhrzvert.c,v 1.15 94/04/17 20:28:24 dpw Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include - -#include "gc.h" -#include "window.h" -#include "pixmap.h" -#include "region.h" - -#include "afb.h" -#include "maskbits.h" - -/* horizontal solid line - abs(len) > 1 -*/ -void -afbHorzS(pbase, nlwidth, sizeDst, depthDst, x1, y1, len, rrops) -PixelType *pbase; /* pointer to base of bitmap */ -register int nlwidth; /* width in longwords of bitmap */ -int sizeDst; -int depthDst; -int x1; /* initial point */ -int y1; -int len; /* length of line */ -register unsigned char *rrops; -{ - register PixelType *addrl; - register PixelType startmask; - register PixelType endmask; - register int nlmiddle; - register int d; - int saveNLmiddle; - - /* force the line to go left to right - but don't draw the last point - */ - if (len < 0) { - x1 += len; - x1 += 1; - len = -len; - } - - /* all bits inside same longword */ - if ( ((x1 & PIM) + len) < PPW) { - maskpartialbits(x1, len, startmask); - - for (d = 0; d < depthDst; d++) { - addrl = afbScanline(pbase, x1, y1, nlwidth); - pbase += sizeDst; /* @@@ NEXT PLANE @@@ */ - - switch (rrops[d]) { - case RROP_BLACK: - *addrl &= ~startmask; - break; - case RROP_WHITE: - *addrl |= startmask; - break; - case RROP_INVERT: - *addrl ^= startmask; - break; - case RROP_NOP: - break; - } /* switch */ - } /* for (d = ...) */ - } else { - maskbits(x1, len, startmask, endmask, nlmiddle); - saveNLmiddle = nlmiddle; - - for (d = 0; d < depthDst; d++) { - addrl = afbScanline(pbase, x1, y1, nlwidth); - pbase += sizeDst; /* @@@ NEXT PLANE @@@ */ - nlmiddle = saveNLmiddle; - - switch (rrops[d]) { - case RROP_BLACK: - if (startmask) - *addrl++ &= ~startmask; - Duff (nlmiddle, *addrl++ = 0x0); - if (endmask) - *addrl &= ~endmask; - break; - - case RROP_WHITE: - if (startmask) - *addrl++ |= startmask; - Duff (nlmiddle, *addrl++ = ~0); - if (endmask) - *addrl |= endmask; - break; - - case RROP_INVERT: - if (startmask) - *addrl++ ^= startmask; - Duff (nlmiddle, *addrl++ ^= ~0); - if (endmask) - *addrl ^= endmask; - break; - - case RROP_NOP: - break; - } /* switch */ - } /* for (d = ... ) */ - } -} - -/* vertical solid line - this uses do loops because pcc (Ultrix 1.2, bsd 4.2) generates - better code. sigh. we know that len will never be 0 or 1, so - it's OK to use it. -*/ -void -afbVertS(pbase, nlwidth, sizeDst, depthDst, x1, y1, len, rrops) -PixelType *pbase; /* pointer to base of bitmap */ -register int nlwidth; /* width in longwords of bitmap */ -int sizeDst; -int depthDst; -int x1, y1; /* initial point */ -register int len; /* length of line */ -unsigned char *rrops; -{ - register PixelType *addrl; - register PixelType bitmask; - int saveLen; - int d; - - if (len < 0) { - nlwidth = -nlwidth; - len = -len; - } - - saveLen = len; - - for (d = 0; d < depthDst; d++) { - addrl = afbScanline(pbase, x1, y1, nlwidth); - pbase += sizeDst; /* @@@ NEXT PLANE @@@ */ - len = saveLen; - - switch (rrops[d]) { - case RROP_BLACK: - bitmask = mfbGetrmask(x1 & PIM); - Duff(len, *addrl &= bitmask; afbScanlineInc(addrl, nlwidth) ); - break; - - case RROP_WHITE: - bitmask = mfbGetmask(x1 & PIM); - Duff(len, *addrl |= bitmask; afbScanlineInc(addrl, nlwidth) ); - break; - - case RROP_INVERT: - bitmask = mfbGetmask(x1 & PIM); - Duff(len, *addrl ^= bitmask; afbScanlineInc(addrl, nlwidth) ); - break; - - case RROP_NOP: - break; - } /* switch */ - } /* for (d = ...) */ -} diff --git a/nx-X11/programs/Xserver/afb/afbimage.c b/nx-X11/programs/Xserver/afb/afbimage.c deleted file mode 100644 index 353fd6f89..000000000 --- a/nx-X11/programs/Xserver/afb/afbimage.c +++ /dev/null @@ -1,301 +0,0 @@ -/* $XFree86: xc/programs/Xserver/afb/afbimage.c,v 3.2 1998/03/20 21:04:55 hohndel Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include "windowstr.h" -#include "pixmapstr.h" -#include "scrnintstr.h" -#include "gcstruct.h" -#include "afb.h" -#include "maskbits.h" -#include "servermd.h" -#include "mfb.h" - -void -afbPutImage(pDraw, pGC, depth, x, y, width, height, leftPad, format, pImage) - DrawablePtr pDraw; - GCPtr pGC; - int depth, x, y, width, height; - int leftPad; - int format; - char *pImage; -{ - PixmapPtr pPixmap; - - if ((width == 0) || (height == 0)) - return; - - if (format != ZPixmap || depth == 1 || pDraw->depth == 1) { - pPixmap = GetScratchPixmapHeader(pDraw->pScreen, width+leftPad, height, - depth, depth, - BitmapBytePad(width+leftPad), - (pointer)pImage); - if (!pPixmap) - return; - - pGC->fExpose = FALSE; - if (format == XYBitmap) - (void)(*pGC->ops->CopyPlane)((DrawablePtr)pPixmap, pDraw, pGC, leftPad, - 0, width, height, x, y, 1); - else { -#if 0 - /* XXX: bit plane order wronge ! */ - pPixmap->drawable.depth = 1; - pPixmap->drawable.bitsPerPixel = 1; - - switch (pGC->alu) { - case GXcopy: - doBitBlt = afbDoBitbltCopy; - break; - case GXxor: - doBitBlt = afbDoBitbltXor; - break; - case GXcopyInverted: - doBitBlt = afbDoBitbltCopyInverted; - break; - case GXor: - doBitBlt = afbDoBitbltOr; - break; - default: - doBitBlt = afbDoBitbltGeneral; - break; - } - - for (plane = (1L << (pPixmap->drawable.depth - 1)); plane; - plane >>= 1) { - (void)afbBitBlt((DrawablePtr)pPixmap, pDraw, pGC, leftPad, 0, - width, height, x, y, doBitBlt, plane); - /* pDraw->devKind += sizeDst; */ - } -#else - (void)(*pGC->ops->CopyArea)((DrawablePtr)pPixmap, pDraw, pGC, leftPad, - 0, width, height, x, y); -#endif - } - - pGC->fExpose = TRUE; - FreeScratchPixmapHeader(pPixmap); - } else { - /* Chunky to planar conversion required */ - - PixmapPtr pPixmap; - ScreenPtr pScreen = pDraw->pScreen; - int widthSrc; - int start_srcshift; - register int b; - register int dstshift; - register int shift_step; - register PixelType dst; - register PixelType srcbits; - register PixelType *pdst; - register PixelType *psrc; - int start_bit; - register int nl; - register int h; - register int d; - int sizeDst; - PixelType *pdstBase; - int widthDst; - int depthDst; - - /* Create a tmp pixmap */ - pPixmap = (pScreen->CreatePixmap)(pScreen, width, height, depth); - if (!pPixmap) - return; - - afbGetPixelWidthSizeDepthAndPointer((DrawablePtr)pPixmap, widthDst, - sizeDst, depthDst, pdstBase); - - widthSrc = PixmapWidthInPadUnits(width, depth); - /* XXX: if depth == 8, use fast chunky to planar assembly function.*/ - if (depth > 4) { - start_srcshift = 24; - shift_step = 8; - } else { - start_srcshift = 28; - shift_step = 4; - } - - for (d = 0; d < depth; d++, pdstBase += sizeDst) { /* @@@ NEXT PLANE @@@ */ - start_bit = start_srcshift + d; - psrc = (PixelType *)pImage; - pdst = pdstBase; - h = height; - - while (h--) { - dstshift = PPW - 1; - dst = 0; - nl = widthSrc; - while (nl--) { - srcbits = *psrc++; - for (b = start_bit; b >= 0; b -= shift_step) { - dst |= ((srcbits >> b) & 1) << dstshift; - if (--dstshift < 0) { - dstshift = PPW - 1; - *pdst++ = dst; - dst = 0; - } - } - } - if (dstshift != PPW - 1) - *pdst++ = dst; - } - } /* for (d = ...) */ - - pGC->fExpose = FALSE; - (void)(*pGC->ops->CopyArea)((DrawablePtr)pPixmap, pDraw, pGC, leftPad, 0, - width, height, x, y); - pGC->fExpose = TRUE; - (*pScreen->DestroyPixmap)(pPixmap); - } -} - -void -afbGetImage(pDrawable, sx, sy, width, height, format, planemask, pdstLine) - DrawablePtr pDrawable; - int sx, sy, width, height; - unsigned int format; - unsigned long planemask; - char *pdstLine; -{ - BoxRec box; - DDXPointRec ptSrc; - RegionRec rgnDst; - ScreenPtr pScreen; - PixmapPtr pPixmap; - - if ((width == 0) || (height == 0)) - return; - - pScreen = pDrawable->pScreen; - sx += pDrawable->x; - sy += pDrawable->y; - - if (format == XYPixmap || pDrawable->depth == 1) { - pPixmap = GetScratchPixmapHeader(pScreen, width, height, 1, 1, - BitmapBytePad(width), (pointer)pdstLine); - if (!pPixmap) - return; - - ptSrc.x = sx; - ptSrc.y = sy; - box.x1 = 0; - box.y1 = 0; - box.x2 = width; - box.y2 = height; - REGION_INIT(pScreen, &rgnDst, &box, 1); - - pPixmap->drawable.depth = 1; - pPixmap->drawable.bitsPerPixel = 1; - /* dix layer only ever calls GetImage with 1 bit set in planemask - * when format is XYPixmap. - */ - afbDoBitblt(pDrawable, (DrawablePtr)pPixmap, GXcopy, &rgnDst, &ptSrc, - planemask); - - FreeScratchPixmapHeader(pPixmap); - REGION_UNINIT(pScreen, &rgnDst); - } else { - /* Planar to chunky conversion required */ - - PixelType *psrcBits; - PixelType *psrcLine; - PixelType startmask, endmask; - int depthSrc; - int widthSrc; - int sizeSrc; - int sizeDst; - int widthDst; - register PixelType *psrc; - register PixelType *pdst; - register PixelType dst; - register PixelType srcbits; - register int d; - register int b; - register int dstshift; - register int shift_step; - register int start_endbit; - int start_startbit; - register int end_endbit = 0; - register int start_dstshift; - register int nl; - register int h; - int nlmiddle; - - widthDst = PixmapWidthInPadUnits(width, pDrawable->depth); - sizeDst = widthDst * height; - - /* Clear the dest image */ - bzero(pdstLine, sizeDst << 2); - - afbGetPixelWidthSizeDepthAndPointer(pDrawable, widthSrc, sizeSrc, - depthSrc, psrcBits); - - psrcBits = afbScanline(psrcBits, sx, sy, widthSrc); - - start_startbit = PPW - 1 - (sx & PIM); - if ((sx & PIM) + width < PPW) { - maskpartialbits(sx, width, startmask); - nlmiddle = 0; - endmask = 0; - start_endbit = PPW - ((sx + width) & PIM); - } else { - maskbits(sx, width, startmask, endmask, nlmiddle); - start_endbit = 0; - end_endbit = PPW - ((sx + width) & PIM); - } - /* ZPixmap images have either 4 or 8 bits per pixel dependent on - * depth. - */ - if (depthSrc > 4) { - start_dstshift = 24; - shift_step = 8; - } else { - start_dstshift = 28; - shift_step = 4; - } -#define SHIFT_BITS(start_bit,end_bit) \ -for (b = (start_bit); b >= (end_bit); b--) { \ - dst |= ((srcbits >> b) & 1) << dstshift; \ - if ((dstshift -= shift_step) < 0) { \ - dstshift = start_dstshift + d; \ - *pdst++ = dst; \ - dst = *pdst; \ - } \ -} \ - - for (d = 0; d < depthSrc; d++, psrcBits += sizeSrc) { /* @@@ NEXT PLANE @@@ */ - psrcLine = psrcBits; - pdst = (PixelType *)pdstLine; - h = height; - - while (h--) { - psrc = psrcLine; - psrcLine += widthSrc; - dst = *pdst; - dstshift = start_dstshift + d; - - if (startmask) { - srcbits = *psrc++ & startmask; - SHIFT_BITS(start_startbit, start_endbit); - } - - nl = nlmiddle; - while (nl--) { - srcbits = *psrc++; - SHIFT_BITS(PPW - 1, 0); - } - if (endmask) { - srcbits = *psrc & endmask; - SHIFT_BITS(PPW - 1, end_endbit); - } - - if (dstshift != start_dstshift + d) - *pdst++ = dst; - } /* while (h--) */ - } /* for (d = ...) */ - } -} diff --git a/nx-X11/programs/Xserver/afb/afbimggblt.c b/nx-X11/programs/Xserver/afb/afbimggblt.c deleted file mode 100644 index 28113b448..000000000 --- a/nx-X11/programs/Xserver/afb/afbimggblt.c +++ /dev/null @@ -1,474 +0,0 @@ -/* $XFree86: xc/programs/Xserver/afb/afbimggblt.c,v 3.1tsi Exp $ */ -/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */ -/*********************************************************** - -Copyright (c) 1987 X Consortium - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of the X Consortium shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from the X Consortium. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XConsortium: afbimggblt.c,v 5.17 94/04/17 20:28:25 dpw Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include -#include "afb.h" -#include -#include "dixfontstr.h" -#include "gcstruct.h" -#include "windowstr.h" -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "regionstr.h" -#include "maskbits.h" - -/* - we should eventually special-case fixed-width fonts for ImageText. - - this works for fonts with glyphs <= 32 bits wide. - - the clipping calculations are done for worst-case fonts. -we make no assumptions about the heights, widths, or bearings -of the glyphs. if we knew that the glyphs are all the same height, -we could clip the tops and bottoms per clipping box, rather -than per character per clipping box. if we knew that the glyphs' -left and right bearings were wlle-behaved, we could clip a single -character at the start, output until the last unclipped -character, and then clip the last one. this is all straightforward -to determine based on max-bounds and min-bounds from the font. - there is some inefficiency introduced in the per-character -clipping to make what's going on clearer. - - (it is possible, for example, for a font to be defined in which the -next-to-last character in a font would be clipped out, but the last -one wouldn't. the code below deals with this.) - - Image text looks at the bits in the glyph and the fg and bg in the -GC. it paints a rectangle, as defined in the protocol dcoument, -and the paints the characters. - - the register allocations for startmask and endmask may not -be the right thing. are there two other deserving candidates? -xoff, pdst, pglyph, and tmpSrc seem like the right things, though. -*/ - -void -afbImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) - DrawablePtr pDrawable; - GC *pGC; - int x, y; - unsigned int nglyph; - CharInfoPtr *ppci; /* array of character info */ - pointer pglyphBase; /* start of array of glyphs */ -{ - ExtentInfoRec info; /* used by QueryGlyphExtents() */ - BoxRec bbox; /* string's bounding box */ - xRectangle backrect;/* backing rectangle to paint. - in the general case, NOT necessarily - the same as the string's bounding box - */ - - CharInfoPtr pci; - int xorg, yorg; /* origin of drawable in bitmap */ - int widthDst; /* width of dst in longwords */ - - /* these keep track of the character origin */ - PixelType *pdstBase; - /* points to longword with character origin */ - int xchar; /* xorigin of char (mod 32) */ - - /* these are used for placing the glyph */ - register int xoff; /* x offset of left edge of glyph (mod 32) */ - register PixelType *pdst; - /* pointer to current longword in dst */ - - register int d; - int depthDst; - int sizeDst; - int hSave; - int w; /* width of glyph in bits */ - int h; /* height of glyph */ - int widthGlyph; /* width of glyph, in bytes */ - unsigned char rrops[AFB_MAX_DEPTH]; - register unsigned char *pglyph; - /* pointer to current row of glyph */ - unsigned char *pglyphSave; - - /* used for putting down glyph */ - register PixelType tmpSrc; - /* for getting bits from glyph */ - register PixelType startmask; - register PixelType endmask; - - register int nFirst;/* bits of glyph in current longword */ - PixelType *pdstSave; - int oldFill; - afbPrivGC *pPriv = (afbPrivGC *)(pGC->devPrivates[afbGCPrivateIndex].ptr); - - xorg = pDrawable->x; - yorg = pDrawable->y; - afbGetPixelWidthSizeDepthAndPointer(pDrawable, widthDst, sizeDst, depthDst, - pdstBase); - - QueryGlyphExtents(pGC->font, ppci, (unsigned long)nglyph, &info); - - backrect.x = x; - backrect.y = y - FONTASCENT(pGC->font); - backrect.width = info.overallWidth; - backrect.height = FONTASCENT(pGC->font) + FONTDESCENT(pGC->font); - - x += xorg; - y += yorg; - - bbox.x1 = x + info.overallLeft; - bbox.x2 = x + info.overallRight; - bbox.y1 = y - info.overallAscent; - bbox.y2 = y + info.overallDescent; - - oldFill = pGC->fillStyle; - pGC->fillStyle = FillSolid; - afbReduceRop (pGC->alu, pGC->bgPixel, pGC->planemask, pGC->depth, - pPriv->rrops); - afbPolyFillRect(pDrawable, pGC, 1, &backrect); - pGC->fillStyle = oldFill; - afbReduceRop (pGC->alu, pGC->fgPixel, pGC->planemask, pGC->depth, - pPriv->rrops); - afbReduceRop (GXcopy, pGC->fgPixel, pGC->planemask, pGC->depth, rrops); - - /* the faint-hearted can open their eyes now */ - - switch (RECT_IN_REGION(pGC->pScreen, pGC->pCompositeClip, &bbox)) { - case rgnOUT: - break; - case rgnIN: - pdstBase = afbScanlineNoBankSwitch(pdstBase, x, y, widthDst); - xchar = x & PIM; - - while(nglyph--) { - pci = *ppci; - pglyphSave = FONTGLYPHBITS(pglyphBase, pci); - w = pci->metrics.rightSideBearing - pci->metrics.leftSideBearing; - hSave = pci->metrics.ascent + pci->metrics.descent; - widthGlyph = GLYPHWIDTHBYTESPADDED(pci); - /* start at top scanline of glyph */ - pdstSave = afbScanlineDelta(pdstBase, -pci->metrics.ascent, - widthDst); - - /* find correct word in scanline and x offset within it - for left edge of glyph - */ - xoff = xchar + pci->metrics.leftSideBearing; - if (xoff > PLST) { - pdstSave++; - xoff &= PIM; - } else if (xoff < 0) { - xoff += PPW; - pdstSave--; - } - - for (d = 0; d < depthDst; d++) { - h = hSave; - pdst = pdstSave; - pdstSave += sizeDst; /* @@@ NEXT PLANE @@@ */ - pglyph = pglyphSave; - - if ((xoff + w) <= PPW) { - /* glyph all in one longword */ - maskpartialbits(xoff, w, startmask); - - switch (rrops[d]) { - case RROP_BLACK: - while (h--) { - getleftbits(pglyph, w, tmpSrc); - *pdst &= ~(SCRRIGHT(tmpSrc, xoff) & startmask); - pglyph += widthGlyph; - afbScanlineInc(pdst, widthDst); - } - break; - case RROP_WHITE: - while (h--) { - getleftbits(pglyph, w, tmpSrc); - *pdst |= SCRRIGHT(tmpSrc, xoff) & startmask; - pglyph += widthGlyph; - afbScanlineInc(pdst, widthDst); - } - break; - case RROP_NOP: - break; - } - } else { - /* glyph crosses longword boundary */ - maskPPWbits(xoff, w, startmask, endmask); - nFirst = PPW - xoff; - - switch (rrops[d]) { - case RROP_BLACK: - while (h--) { - getleftbits(pglyph, w, tmpSrc); - *pdst &= ~(SCRRIGHT(tmpSrc, xoff) & startmask); - *(pdst+1) &= ~(SCRLEFT(tmpSrc, nFirst) & endmask); - pglyph += widthGlyph; - afbScanlineInc(pdst, widthDst); - } - break; - case RROP_WHITE: - while (h--) { - getleftbits(pglyph, w, tmpSrc); - *pdst |= SCRRIGHT(tmpSrc, xoff) & startmask; - *(pdst+1) |= SCRLEFT(tmpSrc, nFirst) & endmask; - pglyph += widthGlyph; - afbScanlineInc(pdst, widthDst); - } - break; - case RROP_NOP: - break; - } - } /* glyph crosses longwords boundary */ - } /* depth loop */ - /* update character origin */ - x += pci->metrics.characterWidth; - xchar += pci->metrics.characterWidth; - if (xchar > PLST) { - xchar -= PPW; - pdstBase++; - } else if (xchar < 0) { - xchar += PPW; - pdstBase--; - } - ppci++; - } /* while nglyph-- */ - break; - case rgnPART: - { - afbTEXTPOS *ppos; - int nbox; - BoxPtr pbox; - RegionPtr cclip; - int xpos; /* x position of char origin */ - int i; - BoxRec clip; - int leftEdge, rightEdge; - int topEdge, bottomEdge; - int glyphRow; /* first row of glyph not wholly - clipped out */ - int glyphCol; /* leftmost visible column of glyph */ -#if GETLEFTBITS_ALIGNMENT > 1 - int getWidth; /* bits to get from glyph */ -#endif - - if(!(ppos = (afbTEXTPOS *)ALLOCATE_LOCAL(nglyph * sizeof(afbTEXTPOS)))) - return; - - pdstBase = afbScanlineNoBankSwitch(pdstBase, x, y, widthDst); - xpos = x; - xchar = xpos & PIM; - - for (i = 0; i < nglyph; i++) { - pci = ppci[i]; - - ppos[i].xpos = xpos; - ppos[i].xchar = xchar; - ppos[i].leftEdge = xpos + pci->metrics.leftSideBearing; - ppos[i].rightEdge = xpos + pci->metrics.rightSideBearing; - ppos[i].topEdge = y - pci->metrics.ascent; - ppos[i].bottomEdge = y + pci->metrics.descent; - ppos[i].pdstBase = pdstBase; - ppos[i].widthGlyph = GLYPHWIDTHBYTESPADDED(pci); - - xpos += pci->metrics.characterWidth; - xchar += pci->metrics.characterWidth; - if (xchar > PLST) { - xchar &= PIM; - pdstBase++; - } else if (xchar < 0) { - xchar += PPW; - pdstBase--; - } - } - - cclip = pGC->pCompositeClip; - pbox = REGION_RECTS(cclip); - nbox = REGION_NUM_RECTS(cclip); - - /* HACK ALERT - since we continue out of the loop below so often, it - is easier to increment pbox at the top than at the end. - don't try this at home. - */ - pbox--; - while(nbox--) { - pbox++; - clip.x1 = max(bbox.x1, pbox->x1); - clip.y1 = max(bbox.y1, pbox->y1); - clip.x2 = min(bbox.x2, pbox->x2); - clip.y2 = min(bbox.y2, pbox->y2); - if ((clip.x2<=clip.x1) || (clip.y2<=clip.y1)) - continue; - - for(i=0; i clip.x2) - rightEdge = clip.x2; - else - rightEdge = ppos[i].rightEdge; - - w = rightEdge - leftEdge; - if (w <= 0) - continue; - - /* clip the top and bottom edges */ - if (ppos[i].topEdge < clip.y1) - topEdge = clip.y1; - else - topEdge = ppos[i].topEdge; - - if (ppos[i].bottomEdge > clip.y2) - bottomEdge = clip.y2; - else - bottomEdge = ppos[i].bottomEdge; - - hSave = bottomEdge - topEdge; - if (hSave <= 0) - continue; - - glyphRow = (topEdge - y) + pci->metrics.ascent; - widthGlyph = ppos[i].widthGlyph; - pglyphSave = FONTGLYPHBITS(pglyphBase, pci); - pglyphSave += (glyphRow * widthGlyph); - - glyphCol = (leftEdge - ppos[i].xpos) - - (pci->metrics.leftSideBearing); -#if GETLEFTBITS_ALIGNMENT > 1 - getWidth = w + glyphCol; -#endif - - pdstSave = afbScanlineDelta(ppos[i].pdstBase, -(y-topEdge), - widthDst); - xoff = xchar + (leftEdge - ppos[i].xpos); - if (xoff > PLST) { - xoff &= PIM; - pdstSave++; - } else if (xoff < 0) { - xoff += PPW; - pdstSave--; - } - - for (d = 0; d < depthDst; d++) { - h = hSave; - pdst = pdstSave; - pdstSave += sizeDst; /* @@@ NEXT PLANE @@@ */ - pglyph = pglyphSave; - - if ((xoff + w) <= PPW) { - maskpartialbits(xoff, w, startmask); - - switch (rrops[d]) { - case RROP_BLACK: - while (h--) { - getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc); - *pdst &= ~(SCRRIGHT(tmpSrc, xoff) & startmask); - pglyph += widthGlyph; - afbScanlineInc(pdst, widthDst); - } - break; - case RROP_WHITE: - while (h--) { - getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc); - *pdst |= SCRRIGHT(tmpSrc, xoff) & startmask; - pglyph += widthGlyph; - afbScanlineInc(pdst, widthDst); - } - break; - case RROP_NOP: - break; - } - } else { - maskPPWbits(xoff, w, startmask, endmask); - nFirst = PPW - xoff; - - switch (rrops[d]) { - case RROP_BLACK: - while (h--) { - getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc); - *pdst &= ~(SCRRIGHT(tmpSrc, xoff) & startmask); - *(pdst+1) &= ~(SCRLEFT(tmpSrc, nFirst) & endmask); - pglyph += widthGlyph; - afbScanlineInc(pdst, widthDst); - } - break; - case RROP_WHITE: - while (h--) { - getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc); - *pdst |= SCRRIGHT(tmpSrc, xoff) & startmask; - *(pdst+1) |= SCRLEFT(tmpSrc, nFirst) & endmask; - pglyph += widthGlyph; - afbScanlineInc(pdst, widthDst); - } - break; - case RROP_NOP: - break; - } - } - } /* depth */ - } /* for each glyph */ - } /* while nbox-- */ - DEALLOCATE_LOCAL(ppos); - break; - } - - default: - break; - } -} diff --git a/nx-X11/programs/Xserver/afb/afbline.c b/nx-X11/programs/Xserver/afb/afbline.c deleted file mode 100644 index 255ea21c1..000000000 --- a/nx-X11/programs/Xserver/afb/afbline.c +++ /dev/null @@ -1,706 +0,0 @@ -/* $XFree86: xc/programs/Xserver/afb/afbline.c,v 3.1 1998/03/20 21:04:55 hohndel Exp $ */ -/*********************************************************** - -Copyright (c) 1987 X Consortium - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of the X Consortium shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from the X Consortium. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XConsortium: afbline.c,v 5.18 94/04/17 20:28:26 dpw Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include - -#include "gcstruct.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "regionstr.h" -#include "scrnintstr.h" -#include "mistruct.h" - -#include "afb.h" -#include "maskbits.h" -#include "miline.h" - -/* single-pixel lines on a color frame buffer - - NON-SLOPED LINES - horizontal lines are always drawn left to right; we have to -move the endpoints right by one after they're swapped. - horizontal lines will be confined to a single band of a -region. the code finds that band (giving up if the lower -bound of the band is above the line we're drawing); then it -finds the first box in that band that contains part of the -line. we clip the line to subsequent boxes in that band. - vertical lines are always drawn top to bottom (y-increasing.) -this requires adding one to the y-coordinate of each endpoint -after swapping. - - SLOPED LINES - when clipping a sloped line, we bring the second point inside -the clipping box, rather than one beyond it, and then add 1 to -the length of the line before drawing it. this lets us use -the same box for finding the outcodes for both endpoints. since -the equation for clipping the second endpoint to an edge gives us -1 beyond the edge, we then have to move the point towards the -first point by one step on the major axis. - eventually, there will be a diagram here to explain what's going -on. the method uses Cohen-Sutherland outcodes to determine -outsideness, and a method similar to Pike's layers for doing the -actual clipping. - -*/ - -void -#ifdef POLYSEGMENT -afbSegmentSS(pDrawable, pGC, nseg, pSeg) - DrawablePtr pDrawable; - GCPtr pGC; - int nseg; - register xSegment *pSeg; -#else -afbLineSS(pDrawable, pGC, mode, npt, pptInit) - DrawablePtr pDrawable; - GCPtr pGC; - int mode; /* Origin or Previous */ - int npt; /* number of points */ - DDXPointPtr pptInit; -#endif -{ - int nboxInit; - register int nbox; - BoxPtr pboxInit; - register BoxPtr pbox; -#ifndef POLYSEGMENT - register DDXPointPtr ppt; /* pointer to list of translated points */ -#endif - - unsigned int oc1; /* outcode of point 1 */ - unsigned int oc2; /* outcode of point 2 */ - - PixelType *addrlBase; /* pointer to start of drawable */ - int nlwidth; /* width in longwords of destination pixmap */ - int xorg, yorg; /* origin of window */ - - int adx; /* abs values of dx and dy */ - int ady; - int signdx; /* sign of dx and dy */ - int signdy; - int e, e1, e2; /* bresenham error and increments */ - int len; /* length of segment */ - int axis; /* major axis */ - int octant; - unsigned int bias = miGetZeroLineBias(pDrawable->pScreen); - int depthDst; -#ifndef POLYSEGMENT - PixelType *addrl; /* address of destination pixmap */ - int d; -#endif - int sizeDst; - unsigned char *rrops; - - /* a bunch of temporaries */ - register int y1, y2; - register int x1, x2; - RegionPtr cclip; - - cclip = pGC->pCompositeClip; - rrops = ((afbPrivGC *)(pGC->devPrivates[afbGCPrivateIndex].ptr))->rrops; - pboxInit = REGION_RECTS(cclip); - nboxInit = REGION_NUM_RECTS(cclip); - - afbGetPixelWidthSizeDepthAndPointer(pDrawable, nlwidth, sizeDst, depthDst, - addrlBase); - - xorg = pDrawable->x; - yorg = pDrawable->y; -#ifdef POLYSEGMENT - while (nseg--) -#else - ppt = pptInit; - x2 = ppt->x + xorg; - y2 = ppt->y + yorg; - while(--npt) -#endif - { - nbox = nboxInit; - pbox = pboxInit; - -#ifdef POLYSEGMENT - x1 = pSeg->x1 + xorg; - y1 = pSeg->y1 + yorg; - x2 = pSeg->x2 + xorg; - y2 = pSeg->y2 + yorg; - pSeg++; -#else - x1 = x2; - y1 = y2; - ++ppt; - if (mode == CoordModePrevious) { - xorg = x1; - yorg = y1; - } - x2 = ppt->x + xorg; - y2 = ppt->y + yorg; -#endif - - if (x1 == x2) /* vertical line */ - { - /* make the line go top to bottom of screen, keeping - endpoint semantics - */ - if (y1 > y2) { - register int tmp; - - tmp = y2; - y2 = y1 + 1; - y1 = tmp + 1; -#ifdef POLYSEGMENT - if (pGC->capStyle != CapNotLast) - y1--; -#endif - } -#ifdef POLYSEGMENT - else if (pGC->capStyle != CapNotLast) - y2++; -#endif - /* get to first band that might contain part of line */ - while ((nbox) && (pbox->y2 <= y1)) { - pbox++; - nbox--; - } - - if (nbox) { - /* stop when lower edge of box is beyond end of line */ - while((nbox) && (y2 >= pbox->y1)) { - if ((x1 >= pbox->x1) && (x1 < pbox->x2)) { - int y1t, y2t; - /* this box has part of the line in it */ - y1t = max(y1, pbox->y1); - y2t = min(y2, pbox->y2); - if (y1t != y2t) - afbVertS(addrlBase, nlwidth, sizeDst, depthDst, x1, y1t, - y2t-y1t, rrops); /* @@@ NEXT PLANE PASSED @@@ */ - } - nbox--; - pbox++; - } - } -#ifndef POLYSEGMENT - y2 = ppt->y + yorg; -#endif - } else if (y1 == y2) /* horizontal line */ { - /* force line from left to right, keeping - endpoint semantics - */ - if (x1 > x2) { - register int tmp; - - tmp = x2; - x2 = x1 + 1; - x1 = tmp + 1; -#ifdef POLYSEGMENT - if (pGC->capStyle != CapNotLast) - x1--; -#endif - } -#ifdef POLYSEGMENT - else if (pGC->capStyle != CapNotLast) - x2++; -#endif - - /* find the correct band */ - while( (nbox) && (pbox->y2 <= y1)) { - pbox++; - nbox--; - } - - /* try to draw the line, if we haven't gone beyond it */ - if ((nbox) && (pbox->y1 <= y1)) { - int tmp; - - /* when we leave this band, we're done */ - tmp = pbox->y1; - while((nbox) && (pbox->y1 == tmp)) { - int x1t, x2t; - - if (pbox->x2 <= x1) { - /* skip boxes until one might contain start point */ - nbox--; - pbox++; - continue; - } - - /* stop if left of box is beyond right of line */ - if (pbox->x1 >= x2) { - nbox = 0; - break; - } - - x1t = max(x1, pbox->x1); - x2t = min(x2, pbox->x2); - if (x1t != x2t) - afbHorzS(addrlBase, nlwidth, sizeDst, depthDst, x1t, y1, - x2t-x1t, rrops); /* @@@ NEXT PLANE PASSED @@@ */ - nbox--; - pbox++; - } - } -#ifndef POLYSEGMENT - x2 = ppt->x + xorg; -#endif - } - else /* sloped line */ - { - CalcLineDeltas(x1, y1, x2, y2, adx, ady, - signdx, signdy, 1, 1, octant); - - if (adx > ady) { - axis = X_AXIS; - e1 = ady << 1; - e2 = e1 - (adx << 1); - e = e1 - adx; - } else { - axis = Y_AXIS; - e1 = adx << 1; - e2 = e1 - (ady << 1); - e = e1 - ady; - SetYMajorOctant(octant); - } - - FIXUP_ERROR(e, octant, bias); - - /* we have bresenham parameters and two points. - all we have to do now is clip and draw. - */ - - while(nbox--) { - oc1 = 0; - oc2 = 0; - OUTCODES(oc1, x1, y1, pbox); - OUTCODES(oc2, x2, y2, pbox); - if ((oc1 | oc2) == 0) { - if (axis == X_AXIS) - len = adx; - else - len = ady; -#ifdef POLYSEGMENT - if (pGC->capStyle != CapNotLast) - len++; -#endif - afbBresS(addrlBase, nlwidth, sizeDst, depthDst, signdx, signdy, - axis, x1, y1, e, e1, e2, len, rrops); /* @@@ NEXT PLANE PASSED @@@ */ - break; - } else if (oc1 & oc2) { - pbox++; - } else { - int new_x1 = x1, new_y1 = y1, new_x2 = x2, new_y2 = y2; - int clip1 = 0, clip2 = 0; - int clipdx, clipdy; - int err; - - if (miZeroClipLine(pbox->x1, pbox->y1, pbox->x2-1, - pbox->y2-1, - &new_x1, &new_y1, &new_x2, &new_y2, - adx, ady, &clip1, &clip2, - octant, bias, oc1, oc2) == -1) { - pbox++; - continue; - } - - if (axis == X_AXIS) - len = abs(new_x2 - new_x1); - else - len = abs(new_y2 - new_y1); -#ifdef POLYSEGMENT - if (clip2 != 0 || pGC->capStyle != CapNotLast) - len++; -#else - len += (clip2 != 0); -#endif - if (len) { - /* unwind bresenham error term to first point */ - if (clip1) { - clipdx = abs(new_x1 - x1); - clipdy = abs(new_y1 - y1); - if (axis == X_AXIS) - err = e+((clipdy*e2) + ((clipdx-clipdy)*e1)); - else - err = e+((clipdx*e2) + ((clipdy-clipdx)*e1)); - } - else - err = e; - afbBresS(addrlBase, nlwidth, sizeDst, depthDst, signdx, - signdy, axis, new_x1, new_y1, err, e1, e2, len, - rrops); /* @@@ NEXT PLANE PASSED @@@ */ - } - pbox++; - } - } /* while (nbox--) */ - } /* sloped line */ - } /* while (nline--) */ - -#ifndef POLYSEGMENT - - /* paint the last point if the end style isn't CapNotLast. - (Assume that a projecting, butt, or round cap that is one - pixel wide is the same as the single pixel of the endpoint.) - */ - - if ((pGC->capStyle != CapNotLast) && - ((ppt->x + xorg != pptInit->x + pDrawable->x) || - (ppt->y + yorg != pptInit->y + pDrawable->y) || - (ppt == pptInit + 1))) { - nbox = nboxInit; - pbox = pboxInit; - while (nbox--) { - if ((x2 >= pbox->x1) && (y2 >= pbox->y1) && (x2 < pbox->x2) && - (y2 < pbox->y2)) { - for (d = 0; d < depthDst; d++) { - addrl = afbScanline(addrlBase, x2, y2, nlwidth); - addrlBase += sizeDst; /* @@@ NEXT PLANE @@@ */ - - switch(rrops[d]) { - case RROP_BLACK: - *addrl &= mfbGetrmask(x2 & PIM); - break; - case RROP_WHITE: - *addrl |= mfbGetmask(x2 & PIM); - break; - case RROP_INVERT: - *addrl ^= mfbGetmask(x2 & PIM); - break; - case RROP_NOP: - break; - } /* switch */ - } /* for (d = ...) */ - break; - } else - pbox++; - } - } -#endif -} - -/* - * Draw dashed 1-pixel lines. - */ - -void -#ifdef POLYSEGMENT -afbSegmentSD(pDrawable, pGC, nseg, pSeg) - DrawablePtr pDrawable; - register GCPtr pGC; - int nseg; - register xSegment *pSeg; -#else -afbLineSD(pDrawable, pGC, mode, npt, pptInit) - DrawablePtr pDrawable; - register GCPtr pGC; - int mode; /* Origin or Previous */ - int npt; /* number of points */ - DDXPointPtr pptInit; -#endif -{ - int nboxInit; - register int nbox; - BoxPtr pboxInit; - register BoxPtr pbox; -#ifndef POLYSEGMENT - register DDXPointPtr ppt; /* pointer to list of translated points */ -#endif - - register unsigned int oc1; /* outcode of point 1 */ - register unsigned int oc2; /* outcode of point 2 */ - - PixelType *addrlBase; /* address of destination pixmap */ - int nlwidth; /* width in longwords of destination pixmap */ - int sizeDst; - int depthDst; - int xorg, yorg; /* origin of window */ - - int adx; /* abs values of dx and dy */ - int ady; - int signdx; /* sign of dx and dy */ - int signdy; - int e, e1, e2; /* bresenham error and increments */ - int len; /* length of segment */ - int axis; /* major axis */ - int octant; - unsigned int bias = miGetZeroLineBias(pDrawable->pScreen); - int x1, x2, y1, y2; - RegionPtr cclip; - unsigned char *rrops; - unsigned char bgrrops[AFB_MAX_DEPTH]; - unsigned char *pDash; - int dashOffset; - int numInDashList; - int dashIndex; - int isDoubleDash; - int dashIndexTmp, dashOffsetTmp; - int unclippedlen; -#ifndef POLYSEGMENT - PixelType *addrl; - int d; -#endif - - cclip = pGC->pCompositeClip; - rrops = ((afbPrivGC *)(pGC->devPrivates[afbGCPrivateIndex].ptr))->rrops; - pboxInit = REGION_RECTS(cclip); - nboxInit = REGION_NUM_RECTS(cclip); - - afbGetPixelWidthSizeDepthAndPointer(pDrawable, nlwidth, sizeDst, depthDst, - addrlBase); - - /* compute initial dash values */ - - pDash = (unsigned char *) pGC->dash; - numInDashList = pGC->numInDashList; - isDoubleDash = (pGC->lineStyle == LineDoubleDash); - dashIndex = 0; - dashOffset = 0; - miStepDash ((int)pGC->dashOffset, &dashIndex, pDash, - numInDashList, &dashOffset); - - if (isDoubleDash) - afbReduceRop (pGC->alu, pGC->bgPixel, pGC->planemask, pGC->depth, - bgrrops); - - xorg = pDrawable->x; - yorg = pDrawable->y; -#ifdef POLYSEGMENT - while (nseg--) -#else - ppt = pptInit; - x2 = ppt->x + xorg; - y2 = ppt->y + yorg; - while(--npt) -#endif - { - nbox = nboxInit; - pbox = pboxInit; - -#ifdef POLYSEGMENT - x1 = pSeg->x1 + xorg; - y1 = pSeg->y1 + yorg; - x2 = pSeg->x2 + xorg; - y2 = pSeg->y2 + yorg; - pSeg++; -#else - x1 = x2; - y1 = y2; - ++ppt; - if (mode == CoordModePrevious) { - xorg = x1; - yorg = y1; - } - x2 = ppt->x + xorg; - y2 = ppt->y + yorg; -#endif - - CalcLineDeltas(x1, y1, x2, y2, adx, ady, signdx, signdy, - 1, 1, octant); - - if (adx > ady) { - axis = X_AXIS; - e1 = ady << 1; - e2 = e1 - (adx << 1); - e = e1 - adx; - unclippedlen = adx; - } else { - axis = Y_AXIS; - e1 = adx << 1; - e2 = e1 - (ady << 1); - e = e1 - ady; - unclippedlen = ady; - SetYMajorOctant(octant); - } - - FIXUP_ERROR(e, octant, bias); - - /* we have bresenham parameters and two points. - all we have to do now is clip and draw. - */ - - while(nbox--) { - oc1 = 0; - oc2 = 0; - OUTCODES(oc1, x1, y1, pbox); - OUTCODES(oc2, x2, y2, pbox); - if ((oc1 | oc2) == 0) { -#ifdef POLYSEGMENT - if (pGC->capStyle != CapNotLast) - unclippedlen++; - dashIndexTmp = dashIndex; - dashOffsetTmp = dashOffset; - afbBresD(&dashIndexTmp, pDash, numInDashList, &dashOffsetTmp, - isDoubleDash, addrlBase, nlwidth, sizeDst, depthDst, - signdx, signdy, axis, x1, y1, e, e1, e2, unclippedlen, - rrops, bgrrops); /* @@@ NEXT PLANE PASSED @@@ */ - break; -#else - afbBresD(&dashIndex, pDash, numInDashList, &dashOffset, - isDoubleDash, addrlBase, nlwidth, sizeDst, depthDst, - signdx, signdy, axis, x1, y1, e, e1, e2, unclippedlen, - rrops, bgrrops); /* @@@ NEXT PLANE PASSED @@@ */ - goto dontStep; -#endif - } else if (oc1 & oc2) { - pbox++; - } else /* have to clip */ { - int new_x1 = x1, new_y1 = y1, new_x2 = x2, new_y2 = y2; - int clip1 = 0, clip2 = 0; - int clipdx, clipdy; - int err; - - if (miZeroClipLine(pbox->x1, pbox->y1, pbox->x2-1, pbox->y2-1, - &new_x1, &new_y1, &new_x2, &new_y2, - adx, ady, &clip1, &clip2, - octant, bias, oc1, oc2) == -1) { - pbox++; - continue; - } - dashIndexTmp = dashIndex; - dashOffsetTmp = dashOffset; - if (clip1) { - int dlen; - - if (axis == X_AXIS) - dlen = abs(new_x1 - x1); - else - dlen = abs(new_y1 - y1); - miStepDash (dlen, &dashIndexTmp, pDash, - numInDashList, &dashOffsetTmp); - } - if (axis == X_AXIS) - len = abs(new_x2 - new_x1); - else - len = abs(new_y2 - new_y1); -#ifdef POLYSEGMENT - if (clip2 != 0 || pGC->capStyle != CapNotLast) - len++; -#else - len += (clip2 != 0); -#endif - if (len) { - /* unwind bresenham error term to first point */ - if (clip1) { - clipdx = abs(new_x1 - x1); - clipdy = abs(new_y1 - y1); - if (axis == X_AXIS) - err = e+((clipdy*e2) + ((clipdx-clipdy)*e1)); - else - err = e+((clipdx*e2) + ((clipdy-clipdx)*e1)); - } - else - err = e; - afbBresD(&dashIndexTmp, pDash, numInDashList, &dashOffsetTmp, - isDoubleDash, addrlBase, nlwidth, sizeDst, depthDst, - signdx, signdy, axis, new_x1, new_y1, err, e1, e2, - len, rrops, bgrrops); /* @@@ NEXT PLANE PASSED @@@ */ - } - pbox++; - } - } /* while (nbox--) */ -#ifndef POLYSEGMENT - /* - * walk the dash list around to the next line - */ - miStepDash (unclippedlen, &dashIndex, pDash, - numInDashList, &dashOffset); -dontStep: ; -#endif - } /* while (nline--) */ - -#ifndef POLYSEGMENT - /* paint the last point if the end style isn't CapNotLast. - (Assume that a projecting, butt, or round cap that is one - pixel wide is the same as the single pixel of the endpoint.) - */ - - if ((pGC->capStyle != CapNotLast) && - ((dashIndex & 1) == 0 || isDoubleDash) && - ((ppt->x + xorg != pptInit->x + pDrawable->x) || - (ppt->y + yorg != pptInit->y + pDrawable->y) || - (ppt == pptInit + 1))) { - nbox = nboxInit; - pbox = pboxInit; - while (nbox--) { - if ((x2 >= pbox->x1) && (y2 >= pbox->y1) && (x2 < pbox->x2) && - (y2 < pbox->y2)) { - int rop; - - for (d = 0; d < depthDst; d++) { - addrl = afbScanline(addrlBase, x2, y2, nlwidth); - addrlBase += sizeDst; /* @@@ NEXT PLANE @@@ */ - - rop = rrops[d]; - if (dashIndex & 1) - rop = bgrrops[d]; - - switch (rop) { - case RROP_BLACK: - *addrl &= mfbGetrmask(x2 & PIM); - break; - case RROP_WHITE: - *addrl |= mfbGetmask(x2 & PIM); - break; - - case RROP_INVERT: - *addrl ^= mfbGetmask(x2 & PIM); - break; - - case RROP_NOP: - break; - } - } /* for (d = ...) */ - break; - } else - pbox++; - } - } -#endif -} diff --git a/nx-X11/programs/Xserver/afb/afbmisc.c b/nx-X11/programs/Xserver/afb/afbmisc.c deleted file mode 100644 index e5a4f492d..000000000 --- a/nx-X11/programs/Xserver/afb/afbmisc.c +++ /dev/null @@ -1,96 +0,0 @@ -/* $XFree86$ */ -/*********************************************************** - -Copyright (c) 1987 X Consortium - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of the X Consortium shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from the X Consortium. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XConsortium: afbmisc.c,v 5.4 94/04/17 20:28:27 dpw Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include "misc.h" -#include "cursor.h" -#include "scrnintstr.h" - -#include "afb.h" - -/*ARGSUSED*/ -void -afbQueryBestSize(class, pwidth, pheight, pScreen) -int class; -unsigned short *pwidth; -unsigned short *pheight; -ScreenPtr pScreen; -{ - unsigned width, test; - - switch(class) { - case CursorShape: - if (*pwidth > pScreen->width) - *pwidth = pScreen->width; - if (*pheight > pScreen->height) - *pheight = pScreen->height; - break; - case TileShape: - case StippleShape: - width = *pwidth; - if (!width) break; - /* Return the closes power of two not less than what they gave me */ - test = 0x80000000; - /* Find the highest 1 bit in the width given */ - while(!(test & width)) - test >>= 1; - /* If their number is greater than that, bump up to the next - * power of two */ - if((test - 1) & width) - test <<= 1; - *pwidth = test; - /* We don't care what height they use */ - break; - } -} diff --git a/nx-X11/programs/Xserver/afb/afbmodule.c b/nx-X11/programs/Xserver/afb/afbmodule.c deleted file mode 100644 index d9cdbf9c3..000000000 --- a/nx-X11/programs/Xserver/afb/afbmodule.c +++ /dev/null @@ -1,63 +0,0 @@ -/* $XFree86: xc/programs/Xserver/afb/afbmodule.c,v 1.1 1999/06/13 13:47:38 dawes Exp $ */ -/* - * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the XFree86 Project shall - * not be used in advertising or otherwise to promote the sale, use or other - * dealings in this Software without prior written authorization from the - * XFree86 Project. - */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#ifdef XFree86LOADER - -#include "xf86Module.h" -#include "afb.h" - -static MODULESETUPPROTO(afbSetup); - -static XF86ModuleVersionInfo VersRec = -{ - "afb", - MODULEVENDORSTRING, - MODINFOSTRING1, - MODINFOSTRING2, - XORG_VERSION_CURRENT, - 1, 0, 0, - ABI_CLASS_ANSIC, /* Only need the ansic layer */ - ABI_ANSIC_VERSION, - MOD_CLASS_NONE, - {0,0,0,0} /* signature, to be patched into the file by a tool */ -}; - -XF86ModuleData afbModuleData = { &VersRec, afbSetup, NULL }; - -static pointer -afbSetup(pointer module, pointer opts, int *errmaj, int *errmin) -{ - /* This modules requires mfb, so load it */ - return LoadSubModule(module, "mfb", NULL, NULL, NULL, NULL, - errmaj, errmin); -} - -#endif diff --git a/nx-X11/programs/Xserver/afb/afbpixmap.c b/nx-X11/programs/Xserver/afb/afbpixmap.c deleted file mode 100644 index c6ae8481c..000000000 --- a/nx-X11/programs/Xserver/afb/afbpixmap.c +++ /dev/null @@ -1,300 +0,0 @@ -/* $XFree86: xc/programs/Xserver/afb/afbpixmap.c,v 3.0 1996/08/18 01:45:45 dawes Exp $ */ -/*********************************************************** - -Copyright (c) 1987 X Consortium - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of the X Consortium shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from the X Consortium. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XConsortium: afbpixmap.c,v 5.13 94/04/17 20:28:28 dpw Exp $ */ - -/* pixmap management - written by drewry, september 1986 - - on a monchrome device, a pixmap is a bitmap. -*/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "maskbits.h" - -#include "afb.h" -#include "mi.h" - -#include "servermd.h" -#include "mfb.h" - -PixmapPtr -afbCreatePixmap(pScreen, width, height, depth) - ScreenPtr pScreen; - int width; - int height; - int depth; -{ - PixmapPtr pPixmap; - size_t datasize; - size_t paddedWidth; - - paddedWidth = BitmapBytePad(width); - - if (paddedWidth > 32767 || height > 32767 || depth > 4) - return NullPixmap; - - datasize = height * paddedWidth * depth; - pPixmap = AllocatePixmap(pScreen, datasize); - if (!pPixmap) - return(NullPixmap); - pPixmap->drawable.type = DRAWABLE_PIXMAP; - pPixmap->drawable.class = 0; - pPixmap->drawable.pScreen = pScreen; - pPixmap->drawable.depth = depth; - pPixmap->drawable.bitsPerPixel = depth; - pPixmap->drawable.id = 0; - pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; - pPixmap->drawable.x = 0; - pPixmap->drawable.y = 0; - pPixmap->drawable.width = width; - pPixmap->drawable.height = height; - pPixmap->devKind = paddedWidth; - pPixmap->refcnt = 1; -#ifdef PIXPRIV - pPixmap->devPrivate.ptr = datasize ? - (pointer)((char *)pPixmap + pScreen->totalPixmapSize) : NULL; -#else - pPixmap->devPrivate.ptr = (pointer)(pPixmap + 1); -#endif - return(pPixmap); -} - -Bool -afbDestroyPixmap(pPixmap) - PixmapPtr pPixmap; -{ - if(--pPixmap->refcnt) - return(TRUE); - xfree(pPixmap); - return(TRUE); -} - - -PixmapPtr -afbCopyPixmap(pSrc) - register PixmapPtr pSrc; -{ - register PixmapPtr pDst; - int size; - ScreenPtr pScreen; - - size = pSrc->drawable.height * pSrc->devKind * pSrc->drawable.depth; - pScreen = pSrc->drawable.pScreen; - pDst = (*pScreen->CreatePixmap)(pScreen, pSrc->drawable.width, - pSrc->drawable.height, pSrc->drawable.depth); - if (!pDst) - return(NullPixmap); - memmove((char *)pDst->devPrivate.ptr, (char *)pSrc->devPrivate.ptr, size); - return(pDst); -} - - -/* replicates a pattern to be a full 32 bits wide. - relies on the fact that each scnaline is longword padded. - doesn't do anything if pixmap is not a factor of 32 wide. - changes width field of pixmap if successful, so that the fast - XRotatePixmap code gets used if we rotate the pixmap later. - - calculate number of times to repeat - for each scanline of pattern - zero out area to be filled with replicate - left shift and or in original as many times as needed -*/ -void -afbPadPixmap(pPixmap) - PixmapPtr pPixmap; -{ - register int width = pPixmap->drawable.width; - register int h; - register PixelType mask; - register PixelType *p; - register PixelType bits; /* real pattern bits */ - register int i; - int d; - int rep; /* repeat count for pattern */ - - if (width >= PPW) - return; - - rep = PPW/width; - if (rep*width != PPW) - return; - - mask = mfbGetendtab(width); - - p = (PixelType *)(pPixmap->devPrivate.ptr); - - for (d = 0; d < pPixmap->drawable.depth; d++) { - for (h = 0; h < pPixmap->drawable.height; h++) { - *p &= mask; - bits = *p; - for(i = 1; i < rep; i++) { - bits = SCRRIGHT(bits, width); - *p |= bits; - } - p++; /* @@@ NEXT PLANE @@@ */ - } - } - pPixmap->drawable.width = PPW; -} - -/* Rotates pixmap pPix by w pixels to the right on the screen. Assumes that - * words are PPW bits wide, and that the least significant bit appears on the - * left. - */ -void -afbXRotatePixmap(pPix, rw) - PixmapPtr pPix; - register int rw; -{ - register PixelType *pw, *pwFinal; - register PixelType t; - - if (pPix == NullPixmap) - return; - - pw = (PixelType *)pPix->devPrivate.ptr; - rw %= (int)pPix->drawable.width; - if (rw < 0) - rw += (int)pPix->drawable.width; - if(pPix->drawable.width == PPW) { - pwFinal = pw + pPix->drawable.height * pPix->drawable.depth; - while(pw < pwFinal) { - t = *pw; - *pw++ = SCRRIGHT(t, rw) | - (SCRLEFT(t, (PPW-rw)) & mfbGetendtab(rw)); - } - } else { - /* We no longer do this. Validate doesn't try to rotate odd-size - * tiles or stipples. afbUnnaturalFS works directly off - * the unrotate tile/stipple in the GC - */ - ErrorF("X internal error: trying to rotate odd-sized pixmap.\n"); - } - -} - -/* Rotates pixmap pPix by h lines. Assumes that h is always less than - pPix->height - works on any width. - */ -void -afbYRotatePixmap(pPix, rh) - register PixmapPtr pPix; - int rh; -{ - int nbyDown; /* bytes to move down to row 0; also offset of - row rh */ - int nbyUp; /* bytes to move up to line rh; also - offset of first line moved down to 0 */ - char *pbase; - char *ptmp; - int height; - int d; - - if (pPix == NullPixmap) - return; - height = (int) pPix->drawable.height; - rh %= height; - if (rh < 0) - rh += height; - - nbyDown = rh * pPix->devKind; - nbyUp = (pPix->devKind * height) - nbyDown; - - if(!(ptmp = (char *)ALLOCATE_LOCAL(nbyUp))) - return; - - for (d = 0; d < pPix->drawable.depth; d++) { - pbase = (char *)pPix->devPrivate.ptr + pPix->devKind * height * d; /* @@@ NEXT PLANE @@@ */ - - memmove(ptmp, pbase, nbyUp); /* save the low rows */ - memmove(pbase, pbase+nbyUp, nbyDown); /* slide the top rows down */ - memmove(pbase+nbyDown, ptmp, nbyUp); /* move lower rows up to row rh */ - } - DEALLOCATE_LOCAL(ptmp); -} - -void -afbCopyRotatePixmap(psrcPix, ppdstPix, xrot, yrot) - register PixmapPtr psrcPix, *ppdstPix; - int xrot, yrot; -{ - register PixmapPtr pdstPix; - - if ((pdstPix = *ppdstPix) && - (pdstPix->devKind == psrcPix->devKind) && - (pdstPix->drawable.height == psrcPix->drawable.height) && - (pdstPix->drawable.depth == psrcPix->drawable.depth)) { - memmove((char *)pdstPix->devPrivate.ptr, - (char *)psrcPix->devPrivate.ptr, - psrcPix->drawable.height * psrcPix->devKind * - psrcPix->drawable.depth); - pdstPix->drawable.width = psrcPix->drawable.width; - pdstPix->drawable.serialNumber = NEXT_SERIAL_NUMBER; - } else { - if (pdstPix) - /* FIX XBUG 6168 */ - (*pdstPix->drawable.pScreen->DestroyPixmap)(pdstPix); - *ppdstPix = pdstPix = afbCopyPixmap(psrcPix); - if (!pdstPix) - return; - } - afbPadPixmap(pdstPix); - if (xrot) - afbXRotatePixmap(pdstPix, xrot); - if (yrot) - afbYRotatePixmap(pdstPix, yrot); -} diff --git a/nx-X11/programs/Xserver/afb/afbply1rct.c b/nx-X11/programs/Xserver/afb/afbply1rct.c deleted file mode 100644 index 90e55cf8e..000000000 --- a/nx-X11/programs/Xserver/afb/afbply1rct.c +++ /dev/null @@ -1,300 +0,0 @@ -/* $XFree86: xc/programs/Xserver/afb/afbply1rct.c,v 3.1 1998/03/20 21:04:56 hohndel Exp $ */ -/* - * $XConsortium: afbply1rct.c,v 1.9 94/04/17 20:28:28 dpw Exp $ - * -Copyright (c) 1990 X Consortium - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of the X Consortium shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from the X Consortium. - * - * Author: Keith Packard, MIT X Consortium - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include - -#include "gcstruct.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "regionstr.h" -#include "scrnintstr.h" -#include "mistruct.h" - -#include "afb.h" -#include "maskbits.h" - -#if defined(mips) || defined(sparc) -#define GetHighWord(x) (((int)(x)) >> 16) -#else -#define GetHighWord(x) (((int)(x)) / 65536) -#endif - -#if IMAGE_BYTE_ORDER == MSBFirst -#define intToCoord(i,x,y) (((x) = GetHighWord(i)), ((y) = (int)((short) (i)))) -#define coordToInt(x,y) (((x) << 16) | (y)) -#define intToX(i) (GetHighWord(i)) -#define intToY(i) ((int)((short) i)) -#else -#define intToCoord(i,x,y) (((x) = (int)((short) (i))), ((y) = GetHighWord(i))) -#define coordToInt(x,y) (((y) << 16) | (x)) -#define intToX(i) ((int)((short) (i))) -#define intToY(i) (GetHighWord(i)) -#endif - -void -afbFillPolygonSolid (pDrawable, pGC, shape, mode, count, ptsIn) - DrawablePtr pDrawable; - GCPtr pGC; - int shape; - int mode; - int count; - DDXPointPtr ptsIn; -{ - afbPrivGCPtr devPriv; - int nlwidth; - PixelType *addrl, *addr; - int maxy; - int origin; - register int vertex1, vertex2; - int c; - BoxPtr extents; - int clip; - int y; - int *vertex1p = NULL, *vertex2p; - int *endp; - int x1 = 0, x2 = 0; - int dx1 = 0, dx2 = 0; - int dy1 = 0, dy2 = 0; - int e1 = 0, e2 = 0; - int step1 = 0, step2 = 0; - int sign1 = 0, sign2 = 0; - int h; - int l, r; - PixelType mask, bits = ~((PixelType)0); - int nmiddle; - register unsigned char *rrops; - register int n; - register int d; - int sizeDst; - int depthDst; - register PixelType *pdst; - - devPriv = (afbPrivGC *)(pGC->devPrivates[afbGCPrivateIndex].ptr); - - if (mode == CoordModePrevious || shape != Convex || - REGION_NUM_RECTS(pGC->pCompositeClip) != 1) { - miFillPolygon (pDrawable, pGC, shape, mode, count, ptsIn); - return; - } - origin = *((int *) &pDrawable->x); - origin -= (origin & 0x8000) << 1; - extents = &pGC->pCompositeClip->extents; - vertex1 = *((int *) &extents->x1) - origin; - vertex2 = *((int *) &extents->x2) - origin - 0x00010001; - clip = 0; - y = 32767; - maxy = 0; - vertex2p = (int *) ptsIn; - endp = vertex2p + count; - while (count--) { - c = *vertex2p; - clip |= (c - vertex1) | (vertex2 - c); - c = intToY(c); - if (c < y) { - y = c; - vertex1p = vertex2p; - } - vertex2p++; - if (c > maxy) - maxy = c; - } - if (y == maxy) - return; - - if (clip & 0x80008000) { - miFillPolygon (pDrawable, pGC, shape, mode, vertex2p - (int *) ptsIn, ptsIn); - return; - } - - afbGetPixelWidthSizeDepthAndPointer(pDrawable, nlwidth, sizeDst, depthDst, - addrl); - rrops = devPriv->rrops; - addrl = afbScanlineDelta(addrl, y + pDrawable->y, nlwidth); - origin = intToX(origin); - vertex2p = vertex1p; - vertex2 = vertex1 = *vertex2p++; - if (vertex2p == endp) - vertex2p = (int *) ptsIn; -#define Setup(c,x,vertex,dx,dy,e,sign,step) {\ - x = intToX(vertex); \ - if ((dy = intToY(c) - y)) { \ - dx = intToX(c) - x; \ - step = 0; \ - if (dx >= 0) { \ - e = 0; \ - sign = 1; \ - if (dx >= dy) {\ - step = dx / dy; \ - dx = dx % dy; \ - } \ - } else { \ - e = 1 - dy; \ - sign = -1; \ - dx = -dx; \ - if (dx >= dy) { \ - step = - (dx / dy); \ - dx = dx % dy; \ - } \ - } \ - } \ - x += origin; \ - vertex = c; \ -} - -#define Step(x,dx,dy,e,sign,step) {\ - x += step; \ - if ((e += dx) > 0) { \ - x += sign; \ - e -= dy; \ - } \ -} - for (;;) { - if (y == intToY(vertex1)) { - do { - if (vertex1p == (int *) ptsIn) - vertex1p = endp; - c = *--vertex1p; - Setup (c,x1,vertex1,dx1,dy1,e1,sign1,step1) - } while (y >= intToY(vertex1)); - h = dy1; - } else { - Step(x1,dx1,dy1,e1,sign1,step1) - h = intToY(vertex1) - y; - } - if (y == intToY(vertex2)) { - do { - c = *vertex2p++; - if (vertex2p == endp) - vertex2p = (int *) ptsIn; - Setup (c,x2,vertex2,dx2,dy2,e2,sign2,step2) - } while (y >= intToY(vertex2)); - if (dy2 < h) - h = dy2; - } else { - Step(x2,dx2,dy2,e2,sign2,step2) - if ((c = (intToY(vertex2) - y)) < h) - h = c; - } - /* fill spans for this segment */ - y += h; - for (;;) { - l = x1; - r = x2; - nmiddle = x2 - x1; - if (nmiddle < 0) { - nmiddle = -nmiddle; - l = x2; - r = x1; - } - c = l & PIM; - l -= c; - l = l >> PWSH; - addr = addrl + l; - if (c + nmiddle < PPW) { - mask = SCRRIGHT (bits,c) ^ SCRRIGHT (bits,c+nmiddle); - for (pdst = addr, d = 0; d < depthDst; d++, pdst += sizeDst) { /* @@@ NEXT PLANE @@@ */ - switch (rrops[d]) { - case RROP_BLACK: - *pdst &= ~mask; - break; - case RROP_WHITE: - *pdst |= mask; - break; - case RROP_INVERT: - *pdst ^= mask; - break; - case RROP_NOP: - break; - } - } - } else { - if (c) { - mask = SCRRIGHT(bits, c); - for (pdst = addr, d = 0; d < depthDst; d++, pdst += sizeDst) { /* @@@ NEXT PLANE @@@ */ - switch (rrops[d]) { - case RROP_BLACK: - *pdst &= ~mask; - break; - case RROP_WHITE: - *pdst |= mask; - break; - case RROP_INVERT: - *pdst ^= mask; - break; - case RROP_NOP: - break; - } - } - nmiddle += c - PPW; - addr++; - } - nmiddle >>= PWSH; - mask = ~SCRRIGHT(bits, r & PIM); - - for (d = 0; d < depthDst; d++, addr += sizeDst) { /* @@@ NEXT PLANE @@@ */ - n = nmiddle; - pdst = addr; - - switch (rrops[d]) { - case RROP_BLACK: - Duff (n, *pdst++ = 0;) - if (mask) - *pdst &= ~mask; - break; - case RROP_WHITE: - Duff (n, *pdst++ = ~0;); - if (mask) - *pdst |= mask; - break; - case RROP_INVERT: - Duff (n, *pdst++ ^= ~0;); - if (mask) - *pdst ^= mask; - break; - case RROP_NOP: - break; - } - } - } - if (!--h) - break; - afbScanlineInc(addrl, nlwidth); - Step(x1,dx1,dy1,e1,sign1,step1) - Step(x2,dx2,dy2,e2,sign2,step2) - } - if (y == maxy) - break; - afbScanlineInc(addrl, nlwidth); - } -} diff --git a/nx-X11/programs/Xserver/afb/afbplygblt.c b/nx-X11/programs/Xserver/afb/afbplygblt.c deleted file mode 100644 index 7d4f5ddd7..000000000 --- a/nx-X11/programs/Xserver/afb/afbplygblt.c +++ /dev/null @@ -1,465 +0,0 @@ -/* $XFree86: xc/programs/Xserver/afb/afbplygblt.c,v 3.2tsi Exp $ */ -/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */ -/*********************************************************** - -Copyright (c) 1987 X Consortium - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of the X Consortium shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from the X Consortium. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XConsortium: afbimggblt.c,v 5.17 94/04/17 20:28:25 dpw Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include -#include "afb.h" -#include -#include "dixfontstr.h" -#include "gcstruct.h" -#include "windowstr.h" -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "regionstr.h" -#include "maskbits.h" - -/* - this works for fonts with glyphs <= 32 bits wide. - - the clipping calculations are done for worst-case fonts. -we make no assumptions about the heights, widths, or bearings -of the glyphs. if we knew that the glyphs are all the same height, -we could clip the tops and bottoms per clipping box, rather -than per character per clipping box. if we knew that the glyphs' -left and right bearings were wlle-behaved, we could clip a single -character at the start, output until the last unclipped -character, and then clip the last one. this is all straightforward -to determine based on max-bounds and min-bounds from the font. - there is some inefficiency introduced in the per-character -clipping to make what's going on clearer. - - (it is possible, for example, for a font to be defined in which the -next-to-last character in a font would be clipped out, but the last -one wouldn't. the code below deals with this.) - -*/ - -void -afbPolyGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) - DrawablePtr pDrawable; - GC *pGC; - int x, y; - unsigned int nglyph; - CharInfoPtr *ppci; /* array of character info */ - pointer pglyphBase; /* start of array of glyphs */ -{ - ExtentInfoRec info; /* used by QueryGlyphExtents() */ - BoxRec bbox; /* string's bounding box */ - - CharInfoPtr pci; - int xorg, yorg; /* origin of drawable in bitmap */ - int widthDst; /* width of dst in longwords */ - - /* these keep track of the character origin */ - PixelType *pdstBase; - /* points to longword with character origin */ - int xchar; /* xorigin of char (mod 32) */ - - /* these are used for placing the glyph */ - register int xoff; /* x offset of left edge of glyph (mod 32) */ - register PixelType *pdst; /* pointer to current longword in dst */ - - register int d; - int depthDst; - int sizeDst; - int hSave; - int w; /* width of glyph in bits */ - int h; /* height of glyph */ - int widthGlyph; /* width of glyph, in bytes */ - unsigned char *rrops; - register unsigned char *pglyph; - /* pointer to current row of glyph */ - unsigned char *pglyphSave; - - /* used for putting down glyph */ - register PixelType tmpSrc; - /* for getting bits from glyph */ - register PixelType startmask; - register PixelType endmask; - - register int nFirst; /* bits of glyph in current longword */ - PixelType *pdstSave; - - xorg = pDrawable->x; - yorg = pDrawable->y; - afbGetPixelWidthSizeDepthAndPointer(pDrawable, widthDst, sizeDst, depthDst, - pdstBase); - - QueryGlyphExtents(pGC->font, ppci, (unsigned long)nglyph, &info); - - x += xorg; - y += yorg; - - bbox.x1 = x + info.overallLeft; - bbox.x2 = x + info.overallRight; - bbox.y1 = y - info.overallAscent; - bbox.y2 = y + info.overallDescent; - - rrops = ((afbPrivGCPtr) pGC->devPrivates[afbGCPrivateIndex].ptr)->rrops; - - switch (RECT_IN_REGION(pGC->pScreen, pGC->pCompositeClip, &bbox)) { - case rgnOUT: - break; - case rgnIN: - pdstBase = afbScanlineNoBankSwitch(pdstBase, x, y, widthDst); - xchar = x & PIM; - - while(nglyph--) { - pci = *ppci; - pglyphSave = FONTGLYPHBITS(pglyphBase, pci); - w = pci->metrics.rightSideBearing - pci->metrics.leftSideBearing; - hSave = pci->metrics.ascent + pci->metrics.descent; - widthGlyph = GLYPHWIDTHBYTESPADDED(pci); - /* start at top scanline of glyph */ - pdstSave = afbScanlineDelta(pdstBase, -pci->metrics.ascent, - widthDst); - - /* find correct word in scanline and x offset within it - for left edge of glyph - */ - xoff = xchar + pci->metrics.leftSideBearing; - if (xoff > PLST) { - pdstSave++; - xoff &= PIM; - } else if (xoff < 0) { - xoff += PPW; - pdstSave--; - } - - for (d = 0; d < depthDst; d++) { - h = hSave; - pdst = pdstSave; - pdstSave += sizeDst; /* @@@ NEXT PLANE @@@ */ - pglyph = pglyphSave; - - if ((xoff + w) <= PPW) { - /* glyph all in one longword */ - maskpartialbits(xoff, w, startmask); - switch (rrops[d]) { - case RROP_WHITE: - while (h--) { - getleftbits(pglyph, w, tmpSrc); - *pdst |= (SCRRIGHT(tmpSrc, xoff) & startmask); - pglyph += widthGlyph; - afbScanlineInc(pdst, widthDst); - } - break; - case RROP_BLACK: - while (h--) { - getleftbits(pglyph, w, tmpSrc); - *pdst &= ~(SCRRIGHT(tmpSrc, xoff) & startmask); - pglyph += widthGlyph; - afbScanlineInc(pdst, widthDst); - } - break; - case RROP_INVERT: - while (h--) { - getleftbits(pglyph, w, tmpSrc); - *pdst ^= (SCRRIGHT(tmpSrc, xoff) & startmask); - pglyph += widthGlyph; - afbScanlineInc(pdst, widthDst); - } - break; - } - } else { - /* glyph crosses longword boundary */ - maskPPWbits(xoff, w, startmask, endmask); - nFirst = PPW - xoff; - switch (rrops[d]) { - case RROP_WHITE: - while (h--) { - getleftbits(pglyph, w, tmpSrc); - *pdst |= (SCRRIGHT(tmpSrc, xoff) & startmask); - *(pdst+1) |= (SCRLEFT(tmpSrc, nFirst) & endmask); - pglyph += widthGlyph; - afbScanlineInc(pdst, widthDst); - } - break; - case RROP_BLACK: - while (h--) { - getleftbits(pglyph, w, tmpSrc); - *pdst &= ~(SCRRIGHT(tmpSrc, xoff) & startmask); - *(pdst+1) &= ~(SCRLEFT(tmpSrc, nFirst) & endmask); - pglyph += widthGlyph; - afbScanlineInc(pdst, widthDst); - } - break; - case RROP_INVERT: - while (h--) { - getleftbits(pglyph, w, tmpSrc); - *pdst ^= (SCRRIGHT(tmpSrc, xoff) & startmask); - *(pdst+1) ^= (SCRLEFT(tmpSrc, nFirst) & endmask); - pglyph += widthGlyph; - afbScanlineInc(pdst, widthDst); - } - break; - } - } /* glyph crosses longwords boundary */ - } /* depth loop */ - /* update character origin */ - x += pci->metrics.characterWidth; - xchar += pci->metrics.characterWidth; - if (xchar > PLST) { - xchar -= PPW; - pdstBase++; - } else if (xchar < 0) { - xchar += PPW; - pdstBase--; - } - ppci++; - } /* while nglyph-- */ - break; - case rgnPART: - { - afbTEXTPOS *ppos; - int nbox; - BoxPtr pbox; - RegionPtr cclip; - int xpos; /* x position of char origin */ - int i; - BoxRec clip; - int leftEdge, rightEdge; - int topEdge, bottomEdge; - int glyphRow; /* first row of glyph not wholly - clipped out */ - int glyphCol; /* leftmost visible column of glyph */ -#if GETLEFTBITS_ALIGNMENT > 1 - int getWidth; /* bits to get from glyph */ -#endif - - if(!(ppos = (afbTEXTPOS *)ALLOCATE_LOCAL(nglyph * sizeof(afbTEXTPOS)))) - return; - - pdstBase = afbScanlineNoBankSwitch(pdstBase, x, y, widthDst); - xpos = x; - xchar = xpos & PIM; - - for (i = 0; i < nglyph; i++) { - pci = ppci[i]; - - ppos[i].xpos = xpos; - ppos[i].xchar = xchar; - ppos[i].leftEdge = xpos + pci->metrics.leftSideBearing; - ppos[i].rightEdge = xpos + pci->metrics.rightSideBearing; - ppos[i].topEdge = y - pci->metrics.ascent; - ppos[i].bottomEdge = y + pci->metrics.descent; - ppos[i].pdstBase = pdstBase; - ppos[i].widthGlyph = GLYPHWIDTHBYTESPADDED(pci); - - xpos += pci->metrics.characterWidth; - xchar += pci->metrics.characterWidth; - if (xchar > PLST) { - xchar &= PIM; - pdstBase++; - } else if (xchar < 0) { - xchar += PPW; - pdstBase--; - } - } - - cclip = pGC->pCompositeClip; - pbox = REGION_RECTS(cclip); - nbox = REGION_NUM_RECTS(cclip); - - /* HACK ALERT - since we continue out of the loop below so often, it - is easier to increment pbox at the top than at the end. - don't try this at home. - */ - pbox--; - while(nbox--) { - pbox++; - clip.x1 = max(bbox.x1, pbox->x1); - clip.y1 = max(bbox.y1, pbox->y1); - clip.x2 = min(bbox.x2, pbox->x2); - clip.y2 = min(bbox.y2, pbox->y2); - if ((clip.x2<=clip.x1) || (clip.y2<=clip.y1)) - continue; - - for(i=0; i clip.x2) - rightEdge = clip.x2; - else - rightEdge = ppos[i].rightEdge; - - w = rightEdge - leftEdge; - if (w <= 0) - continue; - - /* clip the top and bottom edges */ - if (ppos[i].topEdge < clip.y1) - topEdge = clip.y1; - else - topEdge = ppos[i].topEdge; - - if (ppos[i].bottomEdge > clip.y2) - bottomEdge = clip.y2; - else - bottomEdge = ppos[i].bottomEdge; - - hSave = bottomEdge - topEdge; - if (hSave <= 0) - continue; - - glyphRow = (topEdge - y) + pci->metrics.ascent; - widthGlyph = ppos[i].widthGlyph; - pglyphSave = FONTGLYPHBITS(pglyphBase, pci); - pglyphSave += (glyphRow * widthGlyph); - - glyphCol = (leftEdge - ppos[i].xpos) - - (pci->metrics.leftSideBearing); -#if GETLEFTBITS_ALIGNMENT > 1 - getWidth = w + glyphCol; -#endif - - pdstSave = afbScanlineDelta(ppos[i].pdstBase, -(y-topEdge), - widthDst); - xoff = xchar + (leftEdge - ppos[i].xpos); - if (xoff > PLST) { - xoff &= PIM; - pdstSave++; - } else if (xoff < 0) { - xoff += PPW; - pdstSave--; - } - - for (d = 0; d < depthDst; d++) { - h = hSave; - pdst = pdstSave; - pdstSave += sizeDst; /* @@@ NEXT PLANE @@@ */ - pglyph = pglyphSave; - - if ((xoff + w) <= PPW) { - maskpartialbits(xoff, w, startmask); - switch (rrops[d]) { - case RROP_WHITE: - while (h--) { - getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc); - *pdst |= (SCRRIGHT(tmpSrc, xoff) & startmask); - pglyph += widthGlyph; - afbScanlineInc(pdst, widthDst); - } - break; - case RROP_BLACK: - while (h--) { - getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc); - *pdst &= ~(SCRRIGHT(tmpSrc, xoff) & startmask); - pglyph += widthGlyph; - afbScanlineInc(pdst, widthDst); - } - break; - case RROP_INVERT: - while (h--) { - getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc); - *pdst ^= (SCRRIGHT(tmpSrc, xoff) & startmask); - pglyph += widthGlyph; - afbScanlineInc(pdst, widthDst); - } - break; - } - } else { - maskPPWbits(xoff, w, startmask, endmask); - nFirst = PPW - xoff; - switch (rrops[d]) { - case RROP_WHITE: - while (h--) { - getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc); - *pdst |= (SCRRIGHT(tmpSrc, xoff) & startmask); - *(pdst+1) |= (SCRLEFT(tmpSrc, nFirst) & endmask); - pglyph += widthGlyph; - afbScanlineInc(pdst, widthDst); - } - break; - case RROP_BLACK: - while (h--) { - getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc); - *pdst &= ~(SCRRIGHT(tmpSrc, xoff) & startmask); - *(pdst+1) &= ~(SCRLEFT(tmpSrc, nFirst) & endmask); - pglyph += widthGlyph; - afbScanlineInc(pdst, widthDst); - } - break; - case RROP_INVERT: - while (h--) { - getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc); - *pdst ^= (SCRRIGHT(tmpSrc, xoff) & startmask); - *(pdst+1) ^= (SCRLEFT(tmpSrc, nFirst) & endmask); - pglyph += widthGlyph; - afbScanlineInc(pdst, widthDst); - } - break; - } - } - } /* depth */ - } /* for each glyph */ - } /* while nbox-- */ - DEALLOCATE_LOCAL(ppos); - break; - } - - default: - break; - } -} diff --git a/nx-X11/programs/Xserver/afb/afbpntarea.c b/nx-X11/programs/Xserver/afb/afbpntarea.c deleted file mode 100644 index 648a2d19c..000000000 --- a/nx-X11/programs/Xserver/afb/afbpntarea.c +++ /dev/null @@ -1,657 +0,0 @@ -/* $XFree86: xc/programs/Xserver/afb/afbpntarea.c,v 3.0 1996/08/18 01:45:49 dawes Exp $ */ -/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */ -/*********************************************************** - -Copyright (c) 1987 X Consortium - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of the X Consortium shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from the X Consortium. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XConsortium: afbpntarea.c,v 5.7 94/04/17 20:28:29 dpw Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include - -#include "windowstr.h" -#include "regionstr.h" -#include "pixmapstr.h" -#include "scrnintstr.h" - -#include "afb.h" -#include "maskbits.h" - -/* - the solid fillers are called for rectangles and window backgrounds. - the boxes are already translated. - maybe this should always take a pixmap instead of a drawable? - - NOTE: - iy = ++iy < tileHeight ? iy : 0 -is equivalent to iy%= tileheight, and saves a division. -*/ - -/*ARGSUSED*/ -void -afbSolidFillArea (pDraw, nbox, pbox, rrops) - DrawablePtr pDraw; - int nbox; - BoxPtr pbox; - register unsigned char *rrops; -{ - int nlwidth; /* width in longwords of the drawable */ - int w; /* width of current box */ - register int h; /* height of current box */ - register PixelType *p; /* pointer to bits we're writing */ - register int nlw; /* loop version of nlwMiddle */ - register PixelType startmask; - register PixelType endmask; - /* masks for reggedy bits at either end of line */ - register int nlwExtra; - /* to get from right of box to left of next span */ - int nlwMiddle; /* number of longwords between sides of boxes */ - PixelType *pbits; /* pointer to start of drawable */ - PixelType *saveP; - int saveH; - int depthDst; - int sizeDst; - register int d; - - afbGetPixelWidthSizeDepthAndPointer(pDraw, nlwidth, sizeDst, depthDst, - pbits); - - while (nbox--) { - w = pbox->x2 - pbox->x1; - saveH = pbox->y2 - pbox->y1; - - saveP = afbScanline(pbits, pbox->x1, pbox->y1, nlwidth); - - if ( ((pbox->x1 & PIM) + w) < PPW) { - for (d = 0; d < depthDst; d++) { - h = saveH; - p = saveP; - saveP += sizeDst; /* @@@ NEXT PLANE @@@ */ - maskpartialbits(pbox->x1, w, startmask); - nlwExtra = nlwidth; - - switch (rrops[d]) { - case RROP_BLACK: - Duff(h, *p &= ~startmask; afbScanlineInc(p, nlwExtra)); - break; - case RROP_WHITE: - Duff(h, *p |= startmask; afbScanlineInc(p, nlwExtra)); - break; - case RROP_INVERT: - Duff(h, *p ^= startmask; afbScanlineInc(p, nlwExtra)); - break; - case RROP_NOP: - break; - } /* switch */ - } /* for (d = ..) */ - } else { - maskbits(pbox->x1, w, startmask, endmask, nlwMiddle); - - for (d = 0; d < depthDst; d++) { - h = saveH; - p = saveP; - saveP += sizeDst; /* @@@ NEXT PLANE @@@ */ - nlwExtra = nlwidth - nlwMiddle; - - if (startmask && endmask) { - nlwExtra -= 1; - switch (rrops[d]) { - case RROP_BLACK: - while (h--) { - nlw = nlwMiddle; - *p &= ~startmask; - p++; - Duff(nlw, *p++ = 0); - *p &= ~endmask; - afbScanlineInc(p, nlwExtra); - } - break; - case RROP_WHITE: - while (h--) { - nlw = nlwMiddle; - *p |= startmask; - p++; - Duff(nlw, *p++ = ~0); - *p |= endmask; - afbScanlineInc(p, nlwExtra); - } - break; - case RROP_INVERT: - while (h--) { - nlw = nlwMiddle; - *p ^= startmask; - p++; - Duff(nlw, *p++ ^= ~0); - *p ^= endmask; - afbScanlineInc(p, nlwExtra); - } - break; - case RROP_NOP: - break; - } - } else if (startmask && !endmask) { - nlwExtra -= 1; - switch (rrops[d]) { - case RROP_BLACK: - while (h--) { - nlw = nlwMiddle; - *p &= ~startmask; - p++; - Duff(nlw, *p++ = 0); - afbScanlineInc(p, nlwExtra); - } - break; - case RROP_WHITE: - while (h--) { - nlw = nlwMiddle; - *p |= startmask; - p++; - Duff(nlw, *p++ = ~0); - afbScanlineInc(p, nlwExtra); - } - break; - case RROP_INVERT: - while (h--) { - nlw = nlwMiddle; - *p ^= startmask; - p++; - Duff(nlw, *p++ ^= ~0); - afbScanlineInc(p, nlwExtra); - } - break; - case RROP_NOP: - break; - } - } else if (!startmask && endmask) { - switch (rrops[d]) { - case RROP_BLACK: - while (h--) { - nlw = nlwMiddle; - Duff(nlw, *p++ = 0); - *p &= ~endmask; - afbScanlineInc(p, nlwExtra); - } - break; - case RROP_WHITE: - while (h--) { - nlw = nlwMiddle; - Duff(nlw, *p++ = ~0); - *p |= endmask; - afbScanlineInc(p, nlwExtra); - } - break; - case RROP_INVERT: - while (h--) { - nlw = nlwMiddle; - Duff(nlw, *p++ ^= ~0); - *p ^= endmask; - afbScanlineInc(p, nlwExtra); - } - case RROP_NOP: - break; - } - } else { /* no ragged bits at either end */ - switch (rrops[d]) { - case RROP_BLACK: - while (h--) { - nlw = nlwMiddle; - Duff(nlw, *p++ = 0); - afbScanlineInc(p, nlwExtra); - } - break; - case RROP_WHITE: - while (h--) { - nlw = nlwMiddle; - Duff(nlw, *p++ = ~0); - afbScanlineInc(p, nlwExtra); - } - break; - case RROP_INVERT: - while (h--) { - nlw = nlwMiddle; - Duff(nlw, *p++ ^= ~0); - afbScanlineInc(p, nlwExtra); - } - break; - case RROP_NOP: - break; - } /* switch */ - } - } /* for (d = 0 ... ) */ - } - pbox++; - } -} - -/* stipple a list of boxes - - -you can use the reduced rasterop for stipples. if rrop is -black, AND the destination with (not stipple pattern). if rrop is -white OR the destination with the stipple pattern. if rrop is invert, -XOR the destination with the stipple pattern. -*/ - -/*ARGSUSED*/ -void -afbStippleAreaPPW (pDraw, nbox, pbox, pstipple, rrops) - DrawablePtr pDraw; - int nbox; - BoxPtr pbox; - PixmapPtr pstipple; - unsigned char *rrops; -{ - register PixelType *psrc; - /* pointer to bits in tile, if needed */ - int tileHeight; /* height of the tile */ - register PixelType srcpix; - - int nlwidth; /* width in longwords of the drawable */ - int w; /* width of current box */ - register int nlw; /* loop version of nlwMiddle */ - register PixelType *p; /* pointer to bits we're writing */ - register int h; /* height of current box */ - PixelType startmask; - PixelType endmask; /* masks for reggedy bits at either end of line */ - int nlwMiddle; /* number of longwords between sides of boxes */ - int nlwExtra; /* to get from right of box to left of next span */ - int sizeDst; - int depthDst; - int d; - int saveIy; - register int iy; /* index of current scanline in tile */ - PixelType *pbits; /* pointer to start of drawable */ - PixelType *pBase; - - afbGetPixelWidthSizeDepthAndPointer(pDraw, nlwidth, sizeDst, depthDst, - pBase); - - tileHeight = pstipple->drawable.height; - psrc = (PixelType *)(pstipple->devPrivate.ptr); - - while (nbox--) { - w = pbox->x2 - pbox->x1; - saveIy = pbox->y1 % tileHeight; - pbits = pBase; - - if ( ((pbox->x1 & PIM) + w) < PPW) { - maskpartialbits(pbox->x1, w, startmask); - nlwExtra = nlwidth; - for (d = 0; d < depthDst; d++) { - p = afbScanline(pbits, pbox->x1, pbox->y1, nlwidth); - pbits += sizeDst; /* @@@ NEXT PLANE @@@ */ - iy = saveIy; - h = pbox->y2 - pbox->y1; - - switch (rrops[d]) { - case RROP_BLACK: - while (h--) { - srcpix = psrc[iy]; - iy = ++iy < tileHeight ? iy : 0; - *p &= ~(srcpix & startmask); - afbScanlineInc(p, nlwExtra); - } - break; - case RROP_WHITE: - while (h--) { - srcpix = psrc[iy]; - iy = ++iy < tileHeight ? iy : 0; - *p |= (srcpix & startmask); - afbScanlineInc(p, nlwExtra); - } - break; - case RROP_INVERT: - while (h--) { - srcpix = psrc[iy]; - iy = ++iy < tileHeight ? iy : 0; - *p ^= (srcpix & startmask); - afbScanlineInc(p, nlwExtra); - } - break; - case RROP_NOP: - break; - } /* switch */ - } /* for (d = ...) */ - - } else { - maskbits(pbox->x1, w, startmask, endmask, nlwMiddle); - - for (d = 0; d < depthDst; d++) { - nlwExtra = nlwidth - nlwMiddle; - p = afbScanline(pbits, pbox->x1, pbox->y1, nlwidth); - pbits += sizeDst; /* @@@ NEXT PLANE @@@ */ - iy = saveIy; - h = pbox->y2 - pbox->y1; - - if (startmask && endmask) { - nlwExtra -= 1; - switch (rrops[d]) { - case RROP_BLACK: - while (h--) { - srcpix = psrc[iy]; - iy = ++iy < tileHeight ? iy : 0; - nlw = nlwMiddle; - *p &= ~(srcpix & startmask); - p++; - Duff (nlw, *p++ &= ~srcpix); - *p &= ~(srcpix & endmask); - afbScanlineInc(p, nlwExtra); - } - break; - case RROP_WHITE: - while (h--) { - srcpix = psrc[iy]; - iy = ++iy < tileHeight ? iy : 0; - nlw = nlwMiddle; - *p |= (srcpix & startmask); - p++; - Duff (nlw, *p++ |= srcpix); - *p |= (srcpix & endmask); - afbScanlineInc(p, nlwExtra); - } - break; - case RROP_INVERT: - while (h--) { - srcpix = psrc[iy]; - iy = ++iy < tileHeight ? iy : 0; - nlw = nlwMiddle; - *p ^= (srcpix & startmask); - p++; - Duff (nlw, *p++ ^= srcpix); - *p ^= (srcpix & endmask); - afbScanlineInc(p, nlwExtra); - } - break; - case RROP_NOP: - break; - } /* switch */ - } else if (startmask && !endmask) { - nlwExtra -= 1; - switch (rrops[d]) { - case RROP_BLACK: - while (h--) { - srcpix = psrc[iy]; - iy = ++iy < tileHeight ? iy : 0; - nlw = nlwMiddle; - *p &= ~(srcpix & startmask); - p++; - Duff(nlw, *p++ &= ~srcpix); - afbScanlineInc(p, nlwExtra); - } - break; - case RROP_WHITE: - while (h--) { - srcpix = psrc[iy]; - iy = ++iy < tileHeight ? iy : 0; - nlw = nlwMiddle; - *p |= (srcpix & startmask); - p++; - Duff(nlw, *p++ |= srcpix); - afbScanlineInc(p, nlwExtra); - } - break; - case RROP_INVERT: - while (h--) { - srcpix = psrc[iy]; - iy = ++iy < tileHeight ? iy : 0; - nlw = nlwMiddle; - *p ^= (srcpix & startmask); - p++; - Duff(nlw, *p++ ^= srcpix); - afbScanlineInc(p, nlwExtra); - } - break; - case RROP_NOP: - break; - } /* switch */ - } else if (!startmask && endmask) { - switch (rrops[d]) { - case RROP_BLACK: - while (h--) { - srcpix = psrc[iy]; - iy = ++iy < tileHeight ? iy : 0; - nlw = nlwMiddle; - Duff(nlw, *p++ &= ~srcpix); - *p &= ~(srcpix & endmask); - afbScanlineInc(p, nlwExtra); - } - break; - case RROP_WHITE: - while (h--) { - srcpix = psrc[iy]; - iy = ++iy < tileHeight ? iy : 0; - nlw = nlwMiddle; - Duff(nlw, *p++ |= srcpix); - *p |= (srcpix & endmask); - afbScanlineInc(p, nlwExtra); - } - break; - case RROP_INVERT: - while (h--) { - srcpix = psrc[iy]; - iy = ++iy < tileHeight ? iy : 0; - nlw = nlwMiddle; - Duff(nlw, *p++ ^= srcpix); - *p ^= (srcpix & endmask); - afbScanlineInc(p, nlwExtra); - } - break; - case RROP_NOP: - break; - } /* switch */ - } else { /* no ragged bits at either end */ - switch (rrops[d]) { - case RROP_BLACK: - while (h--) { - srcpix = psrc[iy]; - iy = ++iy < tileHeight ? iy : 0; - nlw = nlwMiddle; - Duff(nlw, *p++ &= ~srcpix); - afbScanlineInc(p, nlwExtra); - } - break; - case RROP_WHITE: - while (h--) { - srcpix = psrc[iy]; - iy = ++iy < tileHeight ? iy : 0; - nlw = nlwMiddle; - Duff(nlw, *p++ |= srcpix); - afbScanlineInc(p, nlwExtra); - } - break; - case RROP_INVERT: - while (h--) { - srcpix = psrc[iy]; - iy = ++iy < tileHeight ? iy : 0; - nlw = nlwMiddle; - Duff(nlw, *p++ ^= srcpix); - afbScanlineInc(p, nlwExtra); - } - break; - } /* switch */ - } - } /* for (d = ...) */ - } - pbox++; - } -} - -void -afbStippleArea (pDraw, nbox, pbox, pTile, xOff, yOff, rrops) - DrawablePtr pDraw; - int nbox; - BoxPtr pbox; - PixmapPtr pTile; - int xOff; - int yOff; - unsigned char *rrops; -{ - register PixelType *psrc; /* pointer to bits in tile, if needed */ - int nlwidth; /* width in longwords of the drawable */ - register int h; /* height of current box */ - register PixelType *pdst; /* pointer to bits we're writing */ - int sizeDst; - int depthDst; - int tileLine; - int iline; - int w, width, x, xSrc, ySrc, srcStartOver, nend; - int tlwidth, rem, tileWidth, tileHeight, endinc; - int saveW; - register int rop; - PixelType *psrcT; - int d; - int nstart; - PixelType startmask; - PixelType endmask; /* masks for reggedy bits at either end of line */ - int nlMiddle; /* number of longwords between sides of boxes */ - int iy; - PixelType *pBase; /* pointer to start of drawable */ - PixelType *saveP; - PixelType *pStartDst; - PixelType *pStartTile; - int saveH; - - afbGetPixelWidthSizeDepthAndPointer(pDraw, nlwidth, sizeDst, depthDst, - pBase); - - tileHeight = pTile->drawable.height; - tileWidth = pTile->drawable.width; - tlwidth = pTile->devKind / sizeof (PixelType); - - xSrc = pDraw->x + ((xOff % tileWidth) - tileWidth); - ySrc = pDraw->y + ((yOff % tileHeight) - tileHeight); - - while (nbox--) { - saveW = pbox->x2 - pbox->x1; - iline = (pbox->y1 - ySrc) % tileHeight; - psrcT = (PixelType *) pTile->devPrivate.ptr; - tileLine = iline * tlwidth; - saveH = pbox->y2 - pbox->y1; - saveP = afbScanline(pBase, pbox->x1, pbox->y1, nlwidth); - - for (d = 0; d < depthDst; d++, saveP += sizeDst) { /* @@@ NEXT PLANE @@@ */ - h = saveH; - pStartDst = saveP; - pStartTile = psrcT + tileLine; - iy = iline; - - while (h--) { - x = pbox->x1; - width = saveW; - pdst = pStartDst; - rop = rrops[d]; - - while(width > 0) { - psrc = pStartTile; - w = min(tileWidth, width); - if((rem = (x - xSrc) % tileWidth) != 0) { - /* if we're in the middle of the tile, get - as many bits as will finish the span, or - as many as will get to the left edge of the tile, - or a longword worth, starting at the appropriate - offset in the tile. - */ - w = min(min(tileWidth - rem, width), BITMAP_SCANLINE_PAD); - endinc = rem / BITMAP_SCANLINE_PAD; - getandputrrop((psrc + endinc), (rem & PIM), (x & PIM), - w, pdst, rop) - if((x & PIM) + w >= PPW) - pdst++; - } else if(((x & PIM) + w) < PPW) { - /* doing < PPW bits is easy, and worth special-casing */ - putbitsrrop(*psrc, x & PIM, w, pdst, rop); - } else { - /* start at the left edge of the tile, - and put down as much as we can - */ - maskbits(x, w, startmask, endmask, nlMiddle); - - if (startmask) - nstart = PPW - (x & PIM); - else - nstart = 0; - if (endmask) - nend = (x + w) & PIM; - else - nend = 0; - - srcStartOver = nstart > PLST; - - if(startmask) { - putbitsrrop(*psrc, (x & PIM), nstart, pdst, rop); - pdst++; - if(srcStartOver) - psrc++; - } - - while(nlMiddle--) { - getandputrrop0(psrc, nstart, PPW, pdst, rop); - pdst++; - psrc++; - } - - if(endmask) { - getandputrrop0(psrc, nstart, nend, pdst, rop); - } - } - x += w; - width -= w; - } /* while (width > 0) */ - - pStartDst += nlwidth; - if (++iy >= tileHeight) { - iy = 0; - pStartTile = psrcT; - } else - pStartTile += tlwidth; - - } /* while (h) */ - } /* for (d = ... ) */ - pbox++; - } /* for each box */ -} diff --git a/nx-X11/programs/Xserver/afb/afbpntwin.c b/nx-X11/programs/Xserver/afb/afbpntwin.c deleted file mode 100644 index aaa6847a9..000000000 --- a/nx-X11/programs/Xserver/afb/afbpntwin.c +++ /dev/null @@ -1,128 +0,0 @@ -/* $XFree86$ */ -/* $XConsortium: afbpntwin.c,v 5.12 94/04/17 20:28:30 dpw Exp $ */ -/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */ -/*********************************************************** - -Copyright (c) 1987 X Consortium - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of the X Consortium shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from the X Consortium. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include - -#include "windowstr.h" -#include "regionstr.h" -#include "pixmapstr.h" -#include "scrnintstr.h" - -#include "afb.h" -#include "maskbits.h" -#include "mi.h" - -void -afbPaintWindow(pWin, pRegion, what) - WindowPtr pWin; - RegionPtr pRegion; - int what; -{ - register afbPrivWin *pPrivWin; - unsigned char rrops[AFB_MAX_DEPTH]; - - pPrivWin = (afbPrivWin *)(pWin->devPrivates[afbWindowPrivateIndex].ptr); - - switch (what) { - case PW_BACKGROUND: - switch (pWin->backgroundState) { - case None: - return; - case ParentRelative: - do { - pWin = pWin->parent; - } while (pWin->backgroundState == ParentRelative); - (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion, - what); - return; - case BackgroundPixmap: - if (pPrivWin->fastBackground) { - afbTileAreaPPWCopy((DrawablePtr)pWin, - REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), GXcopy, - pPrivWin->pRotatedBackground, ~0); - return; - } else { - afbTileAreaCopy((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), GXcopy, - pWin->background.pixmap, 0, 0, ~0); - return; - } - break; - case BackgroundPixel: - afbReduceRop(GXcopy, pWin->background.pixel, ~0, - pWin->drawable.depth, rrops); - afbSolidFillArea((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), rrops); - return; - } - break; - case PW_BORDER: - if (pWin->borderIsPixel) { - afbReduceRop(GXcopy, pWin->border.pixel, ~0, pWin->drawable.depth, - rrops); - afbSolidFillArea((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), rrops); - return; - } else if (pPrivWin->fastBorder) { - afbTileAreaPPWCopy((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), GXcopy, - pPrivWin->pRotatedBorder, ~0); - return; - } - break; - } - miPaintWindow(pWin, pRegion, what); -} diff --git a/nx-X11/programs/Xserver/afb/afbpolypnt.c b/nx-X11/programs/Xserver/afb/afbpolypnt.c deleted file mode 100644 index 4e9fa0310..000000000 --- a/nx-X11/programs/Xserver/afb/afbpolypnt.c +++ /dev/null @@ -1,148 +0,0 @@ -/* $XFree86: xc/programs/Xserver/afb/afbpolypnt.c,v 3.1 1998/03/20 21:04:56 hohndel Exp $ */ -/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */ -/*********************************************************** - -Copyright (c) 1987 X Consortium - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of the X Consortium shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from the X Consortium. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XConsortium: afbpolypnt.c,v 5.6 94/04/17 20:28:30 dpw Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include "pixmapstr.h" -#include "gcstruct.h" -#include "windowstr.h" -#include "regionstr.h" -#include "scrnintstr.h" - -#include "afb.h" -#include "maskbits.h" - -void -afbPolyPoint(pDrawable, pGC, mode, npt, pptInit) - register DrawablePtr pDrawable; - GCPtr pGC; - int mode; /* Origin or Previous */ - int npt; - xPoint *pptInit; -{ - - register BoxPtr pbox; - register int nbox; - register int d; - - register PixelType *addrl; - PixelType *pBase; - PixelType *pBaseSave; - int nlwidth; - int sizeDst; - int depthDst; - - int nptTmp; - register xPoint *ppt; - - register int x; - register int y; - register unsigned char *rrops; - afbPrivGC *pGCPriv; - - pGCPriv = (afbPrivGC *) pGC->devPrivates[afbGCPrivateIndex].ptr; - - afbGetPixelWidthSizeDepthAndPointer(pDrawable, nlwidth, sizeDst, depthDst, - pBaseSave); - - rrops = pGCPriv->rrops; - if ((mode == CoordModePrevious) && (npt > 1)) - for (ppt = pptInit + 1, nptTmp = npt - 1; --nptTmp >= 0; ppt++) { - ppt->x += (ppt-1)->x; - ppt->y += (ppt-1)->y; - } - - nbox = REGION_NUM_RECTS(pGC->pCompositeClip); - pbox = REGION_RECTS(pGC->pCompositeClip); - for (; --nbox >= 0; pbox++) - for (d = 0, pBase = pBaseSave; d < depthDst; d++, pBase += sizeDst) { /* @@@ NEXT PLANE @@@ */ - addrl = pBase; - - switch (rrops[d]) { - case RROP_BLACK: - for (ppt = pptInit, nptTmp = npt; --nptTmp >= 0; ppt++) { - x = ppt->x + pDrawable->x; - y = ppt->y + pDrawable->y; - if ((x >= pbox->x1) && (x < pbox->x2) && - (y >= pbox->y1) && (y < pbox->y2)) - *afbScanline(addrl, x, y, nlwidth) &= mfbGetrmask(x & PIM); - } - break; - - case RROP_WHITE: - for (ppt = pptInit, nptTmp = npt; --nptTmp >= 0; ppt++) { - x = ppt->x + pDrawable->x; - y = ppt->y + pDrawable->y; - if ((x >= pbox->x1) && (x < pbox->x2) && - (y >= pbox->y1) && (y < pbox->y2)) - *afbScanline(addrl, x, y, nlwidth) |= mfbGetmask(x & PIM); - } - break; - - case RROP_INVERT: - for (ppt = pptInit, nptTmp = npt; --nptTmp >= 0; ppt++) { - x = ppt->x + pDrawable->x; - y = ppt->y + pDrawable->y; - if ((x >= pbox->x1) && (x < pbox->x2) && - (y >= pbox->y1) && (y < pbox->y2)) - *afbScanline(addrl, x, y, nlwidth) ^= mfbGetmask(x & PIM); - } - break; - - case RROP_NOP: - break; - } /* switch */ - } /* for (d = ...) */ -} diff --git a/nx-X11/programs/Xserver/afb/afbpushpxl.c b/nx-X11/programs/Xserver/afb/afbpushpxl.c deleted file mode 100644 index e62181188..000000000 --- a/nx-X11/programs/Xserver/afb/afbpushpxl.c +++ /dev/null @@ -1,259 +0,0 @@ -/* $XFree86: xc/programs/Xserver/afb/afbpushpxl.c,v 3.1 1998/03/20 21:04:56 hohndel Exp $ */ -/*********************************************************** - -Copyright (c) 1987 X Consortium - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of the X Consortium shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from the X Consortium. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XConsortium: afbpushpxl.c,v 5.6 94/04/17 20:28:31 dpw Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include "gcstruct.h" -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "regionstr.h" -#include "maskbits.h" -#include "afb.h" - -/* afbSolidPP is courtesy of xhacks@csri.toronto.edu - - For fillStyle==FillSolid, a monochrome PushPixels can be reduced to - a ROP in the following way: (Note that the ROP is the same as the - result of ROP(src=0x3,dst=0x5)) - - src=0011 0000 0011 - dst=0101 0101 0101 - rop fg=0 fg=1 - GXclear 0x0 0000 0100 0100 0 - GXand 0x1 0001 0100 0101 s&d - GXandReverse 0x2 0010 0100 0110 s&~d - GXcopy 0x3 0011 0100 0111 s - GXandInverted 0x4 0100 0101 0100 ~s&d - GXnoop 0x5 0101 0101 0101 d - GXxor 0x6 0110 0101 0110 s^d - GXor 0x7 0111 0101 0111 s|d - GXnor 0x8 1000 0110 0100 ~s&~d - GXequiv 0x9 1001 0110 0101 ~s^d - GXinvert 0xa 1010 0110 0110 ~d - GXorReverse 0xb 1011 0110 0111 s|~d - GXcopyInverted 0xc 1100 0111 0100 ~s - GXorInverted 0xd 1101 0111 0101 ~s|d - GXnand 0xe 1110 0111 0110 ~s|~d - GXset 0xf 1111 0111 0111 1 - -For src=0: newRop = 0x4|(rop>>2) -For src=1: newRop = 0x4|(rop&3) -*/ - -/* afbSolidPP -- squeegees the forground color of pGC through pBitMap - * into pDrawable. pBitMap is a stencil (dx by dy of it is used, it may - * be bigger) which is placed on the drawable at xOrg, yOrg. Where a 1 bit - * is set in the bitmap, the fill style is put onto the drawable using - * the GC's logical function. The drawable is not changed where the bitmap - * has a zero bit or outside the area covered by the stencil. - */ -void -afbSolidPP(pGC, pBitMap, pDrawable, dx, dy, xOrg, yOrg) - GCPtr pGC; - PixmapPtr pBitMap; - DrawablePtr pDrawable; - int dx, dy, xOrg, yOrg; -{ - unsigned char alu; - RegionRec rgnDst; - DDXPointPtr pptSrc; - BoxRec srcBox; - register DDXPointPtr ppt; - register BoxPtr pbox; - int i; - - if (!pGC->planemask & 1) return; - - /* compute the reduced rop function */ - alu = pGC->alu; - if (!(pGC->fgPixel&1)) alu >>= 2; - alu = (alu & 0x3) | 0x4; - if (alu == GXnoop) return; - - srcBox.x1 = xOrg; - srcBox.y1 = yOrg; - srcBox.x2 = xOrg + dx; - srcBox.y2 = yOrg + dy; - REGION_INIT(pGC->pScreen, &rgnDst, &srcBox, 1); - - /* clip the shape of the dst to the destination composite clip */ - REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, pGC->pCompositeClip); - - if (!REGION_NIL(&rgnDst)) { - i = REGION_NUM_RECTS(&rgnDst); - pptSrc = (DDXPointPtr)ALLOCATE_LOCAL(i * sizeof(DDXPointRec)); - if(pptSrc) { - for (pbox = REGION_RECTS(&rgnDst), ppt = pptSrc; --i >= 0; - pbox++, ppt++) { - ppt->x = pbox->x1 - xOrg; - ppt->y = pbox->y1 - yOrg; - } - afbDoBitblt((DrawablePtr)pBitMap, pDrawable, alu, &rgnDst, pptSrc, - pGC->planemask); - DEALLOCATE_LOCAL(pptSrc); - } - } - REGION_UNINIT(pGC->pScreen, &rgnDst); -} - -#define NPT 128 - -/* afbPushPixels -- squeegees the forground color of pGC through pBitMap - * into pDrawable. pBitMap is a stencil (dx by dy of it is used, it may - * be bigger) which is placed on the drawable at xOrg, yOrg. Where a 1 bit - * is set in the bitmap, the fill style is put onto the drawable using - * the GC's logical function. The drawable is not changed where the bitmap - * has a zero bit or outside the area covered by the stencil. - */ -void -afbPushPixels(pGC, pBitMap, pDrawable, dx, dy, xOrg, yOrg) - GCPtr pGC; - PixmapPtr pBitMap; - DrawablePtr pDrawable; - int dx, dy, xOrg, yOrg; -{ - int h, dxDivPPW, ibEnd; - PixelType *pwLineStart; - register PixelType *pw, *pwEnd; - register PixelType mask; - register int ib; - register PixelType w; - register int ipt; /* index into above arrays */ - Bool fInBox; - DDXPointRec pt[NPT]; - int width[NPT]; - - /* Now scan convert the pixmap and use the result to call fillspans in - * in the drawable with the original GC */ - ipt = 0; - dxDivPPW = dx/PPW; - for (h = 0; h < dy; h++) { - - pw = (PixelType *) - (((char *)(pBitMap->devPrivate.ptr))+(h * pBitMap->devKind)); - pwLineStart = pw; - /* Process all words which are fully in the pixmap */ - - fInBox = FALSE; - pwEnd = pwLineStart + dxDivPPW; - while(pw < pwEnd) { - w = *pw; - mask = mfbGetendtab(1); - for(ib = 0; ib < PPW; ib++) { - if(w & mask) { - if(!fInBox) { - pt[ipt].x = ((pw - pwLineStart) << PWSH) + ib + xOrg; - pt[ipt].y = h + yOrg; - /* start new box */ - fInBox = TRUE; - } - } else { - if(fInBox) { - width[ipt] = ((pw - pwLineStart) << PWSH) + - ib + xOrg - pt[ipt].x; - if (++ipt >= NPT) { - (*pGC->ops->FillSpans)(pDrawable, pGC, NPT, pt, - width, TRUE); - ipt = 0; - } - /* end box */ - fInBox = FALSE; - } - } - mask = SCRRIGHT(mask, 1); - } - pw++; - } - ibEnd = dx & PIM; - if(ibEnd) { - /* Process final partial word on line */ - w = *pw; - mask = mfbGetendtab(1); - for(ib = 0; ib < ibEnd; ib++) { - if(w & mask) { - if(!fInBox) { - /* start new box */ - pt[ipt].x = ((pw - pwLineStart) << PWSH) + ib + xOrg; - pt[ipt].y = h + yOrg; - fInBox = TRUE; - } - } else { - if(fInBox) { - /* end box */ - width[ipt] = ((pw - pwLineStart) << PWSH) + - ib + xOrg - pt[ipt].x; - if (++ipt >= NPT) { - (*pGC->ops->FillSpans)(pDrawable, pGC, NPT, pt, - width, TRUE); - ipt = 0; - } - fInBox = FALSE; - } - } - mask = SCRRIGHT(mask, 1); - } - } - /* If scanline ended with last bit set, end the box */ - if(fInBox) { - width[ipt] = dx + xOrg - pt[ipt].x; - if (++ipt >= NPT) { - (*pGC->ops->FillSpans)(pDrawable, pGC, NPT, pt, width, TRUE); - ipt = 0; - } - } - } - /* Flush any remaining spans */ - if (ipt) { - (*pGC->ops->FillSpans)(pDrawable, pGC, ipt, pt, width, TRUE); - } -} diff --git a/nx-X11/programs/Xserver/afb/afbscrinit.c b/nx-X11/programs/Xserver/afb/afbscrinit.c deleted file mode 100644 index 2e10ad885..000000000 --- a/nx-X11/programs/Xserver/afb/afbscrinit.c +++ /dev/null @@ -1,248 +0,0 @@ -/* $XFree86: xc/programs/Xserver/afb/afbscrinit.c,v 3.4 1998/07/25 08:50:27 dawes Exp $ */ -/*********************************************************** - -Copyright (c) 1987 X Consortium - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of the X Consortium shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from the X Consortium. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XConsortium: afbscrinit.c,v 5.17 94/04/17 20:28:34 dpw Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include /* for xColorItem */ -#include -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "windowstr.h" -#include "resource.h" -#include "colormap.h" -#include "afb.h" -#include "mistruct.h" -#include "dix.h" -#include "mi.h" -#include "mibstore.h" -#include "migc.h" -#include "servermd.h" - -#ifdef PIXMAP_PER_WINDOW -int frameWindowPrivateIndex; -#endif -int afbWindowPrivateIndex; -int afbGCPrivateIndex; -int afbScreenPrivateIndex; - -static unsigned long afbGeneration = 0; - -BSFuncRec afbBSFuncRec = { - afbSaveAreas, - afbRestoreAreas, - (BackingStoreSetClipmaskRgnProcPtr) 0, - (BackingStoreGetImagePixmapProcPtr) 0, - (BackingStoreGetSpansPixmapProcPtr) 0, -}; - -Bool -afbCloseScreen(index, pScreen) - int index; - ScreenPtr pScreen; -{ - int d; - DepthPtr depths = pScreen->allowedDepths; - - for (d = 0; d < pScreen->numDepths; d++) - xfree(depths[d].vids); - xfree(depths); - xfree(pScreen->visuals); - xfree(pScreen->devPrivates[afbScreenPrivateIndex].ptr); - return(TRUE); -} - -Bool -afbCreateScreenResources(pScreen) - ScreenPtr pScreen; -{ - Bool retval; - - pointer oldDevPrivate = pScreen->devPrivate; - - pScreen->devPrivate = pScreen->devPrivates[afbScreenPrivateIndex].ptr; - retval = miCreateScreenResources(pScreen); - - /* Modify screen's pixmap devKind value stored off devPrivate to - * be the width of a single plane in longs rather than the width - * of a chunky screen in longs as incorrectly setup by the mi routine. - */ - ((PixmapPtr)pScreen->devPrivate)->devKind = BitmapBytePad(pScreen->width); - pScreen->devPrivates[afbScreenPrivateIndex].ptr = pScreen->devPrivate; - pScreen->devPrivate = oldDevPrivate; - return(retval); -} - -Bool -afbAllocatePrivates(pScreen, pWinIndex, pGCIndex) - ScreenPtr pScreen; - int *pWinIndex, *pGCIndex; -{ - if (afbGeneration != serverGeneration) { -#ifdef PIXMAP_PER_WINDOW - frameWindowPrivateIndex = AllocateWindowPrivateIndex(); -#endif - afbWindowPrivateIndex = AllocateWindowPrivateIndex(); - afbGCPrivateIndex = AllocateGCPrivateIndex(); - afbGeneration = serverGeneration; - } - if (pWinIndex) - *pWinIndex = afbWindowPrivateIndex; - if (pGCIndex) - *pGCIndex = afbGCPrivateIndex; - - afbScreenPrivateIndex = AllocateScreenPrivateIndex(); - pScreen->GetWindowPixmap = afbGetWindowPixmap; - pScreen->SetWindowPixmap = afbSetWindowPixmap; - return(AllocateWindowPrivate(pScreen, afbWindowPrivateIndex, sizeof(afbPrivWin)) && - AllocateGCPrivate(pScreen, afbGCPrivateIndex, sizeof(afbPrivGC))); -} - -/* dts * (inch/dot) * (25.4 mm / inch) = mm */ -Bool -afbScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width) - register ScreenPtr pScreen; - pointer pbits; /* pointer to screen bitmap */ - int xsize, ysize; /* in pixels */ - int dpix, dpiy; /* dots per inch */ - int width; /* pixel width of frame buffer */ -{ - VisualPtr visuals; - DepthPtr depths; - int nvisuals; - int ndepths; - int rootdepth; - VisualID defaultVisual; - pointer oldDevPrivate; - - rootdepth = 0; - if (!afbInitVisuals(&visuals, &depths, &nvisuals, &ndepths, &rootdepth, - &defaultVisual, 256, 8)) { - ErrorF("afbInitVisuals: FALSE\n"); - return FALSE; - } - if (!afbAllocatePrivates(pScreen,(int *)NULL, (int *)NULL)) { - ErrorF("afbAllocatePrivates: FALSE\n"); - return FALSE; - } - - pScreen->defColormap = (Colormap)FakeClientID(0); - /* whitePixel, blackPixel */ - pScreen->blackPixel = 0; - pScreen->whitePixel = 0; - pScreen->QueryBestSize = afbQueryBestSize; - /* SaveScreen */ - pScreen->GetImage = afbGetImage; - pScreen->GetSpans = afbGetSpans; - pScreen->CreateWindow = afbCreateWindow; - pScreen->DestroyWindow = afbDestroyWindow; - pScreen->PositionWindow = afbPositionWindow; - pScreen->ChangeWindowAttributes = afbChangeWindowAttributes; - pScreen->RealizeWindow = afbMapWindow; - pScreen->UnrealizeWindow = afbUnmapWindow; - pScreen->PaintWindowBackground = afbPaintWindow; - pScreen->PaintWindowBorder = afbPaintWindow; - pScreen->CopyWindow = afbCopyWindow; - pScreen->CreatePixmap = afbCreatePixmap; - pScreen->DestroyPixmap = afbDestroyPixmap; - pScreen->RealizeFont = afbRealizeFont; - pScreen->UnrealizeFont = afbUnrealizeFont; - pScreen->CreateGC = afbCreateGC; - pScreen->CreateColormap = afbInitializeColormap; - pScreen->DestroyColormap = (void (*)())NoopDDA; - pScreen->InstallColormap = afbInstallColormap; - pScreen->UninstallColormap = afbUninstallColormap; - pScreen->ListInstalledColormaps = afbListInstalledColormaps; - pScreen->StoreColors = (void (*)())NoopDDA; - pScreen->ResolveColor = afbResolveColor; - pScreen->BitmapToRegion = afbPixmapToRegion; - oldDevPrivate = pScreen->devPrivate; - if (!miScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width, rootdepth, - ndepths, depths, defaultVisual, nvisuals, visuals)) { - ErrorF("miScreenInit: FALSE\n"); - return FALSE; - } - - pScreen->CloseScreen = afbCloseScreen; - pScreen->CreateScreenResources = afbCreateScreenResources; - pScreen->BackingStoreFuncs = afbBSFuncRec; - - pScreen->devPrivates[afbScreenPrivateIndex].ptr = pScreen->devPrivate; - pScreen->devPrivate = oldDevPrivate; - - return TRUE; -} - -PixmapPtr -afbGetWindowPixmap(pWin) - WindowPtr pWin; -{ -#ifdef PIXMAP_PER_WINDOW - return (PixmapPtr)(pWin->devPrivates[frameWindowPrivateIndex].ptr); -#else - ScreenPtr pScreen = pWin->drawable.pScreen; - - return (* pScreen->GetScreenPixmap)(pScreen); -#endif -} - -void -afbSetWindowPixmap(pWin, pPix) - WindowPtr pWin; - PixmapPtr pPix; -{ -#ifdef PIXMAP_PER_WINDOW - pWin->devPrivates[frameWindowPrivateIndex].ptr = (pointer)pPix; -#else - (* pWin->drawable.pScreen->SetScreenPixmap)(pPix); -#endif -} diff --git a/nx-X11/programs/Xserver/afb/afbsetsp.c b/nx-X11/programs/Xserver/afb/afbsetsp.c deleted file mode 100644 index 3a078ffa9..000000000 --- a/nx-X11/programs/Xserver/afb/afbsetsp.c +++ /dev/null @@ -1,269 +0,0 @@ -/* $XFree86: xc/programs/Xserver/afb/afbsetsp.c,v 3.2 2001/08/01 00:44:47 tsi Exp $ */ -/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */ -/*********************************************************** - -Copyright (c) 1987 X Consortium - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of the X Consortium shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from the X Consortium. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XConsortium: afbsetsp.c,v 5.8 94/04/17 20:28:34 dpw Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include - -#include "misc.h" -#include "regionstr.h" -#include "gcstruct.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "scrnintstr.h" - -#include "afb.h" -#include "maskbits.h" - -#include "servermd.h" - - -/* afbSetScanline -- copies the bits from psrc to the drawable starting at - * (xStart, y) and continuing to (xEnd, y). xOrigin tells us where psrc - * starts on the scanline. (I.e., if this scanline passes through multiple - * boxes, we may not want to start grabbing bits at psrc but at some offset - * further on.) - */ -void -afbSetScanline(y, xOrigin, xStart, xEnd, psrc, alu, pdstBase, widthDst, - sizeDst, depthDst, sizeSrc) - int y; - int xOrigin; /* where this scanline starts */ - int xStart; /* first bit to use from scanline */ - int xEnd; /* last bit to use from scanline + 1 */ - register PixelType *psrc; - register int alu; /* raster op */ - PixelType *pdstBase; /* start of the drawable */ - int widthDst; /* width of drawable in words */ - int sizeDst; - int depthDst; - int sizeSrc; -{ - int w; /* width of scanline in bits */ - register PixelType *pdst; /* where to put the bits */ - register PixelType tmpSrc; /* scratch buffer to collect bits in */ - int dstBit; /* offset in bits from beginning of - * word */ - register int nstart; /* number of bits from first partial */ - register int nend; /* " " last partial word */ - int offSrc; - PixelType startmask, endmask; - PixelType *savePsrc = psrc + ((xStart - xOrigin) >> PWSH); - int nlMiddle, nl; - int d; - - for (d = 0; d < depthDst; d++) { - pdst = afbScanline(pdstBase, xStart, y, widthDst) + sizeDst * d; /* @@@ NEXT PLANE @@@ */ - psrc = savePsrc + sizeSrc * d; /* @@@ NEXT PLANE @@@ */ - offSrc = (xStart - xOrigin) & PIM; - w = xEnd - xStart; - dstBit = xStart & PIM; - - if (dstBit + w <= PPW) { - getandputrop(psrc, offSrc, dstBit, w, pdst, alu) - } else { - maskbits(xStart, w, startmask, endmask, nlMiddle); - if (startmask) - nstart = PPW - dstBit; - else - nstart = 0; - if (endmask) - nend = xEnd & PIM; - else - nend = 0; - if (startmask) { - getandputrop(psrc, offSrc, dstBit, nstart, pdst, alu) - pdst++; - offSrc += nstart; - if (offSrc > PLST) { - psrc++; - offSrc -= PPW; - } - } - nl = nlMiddle; - while (nl--) { - getbits(psrc, offSrc, PPW, tmpSrc); - DoRop(*pdst, alu, tmpSrc, *pdst); - pdst++; - psrc++; - } - if (endmask) { - getandputrop0(psrc, offSrc, nend, pdst, alu); - } - } - } -} - - - -/* SetSpans -- for each span copy pwidth[i] bits from psrc to pDrawable at - * ppt[i] using the raster op from the GC. If fSorted is TRUE, the scanlines - * are in increasing Y order. - * Source bit lines are server scanline padded so that they always begin - * on a word boundary. - */ -void -afbSetSpans(pDrawable, pGC, pcharsrc, ppt, pwidth, nspans, fSorted) - DrawablePtr pDrawable; - GCPtr pGC; - char *pcharsrc; - register DDXPointPtr ppt; - int *pwidth; - int nspans; - int fSorted; -{ - PixelType *psrc = (PixelType *)pcharsrc; - PixelType *pdstBase; /* start of dst bitmap */ - int widthDst; /* width of bitmap in words */ - int sizeDst; - int depthDst; - int sizeSrc = 0; - register BoxPtr pbox, pboxLast, pboxTest; - register DDXPointPtr pptLast; - int alu; - RegionPtr prgnDst; - int xStart, xEnd; - int yMax; - - alu = pGC->alu; - prgnDst = pGC->pCompositeClip; - - pptLast = ppt + nspans; - - yMax = pDrawable->y + (int) pDrawable->height; - afbGetPixelWidthSizeDepthAndPointer(pDrawable, widthDst, sizeDst, depthDst, - pdstBase); - - pbox = REGION_RECTS(prgnDst); - pboxLast = pbox + REGION_NUM_RECTS(prgnDst); - - if(fSorted) { - /* scan lines sorted in ascending order. Because they are sorted, we - * don't have to check each scanline against each clip box. We can be - * sure that this scanline only has to be clipped to boxes at or after the - * beginning of this y-band - */ - pboxTest = pbox; - while(ppt < pptLast) { - pbox = pboxTest; - if(ppt->y >= yMax) - break; - while(pbox < pboxLast) { - if(pbox->y1 > ppt->y) { - /* scanline is before clip box */ - break; - } else if(pbox->y2 <= ppt->y) { - /* clip box is before scanline */ - pboxTest = ++pbox; - continue; - } else if(pbox->x1 > ppt->x + *pwidth) { - /* clip box is to right of scanline */ - break; - } else if(pbox->x2 <= ppt->x) { - /* scanline is to right of clip box */ - pbox++; - continue; - } - - /* at least some of the scanline is in the current clip box */ - xStart = max(pbox->x1, ppt->x); - xEnd = min(ppt->x + *pwidth, pbox->x2); - sizeSrc = PixmapWidthInPadUnits(*pwidth, 1); - afbSetScanline(ppt->y, ppt->x, xStart, xEnd, psrc, alu, pdstBase, - widthDst, sizeDst, depthDst, sizeSrc); - if(ppt->x + *pwidth <= pbox->x2) { - /* End of the line, as it were */ - break; - } else - pbox++; - } - /* We've tried this line against every box; it must be outside them - * all. move on to the next point */ - ppt++; - psrc += sizeSrc * depthDst; - pwidth++; - } - } else { - /* scan lines not sorted. We must clip each line against all the boxes */ - while(ppt < pptLast) { - if(ppt->y >= 0 && ppt->y < yMax) { - for(pbox = REGION_RECTS(prgnDst); pbox< pboxLast; pbox++) { - if(pbox->y1 > ppt->y) { - /* rest of clip region is above this scanline, - * skip it */ - break; - } - if(pbox->y2 <= ppt->y) { - /* clip box is below scanline */ - pbox++; - break; - } - if(pbox->x1 <= ppt->x + *pwidth && - pbox->x2 > ppt->x) { - xStart = max(pbox->x1, ppt->x); - xEnd = min(pbox->x2, ppt->x + *pwidth); - sizeSrc = PixmapWidthInPadUnits(*pwidth, 1); - afbSetScanline(ppt->y, ppt->x, xStart, xEnd, psrc, alu, - pdstBase, widthDst, sizeDst, depthDst, - sizeSrc); - } - - } - } - psrc += sizeSrc * depthDst; - ppt++; - pwidth++; - } - } -} diff --git a/nx-X11/programs/Xserver/afb/afbtegblt.c b/nx-X11/programs/Xserver/afb/afbtegblt.c deleted file mode 100644 index 16f6ca4ea..000000000 --- a/nx-X11/programs/Xserver/afb/afbtegblt.c +++ /dev/null @@ -1,588 +0,0 @@ -/* $XFree86: xc/programs/Xserver/afb/afbtegblt.c,v 3.1 1998/03/20 21:04:57 hohndel Exp $ */ -/* $XConsortium: afbtegblt.c,v 5.14 94/04/17 20:28:35 dpw Exp $ */ -/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */ -/*********************************************************** - -Copyright (c) 1987 X Consortium - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of the X Consortium shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from the X Consortium. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include -#include "afb.h" -#include -#include "dixfontstr.h" -#include "gcstruct.h" -#include "windowstr.h" -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "regionstr.h" -#include "maskbits.h" - -/* - this works for fonts with glyphs <= PPW bits wide. - - This should be called only with a terminal-emulator font; -this means that the FIXED_METRICS flag is set, and that -glyphbounds == charbounds. - - in theory, this goes faster; even if it doesn't, it reduces the -flicker caused by writing a string over itself with image text (since -the background gets repainted per character instead of per string.) -this seems to be important for some converted X10 applications. - - Image text looks at the bits in the glyph and the fg and bg in the -GC. it paints a rectangle, as defined in the protocol dcoument, -and the paints the characters. - -*/ - -#if defined(NO_3_60_CG4) && defined(FASTPUTBITS) && defined(FASTGETBITS) -#define FASTCHARS -#endif - -/* - * this macro "knows" that only characters <= 8 bits wide will - * fit this case (which is why it is independent of GLYPHPADBYTES) - */ - -#if (BITMAP_BIT_ORDER == MSBFirst) && (GLYPHPADBYTES != 4) -#if GLYPHPADBYTES == 1 -#define ShiftAmnt 24 -#else -#define ShiftAmnt 16 -#endif - -/* - * Note: for BITMAP_BIT_ORDER != IMAGE_BYTE_ORDER, SCRRIGHT() evaluates its - * first argument more than once. Thus the imbedded char++ have to be moved. - * (DHD) - */ -#if BITMAP_BIT_ORDER == IMAGE_BYTE_ORDER -#if PPW == 32 -#define GetBits4 c = (*char1++ << ShiftAmnt) | \ - SCRRIGHT (*char2++ << ShiftAmnt, xoff2) | \ - SCRRIGHT (*char3++ << ShiftAmnt, xoff3) | \ - SCRRIGHT (*char4++ << ShiftAmnt, xoff4); -#else /* PPW */ -#define GetBits4 c = ((unsigned long)(*char1++ << ShiftAmnt) << 32 ) | \ - (SCRRIGHT (*char2++ << ShiftAmnt, xoff2) << 32 ) | \ - (SCRRIGHT (*char3++ << ShiftAmnt, xoff3) << 32 ) | \ - (SCRRIGHT (*char4++ << ShiftAmnt, xoff4) << 32 ) | \ - (*char5++ << ShiftAmnt) | \ - SCRRIGHT (*char6++ << ShiftAmnt, xoff6) | \ - SCRRIGHT (*char7++ << ShiftAmnt, xoff7) | \ - SCRRIGHT (*char8++ << ShiftAmnt, xoff8); -#endif /* PPW */ -#else /* BITMAP_BIT_ORDER != IMAGE_BYTE_ORDER */ -#if PPW == 32 -#define GetBits4 c = (*char1++ << ShiftAmnt) | \ - SCRRIGHT (*char2 << ShiftAmnt, xoff2) | \ - SCRRIGHT (*char3 << ShiftAmnt, xoff3) | \ - SCRRIGHT (*char4 << ShiftAmnt, xoff4); \ - char2++; char3++; char4++; -#else /* PPW == 64 */ -#define GetBits4 c = ((unsigned long)(*char1++ << ShiftAmnt) << 32 ) | \ - (SCRRIGHT (*char2 << ShiftAmnt, xoff2) << 32 ) | \ - (SCRRIGHT (*char3 << ShiftAmnt, xoff3) << 32 ) | \ - (SCRRIGHT (*char4 << ShiftAmnt, xoff4) << 32 ) | \ - (*char5++ << ShiftAmnt) | \ - SCRRIGHT (*char6 << ShiftAmnt, xoff6) | \ - SCRRIGHT (*char7 << ShiftAmnt, xoff7) | \ - SCRRIGHT (*char8 << ShiftAmnt, xoff8); \ - char2++; char3++; char4++; char6++; char7++; char8++; -#endif /* PPW */ -#endif /* BITMAP_BIT_ORDER == IMAGE_BYTE_ORDER */ - -#else /* (BITMAP_BIT_ORDER != MSBFirst) || (GLYPHPADBYTES == 4) */ - -#if BITMAP_BIT_ORDER == IMAGE_BYTE_ORDER -#if PPW == 32 -#define GetBits4 c = *char1++ | \ - SCRRIGHT (*char2++, xoff2) | \ - SCRRIGHT (*char3++, xoff3) | \ - SCRRIGHT (*char4++, xoff4); -#else /* PPW == 64 */ -#define GetBits4 c = (unsigned long)(((*char1++) << 64 ) | \ - (SCRRIGHT (*char2++, xoff2) << 64 ) | \ - (SCRRIGHT (*char3++, xoff3) << 64 ) | \ - (SCRRIGHT (*char4++, xoff4) << 64 ) | \ - SCRRIGHT (*char5++, xoff5) | \ - SCRRIGHT (*char6++, xoff6) | \ - SCRRIGHT (*char7++, xoff7) | \ - SCRRIGHT (*char8++, xoff8)); -#endif /* PPW */ -#else /* BITMAP_BIT_ORDER != IMAGE_BYTE_ORDER */ -#if PPW == 32 -#define GetBits4 c = *char1++ | \ - SCRRIGHT (*char2, xoff2) | \ - SCRRIGHT (*char3, xoff3) | \ - SCRRIGHT (*char4, xoff4); \ - char2++; char3++; char4++; -#else /* PPW == 64 */ -#define GetBits4 c = (unsigned long)(((*char1++) << 64 ) | \ - (SCRRIGHT (*char2, xoff2) << 64 ) | \ - (SCRRIGHT (*char3, xoff3) << 64 ) | \ - (SCRRIGHT (*char4, xoff4) << 64 ) | \ - SCRRIGHT (*char5, xoff5) | \ - SCRRIGHT (*char6, xoff6) | \ - SCRRIGHT (*char7, xoff7) | \ - SCRRIGHT (*char8, xoff8)); \ - char2++; char3++; char4++; \ - char5++; char6++; char7++; char8++; -#endif /* PPW */ -#endif /* BITMAP_BIT_ORDER == IMAGE_BYTE_ORDER */ - -#endif /* BITMAP_BIT_ORDER && GLYPHPADBYTES */ - - -#if GLYPHPADBYTES == 1 -typedef unsigned char *glyphPointer; -#define USE_LEFTBITS -#endif - -#if GLYPHPADBYTES == 2 -typedef unsigned short *glyphPointer; -#define USE_LEFTBITS -#endif - -#if GLYPHPADBYTES == 4 -typedef unsigned int *glyphPointer; -#endif - -#ifdef USE_LEFTBITS -#define GetBits1 getleftbits (char1, widthGlyph, c); \ - c &= glyphMask; \ - char1 = (glyphPointer) (((char *) char1) + glyphBytes); -#else -#define GetBits1 c = *char1++; -#endif - -void -afbTEGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) - DrawablePtr pDrawable; - GC *pGC; - int x, y; - unsigned int nglyph; - CharInfoPtr *ppci; /* array of character info */ - pointer pglyphBase; /* start of array of glyphs */ -{ - FontPtr pfont = pGC->font; - int widthDst; - PixelType *pdstBase; /* pointer to longword with top row - of current glyph */ - - int h; /* height of glyph and char */ - register int xpos; /* current x */ - int ypos; /* current y */ - int widthGlyph; - - int hTmp; /* counter for height */ - register PixelType startmask, endmask; - int nfirst; /* used if glyphs spans a longword boundary */ - BoxRec bbox; /* for clipping */ - int widthGlyphs; - int sizeDst; - int depthDst; - PixelType *saveDst; - register PixelType *dst; - register PixelType c; - register int d; - register int xoff1, xoff2, xoff3, xoff4; - register glyphPointer char1, char2, char3, char4; - glyphPointer schar1, schar2, schar3, schar4; -#if PPW == 64 - register int xoff5, xoff6, xoff7, xoff8; - register glyphPointer char5, char6, char7, char8; - glyphPointer schar5, schar6, schar7, schar8; -#endif /* PPW */ - - unsigned char *rrops; -#ifdef USE_LEFTBITS - register PixelType glyphMask; - register PixelType tmpSrc; - register int glyphBytes; -#endif - - afbGetPixelWidthSizeDepthAndPointer(pDrawable, widthDst, sizeDst, depthDst, - pdstBase); - - xpos = x + pDrawable->x; - ypos = y + pDrawable->y; - - widthGlyph = FONTMAXBOUNDS(pfont,characterWidth); - h = FONTASCENT(pfont) + FONTDESCENT(pfont); - - xpos += FONTMAXBOUNDS(pfont,leftSideBearing); - ypos -= FONTASCENT(pfont); - - rrops = ((afbPrivGCPtr) pGC->devPrivates[afbGCPrivateIndex].ptr)->rropOS; - - bbox.x1 = xpos; - bbox.x2 = xpos + (widthGlyph * nglyph); - bbox.y1 = ypos; - bbox.y2 = ypos + h; - - switch (RECT_IN_REGION(pGC->pScreen, pGC->pCompositeClip, &bbox)) { - case rgnPART: - /* this is the WRONG thing to do, but it works. - calling the non-terminal text is easy, but slow, given - what we know about the font. - - the right thing to do is something like: - for each clip rectangle - compute at which row the glyph starts to be in it, - and at which row the glyph ceases to be in it - compute which is the first glyph inside the left - edge, and the last one inside the right edge - draw a fractional first glyph, using only - the rows we know are in - draw all the whole glyphs, using the appropriate rows - draw any pieces of the last glyph, using the right rows - - this way, the code would take advantage of knowing that - all glyphs are the same height and don't overlap. - - one day... - */ - afbImageGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase); - case rgnOUT: - return; - } - pdstBase = afbScanlineDeltaNoBankSwitch(pdstBase, ypos, widthDst); - widthGlyphs = widthGlyph * PGSZB; - -#ifdef USE_LEFTBITS - glyphMask = mfbGetendtab(widthGlyph); - glyphBytes = GLYPHWIDTHBYTESPADDED(*ppci); -#endif - - if (nglyph >= PGSZB && widthGlyphs <= PPW) { - while (nglyph >= PGSZB) { - nglyph -= PGSZB; - xoff1 = xpos & PIM; - xoff2 = widthGlyph; - xoff3 = xoff2 + widthGlyph; - xoff4 = xoff3 + widthGlyph; -#if PPW == 64 - xoff5 = xoff4 + widthGlyph; - xoff6 = xoff5 + widthGlyph; - xoff7 = xoff6 + widthGlyph; - xoff8 = xoff7 + widthGlyph; -#endif /* PPW */ - schar1 = (glyphPointer)FONTGLYPHBITS(pglyphBase,(*ppci++)); - schar2 = (glyphPointer)FONTGLYPHBITS(pglyphBase,(*ppci++)); - schar3 = (glyphPointer)FONTGLYPHBITS(pglyphBase,(*ppci++)); - schar4 = (glyphPointer)FONTGLYPHBITS(pglyphBase,(*ppci++)); -#if PPW == 64 - schar5 = (glyphPointer)FONTGLYPHBITS(pglyphBase,(*ppci++)); - schar6 = (glyphPointer)FONTGLYPHBITS(pglyphBase,(*ppci++)); - schar7 = (glyphPointer)FONTGLYPHBITS(pglyphBase,(*ppci++)); - schar8 = (glyphPointer)FONTGLYPHBITS(pglyphBase,(*ppci++)); -#endif /* PPW */ - - hTmp = h; - saveDst = afbScanlineOffset(pdstBase, (xpos >> PWSH)); /* switch now */ - -#ifndef FASTCHARS - if (xoff1 + widthGlyphs <= PPW) { - maskpartialbits (xoff1, widthGlyphs, startmask); -#endif - for (d = 0; d < depthDst; d++) { - hTmp = h; - dst = saveDst; - saveDst += sizeDst; /* @@@ NEXT PLANE @@@ */ - - switch (rrops[d]) { - case RROP_BLACK: - while (hTmp--) { -#ifdef FASTCHARS - FASTPUTBITS(0, xoff1, widthGlyphs, dst); -#else - *(dst) &= ~startmask; -#endif - afbScanlineInc(dst, widthDst); - } - break; - case RROP_WHITE: - while (hTmp--) { -#ifdef FASTCHARS - FASTPUTBITS(~0, xoff1, widthGlyphs, dst); -#else - *(dst) |= startmask; -#endif - afbScanlineInc(dst, widthDst); - } - break; - case RROP_INVERT: - char1 = schar1; - char2 = schar2; - char3 = schar3; - char4 = schar4; - /* XXX */ - while (hTmp--) { - GetBits4 -#ifdef FASTCHARS -# if BITMAP_BIT_ORDER == MSBFirst - c >>= PPW - widthGlyphs; -# endif - FASTPUTBITS(~c, xoff1, widthGlyphs, dst); -#else - *(dst) = ((*dst) & ~startmask) | (~SCRRIGHT(c, xoff1) & startmask); -#endif - afbScanlineInc(dst, widthDst); - } - break; - case RROP_COPY: - char1 = schar1; - char2 = schar2; - char3 = schar3; - char4 = schar4; - - while (hTmp--) { - GetBits4 -#ifdef FASTCHARS -# if BITMAP_BIT_ORDER == MSBFirst - c >>= PPW - widthGlyphs; -#endif - FASTPUTBITS(c, xoff1, widthGlyphs, dst); -#else - *(dst) = ((*dst) & ~startmask) | (SCRRIGHT(c, xoff1) & startmask); -#endif - afbScanlineInc(dst, widthDst); - } - break; - case RROP_NOP: - break; - } /* switch (rrops[d]) */ - } /* for (d = ... ) */ -#ifndef FASTCHARS - } else { - maskPPWbits (xoff1, widthGlyphs, startmask, endmask); - nfirst = PPW - xoff1; - for (d = 0; d < depthDst; d++) { - hTmp = h; - dst = saveDst; - saveDst += sizeDst; /* @@@ NEXT PLANE @@@ */ - - switch (rrops[d]) { - case RROP_BLACK: - while (hTmp--) { - dst[0] &= ~startmask; - dst[1] &= ~endmask; - afbScanlineInc(dst, widthDst); - } - break; - case RROP_WHITE: - while (hTmp--) { - dst[0] |= startmask; - dst[1] |= endmask; - afbScanlineInc(dst, widthDst); - } - break; - case RROP_INVERT: - char1 = schar1; - char2 = schar2; - char3 = schar3; - char4 = schar4; - - while (hTmp--) { - GetBits4 - dst[0] = (dst[0] & ~startmask) | (~SCRRIGHT(c,xoff1) & startmask); - dst[1] = (dst[1] & ~endmask) | (~SCRLEFT(c,nfirst) & endmask); - afbScanlineInc(dst, widthDst); - } - break; - case RROP_COPY: - char1 = schar1; - char2 = schar2; - char3 = schar3; - char4 = schar4; - - while (hTmp--) { - GetBits4 - dst[0] = (dst[0] & ~startmask) | (SCRRIGHT(c,xoff1) & startmask); - dst[1] = (dst[1] & ~endmask) | (SCRLEFT(c,nfirst) & endmask); - afbScanlineInc(dst, widthDst); - } - break; - - case RROP_NOP: - break; - } /* switch */ - } /* for (d = ... ) */ - } -#endif - xpos += widthGlyphs; - } - } - - while(nglyph--) { - xoff1 = xpos & PIM; - schar1 = (glyphPointer) FONTGLYPHBITS(pglyphBase,(*ppci++)); - hTmp = h; - saveDst = afbScanlineOffset(pdstBase, (xpos >> PWSH)); - - if (xoff1 + widthGlyph <= PPW) { - maskpartialbits (xoff1, widthGlyph, startmask); - - for (d = 0; d < depthDst; d++) { - hTmp = h; - dst = saveDst; - saveDst += sizeDst; /* @@@ NEXT PLANE @@@ */ - char1 = schar1; - - switch (rrops[d]) { - case RROP_BLACK: - while (hTmp--) { - (*dst) &= ~startmask; - afbScanlineInc(dst, widthDst); - } - break; - case RROP_WHITE: - while (hTmp--) { - (*dst) |= startmask; - afbScanlineInc(dst, widthDst); - } - break; - case RROP_INVERT: - while (hTmp--) { -#ifdef FASTCHARS -#ifdef USE_LEFTBITS - FASTGETBITS (char1,0,widthGlyph,c); - char1 = (glyphPointer) (((char *) char1) + glyphBytes); -#else - c = *char1++; -#if BITMAP_BIT_ORDER == MSBFirst - c >>= PPW - widthGlyph; -#endif -#endif - FASTPUTBITS (~c,xoff1,widthGlyph,dst); -#else - GetBits1 - (*dst) = ((*dst) & ~startmask) | (~SCRRIGHT(c, xoff1) & startmask); -#endif - afbScanlineInc(dst, widthDst); - } - break; - case RROP_COPY: - while (hTmp--) { -#ifdef FASTCHARS -#ifdef USE_LEFTBITS - FASTGETBITS (char1,0,widthGlyph,c); - char1 = (glyphPointer) (((char *) char1) + glyphBytes); -#else - c = *char1++; -#if BITMAP_BIT_ORDER == MSBFirst - c >>= PPW - widthGlyph; -#endif -#endif - FASTPUTBITS (c,xoff1,widthGlyph,dst); -#else - GetBits1 - (*dst) = ((*dst) & ~startmask) | (SCRRIGHT(c, xoff1) & startmask); -#endif - afbScanlineInc(dst, widthDst); - } - break; - case RROP_NOP: - break; - } /* switch */ - } /* for (d = ...) */ - } else { - maskPPWbits (xoff1, widthGlyph, startmask, endmask); - nfirst = PPW - xoff1; - - for (d = 0; d < depthDst; d++) { - hTmp = h; - dst = saveDst; - saveDst += sizeDst; /* @@@ NEXT PLANE @@@ */ - char1 = schar1; - - switch (rrops[d]) { - case RROP_BLACK: - while (hTmp--) { - dst[0] &= ~startmask; - dst[1] &= ~endmask; - afbScanlineInc(dst, widthDst); - } - break; - case RROP_WHITE: - while (hTmp--) { - dst[0] |= startmask; - dst[1] |= endmask; - afbScanlineInc(dst, widthDst); - } - break; - case RROP_INVERT: - while (hTmp--) { - GetBits1 - dst[0] = (dst[0] & ~startmask) | (~SCRRIGHT(c,xoff1) & startmask); - dst[1] = (dst[1] & ~endmask) | (~SCRLEFT(c,nfirst) & endmask); - afbScanlineInc(dst, widthDst); - } - break; - case RROP_COPY: - while (hTmp--) { - GetBits1 - dst[0] = (dst[0] & ~startmask) | (SCRRIGHT(c,xoff1) & startmask); - dst[1] = (dst[1] & ~endmask) | (SCRLEFT(c,nfirst) & endmask); - afbScanlineInc(dst, widthDst); - } - break; - case RROP_NOP: - break; - } /* switch */ - } /* for (d = ...) */ - } - - xpos += widthGlyph; - } -} diff --git a/nx-X11/programs/Xserver/afb/afbtile.c b/nx-X11/programs/Xserver/afb/afbtile.c deleted file mode 100644 index 11d76abdf..000000000 --- a/nx-X11/programs/Xserver/afb/afbtile.c +++ /dev/null @@ -1,859 +0,0 @@ -/* $XFree86: xc/programs/Xserver/afb/afbtile.c,v 3.3tsi Exp $ */ -/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */ -/*********************************************************** - -Copyright (c) 1987 X Consortium - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of the X Consortium shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from the X Consortium. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XConsortium: afbtile.c,v 5.8 94/04/17 20:28:36 dpw Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include - -#include "windowstr.h" -#include "regionstr.h" -#include "pixmapstr.h" -#include "scrnintstr.h" - -#include "afb.h" - -#include "maskbits.h" - -#include "mergerop.h" -/* - - the boxes are already translated. - - NOTE: - iy = ++iy < tileHeight ? iy : 0 -is equivalent to iy%= tileheight, and saves a division. -*/ - -/* - tile area with a PPW bit wide pixmap -*/ -void -MROP_NAME(afbTileAreaPPW)(pDraw, nbox, pbox, alu, ptile, planemask) - DrawablePtr pDraw; - int nbox; - BoxPtr pbox; - int alu; - PixmapPtr ptile; - unsigned long planemask; -{ - register PixelType *psrc; - /* pointer to bits in tile, if needed */ - int tileHeight; /* height of the tile */ - register PixelType srcpix; - int nlwidth; /* width in longwords of the drawable */ - int w; /* width of current box */ - MROP_DECLARE_REG () - register int h; /* height of current box */ - register int nlw; /* loop version of nlwMiddle */ - register PixelType *p; /* pointer to bits we're writing */ - int sizeDst; - int depthDst; - register int d; - PixelType startmask; - PixelType endmask; /* masks for reggedy bits at either end of line */ - int nlwMiddle; /* number of longwords between sides of boxes */ - int nlwExtra; /* to get from right of box to left of next span */ - register int iy; /* index of current scanline in tile */ - PixelType *pbits; /* pointer to start of drawable */ - PixelType *saveP; - PixelType *pSaveSrc; - int saveH; - int saveIY; - - afbGetPixelWidthSizeDepthAndPointer(pDraw, nlwidth, sizeDst, depthDst, - pbits); - - MROP_INITIALIZE(alu,~0) - - tileHeight = ptile->drawable.height; - pSaveSrc = (PixelType *)(ptile->devPrivate.ptr); - - while (nbox--) { - w = pbox->x2 - pbox->x1; - saveH = pbox->y2 - pbox->y1; - saveIY = pbox->y1 % tileHeight; - saveP = afbScanline(pbits, pbox->x1, pbox->y1, nlwidth); - psrc = pSaveSrc; - - if (((pbox->x1 & PIM) + w) < PPW) { - maskpartialbits(pbox->x1, w, startmask); - nlwExtra = nlwidth; - for (d = 0; d < depthDst; d++, saveP += sizeDst, psrc += tileHeight) { /* @@@ NEXT PLANE @@@ */ - if (!(planemask & (1 << d))) - continue; - - p = saveP; - h = saveH; - iy = saveIY; - - while (h--) { - srcpix = psrc[iy]; - iy++; - if (iy == tileHeight) - iy = 0; - *p = MROP_MASK(srcpix,*p,startmask); - afbScanlineInc(p, nlwExtra); - } - } - } else { - maskbits(pbox->x1, w, startmask, endmask, nlwMiddle); - - for (d = 0; d < depthDst; d++, saveP += sizeDst, psrc += tileHeight) { /* @@@ NEXT PLANE @@@ */ - if (!(planemask & (1 << d))) - continue; - - p = saveP; - h = saveH; - iy = saveIY; - nlwExtra = nlwidth - nlwMiddle; - - if (startmask && endmask) { - nlwExtra -= 1; - while (h--) { - srcpix = psrc[iy]; - iy++; - if (iy == tileHeight) - iy = 0; - nlw = nlwMiddle; - *p = MROP_MASK (srcpix,*p,startmask); - p++; - while (nlw--) { - *p = MROP_SOLID(srcpix,*p); - p++; - } - - *p = MROP_MASK(srcpix,*p,endmask); - afbScanlineInc(p, nlwExtra); - } - } else if (startmask && !endmask) { - nlwExtra -= 1; - while (h--) { - srcpix = psrc[iy]; - iy++; - if (iy == tileHeight) - iy = 0; - nlw = nlwMiddle; - *p = MROP_MASK(srcpix,*p,startmask); - p++; - while (nlw--) { - *p = MROP_SOLID(srcpix,*p); - p++; - } - afbScanlineInc(p, nlwExtra); - } - } else if (!startmask && endmask) { - while (h--) { - srcpix = psrc[iy]; - iy++; - if (iy == tileHeight) - iy = 0; - nlw = nlwMiddle; - while (nlw--) { - *p = MROP_SOLID(srcpix,*p); - p++; - } - - *p = MROP_MASK(srcpix,*p,endmask); - afbScanlineInc(p, nlwExtra); - } - } else { /* no ragged bits at either end */ - while (h--) { - srcpix = psrc[iy]; - iy++; - if (iy == tileHeight) - iy = 0; - nlw = nlwMiddle; - while (nlw--) { - *p = MROP_SOLID (srcpix,*p); - p++; - } - afbScanlineInc(p, nlwExtra); - } - } - } /* for (d = ...) */ - } - pbox++; - } -} - -void -MROP_NAME(afbTileArea)(pDraw, nbox, pbox, alu, pTile, xOff, yOff, planemask) - DrawablePtr pDraw; - int nbox; - BoxPtr pbox; - int alu; - PixmapPtr pTile; - int xOff; - int yOff; - unsigned long planemask; -{ - register PixelType *psrc; - /* pointer to bits in tile, if needed */ - int nlwidth; /* width in longwords of the drawable */ - MROP_DECLARE_REG () - register int h; /* height of current box */ - register PixelType *pdst; /* pointer to bits we're writing */ - register PixelType tmpsrc; -#if (MROP) != Mcopy - register PixelType tmpdst; -#endif - int sizeDst; - int depthDst; - int sizeTile; - int tileLine; - int iline; - int w, width, x, xSrc, ySrc, srcStartOver, nend; - int tlwidth, rem, tileWidth, tileHeight, endinc; - int saveW; - PixelType *psrcT; - int d; - int nstart; - PixelType startmask; - PixelType endmask; /* masks for reggedy bits at either end of line */ - int nlMiddle; /* number of longwords between sides of boxes */ - int iy; - PixelType *pBase; /* pointer to start of drawable */ - PixelType *saveP; - PixelType *pStartDst; - PixelType *pStartTile; - int saveH; - - afbGetPixelWidthSizeDepthAndPointer(pDraw, nlwidth, sizeDst, depthDst, - pBase); - - MROP_INITIALIZE(alu,~0) - - tileHeight = pTile->drawable.height; - tileWidth = pTile->drawable.width; - tlwidth = pTile->devKind / sizeof (PixelType); - sizeTile = tlwidth * tileHeight; - - xSrc = pDraw->x + ((xOff % tileWidth) - tileWidth); - ySrc = pDraw->y + ((yOff % tileHeight) - tileHeight); - - while (nbox--) { - saveW = pbox->x2 - pbox->x1; - iline = (pbox->y1 - ySrc) % tileHeight; - psrcT = (PixelType *) pTile->devPrivate.ptr; - tileLine = iline * tlwidth; - saveH = pbox->y2 - pbox->y1; - saveP = afbScanline(pBase, pbox->x1, pbox->y1, nlwidth); - - for (d = 0; d < depthDst; d++, psrcT += sizeTile, saveP += sizeDst) { /* @@@ NEXT PLANE @@@ */ - if (!(planemask & (1 << d))) - continue; - - h = saveH; - pStartDst = saveP; - pStartTile = psrcT + tileLine; - iy = iline; - - while (h--) { - x = pbox->x1; - width = saveW; - pdst = pStartDst; - while(width > 0) { - psrc = pStartTile; - w = min(tileWidth, width); - if((rem = (x - xSrc) % tileWidth) != 0) { - /* if we're in the middle of the tile, get - as many bits as will finish the span, or - as many as will get to the left edge of the tile, - or a longword worth, starting at the appropriate - offset in the tile. - */ - w = min(min(tileWidth - rem, width), BITMAP_SCANLINE_PAD); - endinc = rem / BITMAP_SCANLINE_PAD; - - getbits ((psrc+endinc), (rem&PIM), w, tmpsrc); -#if (MROP) != Mcopy - getbits (pdst, (x & PIM), w, tmpdst); - tmpsrc = DoMergeRop (tmpsrc, tmpdst); -#endif - putbits (tmpsrc, (x & PIM), w, pdst); - - if((x & PIM) + w >= PPW) - pdst++; - } else if(((x & PIM) + w) < PPW) { - /* doing < PPW bits is easy, and worth special-casing */ - tmpsrc = *psrc; -#if (MROP) != Mcopy - getbits (pdst, (x & PIM), w, tmpdst); - tmpsrc = DoMergeRop (tmpsrc, tmpdst); -#endif - putbits (tmpsrc, (x & PIM), w, pdst); - } else { - /* start at the left edge of the tile, - and put down as much as we can - */ - maskbits(x, w, startmask, endmask, nlMiddle); - - if (startmask) - nstart = PPW - (x & PIM); - else - nstart = 0; - if (endmask) - nend = (x + w) & PIM; - else - nend = 0; - - srcStartOver = nstart > PLST; - - if(startmask) { - tmpsrc = *psrc; -#if (MROP) != Mcopy - getbits (pdst, (x & PIM), nstart, tmpdst); - tmpsrc = DoMergeRop (tmpsrc, tmpdst); -#endif - putbits (tmpsrc, (x & PIM), nstart, pdst); - pdst++; - if(srcStartOver) - psrc++; - } - - while(nlMiddle--) { - getbits (psrc, nstart, PPW, tmpsrc); -#if (MROP) != Mcopy - tmpdst = *pdst; - tmpsrc = DoMergeRop (tmpsrc, tmpdst); -#endif - *pdst++ = tmpsrc; - /*putbits (tmpsrc, 0, PPW, pdst); - pdst++;*/ - psrc++; - } - - if(endmask) { - getbits (psrc, nstart, nend, tmpsrc); -#if (MROP) != Mcopy - tmpdst = *pdst; - tmpsrc = DoMergeRop (tmpsrc, tmpdst); -#endif - putbits (tmpsrc, 0, nend, pdst); - } - } - x += w; - width -= w; - } /* while (width > 0) */ - - pStartDst += nlwidth; - if (++iy >= tileHeight) { - iy = 0; - pStartTile = psrcT; - } else - pStartTile += tlwidth; - - } /* while (h) */ - } /* for (d = ... ) */ - pbox++; - } /* for each box */ -} - -void -MROP_NAME(afbOpaqueStippleAreaPPW)(pDraw, nbox, pbox, alu, ptile, - rropsOS, planemask) - DrawablePtr pDraw; - int nbox; - BoxPtr pbox; - int alu; - PixmapPtr ptile; - register unsigned char *rropsOS; - unsigned long planemask; -{ - register PixelType *psrc; - /* pointer to bits in tile, if needed */ - int tileHeight; /* height of the tile */ - register PixelType srcpix = 0; - int nlwidth; /* width in longwords of the drawable */ - int w; /* width of current box */ - MROP_DECLARE_REG () - register int h; /* height of current box */ - register int nlw; /* loop version of nlwMiddle */ - register PixelType *p; /* pointer to bits we're writing */ - int sizeDst; - int depthDst; - register int d; - PixelType startmask; - PixelType endmask; /* masks for reggedy bits at either end of line */ - int nlwMiddle; /* number of longwords between sides of boxes */ - int nlwExtra; /* to get from right of box to left of next span */ - register int iy; /* index of current scanline in tile */ - PixelType *pbits; /* pointer to start of drawable */ - PixelType *saveP; - int saveH; - int saveIY; - - afbGetPixelWidthSizeDepthAndPointer(pDraw, nlwidth, sizeDst, depthDst, - pbits); - - MROP_INITIALIZE(alu,~0) - - tileHeight = ptile->drawable.height; - psrc = (PixelType *)(ptile->devPrivate.ptr); - - while (nbox--) { - w = pbox->x2 - pbox->x1; - saveH = pbox->y2 - pbox->y1; - saveIY = pbox->y1 % tileHeight; - saveP = afbScanline(pbits, pbox->x1, pbox->y1, nlwidth); - - if ( ((pbox->x1 & PIM) + w) < PPW) { - maskpartialbits(pbox->x1, w, startmask); - nlwExtra = nlwidth; - for (d = 0; d < depthDst; d++, saveP += sizeDst) { /* @@@ NEXT PLANE @@@ */ - if (!(planemask & (1 << d))) - continue; - - p = saveP; - h = saveH; - iy = saveIY; - - while (h--) { - switch (rropsOS[d]) { - case RROP_BLACK: - srcpix = 0; - break; - case RROP_WHITE: - srcpix = ~0; - break; - case RROP_COPY: - srcpix = psrc[iy]; - break; - case RROP_INVERT: - srcpix = ~psrc[iy]; - break; - } - iy++; - if (iy == tileHeight) - iy = 0; - *p = MROP_MASK(srcpix,*p,startmask); - afbScanlineInc(p, nlwExtra); - } - } - } else { - maskbits(pbox->x1, w, startmask, endmask, nlwMiddle); - - for (d = 0; d < depthDst; d++, saveP += sizeDst) { /* @@@ NEXT PLANE @@@ */ - if (!(planemask & (1 << d))) - continue; - - p = saveP; - h = saveH; - iy = saveIY; - nlwExtra = nlwidth - nlwMiddle; - - if (startmask && endmask) { - nlwExtra -= 1; - while (h--) { - switch (rropsOS[d]) { - case RROP_BLACK: - srcpix = 0; - break; - case RROP_WHITE: - srcpix = ~0; - break; - case RROP_COPY: - srcpix = psrc[iy]; - break; - case RROP_INVERT: - srcpix = ~psrc[iy]; - break; - } - iy++; - if (iy == tileHeight) - iy = 0; - nlw = nlwMiddle; - *p = MROP_MASK (srcpix,*p,startmask); - p++; - while (nlw--) { - *p = MROP_SOLID(srcpix,*p); - p++; - } - - *p = MROP_MASK(srcpix,*p,endmask); - afbScanlineInc(p, nlwExtra); - } - } else if (startmask && !endmask) { - nlwExtra -= 1; - while (h--) { - switch (rropsOS[d]) { - case RROP_BLACK: - srcpix = 0; - break; - case RROP_WHITE: - srcpix = ~0; - break; - case RROP_COPY: - srcpix = psrc[iy]; - break; - case RROP_INVERT: - srcpix = ~psrc[iy]; - break; - } - iy++; - if (iy == tileHeight) - iy = 0; - nlw = nlwMiddle; - *p = MROP_MASK(srcpix,*p,startmask); - p++; - while (nlw--) { - *p = MROP_SOLID(srcpix,*p); - p++; - } - afbScanlineInc(p, nlwExtra); - } - } else if (!startmask && endmask) { - while (h--) { - switch (rropsOS[d]) { - case RROP_BLACK: - srcpix = 0; - break; - case RROP_WHITE: - srcpix = ~0; - break; - case RROP_COPY: - srcpix = psrc[iy]; - break; - case RROP_INVERT: - srcpix = ~psrc[iy]; - break; - } - iy++; - if (iy == tileHeight) - iy = 0; - nlw = nlwMiddle; - while (nlw--) { - *p = MROP_SOLID(srcpix,*p); - p++; - } - - *p = MROP_MASK(srcpix,*p,endmask); - afbScanlineInc(p, nlwExtra); - } - } else { /* no ragged bits at either end */ - while (h--) { - switch (rropsOS[d]) { - case RROP_BLACK: - srcpix = 0; - break; - case RROP_WHITE: - srcpix = ~0; - break; - case RROP_COPY: - srcpix = psrc[iy]; - break; - case RROP_INVERT: - srcpix = ~psrc[iy]; - break; - } - iy++; - if (iy == tileHeight) - iy = 0; - nlw = nlwMiddle; - while (nlw--) { - *p = MROP_SOLID (srcpix,*p); - p++; - } - afbScanlineInc(p, nlwExtra); - } - } - } /* for (d = ...) */ - } - pbox++; - } -} - -void -MROP_NAME(afbOpaqueStippleArea)(pDraw, nbox, pbox, alu, pTile, xOff, yOff, - rropsOS, planemask) - DrawablePtr pDraw; - int nbox; - BoxPtr pbox; - int alu; - PixmapPtr pTile; - int xOff; - int yOff; - register unsigned char *rropsOS; - unsigned long planemask; -{ - register PixelType *psrc; - /* pointer to bits in tile, if needed */ - int nlwidth; /* width in longwords of the drawable */ - MROP_DECLARE_REG () - register int h; /* height of current box */ - register PixelType *pdst; /* pointer to bits we're writing */ - register PixelType tmpsrc = 0; -#if (MROP) != Mcopy - register PixelType tmpdst; -#endif - int sizeDst; - int depthDst; - int tileLine; - int iline; - int w, width, x, xSrc, ySrc, srcStartOver, nend; - int tlwidth, rem, tileWidth, tileHeight, endinc; - int saveW; - PixelType *psrcT; - int d; - int nstart; - PixelType startmask; - PixelType endmask; /* masks for reggedy bits at either end of line */ - int nlMiddle; /* number of longwords between sides of boxes */ - int iy; - PixelType *pBase; /* pointer to start of drawable */ - PixelType *saveP; - PixelType *pStartDst; - PixelType *pStartTile; - int saveH; - - afbGetPixelWidthSizeDepthAndPointer(pDraw, nlwidth, sizeDst, depthDst, - pBase); - - MROP_INITIALIZE(alu,~0) - - tileHeight = pTile->drawable.height; - tileWidth = pTile->drawable.width; - tlwidth = pTile->devKind / sizeof (PixelType); - - xSrc = pDraw->x + ((xOff % tileWidth) - tileWidth); - ySrc = pDraw->y + ((yOff % tileHeight) - tileHeight); - - while (nbox--) { - saveW = pbox->x2 - pbox->x1; - iline = (pbox->y1 - ySrc) % tileHeight; - psrcT = (PixelType *) pTile->devPrivate.ptr; - tileLine = iline * tlwidth; - saveH = pbox->y2 - pbox->y1; - saveP = afbScanline(pBase, pbox->x1, pbox->y1, nlwidth); - - for (d = 0; d < depthDst; d++, saveP += sizeDst) { /* @@@ NEXT PLANE @@@ */ - if (!(planemask & (1 << d))) - continue; - - h = saveH; - pStartDst = saveP; - pStartTile = psrcT + tileLine; - iy = iline; - - while (h--) { - x = pbox->x1; - width = saveW; - pdst = pStartDst; - while(width > 0) { - psrc = pStartTile; - w = min(tileWidth, width); - if((rem = (x - xSrc) % tileWidth) != 0) { - /* if we're in the middle of the tile, get - as many bits as will finish the span, or - as many as will get to the left edge of the tile, - or a longword worth, starting at the appropriate - offset in the tile. - */ - w = min(min(tileWidth - rem, width), BITMAP_SCANLINE_PAD); - endinc = rem / BITMAP_SCANLINE_PAD; - - switch (rropsOS[d]) { - case RROP_BLACK: - tmpsrc = 0; - break; - case RROP_WHITE: - tmpsrc = ~0; - break; - - case RROP_COPY: - getbits ((psrc+endinc), (rem&PIM), w, tmpsrc); - break; - - case RROP_INVERT: - getbits ((psrc+endinc), (rem&PIM), w, tmpsrc); - tmpsrc = ~tmpsrc; - break; - } -#if (MROP) != Mcopy - getbits (pdst, (x & PIM), w, tmpdst); - tmpsrc = DoMergeRop (tmpsrc, tmpdst); -#endif - putbits (tmpsrc, (x & PIM), w, pdst); - - if((x & PIM) + w >= PPW) - pdst++; - } else if(((x & PIM) + w) < PPW) { - /* doing < PPW bits is easy, and worth special-casing */ - switch (rropsOS[d]) { - case RROP_BLACK: - tmpsrc = 0; - break; - case RROP_WHITE: - tmpsrc = ~0; - break; - case RROP_COPY: - tmpsrc = *psrc; - break; - case RROP_INVERT: - tmpsrc = ~*psrc; - break; - } -#if (MROP) != Mcopy - getbits (pdst, (x & PIM), w, tmpdst); - tmpsrc = DoMergeRop (tmpsrc, tmpdst); -#endif - putbits (tmpsrc, (x & PIM), w, pdst); - } else { - /* start at the left edge of the tile, - and put down as much as we can - */ - maskbits(x, w, startmask, endmask, nlMiddle); - - if (startmask) - nstart = PPW - (x & PIM); - else - nstart = 0; - if (endmask) - nend = (x + w) & PIM; - else - nend = 0; - - srcStartOver = nstart > PLST; - - if(startmask) { - switch (rropsOS[d]) { - case RROP_BLACK: - tmpsrc = 0; - break; - case RROP_WHITE: - tmpsrc = ~0; - break; - case RROP_COPY: - tmpsrc = *psrc; - break; - case RROP_INVERT: - tmpsrc = ~*psrc; - break; - } -#if (MROP) != Mcopy - getbits (pdst, (x & PIM), nstart, tmpdst); - tmpsrc = DoMergeRop (tmpsrc, tmpdst); -#endif - putbits (tmpsrc, (x & PIM), nstart, pdst); - pdst++; - if(srcStartOver) - psrc++; - } - - while(nlMiddle--) { - switch (rropsOS[d]) { - case RROP_BLACK: - tmpsrc = 0; - break; - case RROP_WHITE: - tmpsrc = ~0; - break; - case RROP_COPY: - getbits (psrc, nstart, PPW, tmpsrc); - break; - case RROP_INVERT: - getbits (psrc, nstart, PPW, tmpsrc); - tmpsrc = ~tmpsrc; - break; - } -#if (MROP) != Mcopy - tmpdst = *pdst; - tmpsrc = DoMergeRop (tmpsrc, tmpdst); -#endif - *pdst++ = tmpsrc; - /*putbits (tmpsrc, 0, PPW, pdst); - pdst++; */ - psrc++; - } - - if(endmask) { - switch (rropsOS[d]) { - case RROP_BLACK: - tmpsrc = 0; - break; - case RROP_WHITE: - tmpsrc = ~0; - break; - - case RROP_COPY: - getbits (psrc, nstart, nend, tmpsrc); - break; - - case RROP_INVERT: - getbits (psrc, nstart, nend, tmpsrc); - tmpsrc = ~tmpsrc; - break; - } -#if (MROP) != Mcopy - tmpdst = *pdst; - tmpsrc = DoMergeRop (tmpsrc, tmpdst); -#endif - putbits (tmpsrc, 0, nend, pdst); - } - } - x += w; - width -= w; - } /* while (width > 0) */ - - pStartDst += nlwidth; - if (++iy >= tileHeight) { - iy = 0; - pStartTile = psrcT; - } else - pStartTile += tlwidth; - - } /* while (h) */ - } /* for (d = ... ) */ - pbox++; - } /* for each box */ -} diff --git a/nx-X11/programs/Xserver/afb/afbwindow.c b/nx-X11/programs/Xserver/afb/afbwindow.c deleted file mode 100644 index 443dd5aed..000000000 --- a/nx-X11/programs/Xserver/afb/afbwindow.c +++ /dev/null @@ -1,318 +0,0 @@ -/* $XFree86: xc/programs/Xserver/afb/afbwindow.c,v 3.0 1996/08/18 01:45:58 dawes Exp $ */ -/* $XConsortium: afbwindow.c,v 5.14 94/04/17 20:28:36 dpw Exp $ */ -/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */ -/*********************************************************** - -Copyright (c) 1987 X Consortium - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of the X Consortium shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from the X Consortium. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include "scrnintstr.h" -#include "windowstr.h" -#include "afb.h" -#include "mistruct.h" -#include "regionstr.h" -#include "maskbits.h" - -Bool -afbCreateWindow(pWin) - register WindowPtr pWin; -{ - register afbPrivWin *pPrivWin; - - pPrivWin = (afbPrivWin *)(pWin->devPrivates[afbWindowPrivateIndex].ptr); - pPrivWin->pRotatedBorder = NullPixmap; - pPrivWin->pRotatedBackground = NullPixmap; - pPrivWin->fastBackground = FALSE; - pPrivWin->fastBorder = FALSE; -#ifdef PIXMAP_PER_WINDOW - pWin->devPrivates[frameWindowPrivateIndex].ptr = - pWin->pDrawable.pScreen->devPrivates[afbScreenPrivateIndex].ptr; -#endif - - return (TRUE); -} - -/* This always returns true, because Xfree can't fail. It might be possible - * on some devices for Destroy to fail */ -Bool -afbDestroyWindow(pWin) - WindowPtr pWin; -{ - register afbPrivWin *pPrivWin; - - pPrivWin = (afbPrivWin *)(pWin->devPrivates[afbWindowPrivateIndex].ptr); - - if (pPrivWin->pRotatedBorder) - (*pWin->drawable.pScreen->DestroyPixmap)(pPrivWin->pRotatedBorder); - if (pPrivWin->pRotatedBackground) - (*pWin->drawable.pScreen->DestroyPixmap)(pPrivWin->pRotatedBackground); - - return (TRUE); -} - -/*ARGSUSED*/ -Bool -afbMapWindow(pWindow) - WindowPtr pWindow; -{ - return (TRUE); -} - -/* (x, y) is the upper left corner of the window on the screen - do we really need to pass this? (is it a;ready in pWin->absCorner?) - we only do the rotation for pixmaps that are 32 bits wide (padded -or otherwise.) - afbChangeWindowAttributes() has already put a copy of the pixmap -in pPrivWin->pRotated* -*/ - -/*ARGSUSED*/ -Bool -afbPositionWindow(pWin, x, y) - WindowPtr pWin; - int x, y; -{ - register afbPrivWin *pPrivWin; - int reset = 0; - - pPrivWin = (afbPrivWin *)(pWin->devPrivates[afbWindowPrivateIndex].ptr); - if (pWin->backgroundState == BackgroundPixmap && pPrivWin->fastBackground) { - afbXRotatePixmap(pPrivWin->pRotatedBackground, - pWin->drawable.x - pPrivWin->oldRotate.x); - afbYRotatePixmap(pPrivWin->pRotatedBackground, - pWin->drawable.y - pPrivWin->oldRotate.y); - reset = 1; - } - - if (!pWin->borderIsPixel && pPrivWin->fastBorder) { - while (pWin->backgroundState == ParentRelative) - pWin = pWin->parent; - afbXRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.x - pPrivWin->oldRotate.x); - afbYRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.y - pPrivWin->oldRotate.y); - reset = 1; - } - if (reset) { - pPrivWin->oldRotate.x = pWin->drawable.x; - pPrivWin->oldRotate.y = pWin->drawable.y; - } - - /* This is the "wrong" fix to the right problem, but it doesn't really - * cost very much. When the window is moved, we need to invalidate any - * RotatedPixmap that exists in any GC currently validated against this - * window. - */ - pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; - - /* Again, we have no failure modes indicated by any of the routines - * we've called, so we have to assume it worked */ - return (TRUE); -} - -/*ARGSUSED*/ -Bool -afbUnmapWindow(pWindow) - WindowPtr pWindow; -{ - return (TRUE); -} - -/* UNCLEAN! - this code calls the bitblt helper code directly. - - afbCopyWindow copies only the parts of the destination that are -visible in the source. -*/ - - -void -afbCopyWindow(pWin, ptOldOrg, prgnSrc) - WindowPtr pWin; - DDXPointRec ptOldOrg; - RegionPtr prgnSrc; -{ - DDXPointPtr pptSrc; - register DDXPointPtr ppt; - RegionPtr prgnDst; - register BoxPtr pbox; - register int dx, dy; - register int i, nbox; - WindowPtr pwinRoot; - - pwinRoot = WindowTable[pWin->drawable.pScreen->myNum]; - - prgnDst = REGION_CREATE(pWin->drawable.pScreen, NULL, 1); - - dx = ptOldOrg.x - pWin->drawable.x; - dy = ptOldOrg.y - pWin->drawable.y; - REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy); - REGION_INTERSECT(pWin->drawable.pScreen, prgnDst, &pWin->borderClip, - prgnSrc); - - pbox = REGION_RECTS(prgnDst); - nbox = REGION_NUM_RECTS(prgnDst); - if(!(pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))) - return; - ppt = pptSrc; - - for (i=nbox; --i >= 0; ppt++, pbox++) { - ppt->x = pbox->x1 + dx; - ppt->y = pbox->y1 + dy; - } - - afbDoBitblt((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot, GXcopy, prgnDst, - pptSrc, ~0); - DEALLOCATE_LOCAL(pptSrc); - REGION_DESTROY(pWin->drawable.pScreen, prgnDst); -} - - - -/* swap in correct PaintWindow* routine. If we can use a fast output -routine (i.e. the pixmap is paddable to 32 bits), also pre-rotate a copy -of it in devPrivate. -*/ -Bool -afbChangeWindowAttributes(pWin, mask) - register WindowPtr pWin; - register unsigned long mask; -{ - register unsigned long index; - register afbPrivWin *pPrivWin; - WindowPtr pBgWin; - - pPrivWin = (afbPrivWin *)(pWin->devPrivates[afbWindowPrivateIndex].ptr); - /* - * When background state changes from ParentRelative and - * we had previously rotated the fast border pixmap to match - * the parent relative origin, rerotate to match window - */ - if (mask & (CWBackPixmap | CWBackPixel) && - pWin->backgroundState != ParentRelative && pPrivWin->fastBorder && - (pPrivWin->oldRotate.x != pWin->drawable.x || - pPrivWin->oldRotate.y != pWin->drawable.y)) { - afbXRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.x - pPrivWin->oldRotate.x); - afbYRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.y - pPrivWin->oldRotate.y); - pPrivWin->oldRotate.x = pWin->drawable.x; - pPrivWin->oldRotate.y = pWin->drawable.y; - } - while(mask) { - index = lowbit (mask); - mask &= ~index; - switch(index) { - case CWBackPixmap: - if (pWin->backgroundState == None) - pPrivWin->fastBackground = FALSE; - else if (pWin->backgroundState == ParentRelative) { - pPrivWin->fastBackground = FALSE; - /* Rotate border to match parent origin */ - if (pPrivWin->pRotatedBorder) { - for (pBgWin = pWin->parent; - pBgWin->backgroundState == ParentRelative; - pBgWin = pBgWin->parent); - afbXRotatePixmap(pPrivWin->pRotatedBorder, - pBgWin->drawable.x - pPrivWin->oldRotate.x); - afbYRotatePixmap(pPrivWin->pRotatedBorder, - pBgWin->drawable.y - pPrivWin->oldRotate.y); - pPrivWin->oldRotate.x = pBgWin->drawable.x; - pPrivWin->oldRotate.y = pBgWin->drawable.y; - } - } else if ((pWin->background.pixmap->drawable.width <= PPW) && - !(pWin->background.pixmap->drawable.width & - (pWin->background.pixmap->drawable.width - 1))) { - afbCopyRotatePixmap(pWin->background.pixmap, - &pPrivWin->pRotatedBackground, - pWin->drawable.x, pWin->drawable.y); - if (pPrivWin->pRotatedBackground) { - pPrivWin->fastBackground = TRUE; - pPrivWin->oldRotate.x = pWin->drawable.x; - pPrivWin->oldRotate.y = pWin->drawable.y; - } else - pPrivWin->fastBackground = FALSE; - } else - pPrivWin->fastBackground = FALSE; - break; - - case CWBackPixel: - pPrivWin->fastBackground = FALSE; - break; - - case CWBorderPixmap: - if ((pWin->border.pixmap->drawable.width <= PPW) && - !(pWin->border.pixmap->drawable.width & - (pWin->border.pixmap->drawable.width - 1))) { - for (pBgWin = pWin; - pBgWin->backgroundState == ParentRelative; - pBgWin = pBgWin->parent); - afbCopyRotatePixmap(pWin->border.pixmap, - &pPrivWin->pRotatedBorder, - pBgWin->drawable.x, pBgWin->drawable.y); - if (pPrivWin->pRotatedBorder) { - pPrivWin->fastBorder = TRUE; - pPrivWin->oldRotate.x = pBgWin->drawable.x; - pPrivWin->oldRotate.y = pBgWin->drawable.y; - } else - pPrivWin->fastBorder = FALSE; - } else - pPrivWin->fastBorder = FALSE; - break; - case CWBorderPixel: - pPrivWin->fastBorder = FALSE; - break; - } - } - /* Again, we have no failure modes indicated by any of the routines - * we've called, so we have to assume it worked */ - return (TRUE); -} diff --git a/nx-X11/programs/Xserver/afb/afbzerarc.c b/nx-X11/programs/Xserver/afb/afbzerarc.c deleted file mode 100644 index ef62238db..000000000 --- a/nx-X11/programs/Xserver/afb/afbzerarc.c +++ /dev/null @@ -1,210 +0,0 @@ -/* $XFree86: xc/programs/Xserver/afb/afbzerarc.c,v 3.2 2001/10/28 03:32:59 tsi Exp $ */ -/************************************************************ - -Copyright (c) 1989 X Consortium - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of the X Consortium shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from the X Consortium. - -********************************************************/ - -/* $XConsortium: afbzerarc.c,v 5.19 94/04/17 20:28:37 dpw Exp $ */ - -/* Derived from: - * "Algorithm for drawing ellipses or hyperbolae with a digital plotter" - * by M. L. V. Pitteway - * The Computer Journal, November 1967, Volume 10, Number 3, pp. 282-289 - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include "regionstr.h" -#include "gcstruct.h" -#include "pixmapstr.h" -#include "scrnintstr.h" -#include "afb.h" -#include "maskbits.h" -#include "mizerarc.h" -#include "mi.h" - -/* - * Note: LEFTMOST must be the bit leftmost in the actual screen - * representation. This depends also on the IMAGE_BYTE_ORDER. - * LONG2CHARS() takes care of the re-ordering as required. (DHD) - */ -#if (BITMAP_BIT_ORDER == MSBFirst) -#define LEFTMOST ((PixelType) LONG2CHARS((1 << PLST))) -#else -#define LEFTMOST ((PixelType) LONG2CHARS(1)) -#endif - -#define Pixelate(base,yoff,xoff) \ -{ \ - paddr = afbScanlineOffset(base, (yoff) + ((xoff)>>PWSH)); \ - pmask = SCRRIGHT(LEFTMOST, (xoff) & PIM); \ - for (de = 0; de < depthDst; de++, paddr += sizeDst) /* @@@ NEXT PLANE @@@ */ \ - switch (rrops[de]) { \ - case RROP_BLACK: \ - *paddr &= ~pmask; \ - break; \ - case RROP_WHITE: \ - *paddr |= pmask; \ - break; \ - case RROP_INVERT: \ - *paddr ^= pmask; \ - break; \ - case RROP_NOP: \ - break; \ - } \ -} - -#define DoPix(bit,base,yoff,xoff) if (mask & bit) Pixelate(base,yoff,xoff); - -static void -afbZeroArcSS(pDraw, pGC, arc) - DrawablePtr pDraw; - GCPtr pGC; - xArc *arc; -{ - miZeroArcRec info; - Bool do360; - register int de; - register int x, y, a, b, d, mask; - register int k1, k3, dx, dy; - PixelType *addrl; - PixelType *yorgl, *yorgol; - int nlwidth, yoffset, dyoffset; - int sizeDst, depthDst; - PixelType pmask; - register PixelType *paddr; - register unsigned char *rrops; - - rrops = ((afbPrivGC *)(pGC->devPrivates[afbGCPrivateIndex].ptr))->rrops; - - afbGetPixelWidthSizeDepthAndPointer(pDraw, nlwidth, sizeDst, depthDst, - addrl); - do360 = miZeroArcSetup(arc, &info, TRUE); - yorgl = addrl + ((info.yorg + pDraw->y) * nlwidth); - yorgol = addrl + ((info.yorgo + pDraw->y) * nlwidth); - info.xorg += pDraw->x; - info.xorgo += pDraw->x; - MIARCSETUP(); - yoffset = y ? nlwidth : 0; - dyoffset = 0; - mask = info.initialMask; - if (!(arc->width & 1)) { - DoPix(2, yorgl, 0, info.xorgo); - DoPix(8, yorgol, 0, info.xorgo); - } - if (!info.end.x || !info.end.y) { - mask = info.end.mask; - info.end = info.altend; - } - if (do360 && (arc->width == arc->height) && !(arc->width & 1)) { - int xoffset = nlwidth; - PixelType *yorghl = afbScanlineDeltaNoBankSwitch(yorgl, info.h, nlwidth); - int xorghp = info.xorg + info.h; - int xorghn = info.xorg - info.h; - - while (1) { - Pixelate(yorgl, yoffset, info.xorg + x); - Pixelate(yorgl, yoffset, info.xorg - x); - Pixelate(yorgol, -yoffset, info.xorg - x); - Pixelate(yorgol, -yoffset, info.xorg + x); - if (a < 0) - break; - Pixelate(yorghl, -xoffset, xorghp - y); - Pixelate(yorghl, -xoffset, xorghn + y); - Pixelate(yorghl, xoffset, xorghn + y); - Pixelate(yorghl, xoffset, xorghp - y); - xoffset += nlwidth; - MIARCCIRCLESTEP(yoffset += nlwidth;); - } - x = info.w; - yoffset = info.h * nlwidth; - } else if (do360) { - while (y < info.h || x < info.w) { - MIARCOCTANTSHIFT(dyoffset = nlwidth;); - Pixelate(yorgl, yoffset, info.xorg + x); - Pixelate(yorgl, yoffset, info.xorgo - x); - Pixelate(yorgol, -yoffset, info.xorgo - x); - Pixelate(yorgol, -yoffset, info.xorg + x); - MIARCSTEP(yoffset += dyoffset;, yoffset += nlwidth;); - } - } else { - while (y < info.h || x < info.w) { - MIARCOCTANTSHIFT(dyoffset = nlwidth;); - if ((x == info.start.x) || (y == info.start.y)) { - mask = info.start.mask; - info.start = info.altstart; - } - DoPix(1, yorgl, yoffset, info.xorg + x); - DoPix(2, yorgl, yoffset, info.xorgo - x); - DoPix(4, yorgol, -yoffset, info.xorgo - x); - DoPix(8, yorgol, -yoffset, info.xorg + x); - if ((x == info.end.x) || (y == info.end.y)) { - mask = info.end.mask; - info.end = info.altend; - } - MIARCSTEP(yoffset += dyoffset;, yoffset += nlwidth;); - } - } - if ((x == info.start.x) || (y == info.start.y)) - mask = info.start.mask; - DoPix(1, yorgl, yoffset, info.xorg + x); - DoPix(4, yorgol, -yoffset, info.xorgo - x); - if (arc->height & 1) { - DoPix(2, yorgl, yoffset, info.xorgo - x); - DoPix(8, yorgol, -yoffset, info.xorg + x); - } -} - -void -afbZeroPolyArcSS(pDraw, pGC, narcs, parcs) - DrawablePtr pDraw; - GCPtr pGC; - int narcs; - xArc *parcs; -{ - register xArc *arc; - register int i; - BoxRec box; - RegionPtr cclip; - - cclip = pGC->pCompositeClip; - for (arc = parcs, i = narcs; --i >= 0; arc++) { - if (miCanZeroArc(arc)) { - box.x1 = arc->x + pDraw->x; - box.y1 = arc->y + pDraw->y; - box.x2 = box.x1 + (int)arc->width + 1; - box.y2 = box.y1 + (int)arc->height + 1; - if (RECT_IN_REGION(pDraw->pScreen, cclip, &box) == rgnIN) - afbZeroArcSS(pDraw, pGC, arc); - else - miZeroPolyArc(pDraw, pGC, 1, arc); - } else - miPolyArc(pDraw, pGC, 1, arc); - } -} diff --git a/nx-X11/programs/Xserver/cfb/Imakefile b/nx-X11/programs/Xserver/cfb/Imakefile deleted file mode 100644 index 5295c35da..000000000 --- a/nx-X11/programs/Xserver/cfb/Imakefile +++ /dev/null @@ -1,6 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/cfb/Imakefile,v 3.27 2002/05/31 15:12:55 dawes Exp $ - -#define PixelSize 8 - -#include "Imakefile.inc" - diff --git a/nx-X11/programs/Xserver/cfb/Imakefile.inc b/nx-X11/programs/Xserver/cfb/Imakefile.inc deleted file mode 100644 index bfb6c315e..000000000 --- a/nx-X11/programs/Xserver/cfb/Imakefile.inc +++ /dev/null @@ -1,303 +0,0 @@ -XCOMM $XdotOrg: xc/programs/Xserver/cfb/Imakefile.inc,v 1.5 2005/07/11 19:13:26 ajax Exp $ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:48:12 cpqbld Exp $ - - - -XCOMM $XFree86: xc/programs/Xserver/cfb/Imakefile.inc,v 1.3tsi Exp $ - -#if DoLoadableServer -#if !BuildModuleInSubdir -#define IHaveModules -#elif !defined(IHaveModules) -#define IHaveSubdirs -SUBDIRS = module -#endif -#endif - -#include - -#ifndef PixelSize -#define PixelSize 8 -#endif - -#if PixelSize == 8 -PSZSRCS = cfb8bit.c cfbteblt8.c cfbglrop8.c cfbpush8.c cfbrctstp8.c -PSZOBJS = cfb8bit.o cfbteblt8.o cfbglrop8.o cfbpush8.o cfbrctstp8.o -#ifdef MipsArchitecture -#ifndef ArcArchitecture -#ifndef Mips64Architecture -STIPPLESRC = stipmips.s stipmipste.s -STIPPLEOBJ = stipmips.o stipmipste.o -STIPPLEDEF = -DHAS_STIPPLE_CODE -#endif -#endif -#endif -#ifdef SparcArchitecture -#ifndef Sparc64Architecture -STIPPLESRC = stipsparc.s stipsparcte.s -STIPPLEOBJ = stipsparc.o stipsparcte.o -STIPPLEDEF = -DHAS_STIPPLE_CODE -#endif -#endif -#endif - -#if PixelSize == 32 -#ifdef SparcArchitecture -#ifndef Sparc64Architecture -STIPPLESRC = stipsprc32.s stipsprcte32.s -STIPPLEOBJ = stipsprc32.o stipsprcte32.o -STIPPLEDEF = -DHAS_STIPPLE_CODE -#endif -#endif -#endif - -#ifdef SparcArchitecture -# if DoLoadableServer && MakeDllModules -# define SharedAsmDefines -DSHAREDCODE -# else -# define SharedAsmDefines /**/ -# endif -ASMDEFINES = AsmDefines SharedAsmDefines -#endif - -#if defined(IHaveModules) -XFMODSRC = cfbmodule.c -XFMODOBJ = cfbmodule.o -#endif - -XCOMM THIS IS STUPID -#if !(defined(IHaveModules) && defined(LinkDirectory)) -CFBCMAP = cfbcmap.o -#endif - -SRCS = cfbgc.c cfbrrop.c cfbwindow.c \ - cfbpntwin.c cfbmskbits.c cfbpixmap.c cfbbitblt.c \ - cfbfillsp.c cfbsetsp.c cfbscrinit.c cfballpriv.c \ - cfbgetsp.c cfbfillrct.c \ - cfbsolidC.c cfbsolidX.c cfbsolidG.c \ - cfbtileoddC.c cfbtileoddG.c cfbtile32C.c cfbtile32G.c \ - cfbcmap.c cfbzerarcC.c cfbzerarcX.c cfbzerarcG.c \ - cfbfillarcC.c cfbfillarcG.c \ - cfbigblt8.c cfbglblt8.c cfbtegblt.c cfbbstore.c \ - cfbbltC.c cfbbltX.c cfbbltO.c cfbbltG.c \ - cfbpolypnt.c \ - cfbbres.c cfbline.c cfbhrzvert.c cfbbresd.c cfbimage.c cfbseg.c \ - cfb8lineCO.c cfb8lineX.c cfb8lineG.c cfb8lineCP.c \ - cfb8segC.c cfb8segX.c cfb8segG.c cfb8segCS.c \ - cfbply1rctC.c cfbply1rctG.c cfbcppl.c $(PSZSRCS) $(XFMODSRC) - -OBJS = cfbgc.o cfbrrop.o cfbwindow.o \ - cfbgetsp.o cfbfillrct.o \ - cfbsolidC.o cfbsolidX.o cfbsolidG.o \ - cfbtileoddC.o cfbtileoddG.o cfbtile32C.o cfbtile32G.o \ - cfbfillsp.o cfbsetsp.o cfbscrinit.o cfballpriv.o \ - cfbpntwin.o cfbmskbits.o cfbpixmap.o \ - cfbcmap.o cfbzerarcC.o cfbzerarcX.o cfbzerarcG.o \ - cfbfillarcC.o cfbfillarcG.o \ - cfbigblt8.o cfbglblt8.o cfbtegblt.o cfbbstore.o \ - cfbpolypnt.o \ - cfbbres.o cfbline.o cfbhrzvert.o cfbbresd.o cfbimage.o cfbseg.o \ - cfb8lineCO.o cfb8lineX.o cfb8lineG.o cfb8lineCP.o \ - cfb8segCS.o cfb8segX.o cfb8segG.o cfb8segC.o \ - cfbbitblt.o cfbbltC.o cfbbltX.o cfbbltO.o cfbbltG.o \ - cfbply1rctC.o cfbply1rctG.o cfbcppl.o $(PSZOBJS) $(STIPPLEOBJ) \ - $(XFMODOBJ) - -#if (defined(XFree86Version) || defined(XorgVersion)) -PLATFORMDEFS = -DXFREE86 -#endif - - INCLUDES = -I$(SERVERSRC)/cfb -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \ - -I$(SERVERSRC)/cfb24 -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ - -I$(FONTINCSRC) -I$(EXTINCSRC) -I$(SERVERSRC)/Xext - LINTLIBS = $(SERVERSRC)/dix/llib-ldix.ln $(SERVERSRC)/os/llib-los.ln \ - $(SERVERSRC)/mfb/llib-lmfb.ln $(SERVERSRC)/mi/llib-lmi.ln - DEFINES = $(LMDEFINES) -DPSZ=PixelSize $(PLATFORMDEFS) - -#if PixelSize == 8 -CFBNAME = cfb -#elif PixelSize == 16 -CFBNAME = cfb16 -#elif PixelSize == 24 -CFBNAME = cfb24 -#elif PixelSize == 32 -CFBNAME = cfb32 -#endif - -#ifdef IHaveModules -ModuleObjectRule() -LibraryModuleTarget($(CFBNAME),$(OBJS)) -#else -NormalLibraryObjectRule() -NormalLibraryTarget($(CFBNAME),$(OBJS)) -#endif - -LintLibraryTarget($(CFBNAME),$(SRCS)) - -NormalLintTarget($(SRCS)) - -#ifdef LinkDirectory - -LinkSourceFile(cfballpriv.c,LinkDirectory) -LinkSourceFile(cfbbitblt.c,LinkDirectory) -LinkSourceFile(cfbblt.c,LinkDirectory) -LinkSourceFile(cfbbres.c,LinkDirectory) -LinkSourceFile(cfbbresd.c,LinkDirectory) -LinkSourceFile(cfbbstore.c,LinkDirectory) -LinkSourceFile(cfbcmap.c,LinkDirectory) -LinkSourceFile(cfbcppl.c,LinkDirectory) -LinkSourceFile(cfbfillarc.c,LinkDirectory) -LinkSourceFile(cfbfillrct.c,LinkDirectory) -LinkSourceFile(cfbfillsp.c,LinkDirectory) -LinkSourceFile(cfbgc.c,LinkDirectory) -LinkSourceFile(cfbgetsp.c,LinkDirectory) -LinkSourceFile(cfbhrzvert.c,LinkDirectory) -LinkSourceFile(cfbimage.c,LinkDirectory) -LinkSourceFile(cfbline.c,LinkDirectory) -LinkSourceFile(cfb8line.c,LinkDirectory) -LinkSourceFile(cfbmskbits.c,LinkDirectory) -LinkSourceFile(cfbpixmap.c,LinkDirectory) -LinkSourceFile(cfbply1rct.c,LinkDirectory) -LinkSourceFile(cfbpntwin.c,LinkDirectory) -LinkSourceFile(cfbpolypnt.c,LinkDirectory) -LinkSourceFile(cfbrrop.c,LinkDirectory) -LinkSourceFile(cfbscrinit.c,LinkDirectory) -LinkSourceFile(cfbsetsp.c,LinkDirectory) -LinkSourceFile(cfbsolid.c,LinkDirectory) -LinkSourceFile(cfbigblt8.c,LinkDirectory) -LinkSourceFile(cfbglblt8.c,LinkDirectory) -LinkSourceFile(cfbtegblt.c,LinkDirectory) -LinkSourceFile(cfbtileodd.c,LinkDirectory) -LinkSourceFile(cfbtile32.c,LinkDirectory) -LinkSourceFile(cfbwindow.c,LinkDirectory) -LinkSourceFile(cfbzerarc.c,LinkDirectory) -#if PixelSize == 8 -LinkSourceFile(cfb8bit.c,LinkDirectory) -LinkSourceFile(cfbpush8.c,LinkDirectory) -LinkSourceFile(cfbrctstp8.c,LinkDirectory) -LinkSourceFile(cfbteblt8.c,LinkDirectory) -#ifdef MipsArchitecture -LinkSourceFile(stipmips.s,LinkDirectory) -#endif -#ifdef SparcArchitecture -LinkSourceFile(stipsparc.s,LinkDirectory) -#endif -#endif -#if PixelSize == 32 -#ifdef SparcArchitecture -LinkSourceFile(stipsprc32.s,LinkDirectory) -#endif -#endif -#endif - -#if defined(IHaveModules) && BuildModuleInSubdir -LinkSourceFile(cfbmodule.c,..) -#endif - -ObjectFromSpecialSource(cfbseg,cfbline,-DPOLYSEGMENT) - -ObjectFromSpecialSource(cfbfillarcC,cfbfillarc,-DRROP=GXcopy) -ObjectFromSpecialSource(cfbfillarcG,cfbfillarc,-DRROP=GXset) - -ObjectFromSpecialSource(cfbzerarcC,cfbzerarc,-DRROP=GXcopy) -ObjectFromSpecialSource(cfbzerarcX,cfbzerarc,-DRROP=GXxor) -ObjectFromSpecialSource(cfbzerarcG,cfbzerarc,-DRROP=GXset) - -ObjectFromSpecialSource(cfbbltC,cfbblt,-DMROP=Mcopy) -ObjectFromSpecialSource(cfbbltX,cfbblt,-DMROP=Mxor) -ObjectFromSpecialSource(cfbbltO,cfbblt,-DMROP=Mor) -ObjectFromSpecialSource(cfbbltG,cfbblt,-DMROP=0) - -ObjectFromSpecialSource(cfbsolidC,cfbsolid,-DRROP=GXcopy) -ObjectFromSpecialSource(cfbsolidX,cfbsolid,-DRROP=GXxor) -ObjectFromSpecialSource(cfbsolidG,cfbsolid,-DRROP=GXset) - -ObjectFromSpecialSource(cfbtileoddC,cfbtileodd,-DMROP=Mcopy) -ObjectFromSpecialSource(cfbtileoddG,cfbtileodd,-DMROP=0) - -ObjectFromSpecialSource(cfbtile32C,cfbtile32,-DMROP=Mcopy) -ObjectFromSpecialSource(cfbtile32G,cfbtile32,-DMROP=0) - -ObjectFromSpecialSource(cfb8lineCO,cfb8line,-DRROP=GXcopy) -ObjectFromSpecialSource(cfb8lineCP,cfb8line,-DRROP=GXcopy -DPREVIOUS) -ObjectFromSpecialSource(cfb8lineX,cfb8line,-DRROP=GXxor) -ObjectFromSpecialSource(cfb8lineG,cfb8line,-DRROP=GXset) - -ObjectFromSpecialSource(cfb8segCS,cfb8line,-DRROP=GXcopy -DPOLYSEGMENT -DWIDTH_SHIFT) -ObjectFromSpecialSource(cfb8segC,cfb8line,-DRROP=GXcopy -DPOLYSEGMENT) -ObjectFromSpecialSource(cfb8segX,cfb8line,-DRROP=GXxor -DPOLYSEGMENT) -ObjectFromSpecialSource(cfb8segG,cfb8line,-DRROP=GXset -DPOLYSEGMENT) - -ObjectFromSpecialSource(cfbply1rctC,cfbply1rct,-DRROP=GXcopy) -ObjectFromSpecialSource(cfbply1rctG,cfbply1rct,-DRROP=GXset) - -SpecialCObjectRule(cfbglblt8,$(_NOOP_),$(STIPPLEDEF)) -SpecialCObjectRule(cfbpixmap,$(ICONFIGFILES),$(_NOOP_)) -SpecialCObjectRule(cfbcmap,$(ICONFIGFILES),$(EXT_DEFINES) $(GLX_DEFINES)) - -#if PixelSize == 8 -ObjectFromSpecialSource(cfbglrop8,cfbglblt8,-DGLYPHROP) - -#ifdef MipsArchitecture -stipmipste.s: stipmips.s - $(RM) $@ - $(LN) stipmips.s stipmipste.s -clean:: - $(RM) stipmipste.s - -stipmipste.o: stipmipste.s - $(AS) -o $@ -DTETEXT stipmipste.s -#endif - -#ifdef SparcArchitecture -stipsparcte.s: stipsparc.s - $(RM) $@ - $(LN) stipsparc.s stipsparcte.s -clean:: - $(RM) stipsparcte.s - -stipsparc.o: stipsparc.s - $(CPP) stipsparc.s $(ASMDEFINES) | $(AS) -o $@ - - -stipsparcte.o: stipsparcte.s - $(CPP) -DTETEXT stipsparcte.s $(ASMDEFINES) | $(AS) -o $@ - -#endif -#endif - -#if PixelSize == 32 -#ifdef SparcArchitecture -stipsprcte32.s: stipsprc32.s - $(RM) $@ - $(LN) stipsprc32.s stipsprcte32.s -clean:: - $(RM) stipsprcte32.s - -stipsprc32.o: stipsprc32.s - $(CPP) stipsprc32.s $(ASMDEFINES) | $(AS) -o $@ - - -stipsprcte32.o: stipsprcte32.s - $(CPP) -DTETEXT stipsprcte32.s $(ASMDEFINES) | $(AS) -o $@ - -#endif -#endif - -#ifdef IHaveModules -InstallLibraryModule($(CFBNAME),$(MODULEDIR),.) -#endif - -DependTarget() - -#ifdef IHaveSubdirs -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) -#endif - -InstallDriverSDKLibraryModule($(CFBNAME),$(DRIVERSDKMODULEDIR),.) - -#if PixelSize == 8 -InstallDriverSDKNonExecFile(cfb.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(cfb16.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(cfb24.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(cfb32.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(cfbmap.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(cfbunmap.h,$(DRIVERSDKINCLUDEDIR)) -#endif diff --git a/nx-X11/programs/Xserver/cfb/cfb.h b/nx-X11/programs/Xserver/cfb/cfb.h deleted file mode 100644 index 960f6756b..000000000 --- a/nx-X11/programs/Xserver/cfb/cfb.h +++ /dev/null @@ -1,1327 +0,0 @@ -/* $Xorg: cfb.h,v 1.3 2000/08/17 19:48:12 cpqbld Exp $ */ -/************************************************************ -Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this -software and its documentation for any purpose and without -fee is hereby granted, provided that the above copyright no- -tice appear in all copies and that both that copyright no- -tice and this permission notice appear in supporting docu- -mentation, and that the names of Sun or The Open Group -not be used in advertising or publicity pertaining to -distribution of the software without specific prior -written permission. Sun and The Open Group make no -representations about the suitability of this software for -any purpose. It is provided "as is" without any express or -implied warranty. - -SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT- -NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE LI- -ABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR -PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH -THE USE OR PERFORMANCE OF THIS SOFTWARE. - -********************************************************/ -/* $XFree86: xc/programs/Xserver/cfb/cfb.h,v 3.29tsi Exp $ */ - -#if !defined(__CFB_H__) || defined(CFB_PROTOTYPES_ONLY) - -#include -#include "globals.h" -#include "pixmap.h" -#include "region.h" -#include "gc.h" -#include "colormap.h" -#include "miscstruct.h" -#include "servermd.h" -#include "windowstr.h" -#include "mfb.h" -#undef PixelType - -#include "cfbmap.h" - -#ifndef CfbBits -#define CfbBits CARD32 -#endif - -#ifndef CFB_PROTOTYPES_ONLY -#define __CFB_H__ -/* - private filed of pixmap - pixmap.devPrivate = (unsigned int *)pointer_to_bits - pixmap.devKind = width_of_pixmap_in_bytes -*/ - -extern int cfbGCPrivateIndex; -extern int cfbWindowPrivateIndex; - -/* private field of GC */ -typedef struct { - unsigned char rop; /* special case rop values */ - /* next two values unused in cfb, included for compatibility with mfb */ - unsigned char ropOpStip; /* rop for opaque stipple */ - /* this value is ropFillArea in mfb, usurped for cfb */ - unsigned char oneRect; /* drawable has one clip rect */ - CfbBits xor, and; /* reduced rop values */ - } cfbPrivGC; - -typedef cfbPrivGC *cfbPrivGCPtr; - -#define cfbGetGCPrivate(pGC) ((cfbPrivGCPtr)\ - (pGC)->devPrivates[cfbGCPrivateIndex].ptr) - -#define cfbGetCompositeClip(pGC) ((pGC)->pCompositeClip) - -/* way to carry RROP info around */ -typedef struct { - unsigned char rop; - CfbBits xor, and; -} cfbRRopRec, *cfbRRopPtr; - -/* private field of window */ -typedef struct { - unsigned char fastBorder; /* non-zero if border is 32 bits wide */ - unsigned char fastBackground; - unsigned short unused; /* pad for alignment with Sun compiler */ - DDXPointRec oldRotate; - PixmapPtr pRotatedBackground; - PixmapPtr pRotatedBorder; - } cfbPrivWin; - -#define cfbGetWindowPrivate(_pWin) ((cfbPrivWin *)\ - (_pWin)->devPrivates[cfbWindowPrivateIndex].ptr) - - -/* cfb8bit.c */ - -extern int cfbSetStipple( - int /*alu*/, - CfbBits /*fg*/, - CfbBits /*planemask*/ -); - -extern int cfbSetOpaqueStipple( - int /*alu*/, - CfbBits /*fg*/, - CfbBits /*bg*/, - CfbBits /*planemask*/ -); - -extern int cfbComputeClipMasks32( - BoxPtr /*pBox*/, - int /*numRects*/, - int /*x*/, - int /*y*/, - int /*w*/, - int /*h*/, - CARD32 * /*clips*/ -); -#endif /* !CFB_PROTOTYPES_ONLY */ -/* cfb8cppl.c */ - -extern void cfbCopyImagePlane( - DrawablePtr /*pSrcDrawable*/, - DrawablePtr /*pDstDrawable*/, - int /*rop*/, - RegionPtr /*prgnDst*/, - DDXPointPtr /*pptSrc*/, - unsigned long /*planemask*/ -); - -#ifndef CFB_PROTOTYPES_ONLY -extern void cfbCopyPlane8to1( - DrawablePtr /*pSrcDrawable*/, - DrawablePtr /*pDstDrawable*/, - int /*rop*/, - RegionPtr /*prgnDst*/, - DDXPointPtr /*pptSrc*/, - unsigned long /*planemask*/, - unsigned long /*bitPlane*/ -); - -extern void cfbCopyPlane16to1( - DrawablePtr /*pSrcDrawable*/, - DrawablePtr /*pDstDrawable*/, - int /*rop*/, - RegionPtr /*prgnDst*/, - DDXPointPtr /*pptSrc*/, - unsigned long /*planemask*/, - unsigned long /*bitPlane*/ -); - -extern void cfbCopyPlane24to1( - DrawablePtr /*pSrcDrawable*/, - DrawablePtr /*pDstDrawable*/, - int /*rop*/, - RegionPtr /*prgnDst*/, - DDXPointPtr /*pptSrc*/, - unsigned long /*planemask*/, - unsigned long /*bitPlane*/ -); - -extern void cfbCopyPlane32to1( - DrawablePtr /*pSrcDrawable*/, - DrawablePtr /*pDstDrawable*/, - int /*rop*/, - RegionPtr /*prgnDst*/, - DDXPointPtr /*pptSrc*/, - unsigned long /*planemask*/, - unsigned long /*bitPlane*/ -); -#endif - -/* cfb8lineCO.c */ - -extern int cfb8LineSS1RectCopy( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*mode*/, - int /*npt*/, - DDXPointPtr /*pptInit*/, - DDXPointPtr /*pptInitOrig*/, - int * /*x1p*/, - int * /*y1p*/, - int * /*x2p*/, - int * /*y2p*/ -); - -extern void cfb8LineSS1Rect( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*mode*/, - int /*npt*/, - DDXPointPtr /*pptInit*/ -); - -extern void cfb8ClippedLineCopy( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*x1*/, - int /*y1*/, - int /*x2*/, - int /*y2*/, - BoxPtr /*boxp*/, - Bool /*shorten*/ -); -/* cfb8lineCP.c */ - -extern int cfb8LineSS1RectPreviousCopy( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*mode*/, - int /*npt*/, - DDXPointPtr /*pptInit*/, - DDXPointPtr /*pptInitOrig*/, - int * /*x1p*/, - int * /*y1p*/, - int * /*x2p*/, - int * /*y2p*/ -); -/* cfb8lineG.c */ - -extern int cfb8LineSS1RectGeneral( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*mode*/, - int /*npt*/, - DDXPointPtr /*pptInit*/, - DDXPointPtr /*pptInitOrig*/, - int * /*x1p*/, - int * /*y1p*/, - int * /*x2p*/, - int * /*y2p*/ -); - -extern void cfb8ClippedLineGeneral( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*x1*/, - int /*y1*/, - int /*x2*/, - int /*y2*/, - BoxPtr /*boxp*/, - Bool /*shorten*/ -); -/* cfb8lineX.c */ - -extern int cfb8LineSS1RectXor( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*mode*/, - int /*npt*/, - DDXPointPtr /*pptInit*/, - DDXPointPtr /*pptInitOrig*/, - int * /*x1p*/, - int * /*y1p*/, - int * /*x2p*/, - int * /*y2p*/ -); - -extern void cfb8ClippedLineXor( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*x1*/, - int /*y1*/, - int /*x2*/, - int /*y2*/, - BoxPtr /*boxp*/, - Bool /*shorten*/ -); -/* cfb8segC.c */ - -extern int cfb8SegmentSS1RectCopy( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*nseg*/, - xSegment * /*pSegInit*/ -); -/* cfb8segCS.c */ - -extern int cfb8SegmentSS1RectShiftCopy( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*nseg*/, - xSegment * /*pSegInit*/ -); - -extern void cfb8SegmentSS1Rect( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*nseg*/, - xSegment * /*pSegInit*/ -); -/* cfb8segG.c */ - -extern int cfb8SegmentSS1RectGeneral( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*nseg*/, - xSegment * /*pSegInit*/ -); -/* cfbsegX.c */ - -extern int cfb8SegmentSS1RectXor( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*nseg*/, - xSegment * /*pSegInit*/ -); -/* cfballpriv.c */ - -extern Bool cfbAllocatePrivates( - ScreenPtr /*pScreen*/, - int * /*window_index*/, - int * /*gc_index*/ -); -/* cfbbitblt.c */ - -extern RegionPtr cfbBitBlt( - DrawablePtr /*pSrcDrawable*/, - DrawablePtr /*pDstDrawable*/, - GCPtr/*pGC*/, - int /*srcx*/, - int /*srcy*/, - int /*width*/, - int /*height*/, - int /*dstx*/, - int /*dsty*/, - void (* /*doBitBlt*/)( - DrawablePtr /*pSrc*/, - DrawablePtr /*pDst*/, - int /*alu*/, - RegionPtr /*prgnDst*/, - DDXPointPtr /*pptSrc*/, - unsigned long /*planemask*/ - ), - unsigned long /*bitPlane*/ -); - -#define cfbCopyPlaneExpand cfbBitBlt - -extern RegionPtr cfbCopyPlaneReduce( - DrawablePtr /*pSrcDrawable*/, - DrawablePtr /*pDstDrawable*/, - GCPtr /*pGC*/, - int /*srcx*/, - int /*srcy*/, - int /*width*/, - int /*height*/, - int /*dstx*/, - int /*dsty*/, - void (* /*doCopyPlane*/)( - DrawablePtr /*pSrc*/, - DrawablePtr /*pDst*/, - int /*alu*/, - RegionPtr /*prgnDst*/, - DDXPointPtr /*pptSrc*/, - unsigned long /*planemask*/, - unsigned long /*bitPlane*/ /* We must know which plane to reduce! */ - ), - unsigned long /*bitPlane*/ -); - -extern void cfbDoBitblt( - DrawablePtr /*pSrc*/, - DrawablePtr /*pDst*/, - int /*alu*/, - RegionPtr /*prgnDst*/, - DDXPointPtr /*pptSrc*/, - unsigned long /*planemask*/ -); - -extern RegionPtr cfbCopyArea( - DrawablePtr /*pSrcDrawable*/, - DrawablePtr /*pDstDrawable*/, - GCPtr/*pGC*/, - int /*srcx*/, - int /*srcy*/, - int /*width*/, - int /*height*/, - int /*dstx*/, - int /*dsty*/ -); - -#ifndef CFB_PROTOTYPES_ONLY -extern void cfbCopyPlane1to8( - DrawablePtr /*pSrcDrawable*/, - DrawablePtr /*pDstDrawable*/, - int /*rop*/, - RegionPtr /*prgnDst*/, - DDXPointPtr /*pptSrc*/, - unsigned long /*planemask*/ -); -#endif - -extern RegionPtr cfbCopyPlane( - DrawablePtr /*pSrcDrawable*/, - DrawablePtr /*pDstDrawable*/, - GCPtr /*pGC*/, - int /*srcx*/, - int /*srcy*/, - int /*width*/, - int /*height*/, - int /*dstx*/, - int /*dsty*/, - unsigned long /*bitPlane*/ -); -/* cfbbltC.c */ - -extern void cfbDoBitbltCopy( - DrawablePtr /*pSrc*/, - DrawablePtr /*pDst*/, - int /*alu*/, - RegionPtr /*prgnDst*/, - DDXPointPtr /*pptSrc*/, - unsigned long /*planemask*/ -); -/* cfbbltG.c */ - -extern void cfbDoBitbltGeneral( - DrawablePtr /*pSrc*/, - DrawablePtr /*pDst*/, - int /*alu*/, - RegionPtr /*prgnDst*/, - DDXPointPtr /*pptSrc*/, - unsigned long /*planemask*/ -); -/* cfbbltO.c */ - -extern void cfbDoBitbltOr( - DrawablePtr /*pSrc*/, - DrawablePtr /*pDst*/, - int /*alu*/, - RegionPtr /*prgnDst*/, - DDXPointPtr /*pptSrc*/, - unsigned long /*planemask*/ -); -/* cfbbltX.c */ - -extern void cfbDoBitbltXor( - DrawablePtr /*pSrc*/, - DrawablePtr /*pDst*/, - int /*alu*/, - RegionPtr /*prgnDst*/, - DDXPointPtr /*pptSrc*/, - unsigned long /*planemask*/ -); -/* cfbbres.c */ - -extern void cfbBresS( - int /*rop*/, - CfbBits /*and*/, - CfbBits /*xor*/, - CfbBits * /*addrl*/, - int /*nlwidth*/, - int /*signdx*/, - int /*signdy*/, - int /*axis*/, - int /*x1*/, - int /*y1*/, - int /*e*/, - int /*e1*/, - int /*e2*/, - int /*len*/ -); -/* cfbbresd.c */ - -extern void cfbBresD( - cfbRRopPtr /*rrops*/, - int * /*pdashIndex*/, - unsigned char * /*pDash*/, - int /*numInDashList*/, - int * /*pdashOffset*/, - int /*isDoubleDash*/, - CfbBits * /*addrl*/, - int /*nlwidth*/, - int /*signdx*/, - int /*signdy*/, - int /*axis*/, - int /*x1*/, - int /*y1*/, - int /*e*/, - int /*e1*/, - int /*e2*/, - int /*len*/ -); -/* cfbbstore.c */ - -extern void cfbSaveAreas( - PixmapPtr /*pPixmap*/, - RegionPtr /*prgnSave*/, - int /*xorg*/, - int /*yorg*/, - WindowPtr /*pWin*/ -); - -extern void cfbRestoreAreas( - PixmapPtr /*pPixmap*/, - RegionPtr /*prgnRestore*/, - int /*xorg*/, - int /*yorg*/, - WindowPtr /*pWin*/ -); -/* cfbcmap.c */ - -#ifndef CFB_PROTOTYPES_ONLY -extern int cfbListInstalledColormaps( - ScreenPtr /*pScreen*/, - Colormap * /*pmaps*/ -); - -extern void cfbInstallColormap( - ColormapPtr /*pmap*/ -); - -extern void cfbUninstallColormap( - ColormapPtr /*pmap*/ -); - -extern void cfbResolveColor( - unsigned short * /*pred*/, - unsigned short * /*pgreen*/, - unsigned short * /*pblue*/, - VisualPtr /*pVisual*/ -); - -extern Bool cfbInitializeColormap( - ColormapPtr /*pmap*/ -); - -extern int cfbExpandDirectColors( - ColormapPtr /*pmap*/, - int /*ndef*/, - xColorItem * /*indefs*/, - xColorItem * /*outdefs*/ -); - -extern Bool cfbCreateDefColormap( - ScreenPtr /*pScreen*/ -); - -extern Bool cfbSetVisualTypes( - int /*depth*/, - int /*visuals*/, - int /*bitsPerRGB*/ -); - -extern void cfbClearVisualTypes(void); - -extern Bool cfbInitVisuals( - VisualPtr * /*visualp*/, - DepthPtr * /*depthp*/, - int * /*nvisualp*/, - int * /*ndepthp*/, - int * /*rootDepthp*/, - VisualID * /*defaultVisp*/, - unsigned long /*sizes*/, - int /*bitsPerRGB*/ -); -#endif -/* cfbfillarcC.c */ - -extern void cfbPolyFillArcSolidCopy( - DrawablePtr /*pDraw*/, - GCPtr /*pGC*/, - int /*narcs*/, - xArc * /*parcs*/ -); -/* cfbfillarcG.c */ - -extern void cfbPolyFillArcSolidGeneral( - DrawablePtr /*pDraw*/, - GCPtr /*pGC*/, - int /*narcs*/, - xArc * /*parcs*/ -); -/* cfbfillrct.c */ - -extern void cfbFillBoxTileOdd( - DrawablePtr /*pDrawable*/, - int /*n*/, - BoxPtr /*rects*/, - PixmapPtr /*tile*/, - int /*xrot*/, - int /*yrot*/ -); - -extern void cfbFillRectTileOdd( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*nBox*/, - BoxPtr /*pBox*/ -); - -extern void cfbPolyFillRect( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*nrectFill*/, - xRectangle * /*prectInit*/ -); -/* cfbfillsp.c */ - -extern void cfbUnnaturalTileFS( - DrawablePtr /*pDrawable*/, - GCPtr/*pGC*/, - int /*nInit*/, - DDXPointPtr /*pptInit*/, - int * /*pwidthInit*/, - int /*fSorted*/ -); - -extern void cfbUnnaturalStippleFS( - DrawablePtr /*pDrawable*/, - GCPtr/*pGC*/, - int /*nInit*/, - DDXPointPtr /*pptInit*/, - int * /*pwidthInit*/, - int /*fSorted*/ -); - -#ifndef CFB_PROTOTYPES_ONLY -extern void cfb8Stipple32FS( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*nInit*/, - DDXPointPtr /*pptInit*/, - int * /*pwidthInit*/, - int /*fSorted*/ -); - -extern void cfb8OpaqueStipple32FS( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*nInit*/, - DDXPointPtr /*pptInit*/, - int * /*pwidthInit*/, - int /*fSorted*/ -); -#endif -/* cfbgc.c */ - -extern GCOpsPtr cfbMatchCommon( - GCPtr /*pGC*/, - cfbPrivGCPtr /*devPriv*/ -); - -extern Bool cfbCreateGC( - GCPtr /*pGC*/ -); - -extern void cfbValidateGC( - GCPtr /*pGC*/, - unsigned long /*changes*/, - DrawablePtr /*pDrawable*/ -); - -/* cfbgetsp.c */ - -extern void cfbGetSpans( - DrawablePtr /*pDrawable*/, - int /*wMax*/, - DDXPointPtr /*ppt*/, - int * /*pwidth*/, - int /*nspans*/, - char * /*pdstStart*/ -); -/* cfbglblt8.c */ - -extern void cfbPolyGlyphBlt8( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*x*/, - int /*y*/, - unsigned int /*nglyph*/, - CharInfoPtr * /*ppci*/, - pointer /*pglyphBase*/ -); -/* cfbglrop8.c */ - -extern void cfbPolyGlyphRop8( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*x*/, - int /*y*/, - unsigned int /*nglyph*/, - CharInfoPtr * /*ppci*/, - pointer /*pglyphBase*/ -); -/* cfbhrzvert.c */ - -extern void cfbHorzS( - int /*rop*/, - CfbBits /*and*/, - CfbBits /*xor*/, - CfbBits * /*addrl*/, - int /*nlwidth*/, - int /*x1*/, - int /*y1*/, - int /*len*/ -); - -extern void cfbVertS( - int /*rop*/, - CfbBits /*and*/, - CfbBits /*xor*/, - CfbBits * /*addrl*/, - int /*nlwidth*/, - int /*x1*/, - int /*y1*/, - int /*len*/ -); -/* cfbigblt8.c */ - -extern void cfbImageGlyphBlt8( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*x*/, - int /*y*/, - unsigned int /*nglyph*/, - CharInfoPtr * /*ppci*/, - pointer /*pglyphBase*/ -); -/* cfbimage.c */ - -extern void cfbPutImage( - DrawablePtr /*pDraw*/, - GCPtr /*pGC*/, - int /*depth*/, - int /*x*/, - int /*y*/, - int /*w*/, - int /*h*/, - int /*leftPad*/, - int /*format*/, - char * /*pImage*/ -); - -extern void cfbGetImage( - DrawablePtr /*pDrawable*/, - int /*sx*/, - int /*sy*/, - int /*w*/, - int /*h*/, - unsigned int /*format*/, - unsigned long /*planeMask*/, - char * /*pdstLine*/ -); -/* cfbline.c */ - -extern void cfbLineSS( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*mode*/, - int /*npt*/, - DDXPointPtr /*pptInit*/ -); - -extern void cfbLineSD( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*mode*/, - int /*npt*/, - DDXPointPtr /*pptInit*/ -); -/* cfbmskbits.c */ -/* cfbpixmap.c */ - -extern PixmapPtr cfbCreatePixmap( - ScreenPtr /*pScreen*/, - int /*width*/, - int /*height*/, - int /*depth*/ -); - -extern Bool cfbDestroyPixmap( - PixmapPtr /*pPixmap*/ -); - -extern PixmapPtr cfbCopyPixmap( - PixmapPtr /*pSrc*/ -); - -extern void cfbPadPixmap( - PixmapPtr /*pPixmap*/ -); - -extern void cfbXRotatePixmap( - PixmapPtr /*pPix*/, - int /*rw*/ -); - -extern void cfbYRotatePixmap( - PixmapPtr /*pPix*/, - int /*rh*/ -); - -extern void cfbCopyRotatePixmap( - PixmapPtr /*psrcPix*/, - PixmapPtr * /*ppdstPix*/, - int /*xrot*/, - int /*yrot*/ -); -/* cfbply1rctC.c */ - -extern void cfbFillPoly1RectCopy( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*shape*/, - int /*mode*/, - int /*count*/, - DDXPointPtr /*ptsIn*/ -); -/* cfbply1rctG.c */ - -extern void cfbFillPoly1RectGeneral( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*shape*/, - int /*mode*/, - int /*count*/, - DDXPointPtr /*ptsIn*/ -); -/* cfbpntwin.c */ - -extern void cfbPaintWindow( - WindowPtr /*pWin*/, - RegionPtr /*pRegion*/, - int /*what*/ -); - -extern void cfbFillBoxSolid( - DrawablePtr /*pDrawable*/, - int /*nBox*/, - BoxPtr /*pBox*/, - unsigned long /*pixel*/ -); - -extern void cfbFillBoxTile32( - DrawablePtr /*pDrawable*/, - int /*nBox*/, - BoxPtr /*pBox*/, - PixmapPtr /*tile*/ -); -/* cfbpolypnt.c */ - -extern void cfbPolyPoint( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*mode*/, - int /*npt*/, - xPoint * /*pptInit*/ -); -/* cfbpush8.c */ - -#ifndef CFB_PROTOTYPES_ONLY -extern void cfbPushPixels8( - GCPtr /*pGC*/, - PixmapPtr /*pBitmap*/, - DrawablePtr /*pDrawable*/, - int /*dx*/, - int /*dy*/, - int /*xOrg*/, - int /*yOrg*/ -); -/* cfbrctstp8.c */ - -extern void cfb8FillRectOpaqueStippled32( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*nBox*/, - BoxPtr /*pBox*/ -); - -extern void cfb8FillRectTransparentStippled32( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*nBox*/, - BoxPtr /*pBox*/ -); - -extern void cfb8FillRectStippledUnnatural( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*nBox*/, - BoxPtr /*pBox*/ -); -#endif -/* cfbrrop.c */ - -extern int cfbReduceRasterOp( - int /*rop*/, - CfbBits /*fg*/, - CfbBits /*pm*/, - CfbBits * /*andp*/, - CfbBits * /*xorp*/ -); -/* cfbscrinit.c */ - -extern Bool cfbCloseScreen( - int /*index*/, - ScreenPtr /*pScreen*/ -); - -extern Bool cfbSetupScreen( - ScreenPtr /*pScreen*/, - pointer /*pbits*/, - int /*xsize*/, - int /*ysize*/, - int /*dpix*/, - int /*dpiy*/, - int /*width*/ -); - -extern Bool cfbFinishScreenInit( - ScreenPtr /*pScreen*/, - pointer /*pbits*/, - int /*xsize*/, - int /*ysize*/, - int /*dpix*/, - int /*dpiy*/, - int /*width*/ -); - -extern Bool cfbScreenInit( - ScreenPtr /*pScreen*/, - pointer /*pbits*/, - int /*xsize*/, - int /*ysize*/, - int /*dpix*/, - int /*dpiy*/, - int /*width*/ -); - -extern PixmapPtr cfbGetScreenPixmap( - ScreenPtr /*pScreen*/ -); - -extern void cfbSetScreenPixmap( - PixmapPtr /*pPix*/ -); - -/* cfbseg.c */ - -extern void cfbSegmentSS( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*nseg*/, - xSegment * /*pSeg*/ -); - -extern void cfbSegmentSD( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*nseg*/, - xSegment * /*pSeg*/ -); -/* cfbsetsp.c */ - -extern void cfbSetScanline( - int /*y*/, - int /*xOrigin*/, - int /*xStart*/, - int /*xEnd*/, - unsigned int * /*psrc*/, - int /*alu*/, - int * /*pdstBase*/, - int /*widthDst*/, - unsigned long /*planemask*/ -); - -extern void cfbSetSpans( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - char * /*psrc*/, - DDXPointPtr /*ppt*/, - int * /*pwidth*/, - int /*nspans*/, - int /*fSorted*/ -); -/* cfbsolidC.c */ - -extern void cfbFillRectSolidCopy( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*nBox*/, - BoxPtr /*pBox*/ -); - -extern void cfbSolidSpansCopy( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*nInit*/, - DDXPointPtr /*pptInit*/, - int * /*pwidthInit*/, - int /*fSorted*/ -); -/* cfbsolidG.c */ - -extern void cfbFillRectSolidGeneral( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*nBox*/, - BoxPtr /*pBox*/ -); - -extern void cfbSolidSpansGeneral( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*nInit*/, - DDXPointPtr /*pptInit*/, - int * /*pwidthInit*/, - int /*fSorted*/ -); -/* cfbsolidX.c */ - -extern void cfbFillRectSolidXor( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*nBox*/, - BoxPtr /*pBox*/ -); - -extern void cfbSolidSpansXor( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*nInit*/, - DDXPointPtr /*pptInit*/, - int * /*pwidthInit*/, - int /*fSorted*/ -); -/* cfbteblt8.c */ - -#ifndef CFB_PROTOTYPES_ONLY -extern void cfbTEGlyphBlt8( - DrawablePtr /*pDrawable*/, - GCPtr/*pGC*/, - int /*xInit*/, - int /*yInit*/, - unsigned int /*nglyph*/, - CharInfoPtr * /*ppci*/, - pointer /*pglyphBase*/ -); -#endif -/* cfbtegblt.c */ - -extern void cfbTEGlyphBlt( - DrawablePtr /*pDrawable*/, - GCPtr/*pGC*/, - int /*x*/, - int /*y*/, - unsigned int /*nglyph*/, - CharInfoPtr * /*ppci*/, - pointer /*pglyphBase*/ -); -/* cfbtile32C.c */ - -extern void cfbFillRectTile32Copy( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*nBox*/, - BoxPtr /*pBox*/ -); - -extern void cfbTile32FSCopy( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*nInit*/, - DDXPointPtr /*pptInit*/, - int * /*pwidthInit*/, - int /*fSorted*/ -); -/* cfbtile32G.c */ - -extern void cfbFillRectTile32General( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*nBox*/, - BoxPtr /*pBox*/ -); - -extern void cfbTile32FSGeneral( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*nInit*/, - DDXPointPtr /*pptInit*/, - int * /*pwidthInit*/, - int /*fSorted*/ -); -/* cfbtileoddC.c */ - -extern void cfbFillBoxTileOddCopy( - DrawablePtr /*pDrawable*/, - int /*nBox*/, - BoxPtr /*pBox*/, - PixmapPtr /*tile*/, - int /*xrot*/, - int /*yrot*/, - int /*alu*/, - unsigned long /*planemask*/ -); - -extern void cfbFillSpanTileOddCopy( - DrawablePtr /*pDrawable*/, - int /*n*/, - DDXPointPtr /*ppt*/, - int * /*pwidth*/, - PixmapPtr /*tile*/, - int /*xrot*/, - int /*yrot*/, - int /*alu*/, - unsigned long /*planemask*/ -); - -extern void cfbFillBoxTile32sCopy( - DrawablePtr /*pDrawable*/, - int /*nBox*/, - BoxPtr /*pBox*/, - PixmapPtr /*tile*/, - int /*xrot*/, - int /*yrot*/, - int /*alu*/, - unsigned long /*planemask*/ -); - -extern void cfbFillSpanTile32sCopy( - DrawablePtr /*pDrawable*/, - int /*n*/, - DDXPointPtr /*ppt*/, - int * /*pwidth*/, - PixmapPtr /*tile*/, - int /*xrot*/, - int /*yrot*/, - int /*alu*/, - unsigned long /*planemask*/ -); -/* cfbtileoddG.c */ - -extern void cfbFillBoxTileOddGeneral( - DrawablePtr /*pDrawable*/, - int /*nBox*/, - BoxPtr /*pBox*/, - PixmapPtr /*tile*/, - int /*xrot*/, - int /*yrot*/, - int /*alu*/, - unsigned long /*planemask*/ -); - -extern void cfbFillSpanTileOddGeneral( - DrawablePtr /*pDrawable*/, - int /*n*/, - DDXPointPtr /*ppt*/, - int * /*pwidth*/, - PixmapPtr /*tile*/, - int /*xrot*/, - int /*yrot*/, - int /*alu*/, - unsigned long /*planemask*/ -); - -extern void cfbFillBoxTile32sGeneral( - DrawablePtr /*pDrawable*/, - int /*nBox*/, - BoxPtr /*pBox*/, - PixmapPtr /*tile*/, - int /*xrot*/, - int /*yrot*/, - int /*alu*/, - unsigned long /*planemask*/ -); - -extern void cfbFillSpanTile32sGeneral( - DrawablePtr /*pDrawable*/, - int /*n*/, - DDXPointPtr /*ppt*/, - int * /*pwidth*/, - PixmapPtr /*tile*/, - int /*xrot*/, - int /*yrot*/, - int /*alu*/, - unsigned long /*planemask*/ -); -/* cfbwindow.c */ - -extern Bool cfbCreateWindow( - WindowPtr /*pWin*/ -); - -extern Bool cfbDestroyWindow( - WindowPtr /*pWin*/ -); - -extern Bool cfbMapWindow( - WindowPtr /*pWindow*/ -); - -extern Bool cfbPositionWindow( - WindowPtr /*pWin*/, - int /*x*/, - int /*y*/ -); - -extern Bool cfbUnmapWindow( - WindowPtr /*pWindow*/ -); - -extern void cfbCopyWindow( - WindowPtr /*pWin*/, - DDXPointRec /*ptOldOrg*/, - RegionPtr /*prgnSrc*/ -); - -extern Bool cfbChangeWindowAttributes( - WindowPtr /*pWin*/, - unsigned long /*mask*/ -); -/* cfbzerarcC.c */ - -extern void cfbZeroPolyArcSS8Copy( - DrawablePtr /*pDraw*/, - GCPtr /*pGC*/, - int /*narcs*/, - xArc * /*parcs*/ -); -/* cfbzerarcG.c */ - -extern void cfbZeroPolyArcSS8General( - DrawablePtr /*pDraw*/, - GCPtr /*pGC*/, - int /*narcs*/, - xArc * /*parcs*/ -); -/* cfbzerarcX.c */ - -extern void cfbZeroPolyArcSS8Xor( - DrawablePtr /*pDraw*/, - GCPtr /*pGC*/, - int /*narcs*/, - xArc * /*parcs*/ -); - -#if (!defined(SINGLEDEPTH) && PSZ != 8) || defined(FORCE_SEPARATE_PRIVATE) - -#define CFB_NEED_SCREEN_PRIVATE - -extern int cfbScreenPrivateIndex; -#endif - -#ifndef CFB_PROTOTYPES_ONLY - -/* Common macros for extracting drawing information */ - -#define cfbGetWindowPixmap(d) \ - ((* ((DrawablePtr)(d))->pScreen->GetWindowPixmap)((WindowPtr)(d))) - -#define cfbGetTypedWidth(pDrawable,wtype) (\ - (((pDrawable)->type != DRAWABLE_PIXMAP) ? \ - (int) (cfbGetWindowPixmap(pDrawable)->devKind) : \ - (int)(((PixmapPtr)pDrawable)->devKind)) / sizeof (wtype)) - -#define cfbGetByteWidth(pDrawable) cfbGetTypedWidth(pDrawable, unsigned char) - -#define cfbGetPixelWidth(pDrawable) cfbGetTypedWidth(pDrawable, PixelType) - -#define cfbGetLongWidth(pDrawable) cfbGetTypedWidth(pDrawable, CfbBits) - -#define cfbGetTypedWidthAndPointer(pDrawable, width, pointer, wtype, ptype) {\ - PixmapPtr _pPix; \ - if ((pDrawable)->type != DRAWABLE_PIXMAP) \ - _pPix = cfbGetWindowPixmap(pDrawable); \ - else \ - _pPix = (PixmapPtr) (pDrawable); \ - (pointer) = (ptype *) _pPix->devPrivate.ptr; \ - (width) = ((int) _pPix->devKind) / sizeof (wtype); \ -} - -#define cfbGetByteWidthAndPointer(pDrawable, width, pointer) \ - cfbGetTypedWidthAndPointer(pDrawable, width, pointer, unsigned char, unsigned char) - -#define cfbGetLongWidthAndPointer(pDrawable, width, pointer) \ - cfbGetTypedWidthAndPointer(pDrawable, width, pointer, CfbBits, CfbBits) - -#define cfbGetPixelWidthAndPointer(pDrawable, width, pointer) \ - cfbGetTypedWidthAndPointer(pDrawable, width, pointer, PixelType, PixelType) - -#define cfbGetWindowTypedWidthAndPointer(pWin, width, pointer, wtype, ptype) {\ - PixmapPtr _pPix = cfbGetWindowPixmap((DrawablePtr) (pWin)); \ - (pointer) = (ptype *) _pPix->devPrivate.ptr; \ - (width) = ((int) _pPix->devKind) / sizeof (wtype); \ -} - -#define cfbGetWindowLongWidthAndPointer(pWin, width, pointer) \ - cfbGetWindowTypedWidthAndPointer(pWin, width, pointer, CfbBits, CfbBits) - -#define cfbGetWindowByteWidthAndPointer(pWin, width, pointer) \ - cfbGetWindowTypedWidthAndPointer(pWin, width, pointer, unsigned char, unsigned char) - -#define cfbGetWindowPixelWidthAndPointer(pDrawable, width, pointer) \ - cfbGetWindowTypedWidthAndPointer(pDrawable, width, pointer, PixelType, PixelType) - -/* - * XFree86 empties the root BorderClip when the VT is inactive, - * here's a macro which uses that to disable GetImage and GetSpans - */ -#define cfbWindowEnabled(pWin) \ - REGION_NOTEMPTY((pWin)->drawable.pScreen, \ - &WindowTable[(pWin)->drawable.pScreen->myNum]->borderClip) - -#define cfbDrawableEnabled(pDrawable) \ - ((pDrawable)->type == DRAWABLE_PIXMAP ? \ - TRUE : cfbWindowEnabled((WindowPtr) pDrawable)) - -#include "micoord.h" - -/* - * if CFB is built as a module, it shouldn't call libc functions. - */ -#ifdef XFree86LOADER -#include "xf86_ansic.h" -#endif -#endif /* !CFB_PROTOTYPES_ONLY */ - -#endif diff --git a/nx-X11/programs/Xserver/cfb/cfb16.h b/nx-X11/programs/Xserver/cfb/cfb16.h deleted file mode 100644 index 3d51cd142..000000000 --- a/nx-X11/programs/Xserver/cfb/cfb16.h +++ /dev/null @@ -1,94 +0,0 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfb16.h,v 1.4 1998/11/28 10:42:50 dawes Exp $ */ -/* - * Copyright (C) 1994-1998 The XFree86 Project, Inc. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the XFree86 Project shall - * not be used in advertising or otherwise to promote the sale, use or other - * dealings in this Software without prior written authorization from the - * XFree86 Project. - */ - -#ifndef _CFB16_H_ -#define _CFB16_H_ - -/* - * C's preprocessing language substitutes >text<, not values... - */ - -#ifdef OLDPSZ -# undef OLDPSZ -#endif - -#ifdef PSZ - -# if (PSZ == 8) -# define OLDPSZ 8 -# endif - -# if (PSZ == 16) -# define OLDPSZ 16 -# endif - -# if (PSZ == 24) -# define OLDPSZ 24 -# endif - -# if (PSZ == 32) -# define OLDPSZ 32 -# endif - -# ifndef OLDPSZ - /* Maybe an #error here ? */ -# endif - -# undef PSZ - -#endif - -#define PSZ 16 -#define CFB_PROTOTYPES_ONLY -#include "cfb.h" -#undef CFB_PROTOTYPES_ONLY -#include "cfbunmap.h" - -#undef PSZ -#ifdef OLDPSZ - -# if (OLDPSZ == 8) -# define PSZ 8 -# endif - -# if (OLDPSZ == 16) -# define PSZ 16 -# endif - -# if (OLDPSZ == 24) -# define PSZ 24 -# endif - -# if (OLDPSZ == 32) -# define PSZ 32 -# endif - -# undef OLDPSZ - -#endif - -#endif /* _CFB16_H_ */ diff --git a/nx-X11/programs/Xserver/cfb/cfb24.h b/nx-X11/programs/Xserver/cfb/cfb24.h deleted file mode 100644 index 3a99934b7..000000000 --- a/nx-X11/programs/Xserver/cfb/cfb24.h +++ /dev/null @@ -1,98 +0,0 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfb24.h,v 1.4 1998/11/28 10:42:51 dawes Exp $ */ -/* - * Copyright (C) 1994-1998 The XFree86 Project, Inc. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the XFree86 Project shall - * not be used in advertising or otherwise to promote the sale, use or other - * dealings in this Software without prior written authorization from the - * XFree86 Project. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifndef _CFB24_H_ -#define _CFB24_H_ - -/* - * C's preprocessing language substitutes >text<, not values... - */ - -#ifdef OLDPSZ -# undef OLDPSZ -#endif - -#ifdef PSZ - -# if (PSZ == 8) -# define OLDPSZ 8 -# endif - -# if (PSZ == 16) -# define OLDPSZ 16 -# endif - -# if (PSZ == 24) -# define OLDPSZ 24 -# endif - -# if (PSZ == 32) -# define OLDPSZ 32 -# endif - -# ifndef OLDPSZ - /* Maybe an #error here ? */ -# endif - -# undef PSZ - -#endif - -#define PSZ 24 -#define CFB_PROTOTYPES_ONLY -#include "cfb.h" -#undef CFB_PROTOTYPES_ONLY -#include "cfbunmap.h" - -#undef PSZ -#ifdef OLDPSZ - -# if (OLDPSZ == 8) -# define PSZ 8 -# endif - -# if (OLDPSZ == 16) -# define PSZ 16 -# endif - -# if (OLDPSZ == 24) -# define PSZ 24 -# endif - -# if (OLDPSZ == 32) -# define PSZ 32 -# endif - -# undef OLDPSZ - -#endif - -#endif /* _CFB24_H_ */ diff --git a/nx-X11/programs/Xserver/cfb/cfb32.h b/nx-X11/programs/Xserver/cfb/cfb32.h deleted file mode 100644 index 5ea4c13c8..000000000 --- a/nx-X11/programs/Xserver/cfb/cfb32.h +++ /dev/null @@ -1,94 +0,0 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfb32.h,v 1.4 1998/11/28 10:42:51 dawes Exp $ */ -/* - * Copyright (C) 1994-1998 The XFree86 Project, Inc. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the XFree86 Project shall - * not be used in advertising or otherwise to promote the sale, use or other - * dealings in this Software without prior written authorization from the - * XFree86 Project. - */ - -#ifndef _CFB32_H_ -#define _CFB32_H_ - -/* - * C's preprocessing language substitutes >text<, not values... - */ - -#ifdef OLDPSZ -# undef OLDPSZ -#endif - -#ifdef PSZ - -# if (PSZ == 8) -# define OLDPSZ 8 -# endif - -# if (PSZ == 16) -# define OLDPSZ 16 -# endif - -# if (PSZ == 24) -# define OLDPSZ 24 -# endif - -# if (PSZ == 32) -# define OLDPSZ 32 -# endif - -# ifndef OLDPSZ - /* Maybe an #error here ? */ -# endif - -# undef PSZ - -#endif - -#define PSZ 32 -#define CFB_PROTOTYPES_ONLY -#include "cfb.h" -#undef CFB_PROTOTYPES_ONLY -#include "cfbunmap.h" - -#undef PSZ -#ifdef OLDPSZ - -# if (OLDPSZ == 8) -# define PSZ 8 -# endif - -# if (OLDPSZ == 16) -# define PSZ 16 -# endif - -# if (OLDPSZ == 24) -# define PSZ 24 -# endif - -# if (OLDPSZ == 32) -# define PSZ 32 -# endif - -# undef OLDPSZ - -#endif - -#endif /* _CFB32_H_ */ diff --git a/nx-X11/programs/Xserver/cfb/cfb8bit.c b/nx-X11/programs/Xserver/cfb/cfb8bit.c deleted file mode 100644 index 0bc5debbb..000000000 --- a/nx-X11/programs/Xserver/cfb/cfb8bit.c +++ /dev/null @@ -1,471 +0,0 @@ -/* $Xorg: cfb8bit.c,v 1.4 2001/02/09 02:04:37 xorgcvs Exp $ */ -/* - -Copyright 1989, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* $XFree86: xc/programs/Xserver/cfb/cfb8bit.c,v 1.4 2001/01/17 22:36:34 dawes Exp $ */ - -/* - * cfb8bit.c - * - * 8 bit color frame buffer utility routines - */ - - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#if PSZ == 8 - -#include -#include -#include -#include "gcstruct.h" -#include "windowstr.h" -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "regionstr.h" -#include "cfb.h" -#include "cfbmskbits.h" -#include "cfb8bit.h" - -PixelGroup cfb8StippleMasks[NUM_MASKS] = { -#if NUM_MASKS == 16 - 0x00000000, 0x000000ff, 0x0000ff00, 0x0000ffff, - 0x00ff0000, 0x00ff00ff, 0x00ffff00, 0x00ffffff, - 0xff000000, 0xff0000ff, 0xff00ff00, 0xff00ffff, - 0xffff0000, 0xffff00ff, 0xffffff00, 0xffffffff -#else /* NUM_MASKS == 256 */ - 0x0000000000000000, 0x00000000000000ff, - 0x000000000000ff00, 0x000000000000ffff, - 0x0000000000ff0000, 0x0000000000ff00ff, - 0x0000000000ffff00, 0x0000000000ffffff, - 0x00000000ff000000, 0x00000000ff0000ff, - 0x00000000ff00ff00, 0x00000000ff00ffff, - 0x00000000ffff0000, 0x00000000ffff00ff, - 0x00000000ffffff00, 0x00000000ffffffff, - 0x000000ff00000000, 0x000000ff000000ff, - 0x000000ff0000ff00, 0x000000ff0000ffff, - 0x000000ff00ff0000, 0x000000ff00ff00ff, - 0x000000ff00ffff00, 0x000000ff00ffffff, - 0x000000ffff000000, 0x000000ffff0000ff, - 0x000000ffff00ff00, 0x000000ffff00ffff, - 0x000000ffffff0000, 0x000000ffffff00ff, - 0x000000ffffffff00, 0x000000ffffffffff, - 0x0000ff0000000000, 0x0000ff00000000ff, - 0x0000ff000000ff00, 0x0000ff000000ffff, - 0x0000ff0000ff0000, 0x0000ff0000ff00ff, - 0x0000ff0000ffff00, 0x0000ff0000ffffff, - 0x0000ff00ff000000, 0x0000ff00ff0000ff, - 0x0000ff00ff00ff00, 0x0000ff00ff00ffff, - 0x0000ff00ffff0000, 0x0000ff00ffff00ff, - 0x0000ff00ffffff00, 0x0000ff00ffffffff, - 0x0000ffff00000000, 0x0000ffff000000ff, - 0x0000ffff0000ff00, 0x0000ffff0000ffff, - 0x0000ffff00ff0000, 0x0000ffff00ff00ff, - 0x0000ffff00ffff00, 0x0000ffff00ffffff, - 0x0000ffffff000000, 0x0000ffffff0000ff, - 0x0000ffffff00ff00, 0x0000ffffff00ffff, - 0x0000ffffffff0000, 0x0000ffffffff00ff, - 0x0000ffffffffff00, 0x0000ffffffffffff, - 0x00ff000000000000, 0x00ff0000000000ff, - 0x00ff00000000ff00, 0x00ff00000000ffff, - 0x00ff000000ff0000, 0x00ff000000ff00ff, - 0x00ff000000ffff00, 0x00ff000000ffffff, - 0x00ff0000ff000000, 0x00ff0000ff0000ff, - 0x00ff0000ff00ff00, 0x00ff0000ff00ffff, - 0x00ff0000ffff0000, 0x00ff0000ffff00ff, - 0x00ff0000ffffff00, 0x00ff0000ffffffff, - 0x00ff00ff00000000, 0x00ff00ff000000ff, - 0x00ff00ff0000ff00, 0x00ff00ff0000ffff, - 0x00ff00ff00ff0000, 0x00ff00ff00ff00ff, - 0x00ff00ff00ffff00, 0x00ff00ff00ffffff, - 0x00ff00ffff000000, 0x00ff00ffff0000ff, - 0x00ff00ffff00ff00, 0x00ff00ffff00ffff, - 0x00ff00ffffff0000, 0x00ff00ffffff00ff, - 0x00ff00ffffffff00, 0x00ff00ffffffffff, - 0x00ffff0000000000, 0x00ffff00000000ff, - 0x00ffff000000ff00, 0x00ffff000000ffff, - 0x00ffff0000ff0000, 0x00ffff0000ff00ff, - 0x00ffff0000ffff00, 0x00ffff0000ffffff, - 0x00ffff00ff000000, 0x00ffff00ff0000ff, - 0x00ffff00ff00ff00, 0x00ffff00ff00ffff, - 0x00ffff00ffff0000, 0x00ffff00ffff00ff, - 0x00ffff00ffffff00, 0x00ffff00ffffffff, - 0x00ffffff00000000, 0x00ffffff000000ff, - 0x00ffffff0000ff00, 0x00ffffff0000ffff, - 0x00ffffff00ff0000, 0x00ffffff00ff00ff, - 0x00ffffff00ffff00, 0x00ffffff00ffffff, - 0x00ffffffff000000, 0x00ffffffff0000ff, - 0x00ffffffff00ff00, 0x00ffffffff00ffff, - 0x00ffffffffff0000, 0x00ffffffffff00ff, - 0x00ffffffffffff00, 0x00ffffffffffffff, - 0xff00000000000000, 0xff000000000000ff, - 0xff0000000000ff00, 0xff0000000000ffff, - 0xff00000000ff0000, 0xff00000000ff00ff, - 0xff00000000ffff00, 0xff00000000ffffff, - 0xff000000ff000000, 0xff000000ff0000ff, - 0xff000000ff00ff00, 0xff000000ff00ffff, - 0xff000000ffff0000, 0xff000000ffff00ff, - 0xff000000ffffff00, 0xff000000ffffffff, - 0xff0000ff00000000, 0xff0000ff000000ff, - 0xff0000ff0000ff00, 0xff0000ff0000ffff, - 0xff0000ff00ff0000, 0xff0000ff00ff00ff, - 0xff0000ff00ffff00, 0xff0000ff00ffffff, - 0xff0000ffff000000, 0xff0000ffff0000ff, - 0xff0000ffff00ff00, 0xff0000ffff00ffff, - 0xff0000ffffff0000, 0xff0000ffffff00ff, - 0xff0000ffffffff00, 0xff0000ffffffffff, - 0xff00ff0000000000, 0xff00ff00000000ff, - 0xff00ff000000ff00, 0xff00ff000000ffff, - 0xff00ff0000ff0000, 0xff00ff0000ff00ff, - 0xff00ff0000ffff00, 0xff00ff0000ffffff, - 0xff00ff00ff000000, 0xff00ff00ff0000ff, - 0xff00ff00ff00ff00, 0xff00ff00ff00ffff, - 0xff00ff00ffff0000, 0xff00ff00ffff00ff, - 0xff00ff00ffffff00, 0xff00ff00ffffffff, - 0xff00ffff00000000, 0xff00ffff000000ff, - 0xff00ffff0000ff00, 0xff00ffff0000ffff, - 0xff00ffff00ff0000, 0xff00ffff00ff00ff, - 0xff00ffff00ffff00, 0xff00ffff00ffffff, - 0xff00ffffff000000, 0xff00ffffff0000ff, - 0xff00ffffff00ff00, 0xff00ffffff00ffff, - 0xff00ffffffff0000, 0xff00ffffffff00ff, - 0xff00ffffffffff00, 0xff00ffffffffffff, - 0xffff000000000000, 0xffff0000000000ff, - 0xffff00000000ff00, 0xffff00000000ffff, - 0xffff000000ff0000, 0xffff000000ff00ff, - 0xffff000000ffff00, 0xffff000000ffffff, - 0xffff0000ff000000, 0xffff0000ff0000ff, - 0xffff0000ff00ff00, 0xffff0000ff00ffff, - 0xffff0000ffff0000, 0xffff0000ffff00ff, - 0xffff0000ffffff00, 0xffff0000ffffffff, - 0xffff00ff00000000, 0xffff00ff000000ff, - 0xffff00ff0000ff00, 0xffff00ff0000ffff, - 0xffff00ff00ff0000, 0xffff00ff00ff00ff, - 0xffff00ff00ffff00, 0xffff00ff00ffffff, - 0xffff00ffff000000, 0xffff00ffff0000ff, - 0xffff00ffff00ff00, 0xffff00ffff00ffff, - 0xffff00ffffff0000, 0xffff00ffffff00ff, - 0xffff00ffffffff00, 0xffff00ffffffffff, - 0xffffff0000000000, 0xffffff00000000ff, - 0xffffff000000ff00, 0xffffff000000ffff, - 0xffffff0000ff0000, 0xffffff0000ff00ff, - 0xffffff0000ffff00, 0xffffff0000ffffff, - 0xffffff00ff000000, 0xffffff00ff0000ff, - 0xffffff00ff00ff00, 0xffffff00ff00ffff, - 0xffffff00ffff0000, 0xffffff00ffff00ff, - 0xffffff00ffffff00, 0xffffff00ffffffff, - 0xffffffff00000000, 0xffffffff000000ff, - 0xffffffff0000ff00, 0xffffffff0000ffff, - 0xffffffff00ff0000, 0xffffffff00ff00ff, - 0xffffffff00ffff00, 0xffffffff00ffffff, - 0xffffffffff000000, 0xffffffffff0000ff, - 0xffffffffff00ff00, 0xffffffffff00ffff, - 0xffffffffffff0000, 0xffffffffffff00ff, - 0xffffffffffffff00, 0xffffffffffffffff -#endif -}; - -int cfb8StippleMode, cfb8StippleAlu, cfb8StippleRRop; -PixelGroup cfb8StippleFg, cfb8StippleBg, cfb8StipplePm; -PixelGroup cfb8StippleAnd[NUM_MASKS], cfb8StippleXor[NUM_MASKS]; - -int -cfb8SetStipple (alu, fg, planemask) -int alu; -CfbBits fg, planemask; -{ - CfbBits and, xor, rrop; - int s; - CfbBits c; - - cfb8StippleMode = FillStippled; - cfb8StippleAlu = alu; - cfb8StippleFg = fg & PMSK; - cfb8StipplePm = planemask & PMSK; - rrop = cfbReduceRasterOp (alu, fg, planemask, &and, &xor); - cfb8StippleRRop = rrop; - /* - * create the appropriate pixel-fill bits for current - * foreground - */ - for (s = 0; s < NUM_MASKS; s++) - { - c = cfb8StippleMasks[s]; - cfb8StippleAnd[s] = and | ~c; - cfb8StippleXor[s] = xor & c; - } - return TRUE; -} - - -int -cfb8SetOpaqueStipple (alu, fg, bg, planemask) -int alu; -CfbBits fg, bg, planemask; -{ - CfbBits andfg, xorfg, andbg, xorbg, rropfg, rropbg; - int s; - CfbBits c; - - cfb8StippleMode = FillOpaqueStippled; - cfb8StippleAlu = alu; - cfb8StippleFg = fg & PMSK; - cfb8StippleBg = bg & PMSK; - cfb8StipplePm = planemask & PMSK; - rropfg = cfbReduceRasterOp (alu, cfb8StippleFg, cfb8StipplePm, &andfg, &xorfg); - rropbg = cfbReduceRasterOp (alu, cfb8StippleBg, cfb8StipplePm, &andbg, &xorbg); - if (rropfg == rropbg) - cfb8StippleRRop = rropfg; - else - cfb8StippleRRop = GXset; - /* - * create the appropriate pixel-fill bits for current - * foreground - */ - for (s = 0; s < NUM_MASKS; s++) - { - c = cfb8StippleMasks[s]; - cfb8StippleAnd[s] = (andfg | ~c) & (andbg | c); - cfb8StippleXor[s] = (xorfg & c) | (xorbg & ~c); - } - return TRUE; -} - -/* - * a grungy little routine. This computes clip masks - * for partial character blts. Returns rgnOUT if the - * entire character is clipped; returns rgnIN if the entire - * character is unclipped; returns rgnPART if a portion of - * the character is visible. Computes clip masks for each - * longword of the character -- and those with the - * contents of the glyph to compute the visible bits. - */ - -#if PGSZ == 32 -#if (BITMAP_BIT_ORDER == MSBFirst) -PixelGroup cfb8BitLenMasks[PGSZ] = { - 0xffffffff, 0x7fffffff, 0x3fffffff, 0x1fffffff, - 0x0fffffff, 0x07ffffff, 0x03ffffff, 0x01ffffff, - 0x00ffffff, 0x007fffff, 0x003fffff, 0x001fffff, - 0x000fffff, 0x0007ffff, 0x0003ffff, 0x0001ffff, - 0x0000ffff, 0x00007fff, 0x00003fff, 0x00001fff, - 0x00000fff, 0x000007ff, 0x000003ff, 0x000001ff, - 0x000000ff, 0x0000007f, 0x0000003f, 0x0000001f, - 0x0000000f, 0x00000007, 0x00000003, 0x00000001, -}; -#else -PixelGroup cfb8BitLenMasks[PGSZ] = { - 0xffffffff, 0xfffffffe, 0xfffffffc, 0xfffffff8, - 0xfffffff0, 0xffffffe0, 0xffffffc0, 0xffffff80, - 0xffffff00, 0xfffffe00, 0xfffffc00, 0xfffff800, - 0xfffff000, 0xffffe000, 0xffffc000, 0xffff8000, - 0xffff0000, 0xfffe0000, 0xfffc0000, 0xfff80000, - 0xfff00000, 0xffe00000, 0xffc00000, 0xff800000, - 0xff000000, 0xfe000000, 0xfc000000, 0xf8000000, - 0xf0000000, 0xe0000000, 0xc0000000, 0x80000000, -}; -#endif /* BITMAP_BIT_ORDER */ -#else /* PGSZ == 64 */ -#if (BITMAP_BIT_ORDER == MSBFirst) -PixelGroup cfb8BitLenMasks[PGSZ] = { - 0xffffffffffffffff, 0x7fffffffffffffff, - 0x3fffffffffffffff, 0x1fffffffffffffff, - 0x0fffffffffffffff, 0x07ffffffffffffff, - 0x03ffffffffffffff, 0x01ffffffffffffff, - 0x00ffffffffffffff, 0x007fffffffffffff, - 0x003fffffffffffff, 0x001fffffffffffff, - 0x000fffffffffffff, 0x0007ffffffffffff, - 0x0003ffffffffffff, 0x0001ffffffffffff, - 0x0000ffffffffffff, 0x00007fffffffffff, - 0x00003fffffffffff, 0x00001fffffffffff, - 0x00000fffffffffff, 0x000007ffffffffff, - 0x000003ffffffffff, 0x000001ffffffffff, - 0x000000ffffffffff, 0x0000007fffffffff, - 0x0000003fffffffff, 0x0000001fffffffff, - 0x0000000fffffffff, 0x00000007ffffffff, - 0x00000003ffffffff, 0x00000001ffffffff, - 0x00000000ffffffff, 0x000000007fffffff, - 0x000000003fffffff, 0x000000001fffffff, - 0x000000000fffffff, 0x0000000007ffffff, - 0x0000000003ffffff, 0x0000000001ffffff, - 0x0000000000ffffff, 0x00000000007fffff, - 0x00000000003fffff, 0x00000000001fffff, - 0x00000000000fffff, 0x000000000007ffff, - 0x000000000003ffff, 0x000000000001ffff, - 0x000000000000ffff, 0x0000000000007fff, - 0x0000000000003fff, 0x0000000000001fff, - 0x0000000000000fff, 0x00000000000007ff, - 0x00000000000003ff, 0x00000000000001ff, - 0x00000000000000ff, 0x000000000000007f, - 0x000000000000003f, 0x000000000000001f, - 0x000000000000000f, 0x0000000000000007, - 0x0000000000000003, 0x0000000000000001 -}; -#else -PixelGroup cfb8BitLenMasks[PGSZ] = { - 0xffffffffffffffff, 0xfffffffffffffffe, - 0xfffffffffffffffc, 0xfffffffffffffff8, - 0xfffffffffffffff0, 0xffffffffffffffe0, - 0xffffffffffffffc0, 0xffffffffffffff80, - 0xffffffffffffff00, 0xfffffffffffffe00, - 0xfffffffffffffc00, 0xfffffffffffff800, - 0xfffffffffffff000, 0xffffffffffffe000, - 0xffffffffffffc000, 0xffffffffffff8000, - 0xffffffffffff0000, 0xfffffffffffe0000, - 0xfffffffffffc0000, 0xfffffffffff80000, - 0xfffffffffff00000, 0xffffffffffe00000, - 0xffffffffffc00000, 0xffffffffff800000, - 0xffffffffff000000, 0xfffffffffe000000, - 0xfffffffffc000000, 0xfffffffff8000000, - 0xfffffffff0000000, 0xffffffffe0000000, - 0xffffffffc0000000, 0xffffffff80000000, - 0xffffffff00000000, 0xfffffffe00000000, - 0xfffffffc00000000, 0xfffffff800000000, - 0xfffffff000000000, 0xffffffe000000000, - 0xffffffc000000000, 0xffffff8000000000, - 0xffffff0000000000, 0xfffffe0000000000, - 0xfffffc0000000000, 0xfffff80000000000, - 0xfffff00000000000, 0xffffe00000000000, - 0xffffc00000000000, 0xffff800000000000, - 0xffff000000000000, 0xfffe000000000000, - 0xfffc000000000000, 0xfff8000000000000, - 0xfff0000000000000, 0xffe0000000000000, - 0xffc0000000000000, 0xff80000000000000, - 0xff00000000000000, 0xfe00000000000000, - 0xfc00000000000000, 0xf800000000000000, - 0xf000000000000000, 0xe000000000000000, - 0xc000000000000000, 0x8000000000000000 -}; -#endif /* BITMAP_BIT_ORDER */ -#endif /* PGSZ */ - - - -int -cfb8ComputeClipMasks32 (pBox, numRects, x, y, w, h, clips) - BoxPtr pBox; - int numRects; - int x, y, w, h; - CARD32 *clips; -{ - int yBand, yBandBot; - int ch; - CfbBits clip; - int partIN = FALSE, partOUT = FALSE; - int result; - - if (numRects == 0) - return rgnOUT; - while (numRects && pBox->y2 <= y) - { - --numRects; - ++pBox; - } - if (!numRects || pBox->y1 >= y + h) - return rgnOUT; - yBand = pBox->y1; - while (numRects && pBox->y1 == yBand && pBox->x2 <= x) - { - --numRects; - ++pBox; - } - if (!numRects || pBox->y1 >= y + h) - return rgnOUT; - if (numRects && - x >= pBox->x1 && - x + w <= pBox->x2 && - y >= pBox->y1 && - y + h <= pBox->y2) - { - return rgnIN; - } - ch = 0; - while (numRects && pBox->y1 < y + h) - { - yBand = pBox->y1; - yBandBot = pBox->y2; - while (ch < h && y + ch < yBand) - { - partOUT = TRUE; - clips[ch++] = 0; - } - if (ch >= h) - break; - while (numRects && pBox->y1 == yBand && pBox->x2 <= x) - { - --numRects; - ++pBox; - } - if (!numRects) - break; - clip = 0; - while (numRects && pBox->y1 == yBand && pBox->x1 < x + w) - { - if (x < pBox->x1) - if (pBox->x2 < x + w) - clip |= cfb8BitLenMasks[pBox->x1 - x] & ~cfb8BitLenMasks[pBox->x2 - x]; - else - clip |= cfb8BitLenMasks[pBox->x1 - x]; - else - if (pBox->x2 < x + w) - clip |= ~cfb8BitLenMasks[pBox->x2 - x]; - else - clip = ~0; - --numRects; - ++pBox; - } - if (clip != 0) - partIN = TRUE; - if (clip != ~0) - partOUT = TRUE; - while (ch < h && y + ch < yBandBot) - clips[ch++] = clip; - while (numRects && pBox->y1 == yBand) - { - --numRects; - ++pBox; - } - } - while (ch < h) - { - partOUT = TRUE; - clips[ch++] = 0; - } - result = rgnOUT; - if (partIN) - { - if (partOUT) - result = rgnPART; - else - result = rgnIN; - } - return result; -} - -#endif /* PSZ == 8 */ diff --git a/nx-X11/programs/Xserver/cfb/cfb8bit.h b/nx-X11/programs/Xserver/cfb/cfb8bit.h deleted file mode 100644 index 767549af7..000000000 --- a/nx-X11/programs/Xserver/cfb/cfb8bit.h +++ /dev/null @@ -1,1572 +0,0 @@ -/* - * cfb8bit.h - * - * Defines which are only useful to 8 bit color frame buffers - * - * That doesn't seem to be true any more. Some of the macros in here - * are used for depths other than 8. Perhaps the file should be - * renamed. dpw - */ -/* $XFree86: xc/programs/Xserver/cfb/cfb8bit.h,v 3.7 2001/12/14 19:59:20 dawes Exp $ */ - -/* - -Copyright 1989, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. -*/ - -/* $Xorg: cfb8bit.h,v 1.4 2001/02/09 02:04:37 xorgcvs Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "servermd.h" - -#if (BITMAP_BIT_ORDER == MSBFirst) -#define GetBitGroup(x) (((PixelGroup) (x)) >> (PGSZ - PGSZB)) -#define NextBitGroup(x) ((x) <<= PGSZB) -#define NextSomeBits(x,n) ((x) <<= (n)) -#else -#define GetBitGroup(x) ((x) & PGSZBMSK) -#define NextBitGroup(x) ((x) >>= PGSZB) -#define NextSomeBits(x,n) ((x) >>= (n)) -#endif - -#define RotBitsLeft(x,k) ((x) = BitLeft (x,k) | \ - BitRight (x, PGSZ-(k))) - -#if defined(__GNUC__) && defined(mc68020) -#undef RotBitsLeft -#define RotBitsLeft(x,k) asm("rol%.l %2,%0" \ - : "=d" (x) \ - : "0" (x), "dI" (k)) -#endif - -#if PSZ == 8 - -#define GetPixelGroup(x) (cfb8StippleXor[GetBitGroup(x)]) -#define RRopPixels(dst,x) (DoRRop(dst,cfb8StippleAnd[x], cfb8StippleXor[x])) -#define RRopPixelGroup(dst,x) (RRopPixels(dst,GetBitGroup(x))) -#define MaskRRopPixels(dst,x,mask) (DoMaskRRop(dst,cfb8StippleAnd[x], cfb8StippleXor[x], mask)) - -#define NUM_MASKS (1<= MFB_PPW) \ - { \ - inputBits = *srcTemp++; \ - bitsLeft -= MFB_PPW; \ - partBitsLeft = MFB_PPW; \ - } \ - else \ - { \ - inputBits = 0; \ - if (bitsLeft) \ - inputBits = *srcTemp & ~cfb8BitLenMasks[bitsLeft]; \ - srcTemp = srcStart; \ - partBitsLeft = bitsLeft; \ - bitsLeft = bitsWhole; \ - } - -#define NextUnnaturalStippleBits \ - if (partBitsLeft >= PPW) { \ - bits = GetBitGroup (inputBits); \ - NextBitGroup (inputBits); \ - partBitsLeft -= PPW; \ - } else { \ - bits = GetBitGroup (inputBits); \ - nextPartBits = PPW - partBitsLeft; \ - NextUnnaturalStippleWord \ - if (partBitsLeft < nextPartBits) { \ - if (partBitsLeft) {\ - bits |= BitRight (GetBitGroup (inputBits), \ - PPW - nextPartBits) & PPWMSK;\ - nextPartBits -= partBitsLeft; \ - } \ - NextUnnaturalStippleWord \ - } \ - bits |= BitRight (GetBitGroup (inputBits), \ - PPW - nextPartBits) & PPWMSK; \ - NextSomeBits (inputBits, nextPartBits); \ - partBitsLeft -= nextPartBits; \ - } - -#define NextUnnaturalStippleBitsFast \ - if (partBitsLeft >= PPW) { \ - bits = GetBitGroup(inputBits); \ - NextBitGroup(inputBits); \ - partBitsLeft -= PPW; \ - } else { \ - bits = GetBitGroup (inputBits); \ - nextPartBits = PPW - partBitsLeft; \ - inputBits = *srcTemp++; \ - bits |= BitRight (GetBitGroup (inputBits), \ - partBitsLeft) & PPWMSK; \ - NextSomeBits (inputBits, nextPartBits); \ - partBitsLeft = MFB_PPW - nextPartBits; \ - } - -/* - * WriteBitGroup takes the destination address, a pixel - * value (which must be 8 bits duplicated 4 time with PFILL) - * and the PPW bits to write, which must be in the low order - * bits of the register (probably from GetBitGroup) and writes - * the appropriate locations in memory with the pixel value. This - * is a copy-mode only operation. - */ - -#define RRopBitGroup(dst,bits) \ - { \ - *(dst) = RRopPixels(*(dst),bits); \ - } - -#define MaskRRopBitGroup(dst,bits,mask) \ - { \ - *(dst) = MaskRRopPixels(*(dst),bits,mask); \ - } -#endif /* PSZ == 8 */ - -#if !defined(AVOID_MEMORY_READ) && PSZ == 8 - -#define WriteBitGroup(dst,pixel,bits) \ - { \ - register PixelGroup _maskTmp = cfb8PixelMasks[(bits)]; \ - *(dst) = (*(dst) & ~_maskTmp) | ((pixel) & _maskTmp); \ - } - -#define SwitchBitGroup(dst,pixel,bits) \ - { \ - register PixelGroup _maskTmp = cfb8PixelMasks[(bits)]; \ - register PixelGroup _pixTmp = ((pixel) & _maskTmp); \ - _maskTmp = ~_maskTmp; \ - SwitchBitsLoop (*(dst) = (*(dst) & _maskTmp) | _pixTmp;) \ - } - -#else /* AVOID_MEMORY_READ */ - -#if PGSZ == 32 -#if (BITMAP_BIT_ORDER == MSBFirst) -#define SinglePixel0 3 -#define SinglePixel1 2 -#define SinglePixel2 1 -#define SinglePixel3 0 -#define SinglePixel4 7 -#define SinglePixel5 6 -#define SinglePixel6 5 -#define SinglePixel7 4 -#define SinglePixel8 0xB -#define SinglePixel9 0xA -#define DoublePixel0 1 -#define DoublePixel1 0 -#define DoublePixel2 3 -#define DoublePixel3 2 -#define DoublePixel4 5 -#define DoublePixel5 4 -#else -#define SinglePixel0 0 -#define SinglePixel1 1 -#define SinglePixel2 2 -#define SinglePixel3 3 -#define SinglePixel4 4 -#define SinglePixel5 5 -#define SinglePixel6 6 -#define SinglePixel7 7 -#define SinglePixel8 8 -#define SinglePixel9 9 -#define DoublePixel0 0 -#define DoublePixel1 1 -#define DoublePixel2 2 -#define DoublePixel3 3 -#define DoublePixel4 4 -#define DoublePixel5 5 -#endif -#define QuadPixel0 0 -#define QuadPixel1 1 -#define QuadPixel2 2 -#else /* PGSZ == 64 */ -#if (BITMAP_BIT_ORDER == MSBFirst) -#define SinglePixel0 7 -#define SinglePixel1 6 -#define SinglePixel2 5 -#define SinglePixel3 4 -#define SinglePixel4 3 -#define SinglePixel5 2 -#define SinglePixel6 1 -#define SinglePixel7 0 -#define DoublePixel0 3 -#define DoublePixel1 2 -#define DoublePixel2 1 -#define DoublePixel3 0 -#define QuadPixel0 1 -#define QuadPixel1 0 -#else -#define SinglePixel0 0 -#define SinglePixel1 1 -#define SinglePixel2 2 -#define SinglePixel3 3 -#define SinglePixel4 4 -#define SinglePixel5 5 -#define SinglePixel6 6 -#define SinglePixel7 7 -#define DoublePixel0 0 -#define DoublePixel1 1 -#define DoublePixel2 2 -#define DoublePixel3 3 -#define QuadPixel0 0 -#define QuadPixel1 1 -#endif -#define OctaPixel0 0 -#endif /* PGSZ == 64 */ - -#if PSZ == 8 - -#if PGSZ == 32 -#define WriteBitGroup(dst,pixel,bits) \ - switch (bits) { \ - case 0: \ - break; \ - case 1: \ - ((CARD8 *) (dst))[SinglePixel0] = (pixel); \ - break; \ - case 2: \ - ((CARD8 *) (dst))[SinglePixel1] = (pixel); \ - break; \ - case 3: \ - ((CARD16 *) (dst))[DoublePixel0] = (pixel); \ - break; \ - case 4: \ - ((CARD8 *) (dst))[SinglePixel2] = (pixel); \ - break; \ - case 5: \ - ((CARD8 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel2] = (pixel); \ - break; \ - case 6: \ - ((CARD8 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel2] = (pixel); \ - break; \ - case 7: \ - ((CARD16 *) (dst))[DoublePixel0] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel2] = (pixel); \ - break; \ - case 8: \ - ((CARD8 *) (dst))[SinglePixel3] = (pixel); \ - break; \ - case 9: \ - ((CARD8 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel3] = (pixel); \ - break; \ - case 10: \ - ((CARD8 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel3] = (pixel); \ - break; \ - case 11: \ - ((CARD16 *) (dst))[DoublePixel0] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel3] = (pixel); \ - break; \ - case 12: \ - ((CARD16 *) (dst))[DoublePixel1] = (pixel); \ - break; \ - case 13: \ - ((CARD8 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD16 *) (dst))[DoublePixel1] = (pixel); \ - break; \ - case 14: \ - ((CARD8 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD16 *) (dst))[DoublePixel1] = (pixel); \ - break; \ - case 15: \ - ((CARD32 *) (dst))[0] = (pixel); \ - break; \ - } -#else /* PGSZ == 64 */ -#define WriteBitGroup(dst,pixel,bits) \ - if ( bits == 0xff ) \ - ((PixelGroup *) (dst))[OctaPixel0] = (pixel); \ - else { \ - switch (bits & 0x0f) { \ - case 0: \ - break; \ - case 1: \ - ((CARD8 *) (dst))[SinglePixel0] = (pixel); \ - break; \ - case 2: \ - ((CARD8 *) (dst))[SinglePixel1] = (pixel); \ - break; \ - case 3: \ - ((CARD16 *) (dst))[DoublePixel0] = (pixel); \ - break; \ - case 4: \ - ((CARD8 *) (dst))[SinglePixel2] = (pixel); \ - break; \ - case 5: \ - ((CARD8 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel2] = (pixel); \ - break; \ - case 6: \ - ((CARD8 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel2] = (pixel); \ - break; \ - case 7: \ - ((CARD16 *) (dst))[DoublePixel0] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel2] = (pixel); \ - break; \ - case 8: \ - ((CARD8 *) (dst))[SinglePixel3] = (pixel); \ - break; \ - case 9: \ - ((CARD8 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel3] = (pixel); \ - break; \ - case 10: \ - ((CARD8 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel3] = (pixel); \ - break; \ - case 11: \ - ((CARD16 *) (dst))[DoublePixel0] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel3] = (pixel); \ - break; \ - case 12: \ - ((CARD16 *) (dst))[DoublePixel1] = (pixel); \ - break; \ - case 13: \ - ((CARD8 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD16 *) (dst))[DoublePixel1] = (pixel); \ - break; \ - case 14: \ - ((CARD8 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD16 *) (dst))[DoublePixel1] = (pixel); \ - break; \ - case 15: \ - ((CARD32 *) (dst))[QuadPixel0] = (pixel); \ - break; \ - } \ - switch ((bits & 0xf0) >> 4) { \ - case 0: \ - break; \ - case 1: \ - ((CARD8 *) (dst))[SinglePixel4] = (pixel); \ - break; \ - case 2: \ - ((CARD8 *) (dst))[SinglePixel5] = (pixel); \ - break; \ - case 3: \ - ((CARD16 *) (dst))[DoublePixel2] = (pixel); \ - break; \ - case 4: \ - ((CARD8 *) (dst))[SinglePixel6] = (pixel); \ - break; \ - case 5: \ - ((CARD8 *) (dst))[SinglePixel4] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel6] = (pixel); \ - break; \ - case 6: \ - ((CARD8 *) (dst))[SinglePixel5] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel6] = (pixel); \ - break; \ - case 7: \ - ((CARD16 *) (dst))[DoublePixel2] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel6] = (pixel); \ - break; \ - case 8: \ - ((CARD8 *) (dst))[SinglePixel7] = (pixel); \ - break; \ - case 9: \ - ((CARD8 *) (dst))[SinglePixel4] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel7] = (pixel); \ - break; \ - case 10: \ - ((CARD8 *) (dst))[SinglePixel5] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel7] = (pixel); \ - break; \ - case 11: \ - ((CARD16 *) (dst))[DoublePixel2] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel7] = (pixel); \ - break; \ - case 12: \ - ((CARD16 *) (dst))[DoublePixel3] = (pixel); \ - break; \ - case 13: \ - ((CARD8 *) (dst))[SinglePixel4] = (pixel); \ - ((CARD16 *) (dst))[DoublePixel3] = (pixel); \ - break; \ - case 14: \ - ((CARD8 *) (dst))[SinglePixel5] = (pixel); \ - ((CARD16 *) (dst))[DoublePixel3] = (pixel); \ - break; \ - case 15: \ - ((CARD32 *) (dst))[QuadPixel1] = (pixel); \ - break; \ - } \ - } -#endif /* PGSZ == 64 */ - -#if PGSZ == 32 -#define SwitchBitGroup(dst,pixel,bits) { \ - switch (bits) { \ - case 0: \ - break; \ - case 1: \ - SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel0] = (pixel);) \ - break; \ - case 2: \ - SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel1] = (pixel);) \ - break; \ - case 3: \ - SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel0] = (pixel);) \ - break; \ - case 4: \ - SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel2] = (pixel);) \ - break; \ - case 5: \ - SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel2] = (pixel);) \ - break; \ - case 6: \ - SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel2] = (pixel);) \ - break; \ - case 7: \ - SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel0] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel2] = (pixel);) \ - break; \ - case 8: \ - SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel3] = (pixel);) \ - break; \ - case 9: \ - SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel3] = (pixel);) \ - break; \ - case 10: \ - SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel3] = (pixel);) \ - break; \ - case 11: \ - SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel0] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel3] = (pixel);) \ - break; \ - case 12: \ - SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel1] = (pixel);) \ - break; \ - case 13: \ - SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD16 *) (dst))[DoublePixel1] = (pixel);) \ - break; \ - case 14: \ - SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD16 *) (dst))[DoublePixel1] = (pixel);) \ - break; \ - case 15: \ - SwitchBitsLoop (((CARD32 *) (dst))[0] = (pixel);) \ - break; \ - } \ -} -#else /* PGSZ == 64 */ -#define SwitchBitGroup(dst,pixel,bits) { \ - if ( bits == 0xff ) \ - SwitchBitsLoop (((PixelGroup *) (dst))[OctaPixel0] = (pixel);) \ - else { \ - switch (bits & 0x0f) { \ - case 0: \ - break; \ - case 1: \ - SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel0] = (pixel);) \ - break; \ - case 2: \ - SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel1] = (pixel);) \ - break; \ - case 3: \ - SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel0] = (pixel);)\ - break; \ - case 4: \ - SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel2] = (pixel);) \ - break; \ - case 5: \ - SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel2] = (pixel);) \ - break; \ - case 6: \ - SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel2] = (pixel);) \ - break; \ - case 7: \ - SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel0] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel2] = (pixel);) \ - break; \ - case 8: \ - SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel3] = (pixel);) \ - break; \ - case 9: \ - SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel3] = (pixel);) \ - break; \ - case 10: \ - SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel3] = (pixel);) \ - break; \ - case 11: \ - SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel0] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel3] = (pixel);) \ - break; \ - case 12: \ - SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel1] = (pixel);)\ - break; \ - case 13: \ - SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD16 *) (dst))[DoublePixel1] = (pixel);)\ - break; \ - case 14: \ - SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD16 *) (dst))[DoublePixel1] = (pixel);)\ - break; \ - case 15: \ - SwitchBitsLoop (((CARD32 *) (dst))[QuadPixel0] = (pixel);) \ - break; \ - } \ - switch ((bits & 0xf0) >> 4) { \ - case 0: \ - break; \ - case 1: \ - SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel4] = (pixel);) \ - break; \ - case 2: \ - SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel5] = (pixel);) \ - break; \ - case 3: \ - SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel2] = (pixel);)\ - break; \ - case 4: \ - SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel6] = (pixel);) \ - break; \ - case 5: \ - SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel4] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel6] = (pixel);) \ - break; \ - case 6: \ - SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel5] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel6] = (pixel);) \ - break; \ - case 7: \ - SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel2] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel6] = (pixel);) \ - break; \ - case 8: \ - SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel7] = (pixel);) \ - break; \ - case 9: \ - SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel4] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel7] = (pixel);) \ - break; \ - case 10: \ - SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel5] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel7] = (pixel);) \ - break; \ - case 11: \ - SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel2] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel7] = (pixel);) \ - break; \ - case 12: \ - SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel3] = (pixel);)\ - break; \ - case 13: \ - SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel4] = (pixel); \ - ((CARD16 *) (dst))[DoublePixel3] = (pixel);)\ - break; \ - case 14: \ - SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel5] = (pixel); \ - ((CARD16 *) (dst))[DoublePixel3] = (pixel);)\ - break; \ - case 15: \ - SwitchBitsLoop (((CARD32 *) (dst))[QuadPixel1] = (pixel);) \ - break; \ - } \ - } \ -} -#endif /* PGSZ == 64 */ -#endif /* PSZ == 8 */ - -#if PSZ == 16 - -#if PGSZ == 32 -#define WriteBitGroup(dst,pixel,bits) \ - switch (bits) { \ - case 0: \ - break; \ - case 1: \ - ((CARD16 *) (dst))[SinglePixel0] = (pixel); \ - break; \ - case 2: \ - ((CARD16 *) (dst))[SinglePixel1] = (pixel); \ - break; \ - case 3: \ - ((CARD32 *) (dst))[DoublePixel0] = (pixel); \ - break; \ - case 4: \ - ((CARD16 *) (dst))[SinglePixel2] = (pixel); \ - break; \ - case 5: \ - ((CARD16 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD16 *) (dst))[SinglePixel2] = (pixel); \ - break; \ - case 6: \ - ((CARD16 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD16 *) (dst))[SinglePixel2] = (pixel); \ - break; \ - case 7: \ - ((CARD32 *) (dst))[DoublePixel0] = (pixel); \ - ((CARD16 *) (dst))[SinglePixel2] = (pixel); \ - break; \ - case 8: \ - ((CARD16 *) (dst))[SinglePixel3] = (pixel); \ - break; \ - case 9: \ - ((CARD16 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD16 *) (dst))[SinglePixel3] = (pixel); \ - break; \ - case 10: \ - ((CARD16 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD16 *) (dst))[SinglePixel3] = (pixel); \ - break; \ - case 11: \ - ((CARD32 *) (dst))[DoublePixel0] = (pixel); \ - ((CARD16 *) (dst))[SinglePixel3] = (pixel); \ - break; \ - case 12: \ - ((CARD32 *) (dst))[DoublePixel1] = (pixel); \ - break; \ - case 13: \ - ((CARD16 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD32 *) (dst))[DoublePixel1] = (pixel); \ - break; \ - case 14: \ - ((CARD16 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD32 *) (dst))[DoublePixel1] = (pixel); \ - break; \ - case 15: \ - ((CARD32 *) (dst))[DoublePixel0] = (pixel); \ - ((CARD32 *) (dst))[DoublePixel1] = (pixel); \ - break; \ - } -#else /* PGSZ == 64 */ -#define WriteBitGroup(dst,pixel,bits) \ - if ( bits == 0xff ) { \ - ((PixelGroup *) (dst))[QuadPixel0] = (pixel); \ - ((PixelGroup *) (dst))[QuadPixel1] = (pixel); \ - } \ - else { \ - switch (bits & 0x0f) { \ - case 0: \ - break; \ - case 1: \ - ((CARD16 *) (dst))[SinglePixel0] = (pixel); \ - break; \ - case 2: \ - ((CARD16 *) (dst))[SinglePixel1] = (pixel); \ - break; \ - case 3: \ - ((CARD32 *) (dst))[DoublePixel0] = (pixel); \ - break; \ - case 4: \ - ((CARD16 *) (dst))[SinglePixel2] = (pixel); \ - break; \ - case 5: \ - ((CARD16 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD16 *) (dst))[SinglePixel2] = (pixel); \ - break; \ - case 6: \ - ((CARD16 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD16 *) (dst))[SinglePixel2] = (pixel); \ - break; \ - case 7: \ - ((CARD32 *) (dst))[DoublePixel0] = (pixel); \ - ((CARD16 *) (dst))[SinglePixel2] = (pixel); \ - break; \ - case 8: \ - ((CARD16 *) (dst))[SinglePixel3] = (pixel); \ - break; \ - case 9: \ - ((CARD16 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD16 *) (dst))[SinglePixel3] = (pixel); \ - break; \ - case 10: \ - ((CARD16 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD16 *) (dst))[SinglePixel3] = (pixel); \ - break; \ - case 11: \ - ((CARD32 *) (dst))[DoublePixel0] = (pixel); \ - ((CARD16 *) (dst))[SinglePixel3] = (pixel); \ - break; \ - case 12: \ - ((CARD32 *) (dst))[DoublePixel1] = (pixel); \ - break; \ - case 13: \ - ((CARD16 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD32 *) (dst))[DoublePixel1] = (pixel); \ - break; \ - case 14: \ - ((CARD16 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD32 *) (dst))[DoublePixel1] = (pixel); \ - break; \ - case 15: \ - ((CARD32 *) (dst))[DoublePixel0] = (pixel); \ - ((CARD32 *) (dst))[DoublePixel1] = (pixel); \ - break; \ - } \ - switch ((bits & 0xf0) >> 4) { \ - case 0: \ - break; \ - case 1: \ - ((CARD16 *) (dst))[SinglePixel4] = (pixel); \ - break; \ - case 2: \ - ((CARD16 *) (dst))[SinglePixel5] = (pixel); \ - break; \ - case 3: \ - ((CARD32 *) (dst))[DoublePixel2] = (pixel); \ - break; \ - case 4: \ - ((CARD16 *) (dst))[SinglePixel6] = (pixel); \ - break; \ - case 5: \ - ((CARD16 *) (dst))[SinglePixel4] = (pixel); \ - ((CARD16 *) (dst))[SinglePixel6] = (pixel); \ - break; \ - case 6: \ - ((CARD16 *) (dst))[SinglePixel5] = (pixel); \ - ((CARD16 *) (dst))[SinglePixel6] = (pixel); \ - break; \ - case 7: \ - ((CARD32 *) (dst))[DoublePixel2] = (pixel); \ - ((CARD16 *) (dst))[SinglePixel6] = (pixel); \ - break; \ - case 8: \ - ((CARD16 *) (dst))[SinglePixel7] = (pixel); \ - break; \ - case 9: \ - ((CARD16 *) (dst))[SinglePixel4] = (pixel); \ - ((CARD16 *) (dst))[SinglePixel7] = (pixel); \ - break; \ - case 10: \ - ((CARD16 *) (dst))[SinglePixel5] = (pixel); \ - ((CARD16 *) (dst))[SinglePixel7] = (pixel); \ - break; \ - case 11: \ - ((CARD32 *) (dst))[DoublePixel2] = (pixel); \ - ((CARD16 *) (dst))[SinglePixel7] = (pixel); \ - break; \ - case 12: \ - ((CARD32 *) (dst))[DoublePixel3] = (pixel); \ - break; \ - case 13: \ - ((CARD16 *) (dst))[SinglePixel4] = (pixel); \ - ((CARD32 *) (dst))[DoublePixel3] = (pixel); \ - break; \ - case 14: \ - ((CARD16 *) (dst))[SinglePixel5] = (pixel); \ - ((CARD32 *) (dst))[DoublePixel3] = (pixel); \ - break; \ - case 15: \ - ((CARD32 *) (dst))[DoublePixel2] = (pixel); \ - ((CARD32 *) (dst))[DoublePixel3] = (pixel); \ - break; \ - } \ - } -#endif /* PGSZ */ - -#if PGSZ == 32 -#define SwitchBitGroup(dst,pixel,bits) { \ - switch (bits) { \ - case 0: \ - break; \ - case 1: \ - SwitchBitsLoop (((CARD16 *) (dst))[SinglePixel0] = (pixel);) \ - break; \ - case 2: \ - SwitchBitsLoop (((CARD16 *) (dst))[SinglePixel1] = (pixel);) \ - break; \ - case 3: \ - SwitchBitsLoop (((CARD32 *) (dst))[DoublePixel0] = (pixel);) \ - break; \ - case 4: \ - SwitchBitsLoop (((CARD16 *) (dst))[SinglePixel2] = (pixel);) \ - break; \ - case 5: \ - SwitchBitsLoop (((CARD16 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD16 *) (dst))[SinglePixel2] = (pixel);) \ - break; \ - case 6: \ - SwitchBitsLoop (((CARD16 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD16 *) (dst))[SinglePixel2] = (pixel);) \ - break; \ - case 7: \ - SwitchBitsLoop (((CARD32 *) (dst))[DoublePixel0] = (pixel); \ - ((CARD16 *) (dst))[SinglePixel2] = (pixel);) \ - break; \ - case 8: \ - SwitchBitsLoop (((CARD16 *) (dst))[SinglePixel3] = (pixel);) \ - break; \ - case 9: \ - SwitchBitsLoop (((CARD16 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD16 *) (dst))[SinglePixel3] = (pixel);) \ - break; \ - case 10: \ - SwitchBitsLoop (((CARD16 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD16 *) (dst))[SinglePixel3] = (pixel);) \ - break; \ - case 11: \ - SwitchBitsLoop (((CARD32 *) (dst))[DoublePixel0] = (pixel); \ - ((CARD16 *) (dst))[SinglePixel3] = (pixel);) \ - break; \ - case 12: \ - SwitchBitsLoop (((CARD32 *) (dst))[DoublePixel1] = (pixel);) \ - break; \ - case 13: \ - SwitchBitsLoop (((CARD16 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD32 *) (dst))[DoublePixel1] = (pixel);) \ - break; \ - case 14: \ - SwitchBitsLoop (((CARD16 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD32 *) (dst))[DoublePixel1] = (pixel);) \ - break; \ - case 15: \ - SwitchBitsLoop (((CARD32 *) (dst))[DoublePixel0] = (pixel); \ - ((CARD32 *) (dst))[DoublePixel1] = (pixel);) \ - break; \ - } \ -} -#else /* PGSZ == 64 */ -#define SwitchBitGroup(dst,pixel,bits) { \ - cfb cannot hack 64-bit SwitchBitGroup psz=PSZ -#endif /* PGSZ */ - -#endif /* PSZ == 16 */ - -#if PSZ == 24 -/* 32 000011112222*/ -/* 24 000111222333*/ -/* 16 001122334455*/ -/* 8 0123456789AB*/ -#if PGSZ == 32 -#define WriteBitGroup(dst,pixel,bits) \ - { \ - register CARD32 reg_pixel = (pixel); \ - switch (bits) { \ - case 0: \ - break; \ - case 1: \ - ((CARD16 *) (dst))[DoublePixel0] = reg_pixel; \ - ((CARD8 *) (dst))[SinglePixel2] = ((reg_pixel>>16)&0xFF); \ - break; \ - case 2: \ - ((CARD8 *) (dst))[SinglePixel3] = reg_pixel&0xFF; \ - ((CARD16 *) (dst))[DoublePixel2] = (reg_pixel>>8)&0xFFFF; \ - break; \ - case 3: \ - ((CARD8 *) (dst))[SinglePixel3] = reg_pixel & 0xFF; \ - ((CARD16 *) (dst))[DoublePixel0] = reg_pixel; \ - ((CARD16 *) (dst))[DoublePixel2] = (reg_pixel>>8)&0xFFFF; \ - ((CARD8 *) (dst))[SinglePixel2] = (reg_pixel>>16&0xFF); \ - break; \ - case 4: \ - ((CARD16 *) (dst))[DoublePixel3] = reg_pixel; \ - ((CARD8 *) (dst))[SinglePixel8] = (reg_pixel>>16)&0xFF; \ - break; \ - case 5: \ - ((CARD16 *) (dst))[DoublePixel0] = \ - ((CARD16 *) (dst))[DoublePixel3] = reg_pixel; \ - reg_pixel >>= 16; \ - ((CARD8 *) (dst))[SinglePixel2] = \ - ((CARD8 *) (dst))[SinglePixel8] = reg_pixel&0xFF; \ - break; \ - case 6: \ - ((CARD8 *) (dst))[SinglePixel3] = reg_pixel; \ - ((CARD16 *) (dst))[DoublePixel3] = reg_pixel; \ - reg_pixel >>= 8; \ - ((CARD16 *) (dst))[DoublePixel2] = reg_pixel; \ - reg_pixel >>= 8; \ - ((CARD8 *) (dst))[SinglePixel8] = reg_pixel&0xFF; \ - break; \ - case 7: \ - ((CARD16 *) (dst))[DoublePixel0] = \ - ((CARD16 *) (dst))[DoublePixel3] = reg_pixel; \ - ((CARD8 *) (dst))[SinglePixel3] = reg_pixel&0xFF; \ - reg_pixel >>= 8; \ - ((CARD16 *) (dst))[DoublePixel2] = reg_pixel; \ - reg_pixel >>= 8; \ - ((CARD8 *) (dst))[SinglePixel2] = \ - ((CARD8 *) (dst))[SinglePixel8] = reg_pixel&0xFF; \ - break; \ - case 8: \ - ((CARD8 *) (dst))[SinglePixel9] = reg_pixel&0xFF; \ - ((CARD16 *) (dst))[DoublePixel5] = (reg_pixel>>8); \ - break; \ - case 9: \ - ((CARD16 *) (dst))[DoublePixel0] = reg_pixel; \ - ((CARD8 *) (dst))[SinglePixel9] = reg_pixel&0xFF; \ - reg_pixel >>= 8; \ - ((CARD16 *) (dst))[DoublePixel5] = reg_pixel; \ - reg_pixel >>= 8; \ - ((CARD8 *) (dst))[SinglePixel2] = reg_pixel&0xFF; \ - break; \ - case 10: \ - ((CARD8 *) (dst))[SinglePixel3] = \ - ((CARD8 *) (dst))[SinglePixel9] = reg_pixel&0xFF; \ - reg_pixel >>= 8; \ - ((CARD16 *) (dst))[DoublePixel2] = \ - ((CARD16 *) (dst))[DoublePixel5] = reg_pixel; \ - break; \ - case 11: \ - ((CARD8 *) (dst))[SinglePixel3] = \ - ((CARD8 *) (dst))[SinglePixel9] = reg_pixel; \ - ((CARD16 *) (dst))[DoublePixel0] = reg_pixel; \ - reg_pixel >>= 8; \ - ((CARD16 *) (dst))[DoublePixel2] = \ - ((CARD16 *) (dst))[DoublePixel5] = reg_pixel; \ - reg_pixel >>= 8; \ - ((CARD8 *) (dst))[SinglePixel2] = reg_pixel; \ - break; \ - case 12: \ - ((CARD16 *) (dst))[DoublePixel3] = reg_pixel; \ - ((CARD8 *) (dst))[SinglePixel9] = reg_pixel; \ - reg_pixel >>= 8; \ - ((CARD16 *) (dst))[DoublePixel5] = reg_pixel; \ - reg_pixel >>= 8; \ - ((CARD8 *) (dst))[SinglePixel8] = reg_pixel; \ - break; \ - case 13: \ - ((CARD16 *) (dst))[DoublePixel0] = \ - ((CARD16 *) (dst))[DoublePixel3] = reg_pixel; \ - ((CARD8 *) (dst))[SinglePixel9] = reg_pixel; \ - reg_pixel >>= 8; \ - ((CARD16 *) (dst))[DoublePixel5] = reg_pixel; \ - reg_pixel >>= 8; \ - ((CARD8 *) (dst))[SinglePixel2] = \ - ((CARD8 *) (dst))[SinglePixel8] = reg_pixel; \ - break; \ - case 14: \ - ((CARD8 *) (dst))[SinglePixel3] = \ - ((CARD8 *) (dst))[SinglePixel9] = reg_pixel; \ - ((CARD16 *) (dst))[DoublePixel3] = reg_pixel; \ - reg_pixel >>= 8; \ - ((CARD16 *) (dst))[DoublePixel2] = \ - ((CARD16 *) (dst))[DoublePixel5] = reg_pixel; \ - reg_pixel >>= 8; \ - ((CARD8 *) (dst))[SinglePixel8] = reg_pixel; \ - break; \ - case 15: \ - ((CARD16 *) (dst))[DoublePixel0] = \ - ((CARD16 *) (dst))[DoublePixel3] = reg_pixel; \ - ((CARD8 *) (dst))[SinglePixel3] = \ - ((CARD8 *) (dst))[SinglePixel9] = reg_pixel; \ - reg_pixel >>= 8; \ - ((CARD16 *) (dst))[DoublePixel2] = \ - ((CARD16 *) (dst))[DoublePixel5] = reg_pixel; \ - reg_pixel >>= 8; \ - ((CARD8 *) (dst))[SinglePixel8] = \ - ((CARD8 *) (dst))[SinglePixel2] = reg_pixel; \ - break; \ - } \ - } -#else /* PGSZ == 64 */ -#define WriteBitGroup(dst,pixel,bits) \ - if ( bits == 0xff ) { \ - ((PixelGroup *) (dst))[DoublePixel0] = (pixel); \ - ((PixelGroup *) (dst))[DoublePixel1] = (pixel); \ - ((PixelGroup *) (dst))[DoublePixel2] = (pixel); \ - ((PixelGroup *) (dst))[DoublePixel3] = (pixel); \ - } \ - else { \ - switch (bits & 0x0f) { \ - case 0: \ - break; \ - case 1: \ - ((CARD32 *) (dst))[SinglePixel0] = (pixel); \ - break; \ - case 2: \ - ((CARD32 *) (dst))[SinglePixel1] = (pixel); \ - break; \ - case 3: \ - ((CARD32 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel1] = (pixel); \ - break; \ - case 4: \ - ((CARD32 *) (dst))[SinglePixel2] = (pixel); \ - break; \ - case 5: \ - ((CARD32 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel2] = (pixel); \ - break; \ - case 6: \ - ((CARD32 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel2] = (pixel); \ - break; \ - case 7: \ - ((CARD32 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel2] = (pixel); \ - break; \ - case 8: \ - ((CARD32 *) (dst))[SinglePixel3] = (pixel); \ - break; \ - case 9: \ - ((CARD32 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel3] = (pixel); \ - break; \ - case 10: \ - ((CARD32 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel3] = (pixel); \ - break; \ - case 11: \ - ((CARD32 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel3] = (pixel); \ - break; \ - case 12: \ - ((CARD32 *) (dst))[SinglePixel2] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel3] = (pixel); \ - break; \ - case 13: \ - ((CARD32 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel2] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel3] = (pixel); \ - break; \ - case 14: \ - ((CARD32 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel2] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel3] = (pixel); \ - break; \ - case 15: \ - ((CARD32 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel2] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel3] = (pixel); \ - break; \ - } \ - switch ((bits & 0xf0) >> 4) { \ - case 0: \ - break; \ - case 1: \ - ((CARD32 *) (dst))[SinglePixel4] = (pixel); \ - break; \ - case 2: \ - ((CARD32 *) (dst))[SinglePixel5] = (pixel); \ - break; \ - case 3: \ - ((CARD32 *) (dst))[SinglePixel4] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel5] = (pixel); \ - break; \ - case 4: \ - ((CARD32 *) (dst))[SinglePixel6] = (pixel); \ - break; \ - case 5: \ - ((CARD32 *) (dst))[SinglePixel4] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel6] = (pixel); \ - break; \ - case 6: \ - ((CARD32 *) (dst))[SinglePixel5] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel6] = (pixel); \ - break; \ - case 7: \ - ((CARD32 *) (dst))[SinglePixel4] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel5] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel6] = (pixel); \ - break; \ - case 8: \ - ((CARD32 *) (dst))[SinglePixel7] = (pixel); \ - break; \ - case 9: \ - ((CARD32 *) (dst))[SinglePixel4] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel7] = (pixel); \ - break; \ - case 10: \ - ((CARD32 *) (dst))[SinglePixel5] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel7] = (pixel); \ - break; \ - case 11: \ - ((CARD32 *) (dst))[SinglePixel4] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel5] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel7] = (pixel); \ - break; \ - case 12: \ - ((CARD32 *) (dst))[SinglePixel6] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel7] = (pixel); \ - break; \ - case 13: \ - ((CARD32 *) (dst))[SinglePixel4] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel6] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel7] = (pixel); \ - break; \ - case 14: \ - ((CARD32 *) (dst))[SinglePixel5] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel6] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel7] = (pixel); \ - break; \ - case 15: \ - ((CARD32 *) (dst))[SinglePixel4] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel5] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel6] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel7] = (pixel); \ - break; \ - } \ - } -#endif /* PGSZ */ - -#if PGSZ == 32 -#define SwitchBitGroup(dst,pixel,bits) { \ - switch (bits) { \ - case 0: \ - break; \ - case 1: \ - SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel0] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel2] = (pixel);) \ - break; \ - case 2: \ - SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel3] = (pixel); \ - ((CARD16 *) (dst))[DoublePixel2] = (pixel);) \ - break; \ - case 3: \ - SwitchBitsLoop (((CARD32 *) (dst))[QuadPixel0] = (pixel); \ - ((CARD16 *) (dst))[DoublePixel2] = (pixel);) \ - break; \ - case 4: \ - SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel3] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel8] = (pixel);) \ - break; \ - case 5: \ - SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel0] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel2] = (pixel); \ - ((CARD16 *) (dst))[DoublePixel3] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel8] = (pixel);) \ - break; \ - case 6: \ - SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel3] = (pixel); \ - ((CARD32 *) (dst))[QuadPixel2] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel8] = (pixel);) \ - break; \ - case 7: \ - SwitchBitsLoop (((CARD32 *) (dst))[QuadPixel0] = (pixel); \ - ((CARD32 *) (dst))[QuadPixel1] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel8] = (pixel);) \ - break; \ - case 8: \ - SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel9] = (pixel); \ - ((CARD16 *) (dst))[DoublePixel5] = (pixel);) \ - break; \ - case 9: \ - SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel0] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel2] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel9] = (pixel); \ - ((CARD16 *) (dst))[DoublePixel5] = (pixel);) \ - break; \ - case 10: \ - SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel3] = (pixel); \ - ((CARD16 *) (dst))[DoublePixel2] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel9] = (pixel); \ - ((CARD16 *) (dst))[DoublePixel5] = (pixel);) \ - break; \ - case 11: \ - SwitchBitsLoop (((CARD32 *) (dst))[QuadPixel0] = (pixel); \ - ((CARD16 *) (dst))[DoublePixel3] = (pixel);) \ - ((CARD8 *) (dst))[SinglePixel9] = (pixel); \ - ((CARD16 *) (dst))[DoublePixel5] = (pixel);) \ - break; \ - case 12: \ - SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel3] = (pixel); \ - ((CARD32 *) (dst))[QuadPixel2] = (pixel);) \ - break; \ - case 13: \ - SwitchBitsLoop (((CARD16 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD8 *) (dst))[SinglePixel2] = (pixel); \ - ((CARD16 *) (dst))[DoublePixel3] = (pixel); \ - ((CARD32 *) (dst))[QuadPixel2] = (pixel);) \ - break; \ - case 14: \ - SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel3] = (pixel); \ - ((CARD32 *) (dst))[QuadPixel1] = (pixel); \ - ((CARD32 *) (dst))[QuadPixel2] = (pixel);) \ - break; \ - case 15: \ - SwitchBitsLoop (((CARD32 *) (dst))[QuadPixel0] = (pixel); \ - ((CARD32 *) (dst))[QuadPixel1] = (pixel); \ - ((CARD32 *) (dst))[QuadPixel2] = (pixel);) \ - break; \ - } \ -} -#else /* PGSZ == 64 */ -#define SwitchBitGroup(dst,pixel,bits) { \ - cfb cannot hack 64-bit SwitchBitGroup psz=PSZ -#endif /* PGSZ */ - -#endif /* PSZ == 24 */ - -#if PSZ == 32 - -#if PGSZ == 32 -#define WriteBitGroup(dst,pixel,bits) \ - switch (bits) { \ - case 0: \ - break; \ - case 1: \ - ((CARD32 *) (dst))[SinglePixel0] = (pixel); \ - break; \ - case 2: \ - ((CARD32 *) (dst))[SinglePixel1] = (pixel); \ - break; \ - case 3: \ - ((CARD32 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel1] = (pixel); \ - break; \ - case 4: \ - ((CARD32 *) (dst))[SinglePixel2] = (pixel); \ - break; \ - case 5: \ - ((CARD32 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel2] = (pixel); \ - break; \ - case 6: \ - ((CARD32 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel2] = (pixel); \ - break; \ - case 7: \ - ((CARD32 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel2] = (pixel); \ - break; \ - case 8: \ - ((CARD32 *) (dst))[SinglePixel3] = (pixel); \ - break; \ - case 9: \ - ((CARD32 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel3] = (pixel); \ - break; \ - case 10: \ - ((CARD32 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel3] = (pixel); \ - break; \ - case 11: \ - ((CARD32 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel3] = (pixel); \ - break; \ - case 12: \ - ((CARD32 *) (dst))[SinglePixel2] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel3] = (pixel); \ - break; \ - case 13: \ - ((CARD32 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel2] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel3] = (pixel); \ - break; \ - case 14: \ - ((CARD32 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel2] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel3] = (pixel); \ - break; \ - case 15: \ - ((CARD32 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel2] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel3] = (pixel); \ - break; \ - } -#else /* PGSZ == 64 */ -#define WriteBitGroup(dst,pixel,bits) \ - if ( bits == 0xff ) { \ - ((PixelGroup *) (dst))[DoublePixel0] = (pixel); \ - ((PixelGroup *) (dst))[DoublePixel1] = (pixel); \ - ((PixelGroup *) (dst))[DoublePixel2] = (pixel); \ - ((PixelGroup *) (dst))[DoublePixel3] = (pixel); \ - } \ - else { \ - switch (bits & 0x0f) { \ - case 0: \ - break; \ - case 1: \ - ((CARD32 *) (dst))[SinglePixel0] = (pixel); \ - break; \ - case 2: \ - ((CARD32 *) (dst))[SinglePixel1] = (pixel); \ - break; \ - case 3: \ - ((CARD32 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel1] = (pixel); \ - break; \ - case 4: \ - ((CARD32 *) (dst))[SinglePixel2] = (pixel); \ - break; \ - case 5: \ - ((CARD32 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel2] = (pixel); \ - break; \ - case 6: \ - ((CARD32 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel2] = (pixel); \ - break; \ - case 7: \ - ((CARD32 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel2] = (pixel); \ - break; \ - case 8: \ - ((CARD32 *) (dst))[SinglePixel3] = (pixel); \ - break; \ - case 9: \ - ((CARD32 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel3] = (pixel); \ - break; \ - case 10: \ - ((CARD32 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel3] = (pixel); \ - break; \ - case 11: \ - ((CARD32 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel3] = (pixel); \ - break; \ - case 12: \ - ((CARD32 *) (dst))[SinglePixel2] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel3] = (pixel); \ - break; \ - case 13: \ - ((CARD32 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel2] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel3] = (pixel); \ - break; \ - case 14: \ - ((CARD32 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel2] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel3] = (pixel); \ - break; \ - case 15: \ - ((CARD32 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel2] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel3] = (pixel); \ - break; \ - } \ - switch ((bits & 0xf0) >> 4) { \ - case 0: \ - break; \ - case 1: \ - ((CARD32 *) (dst))[SinglePixel4] = (pixel); \ - break; \ - case 2: \ - ((CARD32 *) (dst))[SinglePixel5] = (pixel); \ - break; \ - case 3: \ - ((CARD32 *) (dst))[SinglePixel4] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel5] = (pixel); \ - break; \ - case 4: \ - ((CARD32 *) (dst))[SinglePixel6] = (pixel); \ - break; \ - case 5: \ - ((CARD32 *) (dst))[SinglePixel4] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel6] = (pixel); \ - break; \ - case 6: \ - ((CARD32 *) (dst))[SinglePixel5] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel6] = (pixel); \ - break; \ - case 7: \ - ((CARD32 *) (dst))[SinglePixel4] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel5] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel6] = (pixel); \ - break; \ - case 8: \ - ((CARD32 *) (dst))[SinglePixel7] = (pixel); \ - break; \ - case 9: \ - ((CARD32 *) (dst))[SinglePixel4] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel7] = (pixel); \ - break; \ - case 10: \ - ((CARD32 *) (dst))[SinglePixel5] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel7] = (pixel); \ - break; \ - case 11: \ - ((CARD32 *) (dst))[SinglePixel4] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel5] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel7] = (pixel); \ - break; \ - case 12: \ - ((CARD32 *) (dst))[SinglePixel6] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel7] = (pixel); \ - break; \ - case 13: \ - ((CARD32 *) (dst))[SinglePixel4] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel6] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel7] = (pixel); \ - break; \ - case 14: \ - ((CARD32 *) (dst))[SinglePixel5] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel6] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel7] = (pixel); \ - break; \ - case 15: \ - ((CARD32 *) (dst))[SinglePixel4] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel5] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel6] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel7] = (pixel); \ - break; \ - } \ - } -#endif /* PGSZ */ - -#if PGSZ == 32 -#define SwitchBitGroup(dst,pixel,bits) { \ - switch (bits) { \ - case 0: \ - break; \ - case 1: \ - SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel0] = (pixel);) \ - break; \ - case 2: \ - SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel1] = (pixel);) \ - break; \ - case 3: \ - SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel1] = (pixel);) \ - break; \ - case 4: \ - SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel2] = (pixel);) \ - break; \ - case 5: \ - SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel2] = (pixel);) \ - break; \ - case 6: \ - SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel2] = (pixel);) \ - break; \ - case 7: \ - SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel2] = (pixel);) \ - break; \ - case 8: \ - SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel3] = (pixel);) \ - break; \ - case 9: \ - SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel3] = (pixel);) \ - break; \ - case 10: \ - SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel3] = (pixel);) \ - break; \ - case 11: \ - SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel3] = (pixel);) \ - break; \ - case 12: \ - SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel2] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel3] = (pixel);) \ - break; \ - case 13: \ - SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel2] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel3] = (pixel);) \ - break; \ - case 14: \ - SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel2] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel3] = (pixel);) \ - break; \ - case 15: \ - SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel0] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel1] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel2] = (pixel); \ - ((CARD32 *) (dst))[SinglePixel3] = (pixel);) \ - break; \ - } \ -} -#else /* PGSZ == 64 */ -#define SwitchBitGroup(dst,pixel,bits) { \ - cfb cannot hack 64-bit SwitchBitGroup psz=PSZ -#endif /* PGSZ */ - -#endif /* PSZ == 32 */ -#endif /* AVOID_MEMORY_READ */ - -extern PixelGroup cfb8BitLenMasks[PGSZ]; - -extern int cfb8SetStipple ( - int /*alu*/, - CfbBits /*fg*/, - CfbBits /*planemask*/ -); - -extern int cfb8SetOpaqueStipple ( - int /*alu*/, - CfbBits /*fg*/, - CfbBits /*bg*/, - CfbBits /*planemask*/ -); - -extern int cfb8ComputeClipMasks32 ( - BoxPtr /*pBox*/, - int /*numRects*/, - int /*x*/, - int /*y*/, - int /*w*/, - int /*h*/, - CARD32 * /*clips*/ -); diff --git a/nx-X11/programs/Xserver/cfb/cfb8line.c b/nx-X11/programs/Xserver/cfb/cfb8line.c deleted file mode 100644 index 0f27f1d47..000000000 --- a/nx-X11/programs/Xserver/cfb/cfb8line.c +++ /dev/null @@ -1,1504 +0,0 @@ -/* - * $Xorg: cfb8line.c,v 1.4 2001/02/09 02:04:37 xorgcvs Exp $ - * -Copyright 1990, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - * - * Author: Keith Packard, MIT X Consortium - * - * $XFree86: xc/programs/Xserver/cfb/cfb8line.c,v 3.18tsi Exp $ - * Jeff Anton'x fixes: cfb8line.c 97/02/07 - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include - -#include "gcstruct.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "regionstr.h" -#include "scrnintstr.h" -#include "mistruct.h" - -#include "cfb.h" -#include "cfbmskbits.h" -#include "cfbrrop.h" -#include "miline.h" - -#ifdef PIXEL_ADDR - -#if defined(__GNUC__) && defined(mc68020) -#define STUPID volatile -#define REARRANGE -#else -#define STUPID -#endif - -#ifdef __GNUC__ -/* lame compiler doesn't even look at 'register' attributes */ -#define I_H do{ -#define I_T }while(0); -#define IMPORTANT_START I_H I_H I_H I_H I_H I_H I_H I_H I_H I_H -#define IMPORTANT_END I_T I_T I_T I_T I_T I_T I_T I_T I_T I_T -#else -#define IMPORTANT_START -#define IMPORTANT_END -#endif - -#define isClipped(c,ul,lr) ((((c) - (ul)) | ((lr) - (c))) & ClipMask) - -#ifdef POLYSEGMENT - -# if (defined(sun) || defined(__bsdi__)) && \ - (defined(sparc) || defined(__sparc__)) -# define WIDTH_FAST 1152 -# endif - -# ifdef ultrix -# define WIDTH_FAST 1024 -# endif - -# ifdef Mips -# define WIDTH_FAST 4096 -# endif -# ifdef WIDTH_FAST -# if WIDTH_FAST == 1024 -# define FAST_MUL(y) ((y) << 10) -# endif - -# if WIDTH_FAST == 1152 -# define FAST_MUL(y) (((y) << 10) + ((y) << 7)) -# endif - -# if WIDTH_FAST == 1280 -# define FAST_MUL(y) (((y) << 10) + ((y) << 8)) -# endif - -# if WIDTH_FAST == 2048 -# define FAST_MUL(y) ((y) << 11) -# endif - -# if WIDTH_FAST == 4096 -# define FAST_MUL(y) ((y) << 12) -# endif -# endif - -# if defined(WIDTH_SHIFT) -# ifdef FAST_MUL -# define FUNC_NAME(e) RROP_NAME(RROP_NAME_CAT(e,Shift)) -# if RROP == GXcopy -# define INCLUDE_OTHERS -# define SERIOUS_UNROLLING -# endif -# define INCLUDE_DRAW -# define NWIDTH(nwidth) WIDTH_FAST -# define WIDTH_MUL(y,w) FAST_MUL(y) -# endif -# else -# define FUNC_NAME(e) RROP_NAME(e) -# define WIDTH_MUL(y,w) ((y) * (w)) -# define NWIDTH(nwidth) (nwidth) -# define INCLUDE_DRAW -# if !defined (FAST_MUL) && RROP == GXcopy -# define INCLUDE_OTHERS -# define SERIOUS_UNROLLING -# endif -# endif -#else - -# define INCLUDE_DRAW -# define WIDTH_MUL(y,w) ((y) * (w)) -# define NWIDTH(nwidth) nwidth -# ifdef PREVIOUS -# define FUNC_NAME(e) RROP_NAME(RROP_NAME_CAT(e,Previous)) -# else -# define FUNC_NAME(e) RROP_NAME(e) -# if RROP == GXcopy -# define INCLUDE_OTHERS -# ifdef PLENTIFUL_REGISTERS -# define SAVE_X2Y2 -# endif -# define ORIGIN -# define SERIOUS_UNROLLING -# else -# define EITHER_MODE -# endif -# endif -#endif - -#if PSZ == 24 -#define PXL2ADR(x) ((x)*3 >> 2) - -#if RROP == GXcopy -#define body_rop \ - addrp = (PixelType *)((unsigned long)addrb & ~0x03); \ - switch((unsigned long)addrb & 3){ \ - case 0: \ - *addrp = (*addrp & 0xFF000000)|(piQxelXor[0] & 0xFFFFFF); \ - break; \ - case 1: \ - *addrp = (*addrp & 0xFF)|(piQxelXor[2] & 0xFFFFFF00); \ - break; \ - case 3: \ - *addrp = (*addrp & 0xFFFFFF)|(piQxelXor[0] & 0xFF000000); \ - *(addrp+1)=(*(addrp+1) & 0xFFFF0000)|(piQxelXor[1] & 0xFFFF); \ - break; \ - case 2: \ - *addrp = (*addrp & 0xFFFF)|(piQxelXor[1] & 0xFFFF0000); \ - *(addrp+1)=(*(addrp+1) & 0xFFFFFF00)|(piQxelXor[2] & 0xFF); \ - break; \ - } -#endif -#if RROP == GXxor -#define body_rop \ - addrp = (PixelType *)((unsigned long)addrb & ~0x03); \ - switch((unsigned long)addrb & 3){ \ - case 0: \ - *addrp ^= piQxelXor[0] & 0xFFFFFF; \ - break; \ - case 1: \ - *addrp ^= piQxelXor[2] & 0xFFFFFF00; \ - break; \ - case 3: \ - *addrp ^= piQxelXor[0] & 0xFF000000; \ - *(addrp+1) ^= piQxelXor[1] & 0xFFFF; \ - break; \ - case 2: \ - *addrp ^= piQxelXor[1] & 0xFFFF0000; \ - *(addrp+1) ^= piQxelXor[2] & 0xFF; \ - break; \ - } -#endif -#if RROP == GXand -#define body_rop \ - addrp = (PixelType *)((unsigned long)addrb & ~0x03); \ - switch((unsigned long)addrb & 3){ \ - case 0: \ - *addrp &= piQxelAnd[0] | 0xFF000000; \ - break; \ - case 1: \ - *addrp &= piQxelAnd[2] | 0xFF; \ - break; \ - case 3: \ - *addrp &= 0xFFFFFF | piQxelAnd[0]; \ - *(addrp+1) &= 0xFFFF0000 | piQxelAnd[1]; \ - break; \ - case 2: \ - *addrp &= 0xFFFF | piQxelAnd[1]; \ - *(addrp+1) &= 0xFFFFFF00 | piQxelAnd[2]; \ - break; \ - } -#endif -#if RROP == GXor -#define body_rop \ - addrp = (PixelType *)((unsigned long)addrb & ~0x03); \ - switch((unsigned long)addrb & 3){ \ - case 0: \ - *addrp |= piQxelOr[0] & 0xFFFFFF; \ - break; \ - case 1: \ - *addrp |= piQxelOr[2] & 0xFFFFFF00; \ - break; \ - case 3: \ - *addrp |= piQxelOr[0] & 0xFF000000; \ - *(addrp+1) |= piQxelOr[1] & 0xFFFF; \ - break; \ - case 2: \ - *addrp |= piQxelOr[1] & 0xFFFF0000; \ - *(addrp+1) |= piQxelOr[2] & 0xFF; \ - break; \ - } -#endif -#if RROP == GXset -#define body_rop \ - addrp = (PixelType *)((unsigned long)addrb & ~0x03); \ - switch((unsigned long)addrb & 3){ \ - case 0: \ - *addrp = (*addrp & (piQxelAnd[0]|0xFF000000)) \ - ^ (piQxelXor[0] & 0xFFFFFF); \ - break; \ - case 1: \ - *addrp = (*addrp & (piQxelAnd[2]|0xFF)) \ - ^ (piQxelXor[2] & 0xFFFFFF00); \ - break; \ - case 3: \ - *addrp = (*addrp & (piQxelAnd[0]|0xFFFFFF)) \ - ^ (piQxelXor[0] & 0xFF000000); \ - *(addrp+1) = (*(addrp+1) & (piQxelAnd[1]|0xFFFF0000)) \ - ^ (piQxelXor[1] & 0xFFFF); \ - break; \ - case 2: \ - *addrp = (*addrp & (piQxelAnd[1]|0xFFFF)) \ - ^ (piQxelXor[1] & 0xFFFF0000); \ - *(addrp+1) = (*(addrp+1) & (piQxelAnd[2]|0xFFFFFF00)) \ - ^ (piQxelXor[2] & 0xFF); \ - break; \ - } -#endif -#endif /* PSZ == 24 */ - -#define BUGFIX_clip - -#ifdef INCLUDE_DRAW - -int -#ifdef POLYSEGMENT -FUNC_NAME(cfb8SegmentSS1Rect) (pDrawable, pGC, nseg, pSegInit) - DrawablePtr pDrawable; - GCPtr pGC; - int nseg; - xSegment *pSegInit; -#else -FUNC_NAME(cfb8LineSS1Rect) (pDrawable, pGC, mode, npt, pptInit, pptInitOrig, - x1p,y1p,x2p,y2p) - DrawablePtr pDrawable; - GCPtr pGC; - int mode; /* Origin or Previous */ - int npt; /* number of points */ - DDXPointPtr pptInit, pptInitOrig; - int *x1p, *y1p, *x2p, *y2p; -#endif /* POLYSEGMENT */ -{ - register long e; - register int y1_or_e1; - register PixelType *addrp; - register int stepmajor; - register int stepminor; -#ifndef REARRANGE - register long e3; -#endif -#ifdef mc68000 - register short x1_or_len; -#else - register int x1_or_len; -#endif - RROP_DECLARE - -#ifdef SAVE_X2Y2 -# define c2 y2 -#else - register int c2; -#endif -#if !defined(ORIGIN) && !defined(POLYSEGMENT) - register int _x1 = 0, _y1 = 0, _x2 = 0, _y2 = 0; - int extents_x1, extents_y1, extents_x2, extents_y2; -#endif /* !ORIGIN */ -#ifndef PREVIOUS - register int upperleft, lowerright; - CARD32 ClipMask = 0x80008000; -#endif /* !PREVIOUS */ -#ifdef POLYSEGMENT - register int capStyle; -#endif /* POLYSEGMENT */ -#ifdef SAVE_X2Y2 - register int x2, y2; -# define X1 x1_or_len -# define Y1 y1_or_e1 -# define X2 x2 -# define Y2 y2 -#else -# ifdef POLYSEGMENT -# define X1 x1_or_len -# define Y1 y1_or_e1 -# else -# define X1 intToX(y1_or_e1) -# define Y1 intToY(y1_or_e1) -# endif /* POLYSEGMENT */ -# define X2 intToX(c2) -# define Y2 intToY(c2) -#endif /* SAVE_X2Y2 */ - PixelType *addr; - int nwidth; - cfbPrivGCPtr devPriv; - BoxPtr extents; - int *ppt; -#if PSZ == 24 - int xBase; /* x of addr */ - int xOffset; /* x of addrp */ - PixelType *addrLineEnd; - char *addrb; - int stepmajor3, stepminor3, majordx, minordx; -#endif -#ifndef POLYSEGMENT -#ifndef ORIGIN -#ifdef BUGFIX_clip - int ex_x1, ex_y1, ex_x2, ex_y2; -#endif -#endif -#endif - int octant; - unsigned int bias = miGetZeroLineBias(pDrawable->pScreen); - - devPriv = cfbGetGCPrivate(pGC); - cfbGetPixelWidthAndPointer (pDrawable, nwidth, addr); -#ifndef REARRANGE - RROP_FETCH_GCPRIV(devPriv); -#endif - extents = &pGC->pCompositeClip->extents; -#ifndef PREVIOUS - c2 = *((int *) &pDrawable->x); - c2 -= (c2 & 0x8000) << 1; - upperleft = *((int *) &extents->x1) - c2; - lowerright = *((int *) &extents->x2) - c2 - 0x00010001; -#endif /* !PREVIOUS */ -#ifndef POLYSEGMENT -#ifndef ORIGIN -#ifdef BUGFIX_clip - ex_x1 = extents->x1 - pDrawable->x; - ex_y1 = extents->y1 - pDrawable->y; - ex_x2 = extents->x2 - pDrawable->x; - ex_y2 = extents->y2 - pDrawable->y; -#endif -#endif -#endif -#if PSZ == 24 - xBase = pDrawable->x; - addr += WIDTH_MUL(pDrawable->y,nwidth); -#else - addr = addr + WIDTH_MUL(pDrawable->y,nwidth) + pDrawable->x; -#endif -#ifdef POLYSEGMENT - capStyle = pGC->capStyle - CapNotLast; - ppt = (int *) pSegInit; - while (nseg--) -#else /* POLYSEGMENT */ -#ifdef EITHER_MODE - mode -= CoordModePrevious; - if (!mode) -#endif /* EITHER_MODE */ -#ifndef ORIGIN - { /* CoordModePrevious */ - ppt = (int *)pptInit + 1; - _x1 = *x1p; - _y1 = *y1p; - extents_x1 = extents->x1 - pDrawable->x; - extents_x2 = extents->x2 - pDrawable->x; - extents_y1 = extents->y1 - pDrawable->y; - extents_y2 = extents->y2 - pDrawable->y; - if (_x1 < extents_x1 || _x1 >= extents_x2 || - _y1 < extents_y1 || _y1 >= extents_y2) - { - c2 = *ppt++; - intToCoord(c2, _x2, _y2); - *x2p = _x1 + _x2; - *y2p = _y1 + _y2; - return 1; - } -#if PSZ == 24 - addrLineEnd = addr + WIDTH_MUL(_y1, nwidth); - xOffset = xBase + _x1; - addrb = (char *)addrLineEnd + xOffset * 3; - addrp = (PixelType *)((unsigned long)addrb & ~0x03); -#else - addrp = addr + WIDTH_MUL(_y1, nwidth) + _x1; -#endif - _x2 = _x1; - _y2 = _y1; - } -#endif /* !ORIGIN */ -#ifdef EITHER_MODE - else -#endif /* EITHER_MODE */ -#ifndef PREVIOUS - { - ppt = (int *) pptInit; - c2 = *ppt++; - if (isClipped (c2, upperleft, lowerright)) - { - return 1; - } -#ifdef SAVE_X2Y2 - intToCoord(c2,x2,y2); -#endif -#if PSZ == 24 - addrLineEnd = addr + WIDTH_MUL(Y2, nwidth); - xOffset = xBase + X2; - addrb = (char *)addrLineEnd + xOffset * 3; - addrp = (PixelType *)((unsigned long)addrb & ~0x03); -#else - addrp = addr + WIDTH_MUL(Y2, nwidth) + X2; -#endif - } -#endif /* !PREVIOUS */ - while (--npt) -#endif /* POLYSEGMENT */ - { -#ifdef POLYSEGMENT - y1_or_e1 = ppt[0]; - c2 = ppt[1]; - ppt += 2; - if (isClipped(y1_or_e1,upperleft,lowerright)|isClipped(c2,upperleft,lowerright)) - break; - intToCoord(y1_or_e1,x1_or_len,y1_or_e1); - /* compute now to avoid needing x1, y1 later */ -#if PSZ == 24 - addrLineEnd = addr + WIDTH_MUL(y1_or_e1, nwidth); - xOffset = xBase + x1_or_len; - addrb = (char *)addrLineEnd + xOffset * 3; - addrp = (PixelType *)((unsigned long)addrb & ~0x03); -#else - addrp = addr + WIDTH_MUL(y1_or_e1, nwidth) + x1_or_len; -#endif -#else /* !POLYSEGMENT */ -#ifdef EITHER_MODE - if (!mode) -#endif /* EITHER_MODE */ -#ifndef ORIGIN - { - /* CoordModePrevious */ - _x1 = _x2; - _y1 = _y2; - c2 = *ppt++; - intToCoord(c2, _x2, _y2); - _x2 = _x1 + _x2; - _y2 = _y1 + _y2; - -#ifdef BUGFIX_clip - if (_x2 < ex_x1 || _x2 >= ex_x2 || - _y2 < ex_y1 || _y2 >= ex_y2) -#else - if (_x2 < extents_x1 || _x2 >= extents_x2 || - _y2 < extents_y1 || _y2 >= extents_y2) -#endif - { - break; - } - CalcLineDeltas(_x1, _y1, _x2, _y2, x1_or_len, y1_or_e1, - stepmajor, stepminor, 1, NWIDTH(nwidth), octant); - } -#endif /* !ORIGIN */ -#ifdef EITHER_MODE - else -#endif /* EITHER_MODE */ -#ifndef PREVIOUS - { -#ifndef SAVE_X2Y2 - y1_or_e1 = c2; -#else - y1_or_e1 = y2; - x1_or_len = x2; -#endif /* SAVE_X2Y2 */ - c2 = *ppt++; - - if (isClipped (c2, upperleft, lowerright)) - break; -#ifdef SAVE_X2Y2 - intToCoord(c2,x2,y2); -#endif - CalcLineDeltas(X1, Y1, X2, Y2, x1_or_len, y1_or_e1, - stepmajor, stepminor, 1, NWIDTH(nwidth), octant); - } -#endif /* !PREVIOUS */ -#endif /* POLYSEGMENT */ - -#ifdef POLYSEGMENT - CalcLineDeltas(X1, Y1, X2, Y2, x1_or_len, y1_or_e1, - stepmajor, stepminor, 1, NWIDTH(nwidth), octant); - /* - * although the horizontal code works for polyline, it - * slows down 10 pixel lines by 15%. Thus, this - * code is optimized for horizontal segments and - * random orientation lines, which seems like a reasonable - * assumption - */ - if (y1_or_e1 != 0) - { -#endif /* POLYSEGMENT */ - if (x1_or_len < y1_or_e1) - { -#ifdef REARRANGE - register int e3; -#endif - - e3 = x1_or_len; - x1_or_len = y1_or_e1; - y1_or_e1 = e3; - - e3 = stepminor; - stepminor = stepmajor; - stepmajor = e3; - SetYMajorOctant(octant); - } - - e = -x1_or_len; -#ifdef POLYSEGMENT - if (!capStyle) - x1_or_len--; -#endif - - { -#ifdef REARRANGE - register int e3; - RROP_DECLARE - RROP_FETCH_GCPRIV(devPriv); -#endif - - y1_or_e1 = y1_or_e1 << 1; - e3 = e << 1; - - FIXUP_ERROR(e, octant, bias); - -#if PSZ == 24 - if (stepmajor == 1 || stepmajor == -1){ - stepmajor3 = stepmajor * 3; - stepminor3 = stepminor * sizeof (CfbBits); - majordx = stepmajor; minordx = 0; - } else { - stepmajor3 = stepmajor * sizeof (CfbBits); - stepminor3 = stepminor * 3; - majordx = 0; minordx = stepminor; - } -#endif - -#if PSZ == 24 -#define body {\ - body_rop \ - addrb += stepmajor3; \ - xOffset += majordx; \ - e += y1_or_e1; \ - if (e >= 0){ \ - addrb += stepminor3; \ - xOffset += minordx; \ - e += e3; \ - } \ - } -#else /* PSZ == 24 */ - -#define body {\ - RROP_SOLID(addrp); \ - addrp += stepmajor; \ - e += y1_or_e1; \ - if (e >= 0) \ - { \ - addrp += stepminor; \ - e += e3; \ - } \ - } -#endif /* PSZ == 24 */ - -#ifdef LARGE_INSTRUCTION_CACHE - -# ifdef SERIOUS_UNROLLING -# define UNROLL 16 -# else -# define UNROLL 4 -# endif -#define CASE(n) case -n: body - - while ((x1_or_len -= UNROLL) >= 0) - { - body body body body -# if UNROLL >= 8 - body body body body -# endif -# if UNROLL >= 12 - body body body body -# endif -# if UNROLL >= 16 - body body body body -# endif - } - switch (x1_or_len) - { - CASE(1) CASE(2) CASE(3) -# if UNROLL >= 8 - CASE(4) CASE(5) CASE(6) CASE(7) -# endif -# if UNROLL >= 12 - CASE(8) CASE(9) CASE(10) CASE(11) -# endif -# if UNROLL >= 16 - CASE(12) CASE(13) CASE(14) CASE(15) -# endif - } -#else /* !LARGE_INSTRUCTION_CACHE */ - - IMPORTANT_START - IMPORTANT_START - - if (x1_or_len & 1) - body - x1_or_len >>= 1; - while (x1_or_len--) { - body body - } - - IMPORTANT_END - IMPORTANT_END -#endif /* LARGE_INSTRUCTION_CACHE */ - -#ifdef POLYSEGMENT -#if PSZ == 24 - body_rop -#else - RROP_SOLID(addrp); -#endif -#endif -#if PSZ == 24 - addrp = (PixelType *)((unsigned long)addrb & ~0x03); -#endif - } -#undef body -#ifdef POLYSEGMENT - } - else /* Polysegment horizontal line optimization */ - { -# ifdef REARRANGE - register int e3; - RROP_DECLARE - RROP_FETCH_GCPRIV(devPriv); -# endif /* REARRANGE */ - if (stepmajor < 0) - { -#if PSZ == 24 - xOffset -= x1_or_len; - addrp = addrLineEnd + PXL2ADR(xOffset); -#else - addrp -= x1_or_len; -#endif - if (capStyle) - x1_or_len++; - else -#if PSZ == 24 - xOffset++; - addrp = addrLineEnd + PXL2ADR(xOffset); -#else - addrp++; -#endif - } - else - { -#if PSZ == 24 - addrp = addrLineEnd + PXL2ADR(xOffset); -#endif - if (capStyle) - x1_or_len++; - } -# if PSZ == 24 - y1_or_e1 = xOffset & 3; -# else -# if PGSZ == 64 /* PIM value from is not it! (for 16/32 PSZ)*/ - y1_or_e1 = ((long) addrp) & 0x7; - addrp = (PixelType *) (((unsigned char *) addrp) - y1_or_e1); -# else - y1_or_e1 = ((long) addrp) & PIM; - addrp = (PixelType *) (((unsigned char *) addrp) - y1_or_e1); -# endif -#if PGSZ == 32 -# if PWSH != 2 - y1_or_e1 >>= (2 - PWSH); -# endif -#else /* PGSZ == 64 */ -# if PWSH != 3 - y1_or_e1 >>= (3 - PWSH); -# endif -#endif /* PGSZ */ -# endif /* PSZ == 24 */ -#if PSZ == 24 - { -#if RROP == GXcopy - register int nlmiddle; - int leftIndex = xOffset & 3; - int rightIndex = (xOffset + x1_or_len) & 3; -#else - register int pidx; -#endif - -#if RROP == GXcopy - nlmiddle = x1_or_len; - if(leftIndex){ - nlmiddle -= (4 - leftIndex); - } - if(rightIndex){ - nlmiddle -= rightIndex; - } - - nlmiddle >>= 2; - switch(leftIndex+x1_or_len){ - case 4: - switch(leftIndex){ - case 0: - *addrp++ = piQxelXor[0]; - *addrp++ = piQxelXor[1]; - *addrp = piQxelXor[2]; - break; - case 1: - *addrp = ((*addrp) & 0xFFFFFF) | (piQxelXor[0] & 0xFF000000); - addrp++; - *addrp = piQxelXor[1]; - addrp++; - *addrp = piQxelXor[2]; - break; - case 2: - *addrp = ((*addrp) & 0xFFFF) | (piQxelXor[1] & 0xFFFF0000); - addrp++; - *addrp = piQxelXor[2]; - break; - case 3: - *addrp = ((*addrp) & 0xFF) | (piQxelXor[2] & 0xFFFFFF00); - break; - } - break; - case 3: - switch(leftIndex){ - case 0: - *addrp++ = piQxelXor[0]; - *addrp++ = piQxelXor[1]; - *addrp = ((*addrp) & 0xFFFFFF00) | (piQxelXor[2] & 0xFF); - break; - case 1: - *addrp = ((*addrp) & 0xFFFFFF) | (piQxelXor[0] & 0xFF000000); - addrp++; - *addrp = piQxelXor[1]; - addrp++; - *addrp = ((*addrp) & 0xFFFFFF00) | (piQxelXor[2] & 0xFF); - break; - case 2: - *addrp = ((*addrp) & 0xFFFF) | (piQxelXor[1] & 0xFFFF0000); - addrp++; - *addrp = ((*addrp) & 0xFFFFFF00) | (piQxelXor[2] & 0xFF); - break; - } - break; - case 2: - switch(leftIndex){ -/* - case 2: - *addrp = ((*addrp) & 0xFFFF) | (piQxelXor[1] & 0xFFFF0000); - addrp++; - *addrp = ((*addrp) & 0xFFFFFF00) | (piQxelXor[2] & 0xFF); - break; -*/ - case 1: - *addrp = ((*addrp) & 0xFFFFFF) | (piQxelXor[0] & 0xFF000000); - addrp++; - *addrp = ((*addrp) & 0xFFFF0000) | (piQxelXor[1] & 0xFFFF); - break; - case 0: - *addrp++ = piQxelXor[0]; - *addrp = ((*addrp) & 0xFFFF0000) | (piQxelXor[1] & 0xFFFF); - break; - } - break; - case 1: /*only if leftIndex = 0 and w = 1*/ - if(x1_or_len){ - *addrp = ((*addrp) & 0xFF000000) | (piQxelXor[0] & 0xFFFFFF); - } -/* - else{ - *addrp = ((*addrp) & 0xFFFFFF) | (piQxelXor[0] & 0xFF000000); - addrp++; - *addrp = ((*addrp) & 0xFFFF0000) | (piQxelXor[1] & 0xFFFF); - } -*/ - break; - case 0: /*never*/ - break; - default: - { -/* - maskbits(y1_or_e1, x1_or_len, e, e3, x1_or_len) -*/ - switch(leftIndex){ - case 0: - break; - case 1: - *addrp = ((*addrp) & 0xFFFFFF) | (piQxelXor[0] & 0xFF000000); - addrp++; - *addrp = piQxelXor[1]; - addrp++; - *addrp = piQxelXor[2]; - addrp++; - break; - case 2: - *addrp = ((*addrp) & 0xFFFF) | (piQxelXor[1] & 0xFFFF0000); - addrp++; - *addrp = piQxelXor[2]; - addrp++; - break; - case 3: - *addrp = ((*addrp) & 0xFF) | (piQxelXor[2] & 0xFFFFFF00); - addrp++; - break; - } - while(nlmiddle--){ - *addrp++ = piQxelXor[0]; - *addrp++ = piQxelXor[1]; - *addrp++ = piQxelXor[2]; - } - switch(rightIndex++){ - case 0: - break; - case 1: - *addrp = ((*addrp) & 0xFF000000) | (piQxelXor[0] & 0xFFFFFF); - break; - case 2: - *addrp++ = piQxelXor[0]; - *addrp = ((*addrp) & 0xFFFF0000) | (piQxelXor[1] & 0xFFFF); - break; - case 3: - *addrp++ = piQxelXor[0]; - *addrp++ = piQxelXor[1]; - *addrp = ((*addrp) & 0xFFFFFF00) | (piQxelXor[2] & 0xFF); - break; - } -/* - if (e3){ - e3 &= 0xFFFFFF; - switch(rightIndex&3){ - case 0: - *addrp = ((*addrp) & (0xFF000000 | ~e3)) - | (piQxelXor[0] & 0xFFFFFF & e3); - break; - case 1: - *addrp = ((*addrp) & (0xFFFFFF | ~(e3<<24))) - + (piQxelXor[0] & 0xFF000000 & (e3<<24)); - addrp++; - *addrp = ((*addrp) & (0xFFFF0000|~(e3 >> 8))) - | (piQxelXor[1] & 0xFFFF & (e3 >> 8)); - break; - case 2: - *addrp = ((*addrp) & (0xFFFF|~(e3 << 16))) - | (piQxelXor[1] & 0xFFFF0000 & (e3 << 16)); - addrp++; - *addrp = ((*addrp) & (0xFFFFFF00|~(e3>>16))) - | (piQxelXor[2] & 0xFF & (e3 >> 16)); - break; - case 3: - *addrp = ((*addrp) & (0xFF|~(e3<<8))) - | (piQxelXor[2] & 0xFFFFFF00 & (e3<<8)); - addrp++; - break; - } - } -*/ - } - } -#else /* GXcopy */ - addrp = (PixelType *)((char *)addrLineEnd + ((xOffset * 3) & ~0x03)); - if (x1_or_len <= 1){ - if (x1_or_len) - RROP_SOLID24(addrp, xOffset); - } else { - maskbits(xOffset, x1_or_len, e, e3, x1_or_len); - pidx = xOffset & 3; - if (e){ - RROP_SOLID_MASK(addrp, e, pidx-1); - addrp++; - if (pidx == 3) - pidx = 0; - } - while (--x1_or_len >= 0){ - RROP_SOLID(addrp, pidx); - addrp++; - if (++pidx == 3) - pidx = 0; - } - if (e3) - RROP_SOLID_MASK(addrp, e3, pidx); - } -#endif /* GXcopy */ - } -#else /* PSZ == 24 */ - if (y1_or_e1 + x1_or_len <= PPW) - { - if (x1_or_len) - { - maskpartialbits(y1_or_e1, x1_or_len, e) - RROP_SOLID_MASK((CfbBits *) addrp, e); - } - } - else - { - maskbits(y1_or_e1, x1_or_len, e, e3, x1_or_len) - if (e) - { - RROP_SOLID_MASK((CfbBits *) addrp, e); - addrp += PPW; - } - RROP_SPAN(addrp, x1_or_len) - if (e3) - RROP_SOLID_MASK((CfbBits *) addrp, e3); - } -#endif /* PSZ == 24 */ - } -#endif /* POLYSEGMENT */ - } -#ifdef POLYSEGMENT - if (nseg >= 0) - return (xSegment *) ppt - pSegInit; -#else - if (npt) - { -#ifdef EITHER_MODE - if (!mode) -#endif /* EITHER_MODE */ -#ifndef ORIGIN - { - *x1p = _x1; - *y1p = _y1; - *x2p = _x2; - *y2p = _y2; - } -#endif /* !ORIGIN */ - return ((DDXPointPtr) ppt - pptInit) - 1; - } - -# ifndef ORIGIN -# define C2 c2 -# else -# define C2 ppt[-1] -# endif -#ifdef EITHER_MODE - if (pGC->capStyle != CapNotLast && - ((mode ? (C2 != *((int *) pptInitOrig)) - : ((_x2 != pptInitOrig->x) || - (_y2 != pptInitOrig->y))) - || (ppt == ((int *)pptInitOrig) + 2))) -#endif /* EITHER_MODE */ -#ifdef PREVIOUS - if (pGC->capStyle != CapNotLast && - ((_x2 != pptInitOrig->x) || - (_y2 != pptInitOrig->y) || - (ppt == ((int *)pptInitOrig) + 2))) -#endif /* PREVIOUS */ -#ifdef ORIGIN - if (pGC->capStyle != CapNotLast && - ((C2 != *((int *) pptInitOrig)) || - (ppt == ((int *)pptInitOrig) + 2))) -#endif /* !PREVIOUS */ - { -# ifdef REARRANGE - RROP_DECLARE - - RROP_FETCH_GCPRIV(devPriv); -# endif -#if PSZ == 24 -#if RROP == GXcopy - switch(xOffset & 3){ - case 0: - *addrp = ((*addrp)&0xFF000000)|(piQxelXor[0] & 0xFFFFFF); - break; - case 3: - *addrp = ((*addrp)&0xFF)|(piQxelXor[2] & 0xFFFFFF00); - break; - case 1: - *addrp = ((*addrp)&0xFFFFFF)|(piQxelXor[0] & 0xFF000000); - *(addrp+1) = ((*(addrp+1))&0xFFFF0000)|(piQxelXor[1] & 0xFFFF); - break; - case 2: - *addrp = ((*addrp)&0xFFFF)|(piQxelXor[1] & 0xFFFF0000); - *(addrp+1) = ((*(addrp+1))&0xFFFFFF00)|(piQxelXor[2] & 0xFF); - break; - } -#endif -#if RROP == GXxor - switch(xOffset & 3){ - case 0: - *addrp ^= (piQxelXor[0] & 0xFFFFFF); - break; - case 3: - *addrp ^= (piQxelXor[2] & 0xFFFFFF00); - break; - case 1: - *addrp ^= (piQxelXor[0] & 0xFF000000); - *(addrp+1) ^= (piQxelXor[1] & 0xFFFF); - break; - case 2: - *addrp ^= (piQxelXor[1] & 0xFFFF0000); - *(addrp+1) ^= (piQxelXor[2] & 0xFF); - break; - } -#endif -#if RROP == GXand - switch(xOffset & 3){ - case 0: - *addrp &= (piQxelAnd[0] | 0xFF000000); - break; - case 3: - *addrp &= (piQxelAnd[2] | 0xFF); - break; - case 1: - *addrp &= (0xFFFFFF|piQxelAnd[0]); - *(addrp+1) &= (0xFFFF0000|piQxelAnd[1]); - break; - case 2: - *addrp &= (0xFFFF|piQxelAnd[1]); - *(addrp+1) &= (0xFFFFFF00|piQxelAnd[2]); - break; - } -#endif -#if RROP == GXor - switch(xOffset & 3){ - case 0: - *addrp |= (piQxelOr[0] & 0xFFFFFF); - break; - case 3: - *addrp |= (piQxelOr[2] & 0xFFFFFF00); - break; - case 1: - *addrp |= (piQxelOr[0] & 0xFF000000); - *(addrp+1) |= (piQxelOr[1] & 0xFFFF); - break; - case 2: - *addrp |= (piQxelOr[1] & 0xFFFF0000); - *(addrp+1) |= (piQxelOr[2] & 0xFF); - break; - } -#endif -#if RROP == GXset - switch(xOffset & 3){ - case 0: - *addrp = (((*addrp)&(piQxelAnd[0] |0xFF000000))^(piQxelXor[0] & 0xFFFFFF)); - break; - case 3: - *addrp = (((*addrp)&(piQxelAnd[2]|0xFF))^(piQxelXor[2] & 0xFFFFFF00)); - break; - case 1: - *addrp = (((*addrp)&(piQxelAnd[0]|0xFFFFFF))^(piQxelXor[0] & 0xFF000000)); - *(addrp+1) = (((*(addrp+1))&(piQxelAnd[1]|0xFFFF0000))^(piQxelXor[1] & 0xFFFF)); - break; - case 2: - *addrp = (((*addrp)&(piQxelAnd[1]|0xFFFF))^(piQxelXor[1] & 0xFFFF0000)); - *(addrp+1) = (((*(addrp+1))&(piQxelAnd[2]|0xFFFFFF00))^(piQxelXor[2] & 0xFF)); - break; - } -#endif -#else - RROP_SOLID (addrp); -# endif - } -#endif /* !POLYSEGMENT */ - RROP_UNDECLARE; - return -1; -} - -#endif /* INCLUDE_DRAW */ - - -#ifdef INCLUDE_OTHERS - -#ifdef POLYSEGMENT - -void -cfb8SegmentSS1Rect (pDrawable, pGC, nseg, pSegInit) - DrawablePtr pDrawable; - GCPtr pGC; - int nseg; - xSegment *pSegInit; -{ - int (*func)(DrawablePtr, GCPtr, int, xSegment *); - void (*clip)(DrawablePtr, GCPtr, int, int, int, int, BoxPtr, Bool); - int drawn; - cfbPrivGCPtr devPriv; - -#if defined(__arm32__) && PSZ != 8 - /* XXX -JJK */ - /* There is a painting bug when PSZ != 8; I need to track it down! */ - cfbSegmentSS(pDrawable, pGC, nseg, pSegInit); - return; -#endif - - devPriv = cfbGetGCPrivate(pGC); -#ifdef NO_ONE_RECT - if (REGION_NUM_RECTS(pGC->pCompositeClip) != 1) - { - cfbSegmentSS(pDrawable, pGC, nseg, pSegInit); - return; - } -#endif - switch (devPriv->rop) - { - case GXcopy: - func = cfb8SegmentSS1RectCopy; - clip = cfb8ClippedLineCopy; -#ifdef FAST_MUL - if (cfbGetPixelWidth (pDrawable) == WIDTH_FAST) - func = cfb8SegmentSS1RectShiftCopy; -#endif - break; - case GXxor: - func = cfb8SegmentSS1RectXor; - clip = cfb8ClippedLineXor; - break; - default: - func = cfb8SegmentSS1RectGeneral; - clip = cfb8ClippedLineGeneral; - break; - } - while (nseg) - { - drawn = (*func) (pDrawable, pGC, nseg, pSegInit); - if (drawn == -1) - break; - (*clip) (pDrawable, pGC, - pSegInit[drawn-1].x1, pSegInit[drawn-1].y1, - pSegInit[drawn-1].x2, pSegInit[drawn-1].y2, - &pGC->pCompositeClip->extents, - pGC->capStyle == CapNotLast); - pSegInit += drawn; - nseg -= drawn; - } -} - -#else /* POLYSEGMENT */ - -void -cfb8LineSS1Rect (pDrawable, pGC, mode, npt, pptInit) - DrawablePtr pDrawable; - GCPtr pGC; - int mode; - int npt; - DDXPointPtr pptInit; -{ - int (*func)(DrawablePtr, GCPtr, int, int, - DDXPointPtr, DDXPointPtr, - int *, int *, int *, int *); - void (*clip)(DrawablePtr, GCPtr, int, int, int, int, BoxPtr, Bool); - int drawn; - cfbPrivGCPtr devPriv; - int x1, y1, x2, y2; - DDXPointPtr pptInitOrig = pptInit; - -#if defined(__arm32__) && PSZ != 8 - /* XXX -JJK */ - /* There is a painting bug when PSZ != 8; I need to track it down! */ - cfbLineSS(pDrawable, pGC, mode, npt, pptInit); - return; -#endif - - devPriv = cfbGetGCPrivate(pGC); -#ifdef NO_ONE_RECT - if (REGION_NUM_RECTS(pGC->pCompositeClip) != 1) - { - cfbLineSS(pDrawable, pGC, mode, npt, pptInit); - return; - } -#endif - switch (devPriv->rop) - { - case GXcopy: - func = cfb8LineSS1RectCopy; - clip = cfb8ClippedLineCopy; - if (mode == CoordModePrevious) - func = cfb8LineSS1RectPreviousCopy; - break; - case GXxor: - func = cfb8LineSS1RectXor; - clip = cfb8ClippedLineXor; - break; - default: - func = cfb8LineSS1RectGeneral; - clip = cfb8ClippedLineGeneral; - break; - } - if (mode == CoordModePrevious) - { - x1 = pptInit->x; - y1 = pptInit->y; - while (npt > 1) - { - drawn = (*func) (pDrawable, pGC, mode, npt, pptInit, pptInitOrig, - &x1, &y1, &x2, &y2); - if (drawn == -1) - break; - (*clip) (pDrawable, pGC, x1, y1, x2, y2, - &pGC->pCompositeClip->extents, - drawn != npt - 1 || pGC->capStyle == CapNotLast); - pptInit += drawn; - npt -= drawn; - x1 = x2; - y1 = y2; - } - } - else - { - while (npt > 1) - { - drawn = (*func) (pDrawable, pGC, mode, npt, pptInit, pptInitOrig, - &x1, &y1, &x2, &y2); - if (drawn == -1) - break; - (*clip) (pDrawable, pGC, - pptInit[drawn-1].x, pptInit[drawn-1].y, - pptInit[drawn].x, pptInit[drawn].y, - &pGC->pCompositeClip->extents, - drawn != npt - 1 || pGC->capStyle == CapNotLast); - pptInit += drawn; - npt -= drawn; - } - } -} - -#endif /* else POLYSEGMENT */ -#endif /* INCLUDE_OTHERS */ - -#if !defined(POLYSEGMENT) && !defined (PREVIOUS) - -void -RROP_NAME (cfb8ClippedLine) (pDrawable, pGC, x1, y1, x2, y2, boxp, shorten) - DrawablePtr pDrawable; - GCPtr pGC; - int x1, y1, x2, y2; - BoxPtr boxp; - Bool shorten; -{ - int oc1, oc2; - int e, e1, e3, len; - int adx, ady; - - PixelType *addr; - int nwidth; - int stepx, stepy; - int xorg, yorg; - int new_x1, new_y1, new_x2, new_y2; - Bool pt1_clipped, pt2_clipped; - int changex, changey, result; -#if PSZ == 24 - PixelType *addrLineEnd; - char *addrb; - int stepx3, stepy3; -#endif - int octant; - unsigned int bias = miGetZeroLineBias(pDrawable->pScreen); - - cfbGetPixelWidthAndPointer(pDrawable, nwidth, addr); - - xorg = pDrawable->x; - yorg = pDrawable->y; - x1 += xorg; - y1 += yorg; - x2 += xorg; - y2 += yorg; - oc1 = 0; - oc2 = 0; - OUTCODES (oc1, x1, y1, boxp); - OUTCODES (oc2, x2, y2, boxp); - - if (oc1 & oc2) - return; - - CalcLineDeltas(x1, y1, x2, y2, adx, ady, stepx, stepy, 1, nwidth, octant); - - if (adx <= ady) - { - int t; - - t = adx; - adx = ady; - ady = t; - - t = stepx; - stepx = stepy; - stepy = t; - - SetYMajorOctant(octant); - } - e = - adx; - e1 = ady << 1; - e3 = - (adx << 1); - - FIXUP_ERROR(e, octant, bias); - - new_x1 = x1; - new_y1 = y1; - new_x2 = x2; - new_y2 = y2; - pt1_clipped = 0; - pt2_clipped = 0; - - if (IsXMajorOctant(octant)) - { - result = miZeroClipLine(boxp->x1, boxp->y1, boxp->x2 - 1, boxp->y2 - 1, - &new_x1, &new_y1, &new_x2, &new_y2, - adx, ady, - &pt1_clipped, &pt2_clipped, - octant, bias, oc1, oc2); - if (result == -1) - return; - - len = abs(new_x2 - new_x1) - 1; /* this routine needs the "-1" */ - - /* if we've clipped the endpoint, always draw the full length - * of the segment, because then the capstyle doesn't matter - * if x2,y2 isn't clipped, use the capstyle - * (shorten == TRUE <--> CapNotLast) - */ - if (pt2_clipped || !shorten) - len++; - - if (pt1_clipped) - { - /* must calculate new error terms */ - changex = abs(new_x1 - x1); - changey = abs(new_y1 - y1); - e = e + changey * e3 + changex * e1; - } - } - else /* Y_AXIS */ - { - result = miZeroClipLine(boxp->x1, boxp->y1, boxp->x2 - 1, boxp->y2 - 1, - &new_x1, &new_y1, &new_x2, &new_y2, - ady, adx, - &pt1_clipped, &pt2_clipped, - octant, bias, oc1, oc2); - if (result == -1) - return; - - len = abs(new_y2 - new_y1) - 1; /* this routine needs the "-1" */ - - /* if we've clipped the endpoint, always draw the full length - * of the segment, because then the capstyle doesn't matter - * if x2,y2 isn't clipped, use the capstyle - * (shorten == TRUE <--> CapNotLast) - */ - if (pt2_clipped || !shorten) - len++; - - if (pt1_clipped) - { - /* must calculate new error terms */ - changex = abs(new_x1 - x1); - changey = abs(new_y1 - y1); - e = e + changex * e3 + changey * e1; - } - } - x1 = new_x1; - y1 = new_y1; - { - register PixelType *addrp; - RROP_DECLARE - - RROP_FETCH_GC(pGC); - -#if PSZ == 24 - addrLineEnd = addr + (y1 * nwidth); - addrb = (char *)addrLineEnd + x1 * 3; - if (stepx == 1 || stepx == -1){ - stepx3 = stepx * 3; - stepy3 = stepy * sizeof (CfbBits); - } else { - stepx3 = stepx * sizeof (CfbBits); - stepy3 = stepy * 3; - } -#else - addrp = addr + (y1 * nwidth) + x1; -#endif - -#ifndef REARRANGE - if (!ady) - { -#if PSZ == 24 -#define body {\ - body_rop \ - addrb += stepx3; \ - } -#else -#define body { RROP_SOLID(addrp); addrp += stepx; } -#endif - while (len >= PGSZB) - { - body body body body -#if PGSZ == 64 - body body body body -#endif - len -= PGSZB; - } - switch (len) - { -#if PGSZ == 64 - case 7: body case 6: body case 5: body case 4: body -#endif - case 3: body case 2: body case 1: body - } -#undef body - } - else -#endif /* !REARRANGE */ - { -#if PSZ == 24 -#define body {\ - body_rop \ - addrb += stepx3; \ - e += e1; \ - if (e >= 0) \ - { \ - addrb += stepy3; \ - e += e3; \ - } \ - } -#else -#define body {\ - RROP_SOLID(addrp); \ - addrp += stepx; \ - e += e1; \ - if (e >= 0) \ - { \ - addrp += stepy; \ - e += e3; \ - } \ - } -#endif - -#ifdef LARGE_INSTRUCTION_CACHE - while ((len -= PGSZB) >= 0) - { - body body body body -#if PGSZ == 64 - body body body body -#endif - } - switch (len) - { - case -1: body case -2: body case -3: body -#if PGSZ == 64 - case -4: body case -5: body case -6: body case -7: body -#endif - } -#else /* !LARGE_INSTRUCTION_CACHE */ - IMPORTANT_START; - - while ((len -= 2) >= 0) - { - body body; - } - if (len & 1) - body; - - IMPORTANT_END; -#endif /* LARGE_INSTRUCTION_CACHE */ - } -#if PSZ == 24 - body_rop -#else - RROP_SOLID(addrp); -#endif -#undef body - RROP_UNDECLARE - } -} - -#endif /* !POLYSEGMENT && !PREVIOUS */ -#endif /* PIXEL_ADDR */ diff --git a/nx-X11/programs/Xserver/cfb/cfballpriv.c b/nx-X11/programs/Xserver/cfb/cfballpriv.c deleted file mode 100644 index 68edb281b..000000000 --- a/nx-X11/programs/Xserver/cfb/cfballpriv.c +++ /dev/null @@ -1,94 +0,0 @@ -/* - * $Xorg: cfballpriv.c,v 1.4 2001/02/09 02:04:37 xorgcvs Exp $ - * -Copyright 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - * - * Author: Keith Packard, MIT X Consortium - */ -/* $XFree86: xc/programs/Xserver/cfb/cfballpriv.c,v 1.11 2001/01/30 22:06:15 tsi Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include "servermd.h" -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "resource.h" -#include "colormap.h" -#include "colormapst.h" -#include "cfb.h" -#include "mi.h" -#include "mistruct.h" -#include "dix.h" -#include "cfbmskbits.h" -#include "mibstore.h" - -#if 1 || PSZ==8 -int cfbWindowPrivateIndex = -1; -int cfbGCPrivateIndex = -1; -#endif -#ifdef CFB_NEED_SCREEN_PRIVATE -int cfbScreenPrivateIndex = -1; -static unsigned long cfbGeneration = 0; -#endif - - -Bool -cfbAllocatePrivates(pScreen, window_index, gc_index) - ScreenPtr pScreen; - int *window_index, *gc_index; -{ - if (!window_index || !gc_index || - (*window_index == -1 && *gc_index == -1)) - { - if (!mfbAllocatePrivates(pScreen, - &cfbWindowPrivateIndex, &cfbGCPrivateIndex)) - return FALSE; - if (window_index) - *window_index = cfbWindowPrivateIndex; - if (gc_index) - *gc_index = cfbGCPrivateIndex; - } - else - { - cfbWindowPrivateIndex = *window_index; - cfbGCPrivateIndex = *gc_index; - } - if (!AllocateWindowPrivate(pScreen, cfbWindowPrivateIndex, - sizeof(cfbPrivWin)) || - !AllocateGCPrivate(pScreen, cfbGCPrivateIndex, sizeof(cfbPrivGC))) - return FALSE; -#ifdef CFB_NEED_SCREEN_PRIVATE - if (cfbGeneration != serverGeneration) - { - cfbScreenPrivateIndex = AllocateScreenPrivateIndex (); - cfbGeneration = serverGeneration; - } - if (cfbScreenPrivateIndex == -1) - return FALSE; -#endif - return TRUE; -} diff --git a/nx-X11/programs/Xserver/cfb/cfbbitblt.c b/nx-X11/programs/Xserver/cfb/cfbbitblt.c deleted file mode 100644 index a9dd438fe..000000000 --- a/nx-X11/programs/Xserver/cfb/cfbbitblt.c +++ /dev/null @@ -1,1454 +0,0 @@ -/* - * cfb copy area - */ - -/* $XFree86: xc/programs/Xserver/cfb/cfbbitblt.c,v 1.19tsi Exp $ */ - -/* - -Copyright 1989, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Author: Keith Packard - -*/ -/* $Xorg: cfbbitblt.c,v 1.4 2001/02/09 02:04:37 xorgcvs Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include -#include "gcstruct.h" -#include "windowstr.h" -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "regionstr.h" -#include "mi.h" -#include "cfb.h" -#include "cfbmskbits.h" -#include "cfb8bit.h" -#include "fastblt.h" -#define MFB_CONSTS_ONLY -#include "maskbits.h" - -#if PSZ == 8 -#define cfbCopyPlane1toN cfbCopyPlane1to8 -#define cfbCopyPlaneNto1 cfbCopyPlane8to1 -#else -static unsigned int FgPixel, BgPixel; -# if PSZ == 16 -#define cfbCopyPlane1toN cfbCopyPlane1to16 -#define cfbCopyPlaneNto1 cfbCopyPlane16to1 -# endif -# if PSZ == 24 -#define cfbCopyPlane1toN cfbCopyPlane1to24 -#define cfbCopyPlaneNto1 cfbCopyPlane24to1 -# endif -# if PSZ == 32 -#define cfbCopyPlane1toN cfbCopyPlane1to32 -#define cfbCopyPlaneNto1 cfbCopyPlane32to1 -# endif -#endif - -/* cfbBitBltcfb == cfbCopyPlaneExpand */ -RegionPtr -cfbBitBlt ( - register DrawablePtr pSrcDrawable, - register DrawablePtr pDstDrawable, - GC *pGC, - int srcx, int srcy, - int width, int height, - int dstx, int dsty, - void (*doBitBlt)( - DrawablePtr /*pSrc*/, - DrawablePtr /*pDst*/, - int /*alu*/, - RegionPtr /*prgnDst*/, - DDXPointPtr /*pptSrc*/, - unsigned long /*planemask*/), - unsigned long bitPlane) -{ - RegionPtr prgnSrcClip = NULL; /* may be a new region, or just a copy */ - Bool freeSrcClip = FALSE; - - RegionPtr prgnExposed; - RegionRec rgnDst; - DDXPointPtr pptSrc; - register DDXPointPtr ppt; - register BoxPtr pbox; - int i; - register int dx; - register int dy; - xRectangle origSource; - DDXPointRec origDest; - int numRects; - BoxRec fastBox; - int fastClip = 0; /* for fast clipping with pixmap source */ - int fastExpose = 0; /* for fast exposures with pixmap source */ - - origSource.x = srcx; - origSource.y = srcy; - origSource.width = width; - origSource.height = height; - origDest.x = dstx; - origDest.y = dsty; - - if ((pSrcDrawable != pDstDrawable) && - pSrcDrawable->pScreen->SourceValidate) - { - (*pSrcDrawable->pScreen->SourceValidate) (pSrcDrawable, srcx, srcy, width, height); - } - - srcx += pSrcDrawable->x; - srcy += pSrcDrawable->y; - - /* clip the source */ - - if (pSrcDrawable->type == DRAWABLE_PIXMAP) - { - if ((pSrcDrawable == pDstDrawable) && - (pGC->clientClipType == CT_NONE)) - { - prgnSrcClip = cfbGetCompositeClip(pGC); - } - else - { - fastClip = 1; - } - } - else - { - if (pGC->subWindowMode == IncludeInferiors) - { - /* - * XFree86 DDX empties the border clip when the - * VT is inactive - */ - if (!((WindowPtr) pSrcDrawable)->parent && - REGION_NOTEMPTY (pSrcDrawable->pScreen, - &((WindowPtr) pSrcDrawable)->borderClip)) - { - /* - * special case bitblt from root window in - * IncludeInferiors mode; just like from a pixmap - */ - fastClip = 1; - } - else if ((pSrcDrawable == pDstDrawable) && - (pGC->clientClipType == CT_NONE)) - { - prgnSrcClip = cfbGetCompositeClip(pGC); - } - else - { - prgnSrcClip = NotClippedByChildren((WindowPtr)pSrcDrawable); - freeSrcClip = TRUE; - } - } - else - { - prgnSrcClip = &((WindowPtr)pSrcDrawable)->clipList; - } - } - - fastBox.x1 = srcx; - fastBox.y1 = srcy; - fastBox.x2 = srcx + width; - fastBox.y2 = srcy + height; - - /* Don't create a source region if we are doing a fast clip */ - if (fastClip) - { - fastExpose = 1; - /* - * clip the source; if regions extend beyond the source size, - * make sure exposure events get sent - */ - if (fastBox.x1 < pSrcDrawable->x) - { - fastBox.x1 = pSrcDrawable->x; - fastExpose = 0; - } - if (fastBox.y1 < pSrcDrawable->y) - { - fastBox.y1 = pSrcDrawable->y; - fastExpose = 0; - } - if (fastBox.x2 > pSrcDrawable->x + (int) pSrcDrawable->width) - { - fastBox.x2 = pSrcDrawable->x + (int) pSrcDrawable->width; - fastExpose = 0; - } - if (fastBox.y2 > pSrcDrawable->y + (int) pSrcDrawable->height) - { - fastBox.y2 = pSrcDrawable->y + (int) pSrcDrawable->height; - fastExpose = 0; - } - } - else - { - REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1); - REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, prgnSrcClip); - } - - dstx += pDstDrawable->x; - dsty += pDstDrawable->y; - - if (pDstDrawable->type == DRAWABLE_WINDOW) - { - if (!((WindowPtr)pDstDrawable)->realized) - { - if (!fastClip) - REGION_UNINIT(pGC->pScreen, &rgnDst); - if (freeSrcClip) - REGION_DESTROY(pGC->pScreen, prgnSrcClip); - return NULL; - } - } - - dx = srcx - dstx; - dy = srcy - dsty; - - /* Translate and clip the dst to the destination composite clip */ - if (fastClip) - { - RegionPtr cclip; - - /* Translate the region directly */ - fastBox.x1 -= dx; - fastBox.x2 -= dx; - fastBox.y1 -= dy; - fastBox.y2 -= dy; - - /* If the destination composite clip is one rectangle we can - do the clip directly. Otherwise we have to create a full - blown region and call intersect */ - - /* XXX because CopyPlane uses this routine for 8-to-1 bit - * copies, this next line *must* also correctly fetch the - * composite clip from an mfb gc - */ - - cclip = cfbGetCompositeClip(pGC); - if (REGION_NUM_RECTS(cclip) == 1) - { - BoxPtr pBox = REGION_RECTS(cclip); - - if (fastBox.x1 < pBox->x1) fastBox.x1 = pBox->x1; - if (fastBox.x2 > pBox->x2) fastBox.x2 = pBox->x2; - if (fastBox.y1 < pBox->y1) fastBox.y1 = pBox->y1; - if (fastBox.y2 > pBox->y2) fastBox.y2 = pBox->y2; - - /* Check to see if the region is empty */ - if (fastBox.x1 >= fastBox.x2 || fastBox.y1 >= fastBox.y2) - { - REGION_NULL(pGC->pScreen, &rgnDst); - } - else - { - REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1); - } - } - else - { - /* We must turn off fastClip now, since we must create - a full blown region. It is intersected with the - composite clip below. */ - fastClip = 0; - REGION_INIT(pGC->pScreen, &rgnDst, &fastBox,1); - } - } - else - { - REGION_TRANSLATE(pGC->pScreen, &rgnDst, -dx, -dy); - } - - if (!fastClip) - { - REGION_INTERSECT(pGC->pScreen, &rgnDst, - &rgnDst, - cfbGetCompositeClip(pGC)); - } - - /* Do bit blitting */ - numRects = REGION_NUM_RECTS(&rgnDst); - if (numRects && width && height) - { - if(!(pptSrc = (DDXPointPtr)ALLOCATE_LOCAL(numRects * - sizeof(DDXPointRec)))) - { - REGION_UNINIT(pGC->pScreen, &rgnDst); - if (freeSrcClip) - REGION_DESTROY(pGC->pScreen, prgnSrcClip); - return NULL; - } - pbox = REGION_RECTS(&rgnDst); - ppt = pptSrc; - for (i = numRects; --i >= 0; pbox++, ppt++) - { - ppt->x = pbox->x1 + dx; - ppt->y = pbox->y1 + dy; - } - - (*doBitBlt) (pSrcDrawable, pDstDrawable, pGC->alu, &rgnDst, pptSrc, pGC->planemask); - DEALLOCATE_LOCAL(pptSrc); - } - - prgnExposed = NULL; - if (pGC->fExpose) - { - /* Pixmap sources generate a NoExposed (we return NULL to do this) */ - if (!fastExpose) - prgnExposed = - miHandleExposures(pSrcDrawable, pDstDrawable, pGC, - origSource.x, origSource.y, - (int)origSource.width, - (int)origSource.height, - origDest.x, origDest.y, bitPlane); - } - REGION_UNINIT(pGC->pScreen, &rgnDst); - if (freeSrcClip) - REGION_DESTROY(pGC->pScreen, prgnSrcClip); - return prgnExposed; -} - - -RegionPtr -cfbCopyPlaneReduce ( - register DrawablePtr pSrcDrawable, - register DrawablePtr pDstDrawable, - GC *pGC, - int srcx, int srcy, - int width, int height, - int dstx, int dsty, - void (*doCopyPlane)( - DrawablePtr /*pSrc*/, - DrawablePtr /*pDst*/, - int /*alu*/, - RegionPtr /*prgnDst*/, - DDXPointPtr /*pptSrc*/, - unsigned long /*planemask*/, - unsigned long /*bitPlane*/), - unsigned long bitPlane) -{ - RegionPtr prgnSrcClip = NULL; /* may be a new region, or just a copy */ - Bool freeSrcClip = FALSE; - - RegionPtr prgnExposed; - RegionRec rgnDst; - DDXPointPtr pptSrc; - register DDXPointPtr ppt; - register BoxPtr pbox; - int i; - register int dx; - register int dy; - xRectangle origSource; - DDXPointRec origDest; - int numRects; - BoxRec fastBox; - int fastClip = 0; /* for fast clipping with pixmap source */ - int fastExpose = 0; /* for fast exposures with pixmap source */ - - origSource.x = srcx; - origSource.y = srcy; - origSource.width = width; - origSource.height = height; - origDest.x = dstx; - origDest.y = dsty; - - if ((pSrcDrawable != pDstDrawable) && - pSrcDrawable->pScreen->SourceValidate) - { - (*pSrcDrawable->pScreen->SourceValidate) (pSrcDrawable, srcx, srcy, width, height); - } - - srcx += pSrcDrawable->x; - srcy += pSrcDrawable->y; - - /* clip the source */ - - if (pSrcDrawable->type == DRAWABLE_PIXMAP) - { - if ((pSrcDrawable == pDstDrawable) && - (pGC->clientClipType == CT_NONE)) - { - prgnSrcClip = cfbGetCompositeClip(pGC); - } - else - { - fastClip = 1; - } - } - else - { - if (pGC->subWindowMode == IncludeInferiors) - { - /* - * XFree86 DDX empties the border clip when the - * VT is inactive - */ - if (!((WindowPtr) pSrcDrawable)->parent && - REGION_NOTEMPTY (pSrcDrawable->pScreen, - &((WindowPtr) pSrcDrawable)->borderClip)) - { - /* - * special case bitblt from root window in - * IncludeInferiors mode; just like from a pixmap - */ - fastClip = 1; - } - else if ((pSrcDrawable == pDstDrawable) && - (pGC->clientClipType == CT_NONE)) - { - prgnSrcClip = cfbGetCompositeClip(pGC); - } - else - { - prgnSrcClip = NotClippedByChildren((WindowPtr)pSrcDrawable); - freeSrcClip = TRUE; - } - } - else - { - prgnSrcClip = &((WindowPtr)pSrcDrawable)->clipList; - } - } - - fastBox.x1 = srcx; - fastBox.y1 = srcy; - fastBox.x2 = srcx + width; - fastBox.y2 = srcy + height; - - /* Don't create a source region if we are doing a fast clip */ - if (fastClip) - { - fastExpose = 1; - /* - * clip the source; if regions extend beyond the source size, - * make sure exposure events get sent - */ - if (fastBox.x1 < pSrcDrawable->x) - { - fastBox.x1 = pSrcDrawable->x; - fastExpose = 0; - } - if (fastBox.y1 < pSrcDrawable->y) - { - fastBox.y1 = pSrcDrawable->y; - fastExpose = 0; - } - if (fastBox.x2 > pSrcDrawable->x + (int) pSrcDrawable->width) - { - fastBox.x2 = pSrcDrawable->x + (int) pSrcDrawable->width; - fastExpose = 0; - } - if (fastBox.y2 > pSrcDrawable->y + (int) pSrcDrawable->height) - { - fastBox.y2 = pSrcDrawable->y + (int) pSrcDrawable->height; - fastExpose = 0; - } - } - else - { - REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1); - REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, prgnSrcClip); - } - - dstx += pDstDrawable->x; - dsty += pDstDrawable->y; - - if (pDstDrawable->type == DRAWABLE_WINDOW) - { - if (!((WindowPtr)pDstDrawable)->realized) - { - if (!fastClip) - REGION_UNINIT(pGC->pScreen, &rgnDst); - if (freeSrcClip) - REGION_DESTROY(pGC->pScreen, prgnSrcClip); - return NULL; - } - } - - dx = srcx - dstx; - dy = srcy - dsty; - - /* Translate and clip the dst to the destination composite clip */ - if (fastClip) - { - RegionPtr cclip; - - /* Translate the region directly */ - fastBox.x1 -= dx; - fastBox.x2 -= dx; - fastBox.y1 -= dy; - fastBox.y2 -= dy; - - /* If the destination composite clip is one rectangle we can - do the clip directly. Otherwise we have to create a full - blown region and call intersect */ - - /* XXX because CopyPlane uses this routine for 8-to-1 bit - * copies, this next line *must* also correctly fetch the - * composite clip from an mfb gc - */ - - cclip = cfbGetCompositeClip(pGC); - if (REGION_NUM_RECTS(cclip) == 1) - { - BoxPtr pBox = REGION_RECTS(cclip); - - if (fastBox.x1 < pBox->x1) fastBox.x1 = pBox->x1; - if (fastBox.x2 > pBox->x2) fastBox.x2 = pBox->x2; - if (fastBox.y1 < pBox->y1) fastBox.y1 = pBox->y1; - if (fastBox.y2 > pBox->y2) fastBox.y2 = pBox->y2; - - /* Check to see if the region is empty */ - if (fastBox.x1 >= fastBox.x2 || fastBox.y1 >= fastBox.y2) - { - REGION_NULL(pGC->pScreen, &rgnDst); - } - else - { - REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1); - } - } - else - { - /* We must turn off fastClip now, since we must create - a full blown region. It is intersected with the - composite clip below. */ - fastClip = 0; - REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1); - } - } - else - { - REGION_TRANSLATE(pGC->pScreen, &rgnDst, -dx, -dy); - } - - if (!fastClip) - { - REGION_INTERSECT(pGC->pScreen, &rgnDst, - &rgnDst, - cfbGetCompositeClip(pGC)); - } - - /* Do bit blitting */ - numRects = REGION_NUM_RECTS(&rgnDst); - if (numRects && width && height) - { - if(!(pptSrc = (DDXPointPtr)ALLOCATE_LOCAL(numRects * - sizeof(DDXPointRec)))) - { - REGION_UNINIT(pGC->pScreen, &rgnDst); - if (freeSrcClip) - REGION_DESTROY(pGC->pScreen, prgnSrcClip); - return NULL; - } - pbox = REGION_RECTS(&rgnDst); - ppt = pptSrc; - for (i = numRects; --i >= 0; pbox++, ppt++) - { - ppt->x = pbox->x1 + dx; - ppt->y = pbox->y1 + dy; - } - - (*doCopyPlane) (pSrcDrawable, pDstDrawable, pGC->alu, &rgnDst, pptSrc, pGC->planemask, bitPlane); - DEALLOCATE_LOCAL(pptSrc); - } - - prgnExposed = NULL; - if (pGC->fExpose) - { - /* Pixmap sources generate a NoExposed (we return NULL to do this) */ - if (!fastExpose) - prgnExposed = - miHandleExposures(pSrcDrawable, pDstDrawable, pGC, - origSource.x, origSource.y, - (int)origSource.width, - (int)origSource.height, - origDest.x, origDest.y, bitPlane); - } - REGION_UNINIT(pGC->pScreen, &rgnDst); - if (freeSrcClip) - REGION_DESTROY(pGC->pScreen, prgnSrcClip); - return prgnExposed; -} - - -void -cfbDoBitblt (pSrc, pDst, alu, prgnDst, pptSrc, planemask) - DrawablePtr pSrc, pDst; - int alu; - RegionPtr prgnDst; - DDXPointPtr pptSrc; - unsigned long planemask; -{ - void (*doBitBlt)( - DrawablePtr /*pSrc*/, - DrawablePtr /*pDst*/, - int /*alu*/, - RegionPtr /*prgnDst*/, - DDXPointPtr /*pptSrc*/, - unsigned long /*planemask*/) - = cfbDoBitbltGeneral; - - if ((planemask & PMSK) == PMSK) { - switch (alu) { - case GXcopy: - doBitBlt = cfbDoBitbltCopy; - break; - case GXxor: - doBitBlt = cfbDoBitbltXor; - break; - case GXor: - doBitBlt = cfbDoBitbltOr; - break; - } - } - (*doBitBlt) (pSrc, pDst, alu, prgnDst, pptSrc, planemask); -} - -RegionPtr -cfbCopyArea(pSrcDrawable, pDstDrawable, - pGC, srcx, srcy, width, height, dstx, dsty) - register DrawablePtr pSrcDrawable; - register DrawablePtr pDstDrawable; - GC *pGC; - int srcx, srcy; - int width, height; - int dstx, dsty; -{ - void (*doBitBlt) ( - DrawablePtr /*pSrc*/, - DrawablePtr /*pDst*/, - int /*alu*/, - RegionPtr /*prgnDst*/, - DDXPointPtr /*pptSrc*/, - unsigned long /*planemask*/); - - doBitBlt = cfbDoBitbltCopy; - if (pGC->alu != GXcopy || (pGC->planemask & PMSK) != PMSK) - { - doBitBlt = cfbDoBitbltGeneral; - if ((pGC->planemask & PMSK) == PMSK) - { - switch (pGC->alu) { - case GXxor: - doBitBlt = cfbDoBitbltXor; - break; - case GXor: - doBitBlt = cfbDoBitbltOr; - break; - } - } - } - return cfbBitBlt (pSrcDrawable, pDstDrawable, - pGC, srcx, srcy, width, height, dstx, dsty, doBitBlt, 0L); -} - -#if PSZ == 8 -void -cfbCopyPlane1to8 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, planemask) - DrawablePtr pSrcDrawable; /* must be a bitmap */ - DrawablePtr pDstDrawable; /* must be depth 8 drawable */ - int rop; /* not used; caller must call cfb8CheckOpaqueStipple - * beforehand to get cfb8StippleRRop set correctly */ - RegionPtr prgnDst; /* region in destination to draw to; - * screen relative coords. if dest is a window; - * drawable relative if dest is a pixmap */ - DDXPointPtr pptSrc; /* drawable relative src coords to copy from; - * must be one point for each box in prgnDst */ - unsigned long planemask; /* to apply to destination writes */ -{ - int srcx, srcy; /* upper left corner of box being copied in source */ - int dstx, dsty; /* upper left corner of box being copied in dest */ - int width, height; /* in pixels, unpadded, of box being copied */ - int xoffSrc; /* bit # in leftmost word of row from which copying starts */ - int xoffDst; /* byte # in leftmost word of row from which copying starts */ - CfbBits *psrcBase, *pdstBase; /* start of drawable's pixel data */ - int widthSrc; /* # of groups of 32 pixels (1 bit/pixel) in src bitmap*/ - int widthDst; /* # of groups of 4 pixels (8 bits/pixel) in dst */ - CfbBits *psrcLine, *pdstLine; /* steps a row at a time thru src/dst; - * may point into middle of row */ - register CfbBits *psrc, *pdst; /* steps within the row */ - register CfbBits bits, tmp; /* bits from source */ - register int leftShift; - register int rightShift; - CfbBits startmask; /* left edge pixel mask */ - CfbBits endmask; /* right edge pixel mask */ - register int nlMiddle; /* number of words in middle of the row to draw */ - register int nl; - int firstoff = 0; - int secondoff = 0; - CfbBits src; - int nbox; /* number of boxes in region to copy */ - BoxPtr pbox; /* steps thru boxes in region */ - int pixelsRemainingOnRightEdge; /* # pixels to be drawn on a row after - * the main "middle" loop */ - - cfbGetLongWidthAndPointer (pSrcDrawable, widthSrc, psrcBase) - cfbGetLongWidthAndPointer (pDstDrawable, widthDst, pdstBase) - - nbox = REGION_NUM_RECTS(prgnDst); - pbox = REGION_RECTS(prgnDst); - while (nbox--) - { - dstx = pbox->x1; - dsty = pbox->y1; - srcx = pptSrc->x; - srcy = pptSrc->y; - width = pbox->x2 - pbox->x1; - height = pbox->y2 - pbox->y1; - pbox++; - pptSrc++; - - psrcLine = psrcBase + srcy * widthSrc + (srcx >> MFB_PWSH); - pdstLine = pdstBase + dsty * widthDst + (dstx >> PWSH); - xoffSrc = srcx & MFB_PIM; /* finds starting bit in src */ - xoffDst = dstx & PIM; /* finds starting byte in dst */ - - /* compute startmask, endmask, nlMiddle */ - - if (xoffDst + width < PPW) /* XXX should this be '<= PPW' ? */ - { /* the copy only affects one word per row in destination */ - maskpartialbits(dstx, width, startmask); - endmask = 0; /* nothing on right edge */ - nlMiddle = 0; /* nothing in middle */ - } - else - { /* the copy will affect multiple words per row in destination */ - maskbits(dstx, width, startmask, endmask, nlMiddle); - } - - /* - * compute constants for the first four bits to be - * copied. This avoids troubles with partial first - * writes, and difficult shift computation - */ - if (startmask) - { - firstoff = xoffSrc - xoffDst; - if (firstoff > (MFB_PPW-PPW)) - secondoff = MFB_PPW - firstoff; - if (xoffDst) - { - srcx += (PPW-xoffDst); - xoffSrc = srcx & MFB_PIM; - } - } - leftShift = xoffSrc; - rightShift = MFB_PPW - leftShift; - - pixelsRemainingOnRightEdge = (nlMiddle & 7) * PPW + - ((dstx + width) & PIM); - - /* setup is done; now let's move some bits */ - - /* caller must call cfb8CheckOpaqueStipple before this function - * to set cfb8StippleRRop! - */ - - if (cfb8StippleRRop == GXcopy) - { - while (height--) - { /* one iteration of this loop copies one row */ - psrc = psrcLine; - pdst = pdstLine; - psrcLine += widthSrc; - pdstLine += widthDst; - bits = *psrc++; - if (startmask) - { - if (firstoff < 0) - tmp = BitRight (bits, -firstoff); - else - { - tmp = BitLeft (bits, firstoff); - /* - * need a more cautious test for partialmask - * case... - */ - if (firstoff >= (MFB_PPW-PPW)) - { - bits = *psrc++; - if (firstoff != (MFB_PPW-PPW)) - tmp |= BitRight (bits, secondoff); - } - } - *pdst = (*pdst & ~startmask) | (GetPixelGroup(tmp) & startmask); - pdst++; - } - nl = nlMiddle; - while (nl >= 8) - { - nl -= 8; - tmp = BitLeft(bits, leftShift); - bits = *psrc++; - if (rightShift != MFB_PPW) - tmp |= BitRight(bits, rightShift); - -#ifdef FAST_CONSTANT_OFFSET_MODE -# define StorePixels(pdst,o,pixels) (pdst)[o] = (pixels) -# define EndStep(pdst,o) (pdst) += (o) -# define StoreRopPixels(pdst,o,and,xor) (pdst)[o] = DoRRop((pdst)[o],and,xor); -#else -# define StorePixels(pdst,o,pixels) *(pdst)++ = (pixels) -# define EndStep(pdst,o) -# define StoreRopPixels(pdst,o,and,xor) *(pdst) = DoRRop(*(pdst),and,xor); (pdst)++; -#endif - -#define Step(c) NextBitGroup(c); -#define StoreBitsPlain(o,c) StorePixels(pdst,o,GetPixelGroup(c)) -#define StoreRopBitsPlain(o,c) StoreRopPixels(pdst,o,\ - cfb8StippleAnd[GetBitGroup(c)], \ - cfb8StippleXor[GetBitGroup(c)]) -#define StoreBits0(c) StoreBitsPlain(0,c) -#define StoreRopBits0(c) StoreRopBitsPlain(0,c) - -#if (BITMAP_BIT_ORDER == MSBFirst) -# define StoreBits(o,c) StoreBitsPlain(o,c) -# define StoreRopBits(o,c) StoreRopBitsPlain(o,c) -# define FirstStep(c) Step(c) -#else /* BITMAP_BIT_ORDER == LSBFirst */ -#if PGSZ == 64 -# define StoreBits(o,c) StorePixels(pdst,o, (cfb8Pixels[c & 0xff])) -# define StoreRopBits(o,c) StoreRopPixels(pdst,o, \ - (cfb8StippleAnd[c & 0xff]), \ - (cfb8StippleXor[c & 0xff])) -# define FirstStep(c) c = BitLeft (c, 8); -#else -/* 0x3c is 0xf << 2 (4 bits, long word) */ -# define StoreBits(o,c) StorePixels(pdst,o,*((CfbBits *)\ - (((char *) cfb8Pixels) + (c & 0x3c)))) -# define StoreRopBits(o,c) StoreRopPixels(pdst,o, \ - *((CfbBits *) (((char *) cfb8StippleAnd) + (c & 0x3c))), \ - *((CfbBits *) (((char *) cfb8StippleXor) + (c & 0x3c)))) -# define FirstStep(c) c = BitLeft (c, 2); -#endif /* PGSZ */ -#endif /* BITMAP_BIT_ORDER */ - - StoreBits0(tmp); FirstStep(tmp); - StoreBits(1,tmp); Step(tmp); - StoreBits(2,tmp); Step(tmp); - StoreBits(3,tmp); Step(tmp); - StoreBits(4,tmp); Step(tmp); - StoreBits(5,tmp); Step(tmp); - StoreBits(6,tmp); Step(tmp); - StoreBits(7,tmp); EndStep (pdst,8); - } - - /* do rest of middle and partial word on right edge */ - - if (pixelsRemainingOnRightEdge) - { - tmp = BitLeft(bits, leftShift); - - if (pixelsRemainingOnRightEdge > rightShift) - { - bits = *psrc++; - tmp |= BitRight (bits, rightShift); - } - EndStep (pdst, nl); - switch (nl) - { - case 7: - StoreBitsPlain(-7,tmp); Step(tmp); - case 6: - StoreBitsPlain(-6,tmp); Step(tmp); - case 5: - StoreBitsPlain(-5,tmp); Step(tmp); - case 4: - StoreBitsPlain(-4,tmp); Step(tmp); - case 3: - StoreBitsPlain(-3,tmp); Step(tmp); - case 2: - StoreBitsPlain(-2,tmp); Step(tmp); - case 1: - StoreBitsPlain(-1,tmp); Step(tmp); - } - if (endmask) - *pdst = (*pdst & ~endmask) | (GetPixelGroup(tmp) & endmask); - } - } - } - else /* cfb8StippleRRop != GXcopy */ - { - while (height--) - { /* one iteration of this loop copies one row */ - psrc = psrcLine; - pdst = pdstLine; - psrcLine += widthSrc; - pdstLine += widthDst; - bits = *psrc++; - - /* do partial word on left edge */ - - if (startmask) - { - if (firstoff < 0) - tmp = BitRight (bits, -firstoff); - else - { - tmp = BitLeft (bits, firstoff); - if (firstoff >= (MFB_PPW-PPW)) - { - bits = *psrc++; - if (firstoff != (MFB_PPW-PPW)) - tmp |= BitRight (bits, secondoff); - } - } - src = GetBitGroup(tmp); - *pdst = MaskRRopPixels (*pdst, src, startmask); - pdst++; - } - - /* do middle of row */ - - nl = nlMiddle; - while (nl >= 8) - { - nl -= 8; - tmp = BitLeft(bits, leftShift); - bits = *psrc++; - if (rightShift != MFB_PPW) - tmp |= BitRight(bits, rightShift); - StoreRopBits0(tmp); FirstStep(tmp); - StoreRopBits(1,tmp); Step(tmp); - StoreRopBits(2,tmp); Step(tmp); - StoreRopBits(3,tmp); Step(tmp); - StoreRopBits(4,tmp); Step(tmp); - StoreRopBits(5,tmp); Step(tmp); - StoreRopBits(6,tmp); Step(tmp); - StoreRopBits(7,tmp); EndStep(pdst,8); - } - - /* do rest of middle and partial word on right edge */ - - if (pixelsRemainingOnRightEdge) - { - tmp = BitLeft(bits, leftShift); - - if (pixelsRemainingOnRightEdge > rightShift) - { - bits = *psrc++; /* XXX purify abr here */ - tmp |= BitRight (bits, rightShift); - } - while (nl--) - { - src = GetBitGroup (tmp); - *pdst = RRopPixels (*pdst, src); - pdst++; - NextBitGroup(tmp); - } - if (endmask) - { - src = GetBitGroup (tmp); - *pdst = MaskRRopPixels (*pdst, src, endmask); - } - } - } /* end copy one row */ - } /* end alu is non-copy-mode case */ - } /* end iteration over region boxes */ -} - -#else /* PSZ == 8 */ - -#define mfbmaskbits(x, w, startmask, endmask, nlw) \ - startmask = mfbGetstarttab((x)&0x1f); \ - endmask = mfbGetendtab(((x)+(w)) & 0x1f); \ - if (startmask) \ - nlw = (((w) - (32 - ((x)&0x1f))) >> 5); \ - else \ - nlw = (w) >> 5; - -#define mfbmaskpartialbits(x, w, mask) \ - mask = mfbGetpartmasks((x)&0x1f,(w)&0x1f); - -#define LeftMost 0 -#define StepBit(bit, inc) ((bit) += (inc)) - - -#define GetBits(psrc, nBits, curBit, bitPos, bits) {\ - bits = 0; \ - while (nBits--) \ - { \ - bits |= ((*psrc++ >> bitPos) & 1) << curBit; \ - StepBit (curBit, 1); \ - } \ -} - -/******************************************************************/ - -static void -#if PSZ == 16 -cfbCopyPlane1to16 -#endif -#if PSZ == 24 -cfbCopyPlane1to24 -#endif -#if PSZ == 32 -cfbCopyPlane1to32 -#endif -( - DrawablePtr pSrcDrawable, - DrawablePtr pDstDrawable, - int rop, - RegionPtr prgnDst, - DDXPointPtr pptSrc, - unsigned long planemask) -{ - int srcx, srcy, dstx, dsty; - int width, height; - int xoffSrc; - CfbBits *psrcBase, *pdstBase; - int widthSrc, widthDst; - unsigned int *psrcLine; - register unsigned int *psrc; -#if PSZ == 16 - unsigned short *pdstLine; - register unsigned short *pdst; -#endif -#if PSZ == 32 - unsigned int *pdstLine; - register unsigned int *pdst; -#endif -#if PSZ == 24 - unsigned char *pdstLine; - register unsigned char *pdst; -#endif - register unsigned int bits, tmp; - register unsigned int fgpixel, bgpixel; - register unsigned int src; -#if PSZ == 24 - register unsigned int dst; -#endif - register int leftShift, rightShift; - register int i, nl; - int nbox; - BoxPtr pbox; - int result; - -#if PSZ == 16 - unsigned int doublet[4]; /* Pixel values for 16bpp expansion. */ -#endif -#if PSZ == 32 - unsigned int doublet[8]; /* Pixel values for 32bpp expansion */ -#endif - - fgpixel = FgPixel & planemask; - bgpixel = BgPixel & planemask; - -#if PSZ == 16 - if (rop == GXcopy && (planemask & PMSK) == PMSK) { - doublet[0] = bgpixel | (bgpixel << 16); - doublet[1] = fgpixel | (bgpixel << 16); - doublet[2] = bgpixel | (fgpixel << 16); - doublet[3] = fgpixel | (fgpixel << 16); - } -#endif -#if PSZ == 32 - if (rop == GXcopy && (planemask & PMSK) == PMSK) { - doublet[0] = bgpixel; doublet[1] = bgpixel; - doublet[2] = fgpixel; doublet[3] = bgpixel; - doublet[4] = bgpixel; doublet[5] = fgpixel; - doublet[6] = fgpixel; doublet[7] = fgpixel; - } -#endif - - /* must explicitly ask for "int" widths, as code below expects it */ - /* on some machines (Alpha), "long" and "int" are not the same size */ - cfbGetTypedWidthAndPointer (pSrcDrawable, widthSrc, psrcBase, int, CfbBits) - cfbGetTypedWidthAndPointer (pDstDrawable, widthDst, pdstBase, int, CfbBits) - -#if PSZ == 16 - widthDst <<= 1; -#endif -#if PSZ == 24 - widthDst <<= 2; -#endif - - nbox = REGION_NUM_RECTS(prgnDst); - pbox = REGION_RECTS(prgnDst); - - while (nbox--) - { - dstx = pbox->x1; - dsty = pbox->y1; - srcx = pptSrc->x; - srcy = pptSrc->y; - width = pbox->x2 - pbox->x1; - height = pbox->y2 - pbox->y1; - pbox++; - pptSrc++; - psrcLine = (unsigned int *)psrcBase + srcy * widthSrc + (srcx >> 5); -#if PSZ == 16 - pdstLine = (unsigned short *)pdstBase + dsty * widthDst + dstx; -#endif -#if PSZ == 24 - pdstLine = (unsigned char *)pdstBase + dsty * widthDst + dstx * 3; -#endif -#if PSZ == 32 - pdstLine = (unsigned int *)pdstBase + dsty * widthDst + dstx; -#endif - xoffSrc = srcx & 0x1f; - - /* - * compute constants for the first four bits to be - * copied. This avoids troubles with partial first - * writes, and difficult shift computation - */ - leftShift = xoffSrc; - rightShift = 32 - leftShift; - - if (rop == GXcopy && (planemask & PMSK) == PMSK) - { - while (height--) - { - psrc = psrcLine; - pdst = pdstLine; - psrcLine += widthSrc; - pdstLine += widthDst; - bits = *psrc++; - nl = width; - while (nl >= 32) - { - tmp = BitLeft(bits, leftShift); - bits = *psrc++; - if (rightShift != 32) - tmp |= BitRight(bits, rightShift); - i = 0; -#if PSZ == 16 - /* - * I've thrown in some optimization to at least write - * some aligned 32-bit words instead of 16-bit shorts. - */ - if ((unsigned long)psrc & 2) { - /* Write unaligned 16-bit word at left edge. */ - if (tmp & 0x01) - *pdst = fgpixel; - else - *pdst = bgpixel; - pdst++; - i++; - } - while (i <= 24) - { - unsigned tmpbits = tmp >> i; - *(unsigned int *)pdst = doublet[tmpbits & 0x03]; - *(unsigned int *)(pdst + 2) = - doublet[(tmpbits >> 2) & 0x03]; - *(unsigned int *)(pdst + 4) = - doublet[(tmpbits >> 4) & 0x03]; - *(unsigned int *)(pdst + 6) = - doublet[(tmpbits >> 6) & 0x03]; - pdst += 8; /* Advance four 32-bit words. */ - i += 8; - } - while (i <= 30) - { - *(unsigned int *)pdst = - doublet[(tmp >> i) & 0x03]; - pdst += 2; /* Advance one 32-bit word. */ - i += 2; - } - if (i == 31) { - if ((tmp >> 31) & 0x01) - *pdst = fgpixel; - else - *pdst = bgpixel; - pdst++; - } -#endif -#if PSZ == 24 - while (i < 32) { - if ((tmp >> i) & 0x01) { - *pdst = fgpixel; - *(pdst + 1) = fgpixel >> 8; - *(pdst + 2) = fgpixel >> 16; - } - else { - *pdst = bgpixel; - *(pdst + 1) = bgpixel >> 8; - *(pdst + 2) = bgpixel >> 16; - } - pdst += 3; - i++; - } -#endif -#if PSZ == 32 - while (i <= 28) { - int pair; - pair = (tmp >> i) & 0x03; - *pdst = doublet[pair * 2]; - *(pdst + 1) = doublet[pair * 2 + 1]; - pair = (tmp >> (i + 2)) & 0x03; - *(pdst + 2) = doublet[pair * 2]; - *(pdst + 3) = doublet[pair * 2 + 1]; - pdst += 4; - i += 4; - } - while (i < 32) { - *pdst = ((tmp >> i) & 0x01) ? fgpixel : bgpixel; - pdst++; - i++; - } -#endif - nl -= 32; - } - - if (nl) - { - tmp = BitLeft(bits, leftShift); - /* - * better condition needed -- mustn't run - * off the end of the source... - */ - if (rightShift != 32) - { - bits = *psrc++; - tmp |= BitRight (bits, rightShift); - } - i = 32; - while (nl--) - { - --i; -#if PSZ == 24 - if ((tmp >> (31 - i)) & 0x01) { - *pdst = fgpixel; - *(pdst + 1) = fgpixel >> 8; - *(pdst + 2) = fgpixel >> 16; - } - else { - *pdst = bgpixel; - *(pdst + 1) = bgpixel >> 8; - *(pdst + 2) = bgpixel >> 16; - } - pdst += 3; -#else - *pdst = ((tmp >> (31 - i)) & 0x01) ? fgpixel : bgpixel; - pdst++; -#endif - } - } - } - } - else - { - while (height--) - { - psrc = psrcLine; - pdst = pdstLine; - psrcLine += widthSrc; - pdstLine += widthDst; - bits = *psrc++; - nl = width; - while (nl >= 32) - { - tmp = BitLeft(bits, leftShift); - bits = *psrc++; - if (rightShift != 32) - tmp |= BitRight(bits, rightShift); - i = 32; - while (i--) - { - src = ((tmp >> (31 - i)) & 0x01) ? fgpixel : bgpixel; -#if PSZ == 24 - dst = *pdst; - dst |= (*(pdst + 1)) << 8; - dst |= (*(pdst + 2)) << 16; - DoRop (result, rop, src, dst); - *pdst = (dst & ~planemask) | - (result & planemask); - *(pdst+1) = ((dst & ~planemask) >> 8) | - ((result & planemask) >> 8); - *(pdst+2) = ((dst & ~planemask) >> 16) | - ((result & planemask) >> 16); - pdst += 3; -#else - DoRop (result, rop, src, *pdst); - - *pdst = (*pdst & ~planemask) | - (result & planemask); - pdst++; -#endif - } - nl -= 32; - } - - if (nl) - { - tmp = BitLeft(bits, leftShift); - /* - * better condition needed -- mustn't run - * off the end of the source... - */ - if (rightShift != 32) - { - bits = *psrc++; - tmp |= BitRight (bits, rightShift); - } - i = 32; - while (nl--) - { - --i; - src = ((tmp >> (31 - i)) & 0x01) ? fgpixel : bgpixel; -#if PSZ == 24 - dst = *pdst; - dst |= (*(pdst + 1)) << 8; - dst |= (*(pdst + 2)) << 16; - DoRop (result, rop, src, dst); - *pdst = (dst & ~planemask) | - (result & planemask); - *(pdst+1) = ((dst & ~planemask) >> 8) | - ((result & planemask) >> 8); - *(pdst+2) = ((dst & ~planemask) >> 16) | - ((result & planemask) >> 16); - pdst += 3; -#else - DoRop (result, rop, src, *pdst); - - *pdst = (*pdst & ~planemask) | - (result & planemask); - pdst++; -#endif - } - } - } - } - } -} - -#endif /* PSZ == 8 */ - -/* shared among all different cfb depths through linker magic */ - -RegionPtr cfbCopyPlane(pSrcDrawable, pDstDrawable, - pGC, srcx, srcy, width, height, dstx, dsty, bitPlane) - DrawablePtr pSrcDrawable; - DrawablePtr pDstDrawable; - GCPtr pGC; - int srcx, srcy; - int width, height; - int dstx, dsty; - unsigned long bitPlane; -{ - RegionPtr ret; - -#if IMAGE_BYTE_ORDER == LSBFirst - - void (*doCopyPlaneExpand)( - DrawablePtr /*pSrc*/, - DrawablePtr /*pDst*/, - int /*alu*/, - RegionPtr /*prgnDst*/, - DDXPointPtr /*pptSrc*/, - unsigned long /*planemask*/); - - if (pSrcDrawable->bitsPerPixel == 1 && pDstDrawable->bitsPerPixel == PSZ) - { - if (bitPlane == 1) - { - doCopyPlaneExpand = cfbCopyPlane1toN; -#if PSZ == 8 - cfb8CheckOpaqueStipple (pGC->alu, - pGC->fgPixel, pGC->bgPixel, - pGC->planemask); -#else - FgPixel = pGC->fgPixel; - BgPixel = pGC->bgPixel; -#endif - ret = cfbCopyPlaneExpand (pSrcDrawable, pDstDrawable, - pGC, srcx, srcy, width, height, dstx, dsty, doCopyPlaneExpand, bitPlane); - } - else - ret = miHandleExposures (pSrcDrawable, pDstDrawable, - pGC, srcx, srcy, width, height, dstx, dsty, bitPlane); - } - else if (pSrcDrawable->bitsPerPixel == PSZ && pDstDrawable->bitsPerPixel == 1) - { - int oldalu; - - oldalu = pGC->alu; - if ((pGC->fgPixel & 1) == 0 && (pGC->bgPixel&1) == 1) - pGC->alu = mfbGetInverseAlu(pGC->alu); - else if ((pGC->fgPixel & 1) == (pGC->bgPixel & 1)) - pGC->alu = mfbReduceRop(pGC->alu, pGC->fgPixel); - ret = cfbCopyPlaneReduce(pSrcDrawable, pDstDrawable, - pGC, srcx, srcy, width, height, dstx, dsty, - cfbCopyPlaneNto1, bitPlane); - pGC->alu = oldalu; - } - else if (pSrcDrawable->bitsPerPixel == PSZ && pDstDrawable->bitsPerPixel == PSZ) - { - PixmapPtr pBitmap; - ScreenPtr pScreen = pSrcDrawable->pScreen; - GCPtr pGC1; - - pBitmap = (*pScreen->CreatePixmap) (pScreen, width, height, 1); - if (!pBitmap) - return NULL; - pGC1 = GetScratchGC (1, pScreen); - if (!pGC1) - { - (*pScreen->DestroyPixmap) (pBitmap); - return NULL; - } - /* - * don't need to set pGC->fgPixel,bgPixel as copyPlaneNto1 - * ignores pixel values, expecting the rop to "do the - * right thing", which GXcopy will. - */ - ValidateGC ((DrawablePtr) pBitmap, pGC1); - /* no exposures here, scratch GC's don't get graphics expose */ - cfbCopyPlaneReduce(pSrcDrawable, (DrawablePtr) pBitmap, - pGC1, srcx, srcy, width, height, 0, 0, - cfbCopyPlaneNto1, bitPlane); -#if PSZ == 8 - cfb8CheckOpaqueStipple (pGC->alu, - pGC->fgPixel, pGC->bgPixel, - pGC->planemask); -#else - FgPixel = pGC->fgPixel; - BgPixel = pGC->bgPixel; -#endif - /* no exposures here, copy bits from inside a pixmap */ - cfbCopyPlaneExpand((DrawablePtr) pBitmap, pDstDrawable, pGC, - 0, 0, width, height, dstx, dsty, cfbCopyPlane1toN, 1); - FreeScratchGC (pGC1); - (*pScreen->DestroyPixmap) (pBitmap); - /* compute resultant exposures */ - ret = miHandleExposures (pSrcDrawable, pDstDrawable, pGC, - srcx, srcy, width, height, - dstx, dsty, bitPlane); - } - else -#endif - ret = miCopyPlane (pSrcDrawable, pDstDrawable, - pGC, srcx, srcy, width, height, dstx, dsty, bitPlane); - return ret; -} - - diff --git a/nx-X11/programs/Xserver/cfb/cfbblt.c b/nx-X11/programs/Xserver/cfb/cfbblt.c deleted file mode 100644 index 7a0b192cc..000000000 --- a/nx-X11/programs/Xserver/cfb/cfbblt.c +++ /dev/null @@ -1,933 +0,0 @@ -/* - * cfb copy area - */ -/* $XFree86: xc/programs/Xserver/cfb/cfbblt.c,v 3.13tsi Exp $ */ - -/* - -Copyright 1989, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Author: Keith Packard - -*/ -/* $Xorg: cfbblt.c,v 1.4 2001/02/09 02:04:37 xorgcvs Exp $ */ - -/* 24-bit bug fixes: Peter Wainwright, 1998/11/28 */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include -#include "gcstruct.h" -#include "windowstr.h" -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "regionstr.h" -#include "cfb.h" -#include "cfbmskbits.h" -#include "cfb8bit.h" -#include "fastblt.h" -#include "mergerop.h" - -#ifdef notdef /* XXX fails right now, walks off end of pixmaps */ -#if defined (FAST_UNALIGNED_READS) && PSZ == 8 -#define DO_UNALIGNED_BITBLT -#endif -#endif - -#if defined(FAST_MEMCPY) && (MROP == Mcopy) && PSZ == 8 -#define DO_MEMCPY -#endif - -/* ................................................. */ -/* SPECIAL CODE FOR 24 BITS by Peter Wainwright */ - -#if PSZ == 24 && (MROP) == 0 - -/* The default macros are defined in mergerop.h, and none of them are - really appropriate for what we want to do. - - There are two ways of fixing this: either define SLOW_24BIT_COPY - to copy pixel by pixel, or (by default) use the following macros - modified from mergerop.h - - MROP_SOLID and MROP_MASK are defined for each of the operations, - i.e. each value of MROP. - - There are special cases for Mcopy, McopyInverted, Mxor, and Mor. - There is a completely generic version for MROP=0, and a simplified - generic version which works for (Mcopy|Mxor|MandReverse|Mor). - - However, the generic version does not work for the 24-bit case - because the pixels cannot be packed exactly into a machine word (32 - bits). - - Alternative macros MROP_SOLID24 and MROP_MASK24 are provided for - the 24-bit case. However, these each copy a single *pixel*, not a - single machine word. They take an rvalue source pixel, an lvalue - destination, and the pixel index. The latter is used to find the - position of the pixel data within the two words *dst and *(dst+1). - - Further macros MROP_SOLID24P and MROP_MASK24P are used to copy from - an lvalue source to an lvalue destination. MROP_PIXEL24 is used to - assemble the source pixel from the adjacent words *src and - *(src+1), and this is then split between the destination words - using the non-P macros above. - - But we want to copy entire words for the sake of efficiency. - Unfortunately if a plane mask is specified this must be shifted - from one word to the next. Fortunately the pattern repeats after 3 - words, so we unroll the planemask here and redefine MROP_SOLID - and MROP_MASK. */ - - -#endif /* MROP == 0 && PSZ == 24 */ - -/* ................................................. */ - -#if PSZ == 24 -#define BYPP 3 -#if PGSZ == 32 -#define P3W 4 /* pixels in 3 machine words */ -#define PAM 3 /* pixel align mask; PAM = P3W -1 */ -#define P2WSH 2 -#else -#define P3W 8 /* pixels in 3 machine words */ -#define PAM 7 /* pixel align mask; PAM = P3W -1 */ -#define P2WSH 3 -#endif -#endif - -void -MROP_NAME(cfbDoBitblt)( - DrawablePtr pSrc, - DrawablePtr pDst, - int alu, - RegionPtr prgnDst, - DDXPointPtr pptSrc, - unsigned long planemask) -{ - CfbBits *psrcBase, *pdstBase; - /* start of src and dst bitmaps */ - int widthSrc, widthDst; /* add to get to same position in next line */ - - BoxPtr pbox; - int nbox; - - BoxPtr pboxTmp, pboxNext, pboxBase, pboxNew1, pboxNew2; - /* temporaries for shuffling rectangles */ - DDXPointPtr pptTmp, pptNew1, pptNew2; - /* shuffling boxes entails shuffling the - source points too */ - int w, h; - int xdir; /* 1 = left right, -1 = right left/ */ - int ydir; /* 1 = top down, -1 = bottom up */ - - CfbBits *psrcLine, *pdstLine; - /* pointers to line with current src and dst */ - register CfbBits *psrc;/* pointer to current src longword */ - register CfbBits *pdst;/* pointer to current dst longword */ - - MROP_DECLARE_REG() - - /* following used for looping through a line */ - CfbBits startmask, endmask; /* masks for writing ends of dst */ - int nlMiddle; /* whole longwords in dst */ - int xoffSrc, xoffDst; - register int nl; /* temp copy of nlMiddle */ - int careful; - -#if (PSZ != 24) || (MROP != 0) - register int leftShift, rightShift; - register CfbBits bits; - register CfbBits bits1; -#endif - -#if PSZ == 24 -#ifdef DO_MEMCPY - int w2; -#endif - -#if MROP == 0 - int widthSrcBytes = cfbGetByteWidth(pSrc); - int widthDstBytes = cfbGetByteWidth(pDst); -#endif -#endif - - MROP_INITIALIZE(alu,planemask) - - cfbGetLongWidthAndPointer (pSrc, widthSrc, psrcBase) - - cfbGetLongWidthAndPointer (pDst, widthDst, pdstBase) - - /* XXX we have to err on the side of safety when both are windows, - * because we don't know if IncludeInferiors is being used. - */ - careful = ((pSrc == pDst) || - ((pSrc->type == DRAWABLE_WINDOW) && - (pDst->type == DRAWABLE_WINDOW))); - - pbox = REGION_RECTS(prgnDst); - nbox = REGION_NUM_RECTS(prgnDst); - - pboxNew1 = NULL; - pptNew1 = NULL; - pboxNew2 = NULL; - pptNew2 = NULL; - if (careful && (pptSrc->y < pbox->y1)) - { - /* walk source botttom to top */ - ydir = -1; - widthSrc = -widthSrc; - widthDst = -widthDst; - - if (nbox > 1) - { - /* keep ordering in each band, reverse order of bands */ - pboxNew1 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox); - if(!pboxNew1) - return; - pptNew1 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox); - if(!pptNew1) - { - DEALLOCATE_LOCAL(pboxNew1); - return; - } - pboxBase = pboxNext = pbox+nbox-1; - while (pboxBase >= pbox) - { - while ((pboxNext >= pbox) && - (pboxBase->y1 == pboxNext->y1)) - pboxNext--; - pboxTmp = pboxNext+1; - pptTmp = pptSrc + (pboxTmp - pbox); - while (pboxTmp <= pboxBase) - { - *pboxNew1++ = *pboxTmp++; - *pptNew1++ = *pptTmp++; - } - pboxBase = pboxNext; - } - pboxNew1 -= nbox; - pbox = pboxNew1; - pptNew1 -= nbox; - pptSrc = pptNew1; - } - } - else - { - /* walk source top to bottom */ - ydir = 1; - } - - if (careful && (pptSrc->x < pbox->x1)) - { - /* walk source right to left */ - xdir = -1; - - if (nbox > 1) - { - /* reverse order of rects in each band */ - pboxNew2 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox); - pptNew2 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox); - if(!pboxNew2 || !pptNew2) - { - if (pptNew2) DEALLOCATE_LOCAL(pptNew2); - if (pboxNew2) DEALLOCATE_LOCAL(pboxNew2); - if (pboxNew1) - { - DEALLOCATE_LOCAL(pptNew1); - DEALLOCATE_LOCAL(pboxNew1); - } - return; - } - pboxBase = pboxNext = pbox; - while (pboxBase < pbox+nbox) - { - while ((pboxNext < pbox+nbox) && - (pboxNext->y1 == pboxBase->y1)) - pboxNext++; - pboxTmp = pboxNext; - pptTmp = pptSrc + (pboxTmp - pbox); - while (pboxTmp != pboxBase) - { - *pboxNew2++ = *--pboxTmp; - *pptNew2++ = *--pptTmp; - } - pboxBase = pboxNext; - } - pboxNew2 -= nbox; - pbox = pboxNew2; - pptNew2 -= nbox; - pptSrc = pptNew2; - } - } - else - { - /* walk source left to right */ - xdir = 1; - } - - while(nbox--) - { - w = pbox->x2 - pbox->x1; - h = pbox->y2 - pbox->y1; - -#if PSZ == 24 -#ifdef DO_MEMCPY - w2 = w * BYPP; -#endif -#endif - if (ydir == -1) /* start at last scanline of rectangle */ - { - psrcLine = psrcBase + ((pptSrc->y+h-1) * -widthSrc); - pdstLine = pdstBase + ((pbox->y2-1) * -widthDst); - } - else /* start at first scanline */ - { - psrcLine = psrcBase + (pptSrc->y * widthSrc); - pdstLine = pdstBase + (pbox->y1 * widthDst); - } -#if PSZ == 24 - if (w == 1 && ((pbox->x1 & PAM) == 0 || (pbox->x1 & PAM) == PAM)) -#else - if ((pbox->x1 & PIM) + w <= PPW) -#endif - { - maskpartialbits (pbox->x1, w, endmask); - startmask = 0; - nlMiddle = 0; - } - else - { - maskbits(pbox->x1, w, startmask, endmask, nlMiddle); - } - -#if PSZ == 24 -#if 0 - nlMiddle = w - (pbox->x2 &PAM);; - if(pbox->x1 & PAM){ - nlMiddle -= (PAM+1 - (pbox->x1 &PAM)); - } - nlMiddle >>= P2WSH; - if(nlMiddle < 0) - nlMiddle = 0; -#endif -#endif - -#ifdef DO_MEMCPY - /* If the src and dst scanline don't overlap, do forward case. */ - - if ((xdir == 1) || (pptSrc->y != pbox->y1) - || (pptSrc->x + w <= pbox->x1)) - { -#if PSZ == 24 - char *psrc = (char *) psrcLine + (pptSrc->x * BYPP); - char *pdst = (char *) pdstLine + (pbox->x1 * BYPP); -#else - char *psrc = (char *) psrcLine + pptSrc->x; - char *pdst = (char *) pdstLine + pbox->x1; -#endif - while (h--) - { -#if PSZ == 24 - memcpy(pdst, psrc, w2); -#else - memcpy(pdst, psrc, w); -#endif - pdst += widthDst << PWSH; - psrc += widthSrc << PWSH; - } - } -#else /* ! DO_MEMCPY */ - if (xdir == 1) - { -#if PSZ == 24 && MROP == 0 - /* Note: x is a pixel number; the byte offset is 3*x; - therefore the offset within a word is (3*x) & 3 == - (4*x-x) & 3 == (-x) & 3. The offsets therefore - DECREASE by 1 for each pixel. - */ - xoffSrc = ( - pptSrc->x) & PAM; - xoffDst = ( - pbox->x1) & PAM; -#if 1 - if((int)xoffSrc != (int)xoffDst /* Alignments must be same. */ - || ((widthDstBytes & PAM) != (widthSrcBytes & PAM) && h > 1)) -#else - if(1) -#endif - /* Width also must be same, if hight > 1 */ - { - /* ...otherwise, pixel by pixel operation */ - while (h--) - { - register int i, si, sii, di; - - for (i = 0, si = pptSrc->x, di = pbox->x1; - i < w; - i++, si++, di++) { - psrc = psrcLine + ((si * BYPP) >> P2WSH); - pdst = pdstLine + ((di * BYPP) >> P2WSH); - sii = (si & 3); - MROP_SOLID24P(psrc, pdst, sii, di); - } - pdstLine += widthDst; - psrcLine += widthSrc; - } - } - else -#endif - { - -#if PSZ == 24 - -#if MROP != 0 - xoffSrc = ( - pptSrc->x) & PAM; - xoffDst = ( - pbox->x1) & PAM; -#endif - pdstLine += (pbox->x1 * BYPP) >> P2WSH; - psrcLine += (pptSrc->x * BYPP) >> P2WSH; -#else - xoffSrc = pptSrc->x & PIM; - xoffDst = pbox->x1 & PIM; - pdstLine += (pbox->x1 >> PWSH); - psrcLine += (pptSrc->x >> PWSH); -#endif -#ifdef DO_UNALIGNED_BITBLT - nl = xoffSrc - xoffDst; - psrcLine = (CfbBits *) - (((unsigned char *) psrcLine) + nl); -#else -#if PSZ == 24 && MROP == 0 - /* alredy satisfied */ -#else - if (xoffSrc == xoffDst) -#endif -#endif - { - while (h--) - { -#if PSZ == 24 && MROP == 0 - register int index; - register int im3; -#endif /* PSZ == 24 && MROP == 0 */ - psrc = psrcLine; - pdst = pdstLine; - pdstLine += widthDst; - psrcLine += widthSrc; -#if PSZ == 24 && MROP == 0 - index = (int)(pdst - pdstBase); - im3 = index % 3; -#endif /* PSZ == 24 && MROP == 0 */ - if (startmask) - { -#if PSZ == 24 && MROP == 0 - *pdst = DoMaskMergeRop24u(*psrc, *pdst, startmask, im3); - index++; - im3 = index % 3; -#else /* PSZ != 24 || MROP != 0 */ - *pdst = MROP_MASK(*psrc, *pdst, startmask); -#endif /* PSZ == 24 && MROP == 0 */ - psrc++; - pdst++; - } - - nl = nlMiddle; -#ifdef LARGE_INSTRUCTION_CACHE -#ifdef FAST_CONSTANT_OFFSET_MODE - - psrc += nl & (UNROLL-1); - pdst += nl & (UNROLL-1); - -#if PSZ == 24 && MROP == 0 -#define BodyOdd(n) pdst[-n] = DoMergeRop24u(psrc[-n], pdst[-n], ((int)(pdst - n - pdstBase))%3); -#define BodyEven(n) pdst[-n] = DoMergeRop24u(psrc[-n], pdst[-n], ((int)(pdst - n - pdstBase))%3); -#else /* PSZ != 24 || MROP != 0 */ -#define BodyOdd(n) pdst[-n] = MROP_SOLID (psrc[-n], pdst[-n]); -#define BodyEven(n) pdst[-n] = MROP_SOLID (psrc[-n], pdst[-n]); -#endif /* PSZ == 24 && MROP == 0 */ - -#define LoopReset \ -pdst += UNROLL; \ -psrc += UNROLL; - -#else - -#if PSZ == 24 && MROP == 0 -#define BodyOdd(n) *pdst = DoMergeRop24u(*psrc, *pdst, im3); pdst++; psrc++; index++; im3 = index % 3; -#define BodyEven(n) BodyOdd(n) -#else /* PSZ != 24 || MROP != 0 */ -#define BodyOdd(n) *pdst = MROP_SOLID (*psrc, *pdst); pdst++; psrc++; -#define BodyEven(n) BodyOdd(n) -#endif /* PSZ == 24 && MROP == 0 */ - -#define LoopReset ; - -#endif - PackedLoop - -#undef BodyOdd -#undef BodyEven -#undef LoopReset - -#else -#ifdef NOTDEF - /* you'd think this would be faster -- - * a single instruction instead of 6 - * but measurements show it to be ~15% slower - */ - while ((nl -= 6) >= 0) - { - asm ("moveml %1+,#0x0c0f;moveml#0x0c0f,%0" - : "=m" (*(char *)pdst) - : "m" (*(char *)psrc) - : "d0", "d1", "d2", "d3", - "a2", "a3"); - pdst += 6; - } - nl += 6; - while (nl--) - *pdst++ = *psrc++; -#endif -#if 0 /*PSZ == 24 && MROP == 0*/ - DuffL(nl, label1, - *pdst = DoMergeRop24u(*psrc, *pdst, im3); - pdst++; psrc++; index++;im3 = index % 3;) -#else /* !(PSZ == 24 && MROP == 0) */ - DuffL(nl, label1, - *pdst = MROP_SOLID (*psrc, *pdst); - pdst++; psrc++;) -#endif /* PSZ == 24 && MROP == 0 */ -#endif - - if (endmask) -#if PSZ == 24 && MROP == 0 - *pdst = DoMaskMergeRop24u(*psrc, *pdst, endmask, (int)(pdst - pdstBase) % 3); -#else /* !(PSZ == 24 && MROP == 0) */ - *pdst = MROP_MASK(*psrc, *pdst, endmask); -#endif /* PSZ == 24 && MROP == 0 */ - } - } -#ifndef DO_UNALIGNED_BITBLT -#if PSZ == 24 && MROP == 0 - /* can not happen */ -#else /* !(PSZ == 24 && MROP == 0) */ - else /* xoffSrc != xoffDst */ - { - if (xoffSrc > xoffDst) - { -#if PSZ == 24 - leftShift = (xoffSrc - xoffDst) << 3; -#else -#if PGSZ == 32 - leftShift = (xoffSrc - xoffDst) << (5 - PWSH); -#else /* PGSZ == 64 */ - leftShift = (xoffSrc - xoffDst) << (6 - PWSH); -#endif /* PGSZ */ -#endif - rightShift = PGSZ - leftShift; - } - else - { -#if PSZ == 24 - rightShift = (xoffDst - xoffSrc) << 3; -#else -#if PGSZ == 32 - rightShift = (xoffDst - xoffSrc) << (5 - PWSH); -#else /* PGSZ == 64 */ - rightShift = (xoffDst - xoffSrc) << (6 - PWSH); -#endif /* PGSZ */ -#endif - leftShift = PGSZ - rightShift; - } - while (h--) - { - psrc = psrcLine; - pdst = pdstLine; - pdstLine += widthDst; - psrcLine += widthSrc; - bits = 0; - if (xoffSrc > xoffDst) - bits = *psrc++; - if (startmask) - { - bits1 = BitLeft(bits,leftShift); - bits = *psrc++; - bits1 |= BitRight(bits,rightShift); - *pdst = MROP_MASK(bits1, *pdst, startmask); - pdst++; - } - nl = nlMiddle; -#ifdef LARGE_INSTRUCTION_CACHE - bits1 = bits; - -#ifdef FAST_CONSTANT_OFFSET_MODE - - psrc += nl & (UNROLL-1); - pdst += nl & (UNROLL-1); - -#define BodyOdd(n) \ -bits = psrc[-n]; \ -pdst[-n] = MROP_SOLID(BitLeft(bits1, leftShift) | BitRight(bits, rightShift), pdst[-n]); - -#define BodyEven(n) \ -bits1 = psrc[-n]; \ -pdst[-n] = MROP_SOLID(BitLeft(bits, leftShift) | BitRight(bits1, rightShift), pdst[-n]); - -#define LoopReset \ -pdst += UNROLL; \ -psrc += UNROLL; - -#else - -#define BodyOdd(n) \ -bits = *psrc++; \ -*pdst = MROP_SOLID(BitLeft(bits1, leftShift) | BitRight(bits, rightShift), *pdst); \ -pdst++; - -#define BodyEven(n) \ -bits1 = *psrc++; \ -*pdst = MROP_SOLID(BitLeft(bits, leftShift) | BitRight(bits1, rightShift), *pdst); \ -pdst++; - -#define LoopReset ; - -#endif /* !FAST_CONSTANT_OFFSET_MODE */ - - PackedLoop - -#undef BodyOdd -#undef BodyEven -#undef LoopReset - -#else - DuffL (nl,label2, - bits1 = BitLeft(bits, leftShift); - bits = *psrc++; - *pdst = MROP_SOLID (bits1 | BitRight(bits, rightShift), *pdst); - pdst++; - ) -#endif - - if (endmask) - { - bits1 = BitLeft(bits, leftShift); - if (BitLeft(endmask, rightShift)) - { - bits = *psrc; - bits1 |= BitRight(bits, rightShift); - } - *pdst = MROP_MASK (bits1, *pdst, endmask); - } - } - } -#endif /* (PSZ == 24 && MROP == 0) */ -#endif /* DO_UNALIGNED_BITBLT */ - - } - } -#endif /* ! DO_MEMCPY */ - else /* xdir == -1 */ - { -#if PSZ == 24 && MROP == 0 - xoffSrc = (-(pptSrc->x + w)) & PAM; - xoffDst = (-pbox->x2) & PAM; -#if 1 - if(xoffSrc != xoffDst /* Alignments must be same. */ - || ((widthDstBytes & PAM) != (widthSrcBytes & PAM) && h > 1)) -#else - if(1) -#endif - /* Width also must be same, if hight > 1 */ - { - /* ...otherwise, pixel by pixel operation */ - while (h--) - { - register int i, si, sii, di; - - for (i = 0, si = pptSrc->x + w - 1, di = pbox->x2 - 1; - i < w; - i++, si--, di--) { - psrc = psrcLine + ((si * BYPP) >> P2WSH); - pdst = pdstLine + ((di * BYPP) >> P2WSH); - sii = (si & PAM); - MROP_SOLID24P(psrc, pdst, sii, di); - } - psrcLine += widthSrc; - pdstLine += widthDst; - } - }else -#endif /* MROP == 0 && PSZ == 24 */ - { - -#if PSZ == 24 -#if MROP == 0 - /* already calculated */ -#else - xoffSrc = (pptSrc->x + w) & PAM; - xoffDst = pbox->x2 & PAM; -#endif - pdstLine += ((pbox->x2 * BYPP - 1) >> P2WSH) + 1; - psrcLine += (((pptSrc->x+w) * BYPP - 1) >> P2WSH) + 1; -#else - xoffSrc = (pptSrc->x + w - 1) & PIM; - xoffDst = (pbox->x2 - 1) & PIM; - pdstLine += ((pbox->x2-1) >> PWSH) + 1; - psrcLine += ((pptSrc->x+w - 1) >> PWSH) + 1; -#endif -#ifdef DO_UNALIGNED_BITBLT -#if PSZ == 24 - nl = xoffDst - xoffSrc; -#else - nl = xoffSrc - xoffDst; -#endif - psrcLine = (CfbBits *) - (((unsigned char *) psrcLine) + nl); -#else -#if PSZ == 24 && MROP == 0 - /* already satisfied */ -#else - if (xoffSrc == xoffDst) -#endif -#endif - { - while (h--) - { -#if PSZ == 24 && MROP == 0 - register int index; - register int im3; -#endif /* PSZ == 24 && MROP == 0 */ - psrc = psrcLine; - pdst = pdstLine; - pdstLine += widthDst; - psrcLine += widthSrc; -#if PSZ == 24 && MROP == 0 - index = (int)(pdst - pdstBase); -#endif /* PSZ == 24 && MROP == 0 */ - - if (endmask) - { - pdst--; - psrc--; -#if PSZ == 24 && MROP == 0 - index--; - im3 = index % 3; - *pdst = DoMaskMergeRop24u(*psrc, *pdst, endmask, im3); -#else /* !(PSZ == 24 && MROP == 0) */ - *pdst = MROP_MASK (*psrc, *pdst, endmask); -#endif /* PSZ == 24 && MROP == 0 */ - } - nl = nlMiddle; -#ifdef LARGE_INSTRUCTION_CACHE -#ifdef FAST_CONSTANT_OFFSET_MODE - psrc -= nl & (UNROLL - 1); - pdst -= nl & (UNROLL - 1); - -#if PSZ == 24 && MROP == 0 -#define BodyOdd(n) pdst[n-1] = DoMergeRop24u(psrc[n-1], pdst[n-1], ((int)(pdst - (n - 1) -pdstBase)) % 3); -#else /* !(PSZ == 24 && MROP == 0) */ -#define BodyOdd(n) pdst[n-1] = MROP_SOLID (psrc[n-1], pdst[n-1]); -#endif /* PSZ == 24 && MROP == 0 */ - -#define BodyEven(n) BodyOdd(n) - -#define LoopReset \ -pdst -= UNROLL;\ -psrc -= UNROLL; - -#else - -#if PSZ == 24 && MROP == 0 -#define BodyOdd(n) --pdst; --psrc; --index; im3 = index % 3;*pdst = DoMergeRop24u(*psrc, *pdst, im3); -#else /* !(PSZ == 24 && MROP == 0) */ -#define BodyOdd(n) --pdst; --psrc; *pdst = MROP_SOLID(*psrc, *pdst); -#endif /* PSZ == 24 && MROP == 0 */ -#define BodyEven(n) BodyOdd(n) -#define LoopReset ; - -#endif - PackedLoop - -#undef BodyOdd -#undef BodyEven -#undef LoopReset - -#else -#if PSZ == 24 && MROP == 0 - DuffL(nl,label3, - --pdst; --psrc; --index; im3= index%3;*pdst = DoMergeRop24u(*psrc, *pdst, im3);) -#else /* !(PSZ == 24 && MROP == 0) */ - DuffL(nl,label3, - --pdst; --psrc; *pdst = MROP_SOLID (*psrc, *pdst);) -#endif /* PSZ == 24 && MROP == 0 */ -#endif - - if (startmask) - { - --pdst; - --psrc; -#if PSZ == 24 && MROP == 0 - *pdst = DoMaskMergeRop24u(*psrc, *pdst, startmask, (int)(pdst - pdstBase) % 3); -#else /* !(PSZ == 24 && MROP == 0) */ - *pdst = MROP_MASK(*psrc, *pdst, startmask); -#endif /* PSZ == 24 && MROP == 0 */ - } - } - } -#ifndef DO_UNALIGNED_BITBLT -#if PSZ == 24 && MROP == 0 - /* can not happen */ -#else /* !( PSZ == 24 && MROP == 0) */ - else - { - if (xoffDst > xoffSrc) - { -#if PSZ == 24 - leftShift = (xoffDst - xoffSrc) << 3; - rightShift = PGSZ - leftShift; -#else -#if PGSZ == 32 - rightShift = (xoffDst - xoffSrc) << (5 - PWSH); -#else /* PGSZ == 64 */ - rightShift = (xoffDst - xoffSrc) << (6 - PWSH); -#endif /* PGSZ */ - leftShift = PGSZ - rightShift; -#endif - } - else - { -#if PSZ == 24 - rightShift = (xoffSrc - xoffDst) << 3; - leftShift = PGSZ - rightShift; -#else -#if PGSZ == 32 - leftShift = (xoffSrc - xoffDst) << (5 - PWSH); -#else /* PGSZ == 64 */ - leftShift = (xoffSrc - xoffDst) << (6 - PWSH); -#endif /* PGSZ */ - rightShift = PGSZ - leftShift; -#endif - } - while (h--) - { - psrc = psrcLine; - pdst = pdstLine; - pdstLine += widthDst; - psrcLine += widthSrc; - bits = 0; -#if PSZ == 24 - if (xoffSrc > xoffDst) -#else - if (xoffDst > xoffSrc) -#endif - bits = *--psrc; - if (endmask) - { - bits1 = BitRight(bits, rightShift); - bits = *--psrc; - bits1 |= BitLeft(bits, leftShift); - pdst--; - *pdst = MROP_MASK(bits1, *pdst, endmask); - } - nl = nlMiddle; -#ifdef LARGE_INSTRUCTION_CACHE - bits1 = bits; -#ifdef FAST_CONSTANT_OFFSET_MODE - psrc -= nl & (UNROLL - 1); - pdst -= nl & (UNROLL - 1); - -#define BodyOdd(n) \ -bits = psrc[n-1]; \ -pdst[n-1] = MROP_SOLID(BitRight(bits1, rightShift) | BitLeft(bits, leftShift),pdst[n-1]); - -#define BodyEven(n) \ -bits1 = psrc[n-1]; \ -pdst[n-1] = MROP_SOLID(BitRight(bits, rightShift) | BitLeft(bits1, leftShift),pdst[n-1]); - -#define LoopReset \ -pdst -= UNROLL; \ -psrc -= UNROLL; - -#else - -#define BodyOdd(n) \ -bits = *--psrc; --pdst; \ -*pdst = MROP_SOLID(BitRight(bits1, rightShift) | BitLeft(bits, leftShift),*pdst); - -#define BodyEven(n) \ -bits1 = *--psrc; --pdst; \ -*pdst = MROP_SOLID(BitRight(bits, rightShift) | BitLeft(bits1, leftShift),*pdst); - -#define LoopReset ; - -#endif - - PackedLoop - -#undef BodyOdd -#undef BodyEven -#undef LoopReset - -#else - DuffL (nl, label4, - bits1 = BitRight(bits, rightShift); - bits = *--psrc; - --pdst; - *pdst = MROP_SOLID(bits1 | BitLeft(bits, leftShift),*pdst); - ) -#endif - - if (startmask) - { - bits1 = BitRight(bits, rightShift); - if (BitRight (startmask, leftShift)) - { - bits = *--psrc; - bits1 |= BitLeft(bits, leftShift); - } - --pdst; - *pdst = MROP_MASK(bits1, *pdst, startmask); - } - } - } -#endif /* PSZ == 24 && MROP == 0 */ -#endif - } - } - pbox++; - pptSrc++; - } - if (pboxNew2) - { - DEALLOCATE_LOCAL(pptNew2); - DEALLOCATE_LOCAL(pboxNew2); - } - if (pboxNew1) - { - DEALLOCATE_LOCAL(pptNew1); - DEALLOCATE_LOCAL(pboxNew1); - } -} diff --git a/nx-X11/programs/Xserver/cfb/cfbbres.c b/nx-X11/programs/Xserver/cfb/cfbbres.c deleted file mode 100644 index 2251fb885..000000000 --- a/nx-X11/programs/Xserver/cfb/cfbbres.c +++ /dev/null @@ -1,342 +0,0 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfbbres.c,v 3.4 2001/01/17 22:36:34 dawes Exp $ */ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $Xorg: cfbbres.c,v 1.4 2001/02/09 02:04:37 xorgcvs Exp $ */ -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include "misc.h" -#include "cfb.h" -#include "cfbmskbits.h" -#include "servermd.h" -#include "miline.h" - -/* Solid bresenham line */ -/* NOTES - e2 is used less often than e1, so it's not in a register -*/ - -void -cfbBresS(rop, and, xor, addrl, nlwidth, signdx, signdy, axis, x1, y1, e, e1, - e2, len) - int rop; - CfbBits and, xor; - CfbBits *addrl; /* pointer to base of bitmap */ - int nlwidth; /* width in longwords of bitmap */ - register int signdx; - int signdy; /* signs of directions */ - int axis; /* major axis (Y_AXIS or X_AXIS) */ - int x1, y1; /* initial point */ - register int e; /* error accumulator */ - register int e1; /* bresenham increments */ - int e2; - int len; /* length of line */ -{ - register int e3 = e2-e1; -#if PSZ == 24 - CfbBits piQxelXor[3],piQxelAnd[3]; - char *addrb; - int nlwidth3, signdx3; -#endif -#ifdef PIXEL_ADDR - register PixelType *addrp; /* Pixel pointer */ - - if (len == 0) - return; - /* point to first point */ - nlwidth <<= PWSH; -#if PSZ == 24 - addrp = (PixelType *)(addrl) + (y1 * nlwidth); - addrb = (char *)addrp + x1 * 3; - - piQxelXor[0] = (xor << 24) | xor; - piQxelXor[1] = (xor << 16)| (xor >> 8); - piQxelXor[2] = (xor << 8) | (xor >> 16); - piQxelAnd[0] = (and << 24) | and; - piQxelAnd[1] = (and << 16)| (and >> 8); - piQxelAnd[2] = (and << 8) | (and >> 16); -#else - addrp = (PixelType *)(addrl) + (y1 * nlwidth) + x1; -#endif - if (signdy < 0) - nlwidth = -nlwidth; - e = e-e1; /* to make looping easier */ -#if PSZ == 24 - nlwidth3 = nlwidth * sizeof (CfbBits); - signdx3 = signdx * 3; -#endif - - if (axis == Y_AXIS) - { - int t; - - t = nlwidth; - nlwidth = signdx; - signdx = t; -#if PSZ == 24 - t = nlwidth3; - nlwidth3 = signdx3; - signdx3 = t; -#endif - } - if (rop == GXcopy) - { - --len; -#if PSZ == 24 -#define body_copy \ - addrp = (PixelType *)((unsigned long)addrb & ~0x03); \ - switch((unsigned long)addrb & 3){ \ - case 0: \ - *addrp = ((*addrp)&0xFF000000)|(piQxelXor[0] & 0xFFFFFF); \ - break; \ - case 1: \ - *addrp = ((*addrp)&0xFF)|(piQxelXor[2] & 0xFFFFFF00); \ - break; \ - case 3: \ - *addrp = ((*addrp)&0xFFFFFF)|(piQxelXor[0] & 0xFF000000); \ - *(addrp+1) = ((*(addrp+1))&0xFFFF0000)|(piQxelXor[1] & 0xFFFF); \ - break; \ - case 2: \ - *addrp = ((*addrp)&0xFFFF)|(piQxelXor[1] & 0xFFFF0000); \ - *(addrp+1) = ((*(addrp+1))&0xFFFFFF00)|(piQxelXor[2] & 0xFF); \ - break; \ - } -#define body {\ - body_copy \ - addrb += signdx3; \ - e += e1; \ - if (e >= 0) \ - { \ - addrb += nlwidth3; \ - e += e3; \ - } \ - } -#else /* PSZ == 24 */ -#define body {\ - *addrp = xor; \ - addrp += signdx; \ - e += e1; \ - if (e >= 0) \ - { \ - addrp += nlwidth; \ - e += e3; \ - } \ - } -#endif /* PSZ == 24 */ - while (len >= 4) - { - body body body body - len -= 4; - } - switch (len) - { - case 3: body case 2: body case 1: body - } -#undef body -#if PSZ == 24 - body_copy -# undef body_copy -#else - *addrp = xor; -#endif - } - else /* not GXcopy */ - { - while(len--) - { -#if PSZ == 24 - addrp = (PixelType *)((unsigned long)addrb & ~0x03); - switch((unsigned long)addrb & 3){ - case 0: - *addrp = (*addrp & (piQxelAnd[0]|0xFF000000)) - ^ (piQxelXor[0] & 0xFFFFFF); - break; - case 1: - *addrp = (*addrp & (piQxelAnd[2]|0xFF)) - ^ (piQxelXor[2] & 0xFFFFFF00); - break; - case 3: - *addrp = (*addrp & (piQxelAnd[0]|0xFFFFFF)) - ^ (piQxelXor[0] & 0xFF000000); - *(addrp+1) = (*(addrp+1) & (piQxelAnd[1]|0xFFFF0000)) - ^ (piQxelXor[1] & 0xFFFF); - break; - case 2: - *addrp = (*addrp & (piQxelAnd[1]|0xFFFF)) - ^ (piQxelXor[1] & 0xFFFF0000); - *(addrp+1) = (*(addrp+1) & (piQxelAnd[2]|0xFFFFFF00)) - ^ (piQxelXor[2] & 0xFF); - break; - } - e += e1; - if (e >= 0) - { - addrb += nlwidth3; - e += e3; - } - addrb += signdx3; -#else /* PSZ == 24 */ - *addrp = DoRRop (*addrp, and, xor); - e += e1; - if (e >= 0) - { - addrp += nlwidth; - e += e3; - } - addrp += signdx; -#endif /* PSZ == 24 */ - } - } -#else /* !PIXEL_ADDR */ - register CfbBits tmp, bit; - CfbBits leftbit, rightbit; - - /* point to longword containing first point */ -#if PSZ == 24 - addrl = (addrl + (y1 * nlwidth) + ((x1 * 3) >>2); -#else - addrl = (addrl + (y1 * nlwidth) + (x1 >> PWSH)); -#endif - if (signdy < 0) - nlwidth = -nlwidth; - e = e-e1; /* to make looping easier */ - - leftbit = cfbmask[0]; -#if PSZ == 24 - rightbit = cfbmask[(PPW-1)<<1]; - bit = cfbmask[(x1 & 3)<<1]; -#else - rightbit = cfbmask[PPW-1]; - bit = cfbmask[x1 & PIM]; -#endif - - if (axis == X_AXIS) - { - if (signdx > 0) - { - while (len--) - { - *addrl = DoMaskRRop (*addrl, and, xor, bit); - bit = SCRRIGHT(bit,1); - e += e1; - if (e >= 0) - { - addrl += nlwidth; - e += e3; - } - if (!bit) - { - bit = leftbit; - addrl++; - } - } - } - else - { - while (len--) - { - *addrl = DoMaskRRop (*addrl, and, xor, bit); - e += e1; - bit = SCRLEFT(bit,1); - if (e >= 0) - { - addrl += nlwidth; - e += e3; - } - if (!bit) - { - bit = rightbit; - addrl--; - } - } - } - } /* if X_AXIS */ - else - { - if (signdx > 0) - { - while(len--) - { - *addrl = DoMaskRRop (*addrl, and, xor, bit); - e += e1; - if (e >= 0) - { - bit = SCRRIGHT(bit,1); - if (!bit) - { - bit = leftbit; - addrl++; - } - e += e3; - } - addrl += nlwidth; - } - } - else - { - while(len--) - { - *addrl = DoMaskRRop (*addrl, and, xor, bit); - e += e1; - if (e >= 0) - { - bit = SCRLEFT(bit,1); - if (!bit) - { - bit = rightbit; - addrl--; - } - e += e3; - } - addrl += nlwidth; - } - } - } /* else Y_AXIS */ -#endif -} diff --git a/nx-X11/programs/Xserver/cfb/cfbbresd.c b/nx-X11/programs/Xserver/cfb/cfbbresd.c deleted file mode 100644 index cc27eb5dc..000000000 --- a/nx-X11/programs/Xserver/cfb/cfbbresd.c +++ /dev/null @@ -1,406 +0,0 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfbbresd.c,v 3.5 2001/01/17 22:36:34 dawes Exp $ */ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $Xorg: cfbbresd.c,v 1.4 2001/02/09 02:04:37 xorgcvs Exp $ */ -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include "misc.h" -#include "cfb.h" -#include "cfbmskbits.h" -#include "miline.h" - -/* Dashed bresenham line */ - -void -cfbBresD(rrops, - pdashIndex, pDash, numInDashList, pdashOffset, isDoubleDash, - addrl, nlwidth, - signdx, signdy, axis, x1, y1, e, e1, e2, len) - cfbRRopPtr rrops; - int *pdashIndex; /* current dash */ - unsigned char *pDash; /* dash list */ - int numInDashList; /* total length of dash list */ - int *pdashOffset; /* offset into current dash */ - int isDoubleDash; - CfbBits *addrl; /* pointer to base of bitmap */ - int nlwidth; /* width in longwords of bitmap */ - int signdx, signdy; /* signs of directions */ - int axis; /* major axis (Y_AXIS or X_AXIS) */ - int x1, y1; /* initial point */ - register int e; /* error accumulator */ - register int e1; /* bresenham increments */ - int e2; - int len; /* length of line */ -{ -#ifdef PIXEL_ADDR - register PixelType *addrp; -#endif - register int e3 = e2-e1; - int dashIndex; - int dashOffset; - int dashRemaining; - CfbBits xorFg, andFg, xorBg, andBg; - Bool isCopy; - int thisDash; -#if PSZ == 24 - CfbBits xorPiQxlFg[3], andPiQxlFg[3], xorPiQxlBg[3], andPiQxlBg[3]; - char *addrb; - int signdx3, signdy3; -#endif - - dashOffset = *pdashOffset; - dashIndex = *pdashIndex; - isCopy = (rrops[0].rop == GXcopy && rrops[1].rop == GXcopy); -#if PSZ == 24 - xorFg = rrops[0].xor & 0xffffff; - andFg = rrops[0].and & 0xffffff; - xorBg = rrops[1].xor & 0xffffff; - andBg = rrops[1].and & 0xffffff; - xorPiQxlFg[0] = xorFg | (xorFg << 24); - xorPiQxlFg[1] = (xorFg >> 8) | (xorFg << 16); - xorPiQxlFg[2] = (xorFg >> 16) | (xorFg << 8); - andPiQxlFg[0] = andFg | (andFg << 24); - andPiQxlFg[1] = (andFg >> 8) | (andFg << 16); - andPiQxlFg[2] = (andFg >> 16) | (andFg << 8); - xorPiQxlBg[0] = xorBg | (xorBg << 24); - xorPiQxlBg[1] = (xorBg >> 8) | (xorBg << 16); - xorPiQxlBg[2] = (xorBg >> 16) | (xorBg << 8); - andPiQxlBg[0] = andBg | (andBg << 24); - andPiQxlBg[1] = (andBg >> 8) | (andBg << 16); - andPiQxlBg[2] = (andFg >> 16) | (andBg << 8); -#else - xorFg = rrops[0].xor; - andFg = rrops[0].and; - xorBg = rrops[1].xor; - andBg = rrops[1].and; -#endif - dashRemaining = pDash[dashIndex] - dashOffset; - if ((thisDash = dashRemaining) >= len) - { - thisDash = len; - dashRemaining -= len; - } - e = e-e1; /* to make looping easier */ - -#define BresStep(minor,major) {if ((e += e1) >= 0) { e += e3; minor; } major;} - -#define NextDash {\ - dashIndex++; \ - if (dashIndex == numInDashList) \ - dashIndex = 0; \ - dashRemaining = pDash[dashIndex]; \ - if ((thisDash = dashRemaining) >= len) \ - { \ - dashRemaining -= len; \ - thisDash = len; \ - } \ -} - -#ifdef PIXEL_ADDR - -#if PSZ == 24 -#define Loop(store) while (thisDash--) {\ - store; \ - BresStep(addrb+=signdy3,addrb+=signdx3) \ - } - /* point to first point */ - nlwidth <<= PWSH; - addrp = (PixelType *)(addrl) + (y1 * nlwidth); - addrb = (char *)addrp + x1 * 3; - -#else -#define Loop(store) while (thisDash--) {\ - store; \ - BresStep(addrp+=signdy,addrp+=signdx) \ - } - /* point to first point */ - nlwidth <<= PWSH; - addrp = (PixelType *)(addrl) + (y1 * nlwidth) + x1; -#endif - signdy *= nlwidth; -#if PSZ == 24 - signdx3 = signdx * 3; - signdy3 = signdy * sizeof (CfbBits); -#endif - if (axis == Y_AXIS) - { - int t; - - t = signdx; - signdx = signdy; - signdy = t; -#if PSZ == 24 - t = signdx3; - signdx3 = signdy3; - signdy3 = t; -#endif - } - - if (isCopy) - { -#if PSZ == 24 -#define body_copy(pix) { \ - addrp = (PixelType *)((unsigned long)addrb & ~0x03); \ - switch((unsigned long)addrb & 3){ \ - case 0: \ - *addrp = (*addrp & 0xFF000000)|((pix)[0] & 0xFFFFFF); \ - break; \ - case 1: \ - *addrp = (*addrp & 0xFF)|((pix)[2] & 0xFFFFFF00); \ - break; \ - case 3: \ - *addrp = (*addrp & 0xFFFFFF)|((pix)[0] & 0xFF000000); \ - *(addrp+1) = (*(addrp+1) & 0xFFFF0000)|((pix)[1] & 0xFFFF); \ - break; \ - case 2: \ - *addrp = (*addrp & 0xFFFF)|((pix)[1] & 0xFFFF0000); \ - *(addrp+1) = (*(addrp+1) & 0xFFFFFF00)|((pix)[2] & 0xFF); \ - break; \ - } \ -} -#endif /* PSZ == 24 */ - - for (;;) - { - len -= thisDash; - if (dashIndex & 1) { - if (isDoubleDash) { -#if PSZ == 24 - Loop(body_copy(xorPiQxlBg)) -#else - Loop(*addrp = xorBg) -#endif - } else { - Loop(;) - } - } else { -#if PSZ == 24 - Loop(body_copy(xorPiQxlFg)) -#else - Loop(*addrp = xorFg) -#endif - } - if (!len) - break; - NextDash - } -#undef body_copy - } - else - { -#define body_set(and, xor) { \ - addrp = (PixelType *)((unsigned long)addrb & ~0x03); \ - switch((unsigned long)addrb & 3){ \ - case 0: \ - *addrp = (*addrp & ((and)[0]|0xFF000000)) ^ ((xor)[0] & 0xFFFFFF); \ - break; \ - case 1: \ - *addrp = (*addrp & ((and)[2]|0xFF)) ^ ((xor)[2] & 0xFFFFFF00); \ - break; \ - case 3: \ - *addrp = (*addrp & ((and)[0]|0xFFFFFF)) ^ ((xor)[0] & 0xFF000000); \ - *(addrp+1)=(*(addrp+1)&((and)[1]|0xFFFF0000)) ^ ((xor)[1]&0xFFFF); \ - break; \ - case 2: \ - *addrp = (*addrp & ((and)[1]|0xFFFF)) ^ ((xor)[1] & 0xFFFF0000); \ - *(addrp+1)=(*(addrp+1)&((and)[2]|0xFFFFFF00)) ^ ((xor)[2] & 0xFF); \ - break; \ - } \ -} - - for (;;) - { - len -= thisDash; - if (dashIndex & 1) { - if (isDoubleDash) { -#if PSZ == 24 - Loop(body_set(andPiQxlBg, xorPiQxlBg)) -#else - Loop(*addrp = DoRRop(*addrp,andBg, xorBg)) -#endif - } else { - Loop(;) - } - } else { -#if PSZ == 24 - Loop(body_set(andPiQxlFg, xorPiQxlFg)) -#else - Loop(*addrp = DoRRop(*addrp,andFg, xorFg)) -#endif - } - if (!len) - break; - NextDash - } -#undef body_set - } -#else /* !PIXEL_ADDR */ - { - register CfbBits tmp; - CfbBits startbit, bit; - - /* point to longword containing first point */ -#if PSZ == 24 - addrl = (addrl + (y1 * nlwidth) + ((x1*3) >> 2); -#else - addrl = (addrl + (y1 * nlwidth) + (x1 >> PWSH)); -#endif - signdy = signdy * nlwidth; - - if (signdx > 0) - startbit = cfbmask[0]; - else -#if PSZ == 24 - startbit = cfbmask[(PPW-1)<<1]; - bit = cfbmask[(x1 & 3)<<1]; -#else - startbit = cfbmask[PPW-1]; - bit = cfbmask[x1 & PIM]; -#endif - -#if PSZ == 24 -#define X_Loop(store) while(thisDash--) {\ - store; \ - BresStep(addrl += signdy, \ - if (signdx > 0) \ - bit = SCRRIGHT(bit,1); \ - else \ - bit = SCRLEFT(bit,1); \ - if (!bit) \ - { \ - bit = startbit; \ - addrl += signdx; \ - }) \ - } -#define Y_Loop(store) while(thisDash--) {\ - store; \ - BresStep(if (signdx > 0) \ - bit = SCRRIGHT(bit,1); \ - else \ - bit = SCRLEFT(bit,1); \ - if (!bit) \ - { \ - bit = startbit; \ - addrl += signdx; \ - }, \ - addrl += signdy) \ - } -#else -#define X_Loop(store) while(thisDash--) {\ - store; \ - BresStep(addrl += signdy, \ - if (signdx > 0) \ - bit = SCRRIGHT(bit,1); \ - else \ - bit = SCRLEFT(bit,1); \ - if (!bit) \ - { \ - bit = startbit; \ - addrl += signdx; \ - }) \ - } -#define Y_Loop(store) while(thisDash--) {\ - store; \ - BresStep(if (signdx > 0) \ - bit = SCRRIGHT(bit,1); \ - else \ - bit = SCRLEFT(bit,1); \ - if (!bit) \ - { \ - bit = startbit; \ - addrl += signdx; \ - }, \ - addrl += signdy) \ - } -#endif - - if (axis == X_AXIS) - { - for (;;) - { - len -= thisDash; - if (dashIndex & 1) { - if (isDoubleDash) { - X_Loop(*addrl = DoMaskRRop(*addrl, andBg, xorBg, bit)); - } else { - X_Loop(;) - } - } else { - X_Loop(*addrl = DoMaskRRop(*addrl, andFg, xorFg, bit)); - } - if (!len) - break; - NextDash - } - } /* if X_AXIS */ - else - { - for (;;) - { - len -= thisDash; - if (dashIndex & 1) { - if (isDoubleDash) { - Y_Loop(*addrl = DoMaskRRop(*addrl, andBg, xorBg, bit)); - } else { - Y_Loop(;) - } - } else { - Y_Loop(*addrl = DoMaskRRop(*addrl, andFg, xorFg, bit)); - } - if (!len) - break; - NextDash - } - } /* else Y_AXIS */ - } -#endif - *pdashIndex = dashIndex; - *pdashOffset = pDash[dashIndex] - dashRemaining; -} diff --git a/nx-X11/programs/Xserver/cfb/cfbbstore.c b/nx-X11/programs/Xserver/cfb/cfbbstore.c deleted file mode 100644 index 64adc4050..000000000 --- a/nx-X11/programs/Xserver/cfb/cfbbstore.c +++ /dev/null @@ -1,145 +0,0 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfbbstore.c,v 1.4 1999/01/31 12:21:41 dawes Exp $ */ -/*- - * cfbbstore.c -- - * Functions required by the backing-store implementation in MI. - * - * Copyright (c) 1987 by the Regents of the University of California - * - * Permission to use, copy, modify, and distribute this - * software and its documentation for any purpose and without - * fee is hereby granted, provided that the above copyright - * notice appear in all copies. The University of California - * makes no representations about the suitability of this - * software for any purpose. It is provided "as is" without - * express or implied warranty. - * - * - */ -/* $Xorg: cfbbstore.c,v 1.3 2000/08/17 19:48:13 cpqbld Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "cfb.h" -#include -#include "mibstore.h" -#include "regionstr.h" -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "windowstr.h" - -/*- - *----------------------------------------------------------------------- - * cfbSaveAreas -- - * Function called by miSaveAreas to actually fetch the areas to be - * saved into the backing pixmap. This is very simple to do, since - * cfbDoBitblt is designed for this very thing. The region to save is - * already destination-relative and we're given the offset to the - * window origin, so we have only to create an array of points of the - * u.l. corners of the boxes in the region translated to the screen - * coordinate system and fetch the screen pixmap out of its devPrivate - * field.... - * - * Results: - * None. - * - * Side Effects: - * Data are copied from the screen into the pixmap. - * - *----------------------------------------------------------------------- - */ -void -cfbSaveAreas(pPixmap, prgnSave, xorg, yorg, pWin) - PixmapPtr pPixmap; /* Backing pixmap */ - RegionPtr prgnSave; /* Region to save (pixmap-relative) */ - int xorg; /* X origin of region */ - int yorg; /* Y origin of region */ - WindowPtr pWin; -{ - register DDXPointPtr pPt; - DDXPointPtr pPtsInit; - register BoxPtr pBox; - register int i; - ScreenPtr pScreen = pPixmap->drawable.pScreen; - PixmapPtr pScrPix; - - i = REGION_NUM_RECTS(prgnSave); - pPtsInit = (DDXPointPtr)ALLOCATE_LOCAL(i * sizeof(DDXPointRec)); - if (!pPtsInit) - return; - - pBox = REGION_RECTS(prgnSave); - pPt = pPtsInit; - while (--i >= 0) { - pPt->x = pBox->x1 + xorg; - pPt->y = pBox->y1 + yorg; - pPt++; - pBox++; - } - - pScrPix = (*pScreen->GetWindowPixmap)(pWin); - - - cfbDoBitbltCopy((DrawablePtr) pScrPix, (DrawablePtr)pPixmap, - GXcopy, prgnSave, pPtsInit, ~0L); - - DEALLOCATE_LOCAL (pPtsInit); -} - -/*- - *----------------------------------------------------------------------- - * cfbRestoreAreas -- - * Function called by miRestoreAreas to actually fetch the areas to be - * restored from the backing pixmap. This is very simple to do, since - * cfbDoBitblt is designed for this very thing. The region to restore is - * already destination-relative and we're given the offset to the - * window origin, so we have only to create an array of points of the - * u.l. corners of the boxes in the region translated to the pixmap - * coordinate system and fetch the screen pixmap out of its devPrivate - * field.... - * - * Results: - * None. - * - * Side Effects: - * Data are copied from the pixmap into the screen. - * - *----------------------------------------------------------------------- - */ -void -cfbRestoreAreas(pPixmap, prgnRestore, xorg, yorg, pWin) - PixmapPtr pPixmap; /* Backing pixmap */ - RegionPtr prgnRestore; /* Region to restore (screen-relative)*/ - int xorg; /* X origin of window */ - int yorg; /* Y origin of window */ - WindowPtr pWin; -{ - register DDXPointPtr pPt; - DDXPointPtr pPtsInit; - register BoxPtr pBox; - register int i; - ScreenPtr pScreen = pPixmap->drawable.pScreen; - PixmapPtr pScrPix; - - i = REGION_NUM_RECTS(prgnRestore); - pPtsInit = (DDXPointPtr)ALLOCATE_LOCAL(i*sizeof(DDXPointRec)); - if (!pPtsInit) - return; - - pBox = REGION_RECTS(prgnRestore); - pPt = pPtsInit; - while (--i >= 0) { - pPt->x = pBox->x1 - xorg; - pPt->y = pBox->y1 - yorg; - pPt++; - pBox++; - } - - pScrPix = (*pScreen->GetWindowPixmap)(pWin); - - cfbDoBitbltCopy((DrawablePtr)pPixmap, (DrawablePtr) pScrPix, - GXcopy, prgnRestore, pPtsInit, ~0L); - - DEALLOCATE_LOCAL (pPtsInit); -} diff --git a/nx-X11/programs/Xserver/cfb/cfbcmap.c b/nx-X11/programs/Xserver/cfb/cfbcmap.c deleted file mode 100644 index a7777eda8..000000000 --- a/nx-X11/programs/Xserver/cfb/cfbcmap.c +++ /dev/null @@ -1,121 +0,0 @@ -/* $Xorg: cfbcmap.c,v 1.3 2000/08/17 19:48:13 cpqbld Exp $ */ -/************************************************************ -Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this -software and its documentation for any purpose and without -fee is hereby granted, provided that the above copyright no- -tice appear in all copies and that both that copyright no- -tice and this permission notice appear in supporting docu- -mentation, and that the names of Sun or The Open Group -not be used in advertising or publicity pertaining to -distribution of the software without specific prior -written permission. Sun and The Open Group make no -representations about the suitability of this software for -any purpose. It is provided "as is" without any express or -implied warranty. - -SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT- -NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE LI- -ABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR -PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH -THE USE OR PERFORMANCE OF THIS SOFTWARE. - -********************************************************/ -/* $XFree86: xc/programs/Xserver/cfb/cfbcmap.c,v 3.12 2000/02/12 03:39:23 dawes Exp $ */ - - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include "scrnintstr.h" -#include "colormapst.h" -#include "resource.h" -#include "micmap.h" -#include "cfb.h" - -int -cfbListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps) -{ - return miListInstalledColormaps(pScreen, pmaps); -} - -void -cfbInstallColormap(ColormapPtr pmap) -{ - miInstallColormap(pmap); -} - -void -cfbUninstallColormap(ColormapPtr pmap) -{ - miUninstallColormap(pmap); -} - -void -cfbResolveColor(unsigned short *pred, - unsigned short *pgreen, - unsigned short *pblue, - VisualPtr pVisual) -{ - miResolveColor(pred, pgreen, pblue, pVisual); -} - -Bool -cfbInitializeColormap(ColormapPtr pmap) -{ - return miInitializeColormap(pmap); -} - -int -cfbExpandDirectColors (ColormapPtr pmap, int ndef, - xColorItem *indefs, xColorItem *outdefs) -{ - return miExpandDirectColors(pmap, ndef, indefs, outdefs); -} - -Bool -cfbCreateDefColormap(ScreenPtr pScreen) -{ - return miCreateDefColormap(pScreen); -} - -void -cfbClearVisualTypes(void) -{ - miClearVisualTypes(); -} - -Bool -cfbSetVisualTypes (int depth, int visuals, int bitsPerRGB) -{ - return miSetVisualTypes(depth, visuals, bitsPerRGB, -1); -} - -/* - * Given a list of formats for a screen, create a list - * of visuals and depths for the screen which coorespond to - * the set which can be used with this version of cfb. - */ - -Bool -cfbInitVisuals (VisualPtr *visualp, - DepthPtr *depthp, - int *nvisualp, - int *ndepthp, - int *rootDepthp, - VisualID *defaultVisp, - unsigned long sizes, - int bitsPerRGB) -{ - return miInitVisuals(visualp, depthp, nvisualp, ndepthp, rootDepthp, - defaultVisp, sizes, bitsPerRGB, -1); -} diff --git a/nx-X11/programs/Xserver/cfb/cfbcppl.c b/nx-X11/programs/Xserver/cfb/cfbcppl.c deleted file mode 100644 index 037a516f2..000000000 --- a/nx-X11/programs/Xserver/cfb/cfbcppl.c +++ /dev/null @@ -1,490 +0,0 @@ -/* - * $TOG: cfb8cppl.c /main/16 1998/02/09 14:04:13 kaleb $ - * -Copyright 1990, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - * - * Author: Keith Packard, MIT X Consortium - */ -/* $XFree86: xc/programs/Xserver/cfb/cfbcppl.c,v 1.6 2001/12/14 19:59:22 dawes Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include "gcstruct.h" -#include "window.h" -#include "pixmapstr.h" -#include "scrnintstr.h" -#include "windowstr.h" -#include "cfb.h" -#if PSZ == 8 -#undef PSZ /* for maskbits.h */ -#include "maskbits.h" -#define PSZ 8 -#include "mergerop.h" -#else /* PSZ==8 */ -#include "cfbtab.h" /* provides starttab, endttab, partmasks */ -#endif /* PSZ==8 */ - - -void -cfbCopyImagePlane( - DrawablePtr pSrcDrawable, - DrawablePtr pDstDrawable, - int rop, - RegionPtr prgnDst, - DDXPointPtr pptSrc, - unsigned long planemask) -{ - /* note: there must be some sort of trick behind, - passing a planemask value with all bits set - whilst using the current planemask for the bitPlane value. */ -#if PSZ == 8 - cfbCopyPlane8to1 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, - (unsigned long) ~0L, planemask); -#endif -#if PSZ == 16 - cfbCopyPlane16to1 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, - (unsigned long) ~0L, planemask); -#endif -#if PSZ == 24 - cfbCopyPlane24to1 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, - (unsigned long) ~0L, planemask); -#endif -#if PSZ == 32 - cfbCopyPlane32to1 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, - (unsigned long) ~0L, planemask); -#endif -} - -#if PSZ == 8 - -#if BITMAP_BIT_ORDER == MSBFirst -#define LeftMost (MFB_PPW-1) -#define StepBit(bit, inc) ((bit) -= (inc)) -#else -#define LeftMost 0 -#define StepBit(bit, inc) ((bit) += (inc)) -#endif - -#define GetBits(psrc, nBits, curBit, bitPos, bits) {\ - bits = 0; \ - while (nBits--) \ - { \ - bits |= (PixelType)(((*psrc++ >> bitPos) & 1)) << curBit; \ - StepBit (curBit, 1); \ - } \ -} - -void -cfbCopyPlane8to1( - DrawablePtr pSrcDrawable, - DrawablePtr pDstDrawable, - int rop, - RegionPtr prgnDst, - DDXPointPtr pptSrc, - unsigned long planemask, - unsigned long bitPlane) -{ - int srcx, srcy, dstx, dsty, width, height; - unsigned char *psrcBase; - PixelType *pdstBase; - int widthSrc, widthDst; - unsigned char *psrcLine; - PixelType *pdstLine; - register unsigned char *psrc; - register int i; - register int curBit; - register int bitPos; - register CfbBits bits; - register PixelType *pdst; - PixelType startmask, endmask; - int niStart = 0, niEnd = 0; - int bitStart = 0, bitEnd = 0; - int nl, nlMiddle; - int nbox; - BoxPtr pbox; - MROP_DECLARE() - - if (!(planemask & 1)) - return; - - if (rop != GXcopy) - MROP_INITIALIZE (rop, planemask); - - cfbGetByteWidthAndPointer (pSrcDrawable, widthSrc, psrcBase) - - mfbGetPixelWidthAndPointer (pDstDrawable, widthDst, pdstBase) - - bitPos = ffs (bitPlane) - 1; - - nbox = REGION_NUM_RECTS(prgnDst); - pbox = REGION_RECTS(prgnDst); - while (nbox--) - { - dstx = pbox->x1; - dsty = pbox->y1; - srcx = pptSrc->x; - srcy = pptSrc->y; - width = pbox->x2 - pbox->x1; - height = pbox->y2 - pbox->y1; - pbox++; - pptSrc++; - psrcLine = psrcBase + srcy * widthSrc + srcx; - pdstLine = mfbScanline(pdstBase, dstx, dsty, widthDst); - dstx &= MFB_PIM; - if (dstx + width <= MFB_PPW) - { - maskpartialbits(dstx, width, startmask); - nlMiddle = 0; - endmask = 0; - } - else - { - maskbits (dstx, width, startmask, endmask, nlMiddle); - } - if (startmask) - { - niStart = min(MFB_PPW - dstx, width); - bitStart = LeftMost; - StepBit (bitStart, dstx); - } - if (endmask) - { - niEnd = (dstx + width) & MFB_PIM; - bitEnd = LeftMost; - } - if (rop == GXcopy) - { - while (height--) - { - psrc = psrcLine; - pdst = pdstLine; - psrcLine += widthSrc; - mfbScanlineInc(pdstLine, widthDst); - if (startmask) - { - i = niStart; - curBit = bitStart; - GetBits (psrc, i, curBit, bitPos, bits); - *pdst = (*pdst & ~startmask) | bits; - pdst++; - } - nl = nlMiddle; - while (nl--) - { - i = MFB_PPW; - curBit = LeftMost; - GetBits (psrc, i, curBit, bitPos, bits); - *pdst++ = bits; - } - if (endmask) - { - i = niEnd; - curBit = bitEnd; - GetBits (psrc, i, curBit, bitPos, bits); - *pdst = (*pdst & ~endmask) | bits; - } - } - } - else - { - while (height--) - { - psrc = psrcLine; - pdst = pdstLine; - psrcLine += widthSrc; - mfbScanlineInc(pdstLine, widthDst); - if (startmask) - { - i = niStart; - curBit = bitStart; - GetBits (psrc, i, curBit, bitPos, bits); - *pdst = MROP_MASK(bits, *pdst, startmask); - pdst++; - } - nl = nlMiddle; - while (nl--) - { - i = MFB_PPW; - curBit = LeftMost; - GetBits (psrc, i, curBit, bitPos, bits); - *pdst = MROP_SOLID(bits, *pdst); - pdst++; - } - if (endmask) - { - i = niEnd; - curBit = bitEnd; - GetBits (psrc, i, curBit, bitPos, bits); - *pdst = MROP_MASK (bits, *pdst, endmask); - } - } - } - } -} - -#else /* PSZ == 8 */ - -#define mfbmaskbits(x, w, startmask, endmask, nlw) \ - startmask = mfbGetstarttab((x)&0x1f); \ - endmask = mfbGetendtab(((x)+(w)) & 0x1f); \ - if (startmask) \ - nlw = (((w) - (32 - ((x)&0x1f))) >> 5); \ - else \ - nlw = (w) >> 5; - -#define mfbmaskpartialbits(x, w, mask) \ - mask = mfbGetpartmasks((x)&0x1f,(w)&0x1f); - -#define LeftMost 0 -#define StepBit(bit, inc) ((bit) += (inc)) - - -#if PSZ == 24 -#define GetBits(psrc, nBits, curBit, bitPos, bits) {\ - bits = 0; \ - while (nBits--) \ - { \ - if (bitPos < 8) \ - { \ - bits |= ((*psrc++ >> bitPos) & 1) << curBit; \ - psrc += 2; \ - } \ - else if (bitPos < 16) \ - { \ - psrc++; \ - bits |= ((*psrc++ >> (bitPos - 8)) & 1) << curBit; \ - psrc++; \ - } \ - else \ - { \ - psrc += 2; \ - bits |= ((*psrc++ >> (bitPos - 16)) & 1) << curBit; \ - } \ - StepBit (curBit, 1); \ - } \ -} -#else -#define GetBits(psrc, nBits, curBit, bitPos, bits) {\ - bits = 0; \ - while (nBits--) \ - { \ - bits |= ((*psrc++ >> bitPos) & 1) << curBit; \ - StepBit (curBit, 1); \ - } \ -} -#endif - -void -#if PSZ == 16 -cfbCopyPlane16to1 -#endif -#if PSZ == 24 -cfbCopyPlane24to1 -#endif -#if PSZ == 32 -cfbCopyPlane32to1 -#endif -( - DrawablePtr pSrcDrawable, - DrawablePtr pDstDrawable, - int rop, - RegionPtr prgnDst, - DDXPointPtr pptSrc, - unsigned long planemask, - unsigned long bitPlane) -{ - int srcx, srcy, dstx, dsty, width, height; - CfbBits *psrcBase; - CfbBits *pdstBase; - int widthSrc, widthDst; -#if PSZ == 16 - unsigned short *psrcLine; - register unsigned short *psrc; -#endif -#if PSZ == 24 - unsigned char *psrcLine; - register unsigned char *psrc; -#endif -#if PSZ == 32 - unsigned int *psrcLine; - register unsigned int *psrc; -#endif - unsigned int *pdstLine; - register unsigned int *pdst; - register int i; - register int curBit; - register int bitPos; - register unsigned int bits; - unsigned int startmask = 0, endmask = 0; - int niStart = 0, niEnd = 0; - int bitStart = 0, bitEnd = 0; - int nl, nlMiddle; - int nbox; - BoxPtr pbox; - int result; - - - if (!(planemask & 1)) - return; - - /* must explicitly ask for "int" widths, as code below expects it */ - /* on some machines (Alpha), "long" and "int" are not the same size */ - cfbGetTypedWidthAndPointer (pSrcDrawable, widthSrc, psrcBase, int, CfbBits) - cfbGetTypedWidthAndPointer (pDstDrawable, widthDst, pdstBase, int, CfbBits) - -#if PSZ == 16 - widthSrc <<= 1; -#endif -#if PSZ == 24 - widthSrc <<= 2; -#endif - - bitPos = ffs (bitPlane) - 1; - - nbox = REGION_NUM_RECTS(prgnDst); - pbox = REGION_RECTS(prgnDst); - while (nbox--) - { - dstx = pbox->x1; - dsty = pbox->y1; - srcx = pptSrc->x; - srcy = pptSrc->y; - width = pbox->x2 - pbox->x1; - height = pbox->y2 - pbox->y1; - pbox++; - pptSrc++; -#if PSZ == 16 - psrcLine = (unsigned short *)psrcBase + srcy * widthSrc + srcx; -#endif -#if PSZ == 24 - psrcLine = (unsigned char *)psrcBase + srcy * widthSrc + srcx * 3; -#endif -#if PSZ == 32 - psrcLine = (unsigned int *)psrcBase + srcy * widthSrc + srcx; -#endif - pdstLine = (unsigned int *)pdstBase + dsty * widthDst + (dstx >> 5); - if (dstx + width <= 32) - { - mfbmaskpartialbits(dstx, width, startmask); - nlMiddle = 0; - endmask = 0; - } - else - { - mfbmaskbits (dstx, width, startmask, endmask, nlMiddle); - } - if (startmask) - { - niStart = 32 - (dstx & 0x1f); - bitStart = LeftMost; - StepBit (bitStart, (dstx & 0x1f)); - } - if (endmask) - { - niEnd = (dstx + width) & 0x1f; - bitEnd = LeftMost; - } - if (rop == GXcopy) - { - while (height--) - { - psrc = psrcLine; - pdst = pdstLine; - psrcLine += widthSrc; - pdstLine += widthDst; - if (startmask) - { - i = niStart; - curBit = bitStart; - GetBits (psrc, i, curBit, bitPos, bits); - - *pdst = (*pdst & ~startmask) | bits; - pdst++; - } - nl = nlMiddle; - while (nl--) - { - i = 32; - curBit = LeftMost; - GetBits (psrc, i, curBit, bitPos, bits); - *pdst++ = bits; - } - if (endmask) - { - i = niEnd; - curBit = bitEnd; - GetBits (psrc, i, curBit, bitPos, bits); - - *pdst = (*pdst & ~endmask) | bits; - } - } - } - else - { - while (height--) - { - psrc = psrcLine; - pdst = pdstLine; - psrcLine += widthSrc; - pdstLine += widthDst; - if (startmask) - { - i = niStart; - curBit = bitStart; - GetBits (psrc, i, curBit, bitPos, bits); - DoRop (result, rop, bits, *pdst); - - *pdst = (*pdst & ~startmask) | - (result & startmask); - pdst++; - } - nl = nlMiddle; - while (nl--) - { - i = 32; - curBit = LeftMost; - GetBits (psrc, i, curBit, bitPos, bits); - DoRop (result, rop, bits, *pdst); - *pdst = result; - ++pdst; - } - if (endmask) - { - i = niEnd; - curBit = bitEnd; - GetBits (psrc, i, curBit, bitPos, bits); - DoRop (result, rop, bits, *pdst); - - *pdst = (*pdst & ~endmask) | - (result & endmask); - } - } - } - } -} - -#endif /* PSZ == 8 */ diff --git a/nx-X11/programs/Xserver/cfb/cfbfillarc.c b/nx-X11/programs/Xserver/cfb/cfbfillarc.c deleted file mode 100644 index 6fb6bb728..000000000 --- a/nx-X11/programs/Xserver/cfb/cfbfillarc.c +++ /dev/null @@ -1,374 +0,0 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfbfillarc.c,v 3.6tsi Exp $ */ -/************************************************************ - -Copyright 1989, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -********************************************************/ - -/* $Xorg: cfbfillarc.c,v 1.4 2001/02/09 02:04:37 xorgcvs Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include "regionstr.h" -#include "gcstruct.h" -#include "pixmapstr.h" -#include "scrnintstr.h" -#include "cfb.h" -#include "cfbmskbits.h" -#include "mifillarc.h" -#include "cfbrrop.h" -#include "mi.h" - -/* gcc 1.35 is stupid */ -#if defined(__GNUC__) && __GNUC__ < 2 && defined(mc68020) -#define STUPID volatile -#else -#define STUPID -#endif - -static void -RROP_NAME(cfbFillEllipseSolid)( - DrawablePtr pDraw, - GCPtr pGC, - xArc *arc) -{ - STUPID int x, y, e; - STUPID int yk, xk, ym, xm, dx, dy, xorg, yorg; - miFillArcRec info; -#if PSZ == 24 - unsigned char *addrlt, *addrlb; -#else - CfbBits *addrlt, *addrlb; -#endif - register CfbBits *addrl; - register int n; - int nlwidth; - RROP_DECLARE - register int xpos; - register int slw; - CfbBits startmask, endmask; - int nlmiddle; -#if PSZ == 24 - register int pidx; - int xpos3; -#endif - -#if PSZ == 24 - cfbGetByteWidthAndPointer (pDraw, nlwidth, addrlt) -#else - cfbGetLongWidthAndPointer (pDraw, nlwidth, addrlt) -#endif - - RROP_FETCH_GC(pGC); - miFillArcSetup(arc, &info); - MIFILLARCSETUP(); - xorg += pDraw->x; - yorg += pDraw->y; - addrlb = addrlt; - addrlt += nlwidth * (yorg - y); - addrlb += nlwidth * (yorg + y + dy); - while (y) - { - addrlt += nlwidth; - addrlb -= nlwidth; - MIFILLARCSTEP(slw); - if (!slw) - continue; - xpos = xorg - x; -#if PSZ == 24 - xpos3 = (xpos * 3) & ~0x03; - addrl = (CfbBits *)((char *)addrlt + xpos3); - if (slw == 1){ - RROP_SOLID24(addrl, xpos); - if (miFillArcLower(slw)){ - addrl = (CfbBits *)((char *)addrlb + xpos3); - RROP_SOLID24(addrl, xpos); - } - continue; - } - maskbits(xpos, slw, startmask, endmask, nlmiddle); - xpos &= 3; - pidx = xpos; - if (startmask){ - RROP_SOLID_MASK(addrl, startmask, pidx-1); - addrl++; - if (pidx == 3) - pidx = 0; - } - n = nlmiddle; - while (--n >= 0){ - RROP_SOLID(addrl, pidx); - addrl++; - if (++pidx == 3) - pidx = 0; - } - if (endmask) - RROP_SOLID_MASK(addrl, endmask, pidx); - if (!miFillArcLower(slw)) - continue; - addrl = (CfbBits *)((char *)addrlb + xpos3); - pidx = xpos; - if (startmask){ - RROP_SOLID_MASK(addrl, startmask, pidx-1); - addrl++; - if (pidx == 3) - pidx = 0; - } - n = nlmiddle; - while (--n >= 0){ - RROP_SOLID(addrl, pidx); - addrl++; - if (++pidx == 3) - pidx = 0; - } - if (endmask) - RROP_SOLID_MASK(addrl, endmask, pidx); -#else /* PSZ == 24 */ - addrl = addrlt + (xpos >> PWSH); - if (((xpos & PIM) + slw) <= PPW) - { - maskpartialbits(xpos, slw, startmask); - RROP_SOLID_MASK(addrl,startmask); - if (miFillArcLower(slw)) - { - addrl = addrlb + (xpos >> PWSH); - RROP_SOLID_MASK(addrl, startmask); - } - continue; - } - maskbits(xpos, slw, startmask, endmask, nlmiddle); - if (startmask) - { - RROP_SOLID_MASK(addrl, startmask); - addrl++; - } - n = nlmiddle; - RROP_SPAN(addrl,n) - - if (endmask) - RROP_SOLID_MASK(addrl, endmask); - if (!miFillArcLower(slw)) - continue; - addrl = addrlb + (xpos >> PWSH); - if (startmask) - { - RROP_SOLID_MASK(addrl, startmask); - addrl++; - } - n = nlmiddle; - RROP_SPAN(addrl, n); - if (endmask) - RROP_SOLID_MASK(addrl, endmask); -#endif /* PSZ == 24 */ - } - RROP_UNDECLARE -} - -#if PSZ == 24 -#define FILLSPAN(xl,xr,addr) \ - if (xr >= xl){ \ - n = xr - xl + 1; \ - addrl = (CfbBits *)((char *)addr + ((xl * 3) & ~0x03)); \ - if (n <= 1){ \ - if (n) \ - RROP_SOLID24(addrl, xl); \ - } else { \ - maskbits(xl, n, startmask, endmask, n); \ - pidx = xl & 3; \ - if (startmask){ \ - RROP_SOLID_MASK(addrl, startmask, pidx-1); \ - addrl++; \ - if (pidx == 3) \ - pidx = 0; \ - } \ - while (--n >= 0){ \ - RROP_SOLID(addrl, pidx); \ - addrl++; \ - if (++pidx == 3) \ - pidx = 0; \ - } \ - if (endmask) \ - RROP_SOLID_MASK(addrl, endmask, pidx); \ - } \ - } -#else /* PSZ == 24 */ -#define FILLSPAN(xl,xr,addr) \ - if (xr >= xl) \ - { \ - n = xr - xl + 1; \ - addrl = addr + (xl >> PWSH); \ - if (((xl & PIM) + n) <= PPW) \ - { \ - maskpartialbits(xl, n, startmask); \ - RROP_SOLID_MASK(addrl, startmask); \ - } \ - else \ - { \ - maskbits(xl, n, startmask, endmask, n); \ - if (startmask) \ - { \ - RROP_SOLID_MASK(addrl, startmask); \ - addrl++; \ - } \ - while (n--) \ - { \ - RROP_SOLID(addrl); \ - ++addrl; \ - } \ - if (endmask) \ - RROP_SOLID_MASK(addrl, endmask); \ - } \ - } -#endif /* PSZ == 24 */ - -#define FILLSLICESPANS(flip,addr) \ - if (!flip) \ - { \ - FILLSPAN(xl, xr, addr); \ - } \ - else \ - { \ - xc = xorg - x; \ - FILLSPAN(xc, xr, addr); \ - xc += slw - 1; \ - FILLSPAN(xl, xc, addr); \ - } - -static void -RROP_NAME(cfbFillArcSliceSolid)( - DrawablePtr pDraw, - GCPtr pGC, - xArc *arc) -{ - int yk, xk, ym, xm, dx, dy, xorg, yorg, slw; - register int x, y, e; - miFillArcRec info; - miArcSliceRec slice; - int xl, xr, xc; -#if PSZ == 24 - unsigned char *addrlt, *addrlb; -#else - CfbBits *addrlt, *addrlb; -#endif - register CfbBits *addrl; - register int n; - int nlwidth; - RROP_DECLARE - CfbBits startmask, endmask; -#if PSZ == 24 - register int pidx; -#endif /* PSZ == 24 */ - -#if PSZ == 24 - cfbGetByteWidthAndPointer (pDraw, nlwidth, addrlt) -#else - cfbGetLongWidthAndPointer (pDraw, nlwidth, addrlt) -#endif - - RROP_FETCH_GC(pGC); - miFillArcSetup(arc, &info); - miFillArcSliceSetup(arc, &slice, pGC); - MIFILLARCSETUP(); - xorg += pDraw->x; - yorg += pDraw->y; - addrlb = addrlt; - addrlt += nlwidth * (yorg - y); - addrlb += nlwidth * (yorg + y + dy); - slice.edge1.x += pDraw->x; - slice.edge2.x += pDraw->x; - while (y > 0) - { - addrlt += nlwidth; - addrlb -= nlwidth; - MIFILLARCSTEP(slw); - MIARCSLICESTEP(slice.edge1); - MIARCSLICESTEP(slice.edge2); - if (miFillSliceUpper(slice)) - { - MIARCSLICEUPPER(xl, xr, slice, slw); - FILLSLICESPANS(slice.flip_top, addrlt); - } - if (miFillSliceLower(slice)) - { - MIARCSLICELOWER(xl, xr, slice, slw); - FILLSLICESPANS(slice.flip_bot, addrlb); - } - } - RROP_UNDECLARE -} - -void -RROP_NAME(cfbPolyFillArcSolid) (pDraw, pGC, narcs, parcs) - DrawablePtr pDraw; - GCPtr pGC; - int narcs; - xArc *parcs; -{ - register xArc *arc; - register int i; - int x2, y2; - BoxRec box; - RegionPtr cclip; - - cclip = cfbGetCompositeClip(pGC); - for (arc = parcs, i = narcs; --i >= 0; arc++) - { - if (miFillArcEmpty(arc)) - continue; - if (miCanFillArc(arc)) - { - box.x1 = arc->x + pDraw->x; - box.y1 = arc->y + pDraw->y; - /* - * Because box.x2 and box.y2 get truncated to 16 bits, and the - * RECT_IN_REGION test treats the resulting number as a signed - * integer, the RECT_IN_REGION test alone can go the wrong way. - * This can result in a server crash because the rendering - * routines in this file deal directly with cpu addresses - * of pixels to be stored, and do not clip or otherwise check - * that all such addresses are within their respective pixmaps. - * So we only allow the RECT_IN_REGION test to be used for - * values that can be expressed correctly in a signed short. - */ - x2 = box.x1 + (int)arc->width + 1; - box.x2 = x2; - y2 = box.y1 + (int)arc->height + 1; - box.y2 = y2; - if ( (x2 <= MAXSHORT) && (y2 <= MAXSHORT) && - (RECT_IN_REGION(pDraw->pScreen, cclip, &box) == rgnIN) ) - { - if ((arc->angle2 >= FULLCIRCLE) || - (arc->angle2 <= -FULLCIRCLE)) - RROP_NAME(cfbFillEllipseSolid)(pDraw, pGC, arc); - else - RROP_NAME(cfbFillArcSliceSolid)(pDraw, pGC, arc); - continue; - } - } - miPolyFillArc(pDraw, pGC, 1, arc); - } -} diff --git a/nx-X11/programs/Xserver/cfb/cfbfillrct.c b/nx-X11/programs/Xserver/cfb/cfbfillrct.c deleted file mode 100644 index 657865114..000000000 --- a/nx-X11/programs/Xserver/cfb/cfbfillrct.c +++ /dev/null @@ -1,307 +0,0 @@ -/* - * Fill rectangles. - */ -/* $XFree86: xc/programs/Xserver/cfb/cfbfillrct.c,v 3.7 2001/01/17 22:36:35 dawes Exp $ */ - -/* - -Copyright 1989, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. -*/ - -/* $Xorg: cfbfillrct.c,v 1.4 2001/02/09 02:04:37 xorgcvs Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include "servermd.h" -#include "gcstruct.h" -#include "window.h" -#include "pixmapstr.h" -#include "scrnintstr.h" -#include "windowstr.h" -#include "mi.h" -#include "cfb.h" -#include "cfbmskbits.h" -#include "mergerop.h" - - -void -cfbFillBoxTileOdd (pDrawable, n, rects, tile, xrot, yrot) - DrawablePtr pDrawable; - int n; - BoxPtr rects; - PixmapPtr tile; - int xrot, yrot; -{ -#if PSZ == 24 - if (tile->drawable.width & 3) -#else - if (tile->drawable.width & PIM) -#endif - cfbFillBoxTileOddCopy (pDrawable, n, rects, tile, xrot, yrot, GXcopy, ~0L); - else - cfbFillBoxTile32sCopy (pDrawable, n, rects, tile, xrot, yrot, GXcopy, ~0L); -} - -void -cfbFillRectTileOdd (pDrawable, pGC, nBox, pBox) - DrawablePtr pDrawable; - GCPtr pGC; - int nBox; - BoxPtr pBox; -{ - int xrot, yrot; - void (*fill)(DrawablePtr, int, BoxPtr, PixmapPtr, int, int, int, unsigned long); - - xrot = pDrawable->x + pGC->patOrg.x; - yrot = pDrawable->y + pGC->patOrg.y; -#if PSZ == 24 - if (pGC->tile.pixmap->drawable.width & 3) -#else - if (pGC->tile.pixmap->drawable.width & PIM) -#endif - { - fill = cfbFillBoxTileOddGeneral; - if ((pGC->planemask & PMSK) == PMSK) - { - if (pGC->alu == GXcopy) - fill = cfbFillBoxTileOddCopy; - } - } - else - { - fill = cfbFillBoxTile32sGeneral; - if ((pGC->planemask & PMSK) == PMSK) - { - if (pGC->alu == GXcopy) - fill = cfbFillBoxTile32sCopy; - } - } - (*fill) (pDrawable, nBox, pBox, pGC->tile.pixmap, xrot, yrot, pGC->alu, pGC->planemask); -} - -#define NUM_STACK_RECTS 1024 - -void -cfbPolyFillRect(pDrawable, pGC, nrectFill, prectInit) - DrawablePtr pDrawable; - register GCPtr pGC; - int nrectFill; /* number of rectangles to fill */ - xRectangle *prectInit; /* Pointer to first rectangle to fill */ -{ - xRectangle *prect; - RegionPtr prgnClip; - register BoxPtr pbox; - register BoxPtr pboxClipped; - BoxPtr pboxClippedBase; - BoxPtr pextent; - BoxRec stackRects[NUM_STACK_RECTS]; - cfbPrivGC *priv; - int numRects; - void (*BoxFill)(DrawablePtr, GCPtr, int, BoxPtr); - int n; - int xorg, yorg; - -#if PSZ != 8 - if ((pGC->fillStyle == FillStippled) || - (pGC->fillStyle == FillOpaqueStippled)) { - miPolyFillRect(pDrawable, pGC, nrectFill, prectInit); - return; - } -#endif - - priv = cfbGetGCPrivate(pGC); - prgnClip = pGC->pCompositeClip; - - BoxFill = 0; - switch (pGC->fillStyle) - { - case FillSolid: - switch (priv->rop) { - case GXcopy: - BoxFill = cfbFillRectSolidCopy; - break; - case GXxor: - BoxFill = cfbFillRectSolidXor; - break; - default: - BoxFill = cfbFillRectSolidGeneral; - break; - } - break; - case FillTiled: - if (!pGC->pRotatedPixmap) - BoxFill = cfbFillRectTileOdd; - else - { - if (pGC->alu == GXcopy && (pGC->planemask & PMSK) == PMSK) - BoxFill = cfbFillRectTile32Copy; - else - BoxFill = cfbFillRectTile32General; - } - break; -#if PSZ == 8 - case FillStippled: - if (!pGC->pRotatedPixmap) - BoxFill = cfb8FillRectStippledUnnatural; - else - BoxFill = cfb8FillRectTransparentStippled32; - break; - case FillOpaqueStippled: - if (!pGC->pRotatedPixmap) - BoxFill = cfb8FillRectStippledUnnatural; - else - BoxFill = cfb8FillRectOpaqueStippled32; - break; -#endif - } - prect = prectInit; - xorg = pDrawable->x; - yorg = pDrawable->y; - if (xorg || yorg) - { - prect = prectInit; - n = nrectFill; - while(n--) - { - prect->x += xorg; - prect->y += yorg; - prect++; - } - } - - prect = prectInit; - - numRects = REGION_NUM_RECTS(prgnClip) * nrectFill; - if (numRects > NUM_STACK_RECTS) - { - pboxClippedBase = (BoxPtr)ALLOCATE_LOCAL(numRects * sizeof(BoxRec)); - if (!pboxClippedBase) - return; - } - else - pboxClippedBase = stackRects; - - pboxClipped = pboxClippedBase; - - if (REGION_NUM_RECTS(prgnClip) == 1) - { - int x1, y1, x2, y2, bx2, by2; - - pextent = REGION_RECTS(prgnClip); - x1 = pextent->x1; - y1 = pextent->y1; - x2 = pextent->x2; - y2 = pextent->y2; - while (nrectFill--) - { - if ((pboxClipped->x1 = prect->x) < x1) - pboxClipped->x1 = x1; - - if ((pboxClipped->y1 = prect->y) < y1) - pboxClipped->y1 = y1; - - bx2 = (int) prect->x + (int) prect->width; - if (bx2 > x2) - bx2 = x2; - pboxClipped->x2 = bx2; - - by2 = (int) prect->y + (int) prect->height; - if (by2 > y2) - by2 = y2; - pboxClipped->y2 = by2; - - prect++; - if ((pboxClipped->x1 < pboxClipped->x2) && - (pboxClipped->y1 < pboxClipped->y2)) - { - pboxClipped++; - } - } - } - else - { - int x1, y1, x2, y2, bx2, by2; - - pextent = REGION_EXTENTS(pGC->pScreen, prgnClip); - x1 = pextent->x1; - y1 = pextent->y1; - x2 = pextent->x2; - y2 = pextent->y2; - while (nrectFill--) - { - BoxRec box; - - if ((box.x1 = prect->x) < x1) - box.x1 = x1; - - if ((box.y1 = prect->y) < y1) - box.y1 = y1; - - bx2 = (int) prect->x + (int) prect->width; - if (bx2 > x2) - bx2 = x2; - box.x2 = bx2; - - by2 = (int) prect->y + (int) prect->height; - if (by2 > y2) - by2 = y2; - box.y2 = by2; - - prect++; - - if ((box.x1 >= box.x2) || (box.y1 >= box.y2)) - continue; - - n = REGION_NUM_RECTS (prgnClip); - pbox = REGION_RECTS(prgnClip); - - /* clip the rectangle to each box in the clip region - this is logically equivalent to calling Intersect() - */ - while(n--) - { - pboxClipped->x1 = max(box.x1, pbox->x1); - pboxClipped->y1 = max(box.y1, pbox->y1); - pboxClipped->x2 = min(box.x2, pbox->x2); - pboxClipped->y2 = min(box.y2, pbox->y2); - pbox++; - - /* see if clipping left anything */ - if(pboxClipped->x1 < pboxClipped->x2 && - pboxClipped->y1 < pboxClipped->y2) - { - pboxClipped++; - } - } - } - } - if (pboxClipped != pboxClippedBase) - (*BoxFill) (pDrawable, pGC, - pboxClipped-pboxClippedBase, pboxClippedBase); - if (pboxClippedBase != stackRects) - DEALLOCATE_LOCAL(pboxClippedBase); -} diff --git a/nx-X11/programs/Xserver/cfb/cfbfillsp.c b/nx-X11/programs/Xserver/cfb/cfbfillsp.c deleted file mode 100644 index efb462b6c..000000000 --- a/nx-X11/programs/Xserver/cfb/cfbfillsp.c +++ /dev/null @@ -1,1006 +0,0 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfbfillsp.c,v 3.7tsi Exp $ */ -/************************************************************ -Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this -software and its documentation for any purpose and without -fee is hereby granted, provided that the above copyright no- -tice appear in all copies and that both that copyright no- -tice and this permission notice appear in supporting docu- -mentation, and that the names of Sun or The Open Group -not be used in advertising or publicity pertaining to -distribution of the software without specific prior -written permission. Sun and The Open Group make no -representations about the suitability of this software for -any purpose. It is provided "as is" without any express or -implied warranty. - -SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT- -NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE LI- -ABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR -PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH -THE USE OR PERFORMANCE OF THIS SOFTWARE. - -********************************************************/ - -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -/* $Xorg: cfbfillsp.c,v 1.4 2001/02/09 02:04:37 xorgcvs Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include "servermd.h" -#include "gcstruct.h" -#include "window.h" -#include "pixmapstr.h" -#include "scrnintstr.h" -#include "windowstr.h" - -#include "cfb.h" -#include "cfbmskbits.h" - -#include "mergerop.h" - -#if PSZ == 8 -#include "cfb8bit.h" -#endif - -#define MFB_CONSTS_ONLY -#include "maskbits.h" - -#include "mi.h" -#include "mispans.h" - -/* scanline filling for color frame buffer - written by drewry, oct 1986 modified by smarks - changes for compatibility with Little-endian systems Jul 1987; MIT:yba. - - these routines all clip. they assume that anything that has called -them has already translated the points (i.e. pGC->miTranslate is -non-zero, which is howit gets set in cfbCreateGC().) - - the number of new scnalines created by clipping == -MaxRectsPerBand * nSpans. - - FillSolid is overloaded to be used for OpaqueStipple as well, -if fgPixel == bgPixel. -Note that for solids, PrivGC.rop == PrivGC.ropOpStip - - - FillTiled is overloaded to be used for OpaqueStipple, if -fgPixel != bgPixel. based on the fill style, it uses -{RotatedTile, gc.alu} or {RotatedStipple, PrivGC.ropOpStip} -*/ - -#ifdef notdef -#include -static -dumpspans(n, ppt, pwidth) - int n; - DDXPointPtr ppt; - int *pwidth; -{ - fprintf(stderr,"%d spans\n", n); - while (n--) { - fprintf(stderr, "[%d,%d] %d\n", ppt->x, ppt->y, *pwidth); - ppt++; - pwidth++; - } - fprintf(stderr, "\n"); -} -#endif - -/* Fill spans with tiles that aren't 32 bits wide */ -void -cfbUnnaturalTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) -DrawablePtr pDrawable; -GC *pGC; -int nInit; /* number of spans to fill */ -DDXPointPtr pptInit; /* pointer to list of start points */ -int *pwidthInit; /* pointer to list of n widths */ -int fSorted; -{ - int n; /* number of spans to fill */ - register DDXPointPtr ppt; /* pointer to list of start points */ - register int *pwidth; /* pointer to list of n widths */ - void (*fill)(DrawablePtr, int, DDXPointPtr, int *, PixmapPtr, int, int, int, unsigned long); - int xrot, yrot; - - if (!(pGC->planemask)) - return; - -#if PSZ == 24 - if (pGC->tile.pixmap->drawable.width & 3) -#else - if (pGC->tile.pixmap->drawable.width & PIM) -#endif - { - fill = cfbFillSpanTileOddGeneral; - if ((pGC->planemask & PMSK) == PMSK) - { - if (pGC->alu == GXcopy) - fill = cfbFillSpanTileOddCopy; - } - } - else - { - fill = cfbFillSpanTile32sGeneral; - if ((pGC->planemask & PMSK) == PMSK) - { - if (pGC->alu == GXcopy) - fill = cfbFillSpanTile32sCopy; - } - } - n = nInit * miFindMaxBand( cfbGetCompositeClip(pGC) ); - if ( n == 0 ) - return; - pwidth = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - ppt = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); - if(!ppt || !pwidth) - { - if (ppt) DEALLOCATE_LOCAL(ppt); - if (pwidth) DEALLOCATE_LOCAL(pwidth); - return; - } - n = miClipSpans( cfbGetCompositeClip(pGC), - pptInit, pwidthInit, nInit, - ppt, pwidth, fSorted); - - xrot = pDrawable->x + pGC->patOrg.x; - yrot = pDrawable->y + pGC->patOrg.y; - - (*fill) (pDrawable, n, ppt, pwidth, pGC->tile.pixmap, xrot, yrot, pGC->alu, pGC->planemask); - - DEALLOCATE_LOCAL(ppt); - DEALLOCATE_LOCAL(pwidth); -} - -#if PSZ == 8 - -void -cfbUnnaturalStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) -DrawablePtr pDrawable; -GC *pGC; -int nInit; /* number of spans to fill */ -DDXPointPtr pptInit; /* pointer to list of start points */ -int *pwidthInit; /* pointer to list of n widths */ -int fSorted; -{ - /* next three parameters are post-clip */ - int n; /* number of spans to fill */ - DDXPointPtr ppt; /* pointer to list of start points */ - int *pwidth; /* pointer to list of n widths */ - int *pwidthFree;/* copies of the pointers to free */ - DDXPointPtr pptFree; - CfbBits *pdstBase; /* pointer to start of bitmap */ - int nlwDst; /* width in longwords of bitmap */ - register CfbBits *pdst; /* pointer to current word in bitmap */ - PixmapPtr pStipple; /* pointer to stipple we want to fill with */ - int nlw; - int x, y, w, xrem, xSrc, ySrc; - int stwidth, stippleWidth; - int stippleHeight; - register CfbBits bits, inputBits; - register int partBitsLeft; - int nextPartBits; - int bitsLeft, bitsWhole; - CfbBits *srcTemp, *srcStart; - CfbBits *psrcBase; - CfbBits startmask, endmask; - - if (pGC->fillStyle == FillStippled) - cfb8CheckStipple (pGC->alu, pGC->fgPixel, pGC->planemask); - else - cfb8CheckOpaqueStipple (pGC->alu, pGC->fgPixel, pGC->bgPixel, pGC->planemask); - - if (cfb8StippleRRop == GXnoop) - return; - - n = nInit * miFindMaxBand( cfbGetCompositeClip(pGC) ); - if ( n == 0 ) - return; - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); - if(!pptFree || !pwidthFree) - { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); - return; - } - - pwidth = pwidthFree; - ppt = pptFree; - n = miClipSpans( cfbGetCompositeClip(pGC), - pptInit, pwidthInit, nInit, - ppt, pwidth, fSorted); - - /* - * OK, so what's going on here? We have two Drawables: - * - * The Stipple: - * Depth = 1 - * Width = stippleWidth - * Words per scanline = stwidth - * Pointer to pixels = pStipple->devPrivate.ptr - */ - - pStipple = pGC->stipple; - - stwidth = pStipple->devKind >> PWSH; - stippleWidth = pStipple->drawable.width; - stippleHeight = pStipple->drawable.height; - psrcBase = (CfbBits *) pStipple->devPrivate.ptr; - - /* - * The Target: - * Depth = PSZ - * Width = determined from *pwidth - * Words per scanline = nlwDst - * Pointer to pixels = addrlBase - */ - - cfbGetLongWidthAndPointer (pDrawable, nlwDst, pdstBase) - - /* this replaces rotating the stipple. Instead we just adjust the offset - * at which we start grabbing bits from the stipple. - * Ensure that ppt->x - xSrc >= 0 and ppt->y - ySrc >= 0, - * so that iline and xrem always stay within the stipple bounds. - */ - - modulus (pGC->patOrg.x, stippleWidth, xSrc); - xSrc += pDrawable->x - stippleWidth; - modulus (pGC->patOrg.y, stippleHeight, ySrc); - ySrc += pDrawable->y - stippleHeight; - - bitsWhole = stippleWidth; - - while (n--) - { - x = ppt->x; - y = ppt->y; - ppt++; - w = *pwidth++; - pdst = pdstBase + y * nlwDst + (x >> PWSH); - y = (y - ySrc) % stippleHeight; - srcStart = psrcBase + y * stwidth; - xrem = ((x & ~(PGSZB-1)) - xSrc) % stippleWidth; - srcTemp = srcStart + (xrem >> MFB_PWSH); - bitsLeft = stippleWidth - (xrem & ~MFB_PIM); - xrem &= MFB_PIM; - NextUnnaturalStippleWord - if (partBitsLeft < xrem) - FatalError ("cfbUnnaturalStippleFS bad partBitsLeft %d xrem %d", - partBitsLeft, xrem); - NextSomeBits (inputBits, xrem); - partBitsLeft -= xrem; - if (((x & PIM) + w) <= PPW) - { - maskpartialbits (x, w, startmask) - NextUnnaturalStippleBits - *pdst = MaskRRopPixels(*pdst,bits,startmask); - } - else - { - maskbits (x, w, startmask, endmask, nlw); - nextPartBits = (x & (PGSZB-1)) + w; - if (nextPartBits < partBitsLeft) - { - if (startmask) - { - MaskRRopBitGroup(pdst,GetBitGroup(inputBits),startmask) - pdst++; - NextBitGroup (inputBits); - } - while (nlw--) - { - RRopBitGroup (pdst, GetBitGroup (inputBits)); - pdst++; - NextBitGroup (inputBits); - } - if (endmask) - { - MaskRRopBitGroup(pdst,GetBitGroup(inputBits),endmask) - } - } - else if (bitsLeft != bitsWhole && nextPartBits < partBitsLeft + bitsLeft) - { - NextUnnaturalStippleBitsFast - if (startmask) - { - *pdst = MaskRRopPixels(*pdst,bits,startmask); - pdst++; - NextUnnaturalStippleBitsFast - } - while (nlw--) - { - *pdst = RRopPixels(*pdst,bits); - pdst++; - NextUnnaturalStippleBitsFast - } - if (endmask) - *pdst = MaskRRopPixels (*pdst,bits,endmask); - } - else - { - NextUnnaturalStippleBits - if (startmask) - { - *pdst = MaskRRopPixels(*pdst,bits,startmask); - pdst++; - NextUnnaturalStippleBits - } - while (nlw--) - { - *pdst = RRopPixels(*pdst,bits); - pdst++; - NextUnnaturalStippleBits - } - if (endmask) - *pdst = MaskRRopPixels(*pdst,bits,endmask); - } - } - } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); -} - -#else /* PSZ != 8 */ - -/* Fill spans with stipples that aren't 32 bits wide */ -void -cfbUnnaturalStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) -DrawablePtr pDrawable; -GC *pGC; -int nInit; /* number of spans to fill */ -DDXPointPtr pptInit; /* pointer to list of start points */ -int *pwidthInit; /* pointer to list of n widths */ -int fSorted; -{ - /* next three parameters are post-clip */ - int n; /* number of spans to fill */ - register DDXPointPtr ppt; /* pointer to list of start points */ - register int *pwidth; /* pointer to list of n widths */ - int iline; /* first line of tile to use */ - CfbBits *addrlBase; /* pointer to start of bitmap */ - int nlwidth; /* width in longwords of bitmap */ - register CfbBits *pdst; /* pointer to current word in bitmap */ - PixmapPtr pStipple; /* pointer to stipple we want to fill with */ - register int w; - int width, x, xrem, xSrc, ySrc; - CfbBits tmpSrc, tmpDst1, tmpDst2; - int stwidth, stippleWidth; - CfbBits *psrcS; - int rop, stiprop = 0; - int stippleHeight; - int *pwidthFree; /* copies of the pointers to free */ - DDXPointPtr pptFree; - CfbBits fgfill, bgfill; - - if (!(pGC->planemask)) - return; - - n = nInit * miFindMaxBand( cfbGetCompositeClip(pGC) ); - if ( n == 0 ) - return; - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); - if(!pptFree || !pwidthFree) - { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); - return; - } - pwidth = pwidthFree; - ppt = pptFree; - n = miClipSpans( cfbGetCompositeClip(pGC), - pptInit, pwidthInit, nInit, - ppt, pwidth, fSorted); - rop = pGC->alu; - if (pGC->fillStyle == FillStippled) { - switch (rop) { - case GXand: - case GXcopy: - case GXnoop: - case GXor: - stiprop = rop; - break; - default: - stiprop = rop; - rop = GXcopy; - } - } - fgfill = PFILL(pGC->fgPixel); - bgfill = PFILL(pGC->bgPixel); - - /* - * OK, so what's going on here? We have two Drawables: - * - * The Stipple: - * Depth = 1 - * Width = stippleWidth - * Words per scanline = stwidth - * Pointer to pixels = pStipple->devPrivate.ptr - */ - pStipple = pGC->stipple; - - stwidth = pStipple->devKind / PGSZB; - stippleWidth = pStipple->drawable.width; - stippleHeight = pStipple->drawable.height; - - /* - * The Target: - * Depth = PSZ - * Width = determined from *pwidth - * Words per scanline = nlwidth - * Pointer to pixels = addrlBase - */ - - cfbGetLongWidthAndPointer (pDrawable, nlwidth, addrlBase) - - /* this replaces rotating the stipple. Instead we just adjust the offset - * at which we start grabbing bits from the stipple. - * Ensure that ppt->x - xSrc >= 0 and ppt->y - ySrc >= 0, - * so that iline and xrem always stay within the stipple bounds. - */ - modulus (pGC->patOrg.x, stippleWidth, xSrc); - xSrc += pDrawable->x - stippleWidth; - modulus (pGC->patOrg.y, stippleHeight, ySrc); - ySrc += pDrawable->y - stippleHeight; - - while (n--) - { - iline = (ppt->y - ySrc) % stippleHeight; - x = ppt->x; - pdst = addrlBase + (ppt->y * nlwidth); - psrcS = (CfbBits *) pStipple->devPrivate.ptr + (iline * stwidth); - - if (*pwidth) - { - width = *pwidth; - while(width > 0) - { - int xtemp; -#if PSZ != 32 || PPW != 1 - int tmpx; -#endif - register CfbBits *ptemp; - register CfbBits *pdsttmp; - /* - * Do a stripe through the stipple & destination w pixels - * wide. w is not more than: - * - the width of the destination - * - the width of the stipple - * - the distance between x and the next word - * boundary in the destination - * - the distance between x and the next word - * boundary in the stipple - */ - - /* width of dest/stipple */ - xrem = (x - xSrc) % stippleWidth; -#if PSZ == 24 - w = 1; -#else - w = min((stippleWidth - xrem), width); - /* dist to word bound in dest */ - w = min(w, PPW - (x & PIM)); - /* dist to word bound in stip */ - w = min(w, MFB_PPW - (x & MFB_PIM)); -#endif - - xtemp = (xrem & MFB_PIM); - ptemp = (CfbBits *)(psrcS + (xrem >> MFB_PWSH)); -#if PSZ == 24 - tmpx = x & 3; - pdsttmp = pdst + ((x * 3)>>2); -#else -#if PSZ != 32 || PPW != 1 - tmpx = x & PIM; -#endif - pdsttmp = pdst + (x>>PWSH); -#endif - switch ( pGC->fillStyle ) { - case FillOpaqueStippled: -#if PSZ == 24 - getstipplepixels24(ptemp, xtemp, 0, &bgfill, &tmpDst1, xrem); - getstipplepixels24(ptemp, xtemp, 1, &fgfill, &tmpDst2, xrem); -#else - getstipplepixels(ptemp, xtemp, w, 0, &bgfill, &tmpDst1); - getstipplepixels(ptemp, xtemp, w, 1, &fgfill, &tmpDst2); -#endif - break; - case FillStippled: - /* Fill tmpSrc with the source pixels */ -#if PSZ == 24 - getbits24(pdsttmp, tmpSrc, x); - getstipplepixels24(ptemp, xtemp, 0, &tmpSrc, &tmpDst1, xrem); -#else - getbits(pdsttmp, tmpx, w, tmpSrc); - getstipplepixels(ptemp, xtemp, w, 0, &tmpSrc, &tmpDst1); -#endif - if (rop != stiprop) { -#if PSZ == 24 - putbitsrop24(fgfill, 0, &tmpSrc, pGC->planemask, stiprop); -#else - putbitsrop(fgfill, 0, w, &tmpSrc, pGC->planemask, stiprop); -#endif - } else { - tmpSrc = fgfill; - } -#if PSZ == 24 - getstipplepixels24(ptemp, xtemp, 1, &tmpSrc, &tmpDst2, xrem); -#else - getstipplepixels(ptemp, xtemp, w, 1, &tmpSrc, &tmpDst2); -#endif - break; - } - tmpDst2 |= tmpDst1; -#if PSZ == 24 - putbitsrop24(tmpDst2, tmpx, pdsttmp, pGC->planemask, rop); -#else - putbitsrop(tmpDst2, tmpx, w, pdsttmp, pGC->planemask, rop); -#endif - x += w; - width -= w; - } - } - ppt++; - pwidth++; - } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); -} - -#endif /* PSZ == 8 */ - -#if PSZ == 8 - -void -cfb8Stipple32FS (pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) - DrawablePtr pDrawable; - GCPtr pGC; - int nInit; /* number of spans to fill */ - DDXPointPtr pptInit; /* pointer to list of start points */ - int *pwidthInit; /* pointer to list of n widths */ - int fSorted; -{ - /* next three parameters are post-clip */ - int n; /* number of spans to fill */ - DDXPointPtr ppt; /* pointer to list of start points */ - int *pwidth; /* pointer to list of n widths */ - CfbBits *src; /* pointer to bits in stipple, if needed */ - int stippleHeight; /* height of the stipple */ - PixmapPtr stipple; - - int nlwDst; /* width in longwords of the dest pixmap */ - int x,y,w; /* current span */ - CfbBits startmask; - CfbBits endmask; - register CfbBits *dst; /* pointer to bits we're writing */ - register int nlw; - CfbBits *dstTmp; - int nlwTmp; - - CfbBits *pbits; /* pointer to start of pixmap */ - register CfbBits xor; - register CfbBits mask; - register CfbBits bits; /* bits from stipple */ - int wEnd; - - int *pwidthFree; /* copies of the pointers to free */ - DDXPointPtr pptFree; - cfbPrivGCPtr devPriv; - - devPriv = cfbGetGCPrivate(pGC); - cfb8CheckStipple (pGC->alu, pGC->fgPixel, pGC->planemask); - n = nInit * miFindMaxBand(pGC->pCompositeClip); - if ( n == 0 ) - return; - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); - if(!pptFree || !pwidthFree) - { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); - return; - } - pwidth = pwidthFree; - ppt = pptFree; - n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit, - ppt, pwidth, fSorted); - - stipple = pGC->pRotatedPixmap; - src = (CfbBits *)stipple->devPrivate.ptr; - stippleHeight = stipple->drawable.height; - - cfbGetLongWidthAndPointer (pDrawable, nlwDst, pbits) - - while (n--) - { - w = *pwidth++; - x = ppt->x; - y = ppt->y; - ppt++; - dst = pbits + (y * nlwDst) + (x >> PWSH); - if (((x & PIM) + w) <= PPW) - { - maskpartialbits(x, w, startmask); - endmask = 0; - nlw = 0; - } - else - { - maskbits (x, w, startmask, endmask, nlw); - } - bits = src[y % stippleHeight]; - RotBitsLeft (bits, (x & ((PGSZ-1) & ~PIM))); -#if PPW == 4 - if (cfb8StippleRRop == GXcopy) - { - xor = devPriv->xor; - if (w < (PGSZ*2)) - { - if (startmask) - { - mask = cfb8PixelMasks[GetBitGroup(bits)]; - *dst = (*dst & ~(mask & startmask)) | - (xor & (mask & startmask)); - dst++; - RotBitsLeft (bits, PGSZB); - } - while (nlw--) - { - WriteBitGroup (dst,xor,GetBitGroup(bits)) - dst++; - RotBitsLeft (bits, PGSZB); - } - if (endmask) - { - mask = cfb8PixelMasks[GetBitGroup(bits)]; - *dst = (*dst & ~(mask & endmask)) | - (xor & (mask & endmask)); - } - } - else - { /* XXX constants probably not OK here */ - wEnd = 7 - (nlw & 7); - nlw = (nlw >> 3) + 1; - dstTmp = dst; - nlwTmp = nlw; - if (startmask) - { - mask = cfb8PixelMasks[GetBitGroup(bits)]; - *dstTmp = (*dstTmp & ~(mask & startmask)) | - (xor & (mask & startmask)); - dstTmp++; - RotBitsLeft (bits, PGSZB); - } - w = 7 - wEnd; - while (w--) - { - dst = dstTmp; - dstTmp++; - nlw = nlwTmp; -#if defined(__GNUC__) && defined(mc68020) - mask = cfb8PixelMasks[GetBitGroup(bits)]; - xor = xor & mask; - mask = ~mask; - while (nlw--) - { - *dst = (*dst & mask) | xor; - dst += 8; - } - xor = devPriv->xor; -#else -#define SwitchBitsLoop(body) \ - while (nlw--) \ - { \ - body \ - dst += 8; \ - } - SwitchBitGroup(dst, xor, GetBitGroup(bits)); -#undef SwitchBitsLoop -#endif - NextBitGroup (bits); - } - nlwTmp--; - w = wEnd + 1; - if (endmask) - { - mask = cfb8PixelMasks[GetBitGroup(bits)]; - dst = dstTmp + (nlwTmp << 3); - *dst = (*dst & ~(mask & endmask)) | - (xor & (mask & endmask)); - } - while (w--) - { - nlw = nlwTmp; - dst = dstTmp; - dstTmp++; -#if defined(__GNUC__) && defined(mc68020) - mask = cfb8PixelMasks[GetBitGroup(bits)]; - xor = xor & mask; - mask = ~mask; - while (nlw--) - { - *dst = (*dst & mask) | xor; - dst += 8; - } - xor = devPriv->xor; -#else -#define SwitchBitsLoop(body) \ - while (nlw--) \ - { \ - body \ - dst += 8; \ - } - SwitchBitGroup(dst, xor, GetBitGroup(bits)); -#undef SwitchBitsLoop -#endif - NextBitGroup (bits); - } - } - } - else -#endif /* PPW == 4 */ - { - if (startmask) - { - xor = GetBitGroup(bits); - *dst = MaskRRopPixels(*dst, xor, startmask); - dst++; - RotBitsLeft (bits, PGSZB); - } - while (nlw--) - { - RRopBitGroup(dst, GetBitGroup(bits)); - dst++; - RotBitsLeft (bits, PGSZB); - } - if (endmask) - { - xor = GetBitGroup(bits); - *dst = MaskRRopPixels(*dst, xor, endmask); - } - } - } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); -} - -void -cfb8OpaqueStipple32FS (pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) - DrawablePtr pDrawable; - GCPtr pGC; - int nInit; /* number of spans to fill */ - DDXPointPtr pptInit; /* pointer to list of start points */ - int *pwidthInit; /* pointer to list of n widths */ - int fSorted; -{ - /* next three parameters are post-clip */ - int n; /* number of spans to fill */ - DDXPointPtr ppt; /* pointer to list of start points */ - int *pwidth; /* pointer to list of n widths */ - CfbBits *src; /* pointer to bits in stipple, if needed */ - int stippleHeight; /* height of the stipple */ - PixmapPtr stipple; - - int nlwDst; /* width in longwords of the dest pixmap */ - int x,y,w; /* current span */ - CfbBits startmask; - CfbBits endmask; - register CfbBits *dst; /* pointer to bits we're writing */ - register int nlw; - CfbBits *dstTmp; - int nlwTmp; - - CfbBits *pbits; /* pointer to start of pixmap */ - register CfbBits xor; - register CfbBits bits; /* bits from stipple */ - int wEnd; - - int *pwidthFree; /* copies of the pointers to free */ - DDXPointPtr pptFree; - cfbPrivGCPtr devPriv; - - devPriv = cfbGetGCPrivate(pGC); - - cfb8CheckOpaqueStipple(pGC->alu, pGC->fgPixel, pGC->bgPixel, pGC->planemask); - - n = nInit * miFindMaxBand(pGC->pCompositeClip); - if ( n == 0 ) - return; - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); - if(!pptFree || !pwidthFree) - { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); - return; - } - pwidth = pwidthFree; - ppt = pptFree; - n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit, - ppt, pwidth, fSorted); - - stipple = pGC->pRotatedPixmap; - src = (CfbBits *)stipple->devPrivate.ptr; - stippleHeight = stipple->drawable.height; - - cfbGetLongWidthAndPointer (pDrawable, nlwDst, pbits) - - while (n--) - { - w = *pwidth++; - x = ppt->x; - y = ppt->y; - ppt++; - dst = pbits + (y * nlwDst) + (x >> PWSH); - if (((x & PIM) + w) <= PPW) - { - maskpartialbits(x, w, startmask); - endmask = 0; - nlw = 0; - } - else - { - maskbits (x, w, startmask, endmask, nlw); - } - bits = src[y % stippleHeight]; - RotBitsLeft (bits, (x & ((PGSZ-1) & ~PIM))); -#if PPW == 4 - if (cfb8StippleRRop == GXcopy) - { - xor = devPriv->xor; - if (w < PGSZ*2) - { - if (startmask) - { - *dst = (*dst & ~startmask) | - (GetPixelGroup (bits) & startmask); - dst++; - RotBitsLeft (bits, PGSZB); - } - while (nlw--) - { - *dst++ = GetPixelGroup(bits); - RotBitsLeft (bits, PGSZB); - } - if (endmask) - { - *dst = (*dst & ~endmask) | - (GetPixelGroup (bits) & endmask); - } - } - else - { /* XXX consts probably not OK here */ - wEnd = 7 - (nlw & 7); - nlw = (nlw >> 3) + 1; - dstTmp = dst; - nlwTmp = nlw; - if (startmask) - { - *dstTmp = (*dstTmp & ~startmask) | - (GetPixelGroup (bits) & startmask); - dstTmp++; - RotBitsLeft (bits, PGSZB); - } - w = 7 - wEnd; - while (w--) - { - nlw = nlwTmp; - dst = dstTmp; - dstTmp++; - xor = GetPixelGroup (bits); - while (nlw--) - { - *dst = xor; - dst += 8; - } - NextBitGroup (bits); - } - nlwTmp--; - w = wEnd + 1; - if (endmask) - { - dst = dstTmp + (nlwTmp << 3); - *dst = (*dst & ~endmask) | - (GetPixelGroup (bits) & endmask); - } - while (w--) - { - nlw = nlwTmp; - dst = dstTmp; - dstTmp++; - xor = GetPixelGroup (bits); - while (nlw--) - { - *dst = xor; - dst += 8; - } - NextBitGroup (bits); - } - } - } - else -#endif /* PPW == 4 */ - { - if (startmask) - { - xor = GetBitGroup(bits); - *dst = MaskRRopPixels(*dst, xor, startmask); - dst++; - RotBitsLeft (bits, PGSZB); - } - while (nlw--) - { - RRopBitGroup(dst, GetBitGroup(bits)); - dst++; - RotBitsLeft (bits, PGSZB); - } - if (endmask) - { - xor = GetBitGroup(bits); - *dst = MaskRRopPixels(*dst, xor, endmask); - } - } - } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); -} - -#endif /* PSZ == 8 */ diff --git a/nx-X11/programs/Xserver/cfb/cfbgc.c b/nx-X11/programs/Xserver/cfb/cfbgc.c deleted file mode 100644 index 9cf53d35b..000000000 --- a/nx-X11/programs/Xserver/cfb/cfbgc.c +++ /dev/null @@ -1,811 +0,0 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfbgc.c,v 1.5 2001/01/17 22:36:35 dawes Exp $ */ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -/* $Xorg: cfbgc.c,v 1.4 2001/02/09 02:04:37 xorgcvs Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include -#include "cfb.h" -#include -#include "dixfontstr.h" -#include "gcstruct.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "scrnintstr.h" -#include "region.h" - -#include "mistruct.h" -#include "mibstore.h" -#include "migc.h" - -#include "cfbmskbits.h" -#include "cfb8bit.h" - -#if PSZ == 8 -# define useTEGlyphBlt cfbTEGlyphBlt8 -#else -# ifdef WriteBitGroup -# define useTEGlyphBlt cfbImageGlyphBlt8 -# else -# define useTEGlyphBlt cfbTEGlyphBlt -# endif -#endif - -#ifdef WriteBitGroup -# define useImageGlyphBlt cfbImageGlyphBlt8 -# define usePolyGlyphBlt cfbPolyGlyphBlt8 -#else -# define useImageGlyphBlt miImageGlyphBlt -# define usePolyGlyphBlt miPolyGlyphBlt -#endif - -static void cfbUnPushPixels (GCPtr, PixmapPtr, DrawablePtr, int, int, int, int); - -#ifdef FOUR_BIT_CODE -# define usePushPixels cfbPushPixels8 -#else -# define usePushPixels cfbUnPushPixels -#endif - -#ifdef PIXEL_ADDR -# define ZeroPolyArc cfbZeroPolyArcSS8Copy -#else -# define ZeroPolyArc miZeroPolyArc -#endif - -GCFuncs cfbGCFuncs = { - cfbValidateGC, - miChangeGC, - miCopyGC, - miDestroyGC, - miChangeClip, - miDestroyClip, - miCopyClip, -}; - -GCOps cfbTEOps1Rect = { - cfbSolidSpansCopy, - cfbSetSpans, - cfbPutImage, - cfbCopyArea, - cfbCopyPlane, - cfbPolyPoint, -#ifdef PIXEL_ADDR - cfb8LineSS1Rect, - cfb8SegmentSS1Rect, -#else - cfbLineSS, - cfbSegmentSS, -#endif - miPolyRectangle, - ZeroPolyArc, - cfbFillPoly1RectCopy, - cfbPolyFillRect, - cfbPolyFillArcSolidCopy, - miPolyText8, - miPolyText16, - miImageText8, - miImageText16, - useTEGlyphBlt, - usePolyGlyphBlt, - usePushPixels -#ifdef NEED_LINEHELPER - ,NULL -#endif -}; - -GCOps cfbNonTEOps1Rect = { - cfbSolidSpansCopy, - cfbSetSpans, - cfbPutImage, - cfbCopyArea, - cfbCopyPlane, - cfbPolyPoint, -#ifdef PIXEL_ADDR - cfb8LineSS1Rect, - cfb8SegmentSS1Rect, -#else - cfbLineSS, - cfbSegmentSS, -#endif - miPolyRectangle, - ZeroPolyArc, - cfbFillPoly1RectCopy, - cfbPolyFillRect, - cfbPolyFillArcSolidCopy, - miPolyText8, - miPolyText16, - miImageText8, - miImageText16, - useImageGlyphBlt, - usePolyGlyphBlt, - usePushPixels -#ifdef NEED_LINEHELPER - ,NULL -#endif -}; - -GCOps cfbTEOps = { - cfbSolidSpansCopy, - cfbSetSpans, - cfbPutImage, - cfbCopyArea, - cfbCopyPlane, - cfbPolyPoint, - cfbLineSS, - cfbSegmentSS, - miPolyRectangle, - ZeroPolyArc, - miFillPolygon, - cfbPolyFillRect, - cfbPolyFillArcSolidCopy, - miPolyText8, - miPolyText16, - miImageText8, - miImageText16, - useTEGlyphBlt, - usePolyGlyphBlt, - usePushPixels -#ifdef NEED_LINEHELPER - ,NULL -#endif -}; - -GCOps cfbNonTEOps = { - cfbSolidSpansCopy, - cfbSetSpans, - cfbPutImage, - cfbCopyArea, - cfbCopyPlane, - cfbPolyPoint, - cfbLineSS, - cfbSegmentSS, - miPolyRectangle, -#ifdef PIXEL_ADDR - cfbZeroPolyArcSS8Copy, -#else - miZeroPolyArc, -#endif - miFillPolygon, - cfbPolyFillRect, - cfbPolyFillArcSolidCopy, - miPolyText8, - miPolyText16, - miImageText8, - miImageText16, - useImageGlyphBlt, - usePolyGlyphBlt, - usePushPixels -#ifdef NEED_LINEHELPER - ,NULL -#endif -}; - -GCOps * -cfbMatchCommon (pGC, devPriv) - GCPtr pGC; - cfbPrivGCPtr devPriv; -{ - if (pGC->lineWidth != 0) - return 0; - if (pGC->lineStyle != LineSolid) - return 0; - if (pGC->fillStyle != FillSolid) - return 0; - if (devPriv->rop != GXcopy) - return 0; - if (pGC->font && - FONTMAXBOUNDS(pGC->font,rightSideBearing) - - FONTMINBOUNDS(pGC->font,leftSideBearing) <= 32 && - FONTMINBOUNDS(pGC->font,characterWidth) >= 0) - { - if (TERMINALFONT(pGC->font) -#ifdef FOUR_BIT_CODE - && FONTMAXBOUNDS(pGC->font,characterWidth) >= PGSZB -#endif - ) -#ifdef NO_ONE_RECT - return &cfbTEOps1Rect; -#else - if (devPriv->oneRect) - return &cfbTEOps1Rect; - else - return &cfbTEOps; -#endif - else -#ifdef NO_ONE_RECT - return &cfbNonTEOps1Rect; -#else - if (devPriv->oneRect) - return &cfbNonTEOps1Rect; - else - return &cfbNonTEOps; -#endif - } - return 0; -} - -Bool -cfbCreateGC(pGC) - register GCPtr pGC; -{ - cfbPrivGC *pPriv; - - if (PixmapWidthPaddingInfo[pGC->depth].padPixelsLog2 == LOG2_BITMAP_PAD) - return (mfbCreateGC(pGC)); - pGC->clientClip = NULL; - pGC->clientClipType = CT_NONE; - - if (cfbNonTEOps.PushPixels == cfbUnPushPixels) - { - cfbTEOps1Rect.PushPixels = mfbPushPixelsWeak(); - cfbNonTEOps1Rect.PushPixels = mfbPushPixelsWeak(); - cfbTEOps.PushPixels = mfbPushPixelsWeak(); - cfbNonTEOps.PushPixels = mfbPushPixelsWeak(); - } - - /* - * some of the output primitives aren't really necessary, since they - * will be filled in ValidateGC because of dix/CreateGC() setting all - * the change bits. Others are necessary because although they depend - * on being a color frame buffer, they don't change - */ - - pGC->ops = &cfbNonTEOps; - pGC->funcs = &cfbGCFuncs; - - /* cfb wants to translate before scan conversion */ - pGC->miTranslate = 1; - - pPriv = cfbGetGCPrivate(pGC); - pPriv->rop = pGC->alu; - pPriv->oneRect = FALSE; - pGC->fExpose = TRUE; - pGC->freeCompClip = FALSE; - pGC->pRotatedPixmap = (PixmapPtr) NULL; - return TRUE; -} - -/* Clipping conventions - if the drawable is a window - CT_REGION ==> pCompositeClip really is the composite - CT_other ==> pCompositeClip is the window clip region - if the drawable is a pixmap - CT_REGION ==> pCompositeClip is the translated client region - clipped to the pixmap boundary - CT_other ==> pCompositeClip is the pixmap bounding box -*/ - -void -cfbValidateGC(pGC, changes, pDrawable) - register GCPtr pGC; - unsigned long changes; - DrawablePtr pDrawable; -{ - int mask; /* stateChanges */ - int index; /* used for stepping through bitfields */ - int new_rrop; - int new_line, new_text, new_fillspans, new_fillarea; - int new_rotate; - int xrot, yrot; - /* flags for changing the proc vector */ - cfbPrivGCPtr devPriv; - int oneRect; - - new_rotate = pGC->lastWinOrg.x != pDrawable->x || - pGC->lastWinOrg.y != pDrawable->y; - - pGC->lastWinOrg.x = pDrawable->x; - pGC->lastWinOrg.y = pDrawable->y; - devPriv = cfbGetGCPrivate(pGC); - - new_rrop = FALSE; - new_line = FALSE; - new_text = FALSE; - new_fillspans = FALSE; - new_fillarea = FALSE; - - /* - * if the client clip is different or moved OR the subwindowMode has - * changed OR the window's clip has changed since the last validation - * we need to recompute the composite clip - */ - - if ((changes & (GCClipXOrigin|GCClipYOrigin|GCClipMask|GCSubwindowMode)) || - (pDrawable->serialNumber != (pGC->serialNumber & DRAWABLE_SERIAL_BITS)) - ) - { - miComputeCompositeClip (pGC, pDrawable); -#ifdef NO_ONE_RECT - devPriv->oneRect = FALSE; -#else - oneRect = REGION_NUM_RECTS(pGC->pCompositeClip) == 1; - if (oneRect != devPriv->oneRect) - new_line = TRUE; - devPriv->oneRect = oneRect; -#endif - } - - mask = changes; - while (mask) { - index = lowbit (mask); - mask &= ~index; - - /* - * this switch acculmulates a list of which procedures might have - * to change due to changes in the GC. in some cases (e.g. - * changing one 16 bit tile for another) we might not really need - * a change, but the code is being paranoid. this sort of batching - * wins if, for example, the alu and the font have been changed, - * or any other pair of items that both change the same thing. - */ - switch (index) { - case GCFunction: - case GCForeground: - new_rrop = TRUE; - break; - case GCPlaneMask: - new_rrop = TRUE; - new_text = TRUE; - break; - case GCBackground: - break; - case GCLineStyle: - case GCLineWidth: - new_line = TRUE; - break; - case GCJoinStyle: - case GCCapStyle: - break; - case GCFillStyle: - new_text = TRUE; - new_fillspans = TRUE; - new_line = TRUE; - new_fillarea = TRUE; - break; - case GCFillRule: - break; - case GCTile: - new_fillspans = TRUE; - new_fillarea = TRUE; - break; - - case GCStipple: - if (pGC->stipple) - { - int width = pGC->stipple->drawable.width; - PixmapPtr nstipple; - - if ((width <= PGSZ) && !(width & (width - 1)) && - (nstipple = cfbCopyPixmap(pGC->stipple))) - { - cfbPadPixmap(nstipple); - (*pGC->pScreen->DestroyPixmap)(pGC->stipple); - pGC->stipple = nstipple; - } - } - new_fillspans = TRUE; - new_fillarea = TRUE; - break; - - case GCTileStipXOrigin: - new_rotate = TRUE; - break; - - case GCTileStipYOrigin: - new_rotate = TRUE; - break; - - case GCFont: - new_text = TRUE; - break; - case GCSubwindowMode: - break; - case GCGraphicsExposures: - break; - case GCClipXOrigin: - break; - case GCClipYOrigin: - break; - case GCClipMask: - break; - case GCDashOffset: - break; - case GCDashList: - break; - case GCArcMode: - break; - default: - break; - } - } - - /* - * If the drawable has changed, ensure suitable - * entries are in the proc vector. - */ - if (pDrawable->serialNumber != (pGC->serialNumber & (DRAWABLE_SERIAL_BITS))) { - new_fillspans = TRUE; /* deal with FillSpans later */ - } - - if (new_rotate || new_fillspans) - { - Bool new_pix = FALSE; - - xrot = pGC->patOrg.x + pDrawable->x; - yrot = pGC->patOrg.y + pDrawable->y; - - switch (pGC->fillStyle) - { - case FillTiled: - if (!pGC->tileIsPixel) - { - int width = pGC->tile.pixmap->drawable.width * PSZ; - - if ((width <= PGSZ) && !(width & (width - 1))) - { - cfbCopyRotatePixmap(pGC->tile.pixmap, &pGC->pRotatedPixmap, - xrot, yrot); - new_pix = TRUE; - } - } - break; -#ifdef FOUR_BIT_CODE - case FillStippled: - case FillOpaqueStippled: - { - int width = pGC->stipple->drawable.width; - - if ((width <= PGSZ) && !(width & (width - 1))) - { - mfbCopyRotatePixmap(pGC->stipple, &pGC->pRotatedPixmap, - xrot, yrot); - new_pix = TRUE; - } - } - break; -#endif - } - if (!new_pix && pGC->pRotatedPixmap) - { - (*pGC->pScreen->DestroyPixmap)(pGC->pRotatedPixmap); - pGC->pRotatedPixmap = (PixmapPtr) NULL; - } - } - - if (new_rrop) - { - int old_rrop; - - old_rrop = devPriv->rop; - devPriv->rop = cfbReduceRasterOp (pGC->alu, pGC->fgPixel, - pGC->planemask, - &devPriv->and, &devPriv->xor); - if (old_rrop == devPriv->rop) - new_rrop = FALSE; - else - { -#ifdef PIXEL_ADDR - new_line = TRUE; -#endif -#ifdef WriteBitGroup - new_text = TRUE; -#endif - new_fillspans = TRUE; - new_fillarea = TRUE; - } - } - - if (new_rrop || new_fillspans || new_text || new_fillarea || new_line) - { - GCOps *newops; - - if ((newops = cfbMatchCommon (pGC, devPriv))) - { - if (pGC->ops->devPrivate.val) - miDestroyGCOps (pGC->ops); - pGC->ops = newops; - new_rrop = new_line = new_fillspans = new_text = new_fillarea = 0; - } - else - { - if (!pGC->ops->devPrivate.val) - { - pGC->ops = miCreateGCOps (pGC->ops); - pGC->ops->devPrivate.val = 1; - } - } - } - - /* deal with the changes we've collected */ - if (new_line) - { - pGC->ops->FillPolygon = miFillPolygon; -#ifdef NO_ONE_RECT - if (pGC->fillStyle == FillSolid) - { - switch (devPriv->rop) { - case GXcopy: - pGC->ops->FillPolygon = cfbFillPoly1RectCopy; - break; - default: - pGC->ops->FillPolygon = cfbFillPoly1RectGeneral; - break; - } - } -#else - if (devPriv->oneRect && pGC->fillStyle == FillSolid) - { - switch (devPriv->rop) { - case GXcopy: - pGC->ops->FillPolygon = cfbFillPoly1RectCopy; - break; - default: - pGC->ops->FillPolygon = cfbFillPoly1RectGeneral; - break; - } - } -#endif - if (pGC->lineWidth == 0) - { -#ifdef PIXEL_ADDR - if ((pGC->lineStyle == LineSolid) && (pGC->fillStyle == FillSolid)) - { - switch (devPriv->rop) - { - case GXxor: - pGC->ops->PolyArc = cfbZeroPolyArcSS8Xor; - break; - case GXcopy: - pGC->ops->PolyArc = cfbZeroPolyArcSS8Copy; - break; - default: - pGC->ops->PolyArc = cfbZeroPolyArcSS8General; - break; - } - } - else -#endif - pGC->ops->PolyArc = miZeroPolyArc; - } - else - pGC->ops->PolyArc = miPolyArc; - pGC->ops->PolySegment = miPolySegment; - switch (pGC->lineStyle) - { - case LineSolid: - if(pGC->lineWidth == 0) - { - if (pGC->fillStyle == FillSolid) - { -#if defined(PIXEL_ADDR) && !defined(NO_ONE_RECT) - if (devPriv->oneRect && - ((pDrawable->x >= pGC->pScreen->width - 32768) && - (pDrawable->y >= pGC->pScreen->height - 32768))) - { - pGC->ops->Polylines = cfb8LineSS1Rect; - pGC->ops->PolySegment = cfb8SegmentSS1Rect; - } else -#endif -#ifdef NO_ONE_RECT - { - pGC->ops->Polylines = cfb8LineSS1Rect; - pGC->ops->PolySegment = cfb8SegmentSS1Rect; - } -#else - { - pGC->ops->Polylines = cfbLineSS; - pGC->ops->PolySegment = cfbSegmentSS; - } -#endif - } - else - pGC->ops->Polylines = miZeroLine; - } - else - pGC->ops->Polylines = miWideLine; - break; - case LineOnOffDash: - case LineDoubleDash: - if (pGC->lineWidth == 0 && pGC->fillStyle == FillSolid) - { - pGC->ops->Polylines = cfbLineSD; - pGC->ops->PolySegment = cfbSegmentSD; - } else - pGC->ops->Polylines = miWideDash; - break; - } - } - - if (new_text && (pGC->font)) - { - if (FONTMAXBOUNDS(pGC->font,rightSideBearing) - - FONTMINBOUNDS(pGC->font,leftSideBearing) > 32 || - FONTMINBOUNDS(pGC->font,characterWidth) < 0) - { - pGC->ops->PolyGlyphBlt = miPolyGlyphBlt; - pGC->ops->ImageGlyphBlt = miImageGlyphBlt; - } - else - { -#ifdef WriteBitGroup - if (pGC->fillStyle == FillSolid) - { - if (devPriv->rop == GXcopy) - pGC->ops->PolyGlyphBlt = cfbPolyGlyphBlt8; - else -#ifdef FOUR_BIT_CODE - pGC->ops->PolyGlyphBlt = cfbPolyGlyphRop8; -#else - pGC->ops->PolyGlyphBlt = miPolyGlyphBlt; -#endif - } - else -#endif - pGC->ops->PolyGlyphBlt = miPolyGlyphBlt; - /* special case ImageGlyphBlt for terminal emulator fonts */ -#if !defined(WriteBitGroup) || PSZ == 8 - if (TERMINALFONT(pGC->font) && - (pGC->planemask & PMSK) == PMSK -#ifdef FOUR_BIT_CODE - && FONTMAXBOUNDS(pGC->font,characterWidth) >= PGSZB -#endif - ) - { - pGC->ops->ImageGlyphBlt = useTEGlyphBlt; - } - else -#endif - { -#ifdef WriteBitGroup - if (devPriv->rop == GXcopy && - pGC->fillStyle == FillSolid && - (pGC->planemask & PMSK) == PMSK) - pGC->ops->ImageGlyphBlt = cfbImageGlyphBlt8; - else -#endif - pGC->ops->ImageGlyphBlt = miImageGlyphBlt; - } - } - } - - - if (new_fillspans) { - switch (pGC->fillStyle) { - case FillSolid: - switch (devPriv->rop) { - case GXcopy: - pGC->ops->FillSpans = cfbSolidSpansCopy; - break; - case GXxor: - pGC->ops->FillSpans = cfbSolidSpansXor; - break; - default: - pGC->ops->FillSpans = cfbSolidSpansGeneral; - break; - } - break; - case FillTiled: - if (pGC->pRotatedPixmap) - { - if (pGC->alu == GXcopy && (pGC->planemask & PMSK) == PMSK) - pGC->ops->FillSpans = cfbTile32FSCopy; - else - pGC->ops->FillSpans = cfbTile32FSGeneral; - } - else - pGC->ops->FillSpans = cfbUnnaturalTileFS; - break; - case FillStippled: -#ifdef FOUR_BIT_CODE - if (pGC->pRotatedPixmap) - pGC->ops->FillSpans = cfb8Stipple32FS; - else -#endif - pGC->ops->FillSpans = cfbUnnaturalStippleFS; - break; - case FillOpaqueStippled: -#ifdef FOUR_BIT_CODE - if (pGC->pRotatedPixmap) - pGC->ops->FillSpans = cfb8OpaqueStipple32FS; - else -#endif - pGC->ops->FillSpans = cfbUnnaturalStippleFS; - break; - default: - FatalError("cfbValidateGC: illegal fillStyle\n"); - } - } /* end of new_fillspans */ - - if (new_fillarea) { -#ifndef FOUR_BIT_CODE - pGC->ops->PolyFillRect = miPolyFillRect; - if (pGC->fillStyle == FillSolid || pGC->fillStyle == FillTiled) - { - pGC->ops->PolyFillRect = cfbPolyFillRect; - } -#endif -#ifdef FOUR_BIT_CODE - pGC->ops->PushPixels = mfbPushPixelsWeak(); - if (pGC->fillStyle == FillSolid && devPriv->rop == GXcopy) - pGC->ops->PushPixels = cfbPushPixels8; -#endif - pGC->ops->PolyFillArc = miPolyFillArc; - if (pGC->fillStyle == FillSolid) - { - switch (devPriv->rop) - { - case GXcopy: - pGC->ops->PolyFillArc = cfbPolyFillArcSolidCopy; - break; - default: - pGC->ops->PolyFillArc = cfbPolyFillArcSolidGeneral; - break; - } - } - } -} - -/* - * this is never called, it just exists to have its address - * taken in mfbCreateGC. - */ -static void -cfbUnPushPixels (pGC, pBitmap, pDrawable, dx, dy, xOrg, yOrg) - GCPtr pGC; - PixmapPtr pBitmap; - DrawablePtr pDrawable; - int dx, dy, xOrg, yOrg; -{ - return; -} diff --git a/nx-X11/programs/Xserver/cfb/cfbgetsp.c b/nx-X11/programs/Xserver/cfb/cfbgetsp.c deleted file mode 100644 index 44e31a241..000000000 --- a/nx-X11/programs/Xserver/cfb/cfbgetsp.c +++ /dev/null @@ -1,215 +0,0 @@ -/* $Xorg: cfbgetsp.c,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $ */ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XFree86: xc/programs/Xserver/cfb/cfbgetsp.c,v 3.9tsi Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include "servermd.h" - -#include "misc.h" -#include "region.h" -#include "gc.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "scrnintstr.h" - -#include "cfb.h" -#include "cfbmskbits.h" - -/* GetSpans -- for each span, gets bits from drawable starting at ppt[i] - * and continuing for pwidth[i] bits - * Each scanline returned will be server scanline padded, i.e., it will come - * out to an integral number of words. - */ -void -cfbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pchardstStart) - DrawablePtr pDrawable; /* drawable from which to get bits */ - int wMax; /* largest value of all *pwidths */ - register DDXPointPtr ppt; /* points to start copying from */ - int *pwidth; /* list of number of bits to copy */ - int nspans; /* number of scanlines to copy */ - char *pchardstStart; /* where to put the bits */ -{ - PixelGroup *pdstStart = (PixelGroup *)pchardstStart; - register PixelGroup *pdst; /* where to put the bits */ - register PixelGroup *psrc; /* where to get the bits */ - register PixelGroup tmpSrc; /* scratch buffer for bits */ - PixelGroup *psrcBase; /* start of src bitmap */ - int widthSrc; /* width of pixmap in bytes */ - register DDXPointPtr pptLast; /* one past last point to get */ - int xEnd; /* last pixel to copy from */ - int nl, srcBit; - int w; - PixelGroup *pdstNext; -#if PSZ == 24 - register char *psrcb, *pdstb; - register int xIndex = 0; -#else - register int nstart; -#if PSZ != 32 || PPW != 1 - int nend; -#endif - PixelGroup startmask, endmask; - int nlMiddle; -#endif - - switch (pDrawable->bitsPerPixel) { - case 1: - mfbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pchardstStart); - return; - case PSZ: - break; - default: - FatalError("cfbGetSpans: invalid depth\n"); - } - - /* - * XFree86 DDX empties the root borderClip when the VT is - * switched away; this checks for that case - */ - if (!cfbDrawableEnabled(pDrawable)) - return; - - cfbGetLongWidthAndPointer (pDrawable, widthSrc, psrcBase) - -#ifdef PIXEL_ADDR -# if PSZ != 24 - if ((nspans == 1) && (*pwidth == 1)) - { - tmpSrc = *((PixelType *)(psrcBase + (ppt->y * widthSrc)) - + ppt->x); -#if BITMAP_BIT_ORDER == MSBFirst - tmpSrc <<= (sizeof (CfbBits) - sizeof (PixelType)) * 8; -#endif - *pdstStart = tmpSrc; - return; - } -# endif /* PSZ != 24 */ -#endif - pdst = pdstStart; - pptLast = ppt + nspans; - while(ppt < pptLast) - { -#if PSZ == 24 - xEnd = min(ppt->x + *pwidth, widthSrc * sizeof(CfbBits) / 3); - w = xEnd - ppt->x; - psrc = psrcBase + ppt->y * widthSrc; - srcBit = ppt->x; - psrcb = (char *)psrc + (ppt->x * 3); - xIndex = 0; - pdstb = (char *)pdst; - pdstNext = pdst + ((w * 3 + 3) >> 2); -#else - xEnd = min(ppt->x + *pwidth, widthSrc << PWSH); - w = xEnd - ppt->x; - psrc = psrcBase + ppt->y * widthSrc + (ppt->x >> PWSH); - srcBit = ppt->x & PIM; - pdstNext = pdst + ((w + PPW - 1) >> PWSH); -#endif - -#if PSZ == 24 - if (w < 0) - FatalError("cfb24GetSpans: Internal error (w < 0)\n"); - nl = w; - while (nl--){ - psrc = (PixelGroup *)((unsigned long)psrcb & ~0x03); - getbits24(psrc, tmpSrc, srcBit); - pdst = (PixelGroup *)((unsigned long)pdstb & ~0x03); - putbits24(tmpSrc, PPW, pdst, ~((CfbBits)0), xIndex); - srcBit++; - psrcb += 3; - xIndex++; - pdstb += 3; - } - pdst = pdstNext; -#else /* PSZ == 24 */ - if (srcBit + w <= PPW) - { - getbits(psrc, srcBit, w, tmpSrc); - putbits(tmpSrc, 0, w, pdst, ~((CfbBits)0)); - pdst++; - } - else - { - maskbits(ppt->x, w, startmask, endmask, nlMiddle); - nstart = 0; - if (startmask) - { - nstart = PPW - srcBit; - getbits(psrc, srcBit, nstart, tmpSrc); - putbits(tmpSrc, 0, nstart, pdst, ~((CfbBits)0)); - if(srcBit + nstart >= PPW) - psrc++; - } - nl = nlMiddle; - while (nl--) - { - tmpSrc = *psrc; - putbits(tmpSrc, nstart, PPW, pdst, ~((CfbBits)0)); - psrc++; - pdst++; - } - if (endmask) - { -#if PSZ != 32 || PPW != 1 - nend = xEnd & PIM; -#endif - getbits(psrc, 0, nend, tmpSrc); - putbits(tmpSrc, nstart, nend, pdst, ~((CfbBits)0)); - } - pdst = pdstNext; - } -#endif /* PSZ == 24 */ - ppt++; - pwidth++; - } -} diff --git a/nx-X11/programs/Xserver/cfb/cfbglblt8.c b/nx-X11/programs/Xserver/cfb/cfbglblt8.c deleted file mode 100644 index fda848fde..000000000 --- a/nx-X11/programs/Xserver/cfb/cfbglblt8.c +++ /dev/null @@ -1,479 +0,0 @@ -/* $Xorg: cfbglblt8.c,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $ */ -/* - -Copyright 1989, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. -*/ -/* $XFree86: xc/programs/Xserver/cfb/cfbglblt8.c,v 3.7 2003/07/16 01:38:37 dawes Exp $ */ - -/* - * Poly glyph blt. Accepts an arbitrary font <= 32 bits wide, in Copy mode - * only. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include -#include "cfb.h" -#include -#include "dixfontstr.h" -#include "gcstruct.h" -#include "windowstr.h" -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "regionstr.h" -#include "cfbmskbits.h" -#include "cfb8bit.h" - -#define BOX_OVERLAP(box1, box2, xoffset, yoffset) \ - ((box1)->x1 <= ((int) (box2)->x2 + (xoffset)) && \ - ((int) (box2)->x1 + (xoffset)) <= (box1)->x2 && \ - (box1)->y1 <= ((int) (box2)->y2 + (yoffset)) && \ - ((int) (box2)->y1 + (yoffset)) <= (box1)->y2) - -#define BOX_CONTAINS(box1, box2, xoffset, yoffset) \ - ((box1)->x1 <= ((int) (box2)->x1 + (xoffset)) && \ - ((int) (box2)->x2 + (xoffset)) <= (box1)->x2 && \ - (box1)->y1 <= ((int) (box2)->y1 + (yoffset)) && \ - ((int) (box2)->y2 + (yoffset)) <= (box1)->y2) - -#if defined(FOUR_BIT_CODE) || defined(WriteBitGroup) && !defined(GLYPHROP) - -#if GLYPHPADBYTES != 4 -#define USE_LEFTBITS -#endif - -#ifdef USE_LEFTBITS -typedef unsigned char *glyphPointer; - -#define GlyphBits(bits,width,dst) getleftbits(bits,width,dst); \ - (dst) &= widthMask; \ - (bits) += widthGlyph; -#define GlyphBitsS(bits,width,dst,off) GlyphBits(bits,width,dst); \ - dst = BitRight (dst, off); -#else -typedef CARD32 *glyphPointer; - -#define GlyphBits(bits,width,dst) dst = *bits++; -#define GlyphBitsS(bits,width,dst,off) dst = BitRight(*bits++, off); -#endif - -#ifdef GLYPHROP -#define cfbPolyGlyphBlt8 cfbPolyGlyphRop8 -#define cfbPolyGlyphBlt8Clipped cfbPolyGlyphRop8Clipped - -#undef WriteBitGroup -#define WriteBitGroup(dst,pixel,bits) RRopBitGroup(dst,bits) - -#endif - -static void cfbPolyGlyphBlt8Clipped( - DrawablePtr pDrawable, - GCPtr pGC, - int x, - int y, - unsigned int nglyph, - CharInfoPtr *ppci, /* array of character info */ - unsigned char *pglyphBase); /* start of array of glyphs */ - -#if defined(HAS_STIPPLE_CODE) && !defined(GLYPHROP) && !defined(USE_LEFTBITS) -#define USE_STIPPLE_CODE -#endif - -#if defined(__GNUC__) && !defined(GLYPHROP) && (defined(mc68020) || defined(mc68000) || defined(__mc68000__)) && PSZ == 8 && !defined(USE_LEFTBITS) -#ifdef USE_STIPPLE_CODE -#undef USE_STIPPLE_CODE -#endif -#include "stip68kgnu.h" -#endif - -#if PSZ == 24 -#define DST_INC 3 -#else -#define DST_INC (PGSZB >> PWSH) -#endif - -/* cfbStippleStack/cfbStippleStackTE are coded in assembly language. - * They are only provided on some architecures. - */ -#ifdef USE_STIPPLE_CODE -extern void cfbStippleStack (), cfbStippleStackTE (); -#endif - -void -cfbPolyGlyphBlt8 (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) - DrawablePtr pDrawable; - GCPtr pGC; - int x, y; - unsigned int nglyph; - CharInfoPtr *ppci; /* array of character info */ - pointer pglyphBase; /* start of array of glyphs */ -{ -#ifndef GLYPHROP - register CfbBits pixel; -#endif -#if !defined(STIPPLE) && !defined(USE_STIPPLE_CODE) - register CfbBits c; - register CfbBits *dst; -#endif - register glyphPointer glyphBits; - register int xoff; - - FontPtr pfont = pGC->font; - CharInfoPtr pci; - CfbBits *dstLine; - CfbBits *pdstBase; - int hTmp; - int bwidthDst; - int widthDst; - int h; - BoxRec bbox; /* for clipping */ - int w; - RegionPtr clip; - BoxPtr extents; -#ifdef USE_LEFTBITS - int widthGlyph; - CfbBits widthMask; -#endif -#ifndef STIPPLE -#ifdef USE_STIPPLE_CODE - void (*stipple)(); - - stipple = cfbStippleStack; - if (FONTCONSTMETRICS(pfont)) - stipple = cfbStippleStackTE; -#endif -#endif - - x += pDrawable->x; - y += pDrawable->y; - - /* compute an approximate (but covering) bounding box */ - bbox.x1 = 0; - if ((ppci[0]->metrics.leftSideBearing < 0)) - bbox.x1 = ppci[0]->metrics.leftSideBearing; - h = nglyph - 1; - w = ppci[h]->metrics.rightSideBearing; - while (--h >= 0) - w += ppci[h]->metrics.characterWidth; - bbox.x2 = w; - bbox.y1 = -FONTMAXBOUNDS(pfont,ascent); - bbox.y2 = FONTMAXBOUNDS(pfont,descent); - - clip = cfbGetCompositeClip(pGC); - extents = &clip->extents; - - if (!clip->data) - { - if (!BOX_CONTAINS(extents, &bbox, x, y)) - { - if (BOX_OVERLAP (extents, &bbox, x, y)) - cfbPolyGlyphBlt8Clipped(pDrawable, pGC, x, y, - nglyph, ppci, pglyphBase); - return; - } - } - else - { - /* check to make sure some of the text appears on the screen */ - if (!BOX_OVERLAP (extents, &bbox, x, y)) - return; - - bbox.x1 += x; - bbox.x2 += x; - bbox.y1 += y; - bbox.y2 += y; - - switch (RECT_IN_REGION(pGC->pScreen, clip, &bbox)) - { - case rgnPART: - cfbPolyGlyphBlt8Clipped(pDrawable, pGC, x, y, - nglyph, ppci, pglyphBase); - case rgnOUT: - return; - } - } - -#ifdef GLYPHROP - cfb8CheckStipple (pGC->alu, pGC->fgPixel, pGC->planemask); -#else - pixel = cfbGetGCPrivate(pGC)->xor; -#endif - - cfbGetTypedWidthAndPointer (pDrawable, bwidthDst, pdstBase, char, CfbBits) - - widthDst = bwidthDst / PGSZB; - while (nglyph--) - { - pci = *ppci++; - glyphBits = (glyphPointer) FONTGLYPHBITS(pglyphBase,pci); - xoff = x + pci->metrics.leftSideBearing; -#if PSZ == 24 - dstLine = pdstBase + (y - pci->metrics.ascent) * widthDst +((xoff>> 2)*3); -#else - dstLine = pdstBase + - (y - pci->metrics.ascent) * widthDst + (xoff >> PWSH); -#endif - x += pci->metrics.characterWidth; - if ((hTmp = pci->metrics.descent + pci->metrics.ascent)) - { -#if PSZ == 24 - xoff &= 0x03; -#else - xoff &= PIM; -#endif /* PSZ == 24 */ -#ifdef STIPPLE - STIPPLE(dstLine,glyphBits,pixel,bwidthDst,hTmp,xoff); -#else -#ifdef USE_STIPPLE_CODE - (*stipple)(dstLine,glyphBits,pixel,bwidthDst,hTmp,xoff); -#else -#ifdef USE_LEFTBITS - w = pci->metrics.rightSideBearing - pci->metrics.leftSideBearing; - widthGlyph = PADGLYPHWIDTHBYTES(w); - widthMask = mfbGetendtab(w); -#endif - do { - dst = dstLine; - dstLine = (CfbBits *) (((char *) dstLine) + bwidthDst); - GlyphBits(glyphBits, w, c) - WriteBitGroup(dst, pixel, GetBitGroup(BitRight(c,xoff))); - dst += DST_INC; - c = BitLeft(c,PGSZB - xoff); - while (c) - { - WriteBitGroup(dst, pixel, GetBitGroup(c)); - NextBitGroup(c); - dst += DST_INC; - } - } while (--hTmp); -#endif /* USE_STIPPLE_CODE else */ -#endif /* STIPPLE else */ - } - } -} - -static void -cfbPolyGlyphBlt8Clipped( - DrawablePtr pDrawable, - GCPtr pGC, - int x, - int y, - unsigned int nglyph, - CharInfoPtr *ppci, /* array of character info */ - unsigned char *pglyphBase) /* start of array of glyphs */ -{ -#ifndef GLYPHROP - register CfbBits pixel; -#endif -#if !defined(STIPPLE) && !defined(USE_STIPPLE_CODE) - register CfbBits c; -#endif - register glyphPointer glyphBits; - register int xoff; -#if defined(USE_LEFTBITS) || (!defined(STIPPLE) && !defined(USE_STIPPLE_CODE)) - register CfbBits *dst; -#endif - - CharInfoPtr pci; - FontPtr pfont = pGC->font; - CfbBits *dstLine; - CfbBits *pdstBase; -#ifdef USE_LEFTBITS - CARD32 *cTmp; -#endif - CARD32 *clips; - int maxAscent, maxDescent; - int minLeftBearing; - int hTmp; - int widthDst; - int bwidthDst; - int xG, yG; - BoxPtr pBox; - int numRects; - int w; - RegionPtr pRegion; - int yBand; -#ifdef GLYPHROP - CfbBits bits; -#endif -#ifdef USE_LEFTBITS - int widthGlyph; - CfbBits widthMask; -#endif - -#ifdef GLYPHROP - cfb8CheckStipple (pGC->alu, pGC->fgPixel, pGC->planemask); -#else - pixel = cfbGetGCPrivate(pGC)->xor; -#endif - - cfbGetTypedWidthAndPointer (pDrawable, bwidthDst, pdstBase, char, CfbBits) - - widthDst = bwidthDst / PGSZB; - maxAscent = FONTMAXBOUNDS(pfont,ascent); - maxDescent = FONTMAXBOUNDS(pfont,descent); - minLeftBearing = FONTMINBOUNDS(pfont,leftSideBearing); - - pRegion = cfbGetCompositeClip(pGC); - - pBox = REGION_RECTS(pRegion); - numRects = REGION_NUM_RECTS (pRegion); - while (numRects && pBox->y2 <= y - maxAscent) - { - ++pBox; - --numRects; - } - if (!numRects || pBox->y1 >= y + maxDescent) - return; - yBand = pBox->y1; - while (numRects && pBox->y1 == yBand && pBox->x2 <= x + minLeftBearing) - { - ++pBox; - --numRects; - } - if (!numRects) - return; - clips = (CARD32 *)ALLOCATE_LOCAL ((maxAscent + maxDescent) * - sizeof (CARD32)); - while (nglyph--) - { - pci = *ppci++; - glyphBits = (glyphPointer) FONTGLYPHBITS(pglyphBase,pci); - w = pci->metrics.rightSideBearing - pci->metrics.leftSideBearing; - xG = x + pci->metrics.leftSideBearing; - yG = y - pci->metrics.ascent; - x += pci->metrics.characterWidth; - if ((hTmp = pci->metrics.descent + pci->metrics.ascent)) - { -#if PSZ == 24 - dstLine = pdstBase + yG * widthDst + ((xG>> 2)*3); - /* never use (xG*3)>>2 */ -#else - dstLine = pdstBase + yG * widthDst + (xG >> PWSH); -#endif -#if PSZ == 24 - xoff = xG & 3; -#else - xoff = xG & PIM; -#endif -#ifdef USE_LEFTBITS - w = pci->metrics.rightSideBearing - pci->metrics.leftSideBearing; - widthGlyph = PADGLYPHWIDTHBYTES(w); - widthMask = mfbGetendtab(w); -#endif - switch (cfb8ComputeClipMasks32 (pBox, numRects, xG, yG, w, hTmp, clips)) - { - case rgnPART: -#ifdef USE_LEFTBITS - cTmp = clips; - do { - dst = dstLine; - dstLine = (CfbBits *) (((char *) dstLine) + bwidthDst); - GlyphBits(glyphBits, w, c) - c &= *cTmp++; - if (c) - { - WriteBitGroup(dst, pixel, GetBitGroup(BitRight(c,xoff))); - c = BitLeft(c,PGSZB - xoff); - dst += DST_INC; - while (c) - { - WriteBitGroup(dst, pixel, GetBitGroup(c)); - NextBitGroup(c); - dst += DST_INC; - } - } - } while (--hTmp); - break; -#else /* !USE_LEFTBITS */ - { - int h; - - h = hTmp; - do - { - --h; - clips[h] = clips[h] & glyphBits[h]; - } while (h); - } - glyphBits = clips; - /* fall through */ -#endif /* USE_LEFTBITS */ - case rgnIN: -#ifdef STIPPLE - STIPPLE(dstLine,glyphBits,pixel,bwidthDst,hTmp,xoff); -#else -#ifdef USE_STIPPLE_CODE - cfbStippleStackTE(dstLine,glyphBits,pixel,bwidthDst,hTmp,xoff); -#else - do { - dst = dstLine; - dstLine = (CfbBits *) (((char *) dstLine) + bwidthDst); - GlyphBits(glyphBits, w, c) - if (c) - { - /* This code originally could read memory locations - * that were not mapped. Hence we have to check the - * trailing bits to see whether they are zero and if - * then skip them correctly. This is no problem for - * the GXcopy case, since there only the pixels that - * are non-zero are written ... - */ -#ifndef GLYPHROP - WriteBitGroup(dst, pixel, GetBitGroup(BitRight(c,xoff))); - c = BitLeft(c,PGSZB - xoff); - dst += DST_INC; -#else /* GLYPHROP */ - if ((bits = GetBitGroup(BitRight(c,xoff)))) - WriteBitGroup(dst, pixel, bits); - c = BitLeft(c,PGSZB - xoff); - dst += DST_INC; - - while (c && ((bits = GetBitGroup(c)) == 0)) - { - NextBitGroup(c); - dst += DST_INC; - } -#endif /* GLYPHROP */ - while (c) - { - WriteBitGroup(dst, pixel, GetBitGroup(c)); - NextBitGroup(c); - dst += DST_INC; - } - } - } while (--hTmp); -#endif /* USE_STIPPLE_CODE else */ -#endif /* STIPPLE else */ - break; - } - } - } - DEALLOCATE_LOCAL (clips); -} - -#endif /* FOUR_BIT_CODE */ diff --git a/nx-X11/programs/Xserver/cfb/cfbhrzvert.c b/nx-X11/programs/Xserver/cfb/cfbhrzvert.c deleted file mode 100644 index 4df991b00..000000000 --- a/nx-X11/programs/Xserver/cfb/cfbhrzvert.c +++ /dev/null @@ -1,556 +0,0 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfbhrzvert.c,v 3.6 2001/10/28 03:33:00 tsi Exp $ */ -/*********************************************************** - -Copyright 1987,1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $Xorg: cfbhrzvert.c,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $ */ -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include - -#include "gc.h" -#include "window.h" -#include "pixmap.h" -#include "region.h" - -#include "cfb.h" -#include "cfbmskbits.h" - -/* horizontal solid line - abs(len) > 1 -*/ -void -cfbHorzS(rop, and, xor, addrl, nlwidth, x1, y1, len) -register int rop; -register CfbBits and; -register CfbBits xor; -register CfbBits *addrl; /* pointer to base of bitmap */ -int nlwidth; /* width in longwords of bitmap */ -int x1; /* initial point */ -int y1; -int len; /* length of line */ -{ - register int nlmiddle; - -#if PSZ == 24 - - int leftIndex, rightIndex; - CfbBits piQxelAnd[3], piQxelXor[3]; - piQxelAnd[0] = (and & 0xFFFFFF) | ((and<<24) & 0xFF000000); - piQxelAnd[1] = ((and>>8) & 0xFFFF)| ((and<<16) & 0xFFFF0000); - piQxelAnd[2] = ((and<<8) & 0xFFFFFF00) | ((and>>16) & 0xFF); - - piQxelXor[0] = (xor & 0xFFFFFF) | ((xor<<24) & 0xFF000000); - piQxelXor[1] = ((xor>>8) & 0xFFFF)| ((xor<<16) & 0xFFFF0000); - piQxelXor[2] = ((xor<<8) & 0xFFFFFF00) | ((xor>>16) & 0xFF); - - leftIndex = x1 & 3; - rightIndex = ((x1 + len) < 5)?0:(x1 + len)&3; - nlmiddle = len; - if(leftIndex){ - nlmiddle -= (4 - leftIndex); - } - if(rightIndex){ - nlmiddle -= rightIndex; - } - if (nlmiddle < 0) - nlmiddle = 0; - - nlmiddle >>= 2; - - addrl += (y1 * nlwidth) + (x1 >> 2)*3 + (leftIndex?leftIndex-1:0); - - switch(leftIndex+len){ - case 4: - switch(leftIndex){ - case 0: - *addrl = DoRRop (*addrl, piQxelAnd[0], piQxelXor[0]); - addrl++; - *addrl = DoRRop (*addrl, piQxelAnd[1], piQxelXor[1]); - addrl++; - *addrl = DoRRop (*addrl, piQxelAnd[2], piQxelXor[2]); - break; - case 1: - *addrl = DoMaskRRop (*addrl, piQxelAnd[0], piQxelXor[0], 0xFF000000); - addrl++; - *addrl = DoRRop (*addrl, piQxelAnd[1], piQxelXor[1]); - addrl++; - *addrl = DoRRop (*addrl, piQxelAnd[2], piQxelXor[2]); - break; - case 2: - *addrl = DoMaskRRop (*addrl, piQxelAnd[1], piQxelXor[1], 0xFFFF0000); - addrl++; - *addrl = DoRRop (*addrl, piQxelAnd[2], piQxelXor[2]); - break; - case 3: - *addrl = DoMaskRRop (*addrl, piQxelAnd[2], piQxelXor[2], 0xFFFFFF00); - break; - } - break; - case 3: - switch(leftIndex){ - case 0: - *addrl = DoRRop (*addrl, piQxelAnd[0], piQxelXor[0]); - addrl++; - *addrl = DoRRop (*addrl, piQxelAnd[1], piQxelXor[1]); - addrl++; - *addrl = DoMaskRRop (*addrl, piQxelAnd[2], piQxelXor[2], 0xFF); - break; - case 1: - *addrl = DoMaskRRop (*addrl, piQxelAnd[0], piQxelXor[0], 0xFF000000); - addrl++; - *addrl = DoRRop (*addrl, piQxelAnd[1], piQxelXor[1]); - addrl++; - *addrl = DoMaskRRop (*addrl, piQxelAnd[2], piQxelXor[2], 0xFF); - break; - case 2: - *addrl = DoMaskRRop (*addrl, piQxelAnd[1], piQxelXor[1], 0xFFFF0000); - addrl++; - *addrl = DoMaskRRop (*addrl, piQxelAnd[2], piQxelXor[2], 0xFF); - break; - } - break; - case 2: - if(leftIndex){ - *addrl = DoMaskRRop (*addrl, piQxelAnd[0], piQxelXor[0], 0xFF000000); - addrl++; - } - else{ - *addrl = DoRRop (*addrl, piQxelAnd[0], piQxelXor[0]); - addrl++; - } - *addrl = DoMaskRRop (*addrl, piQxelAnd[1], piQxelXor[1], 0xFFFF); - break; - case 1: /*only if leftIndex = 0 and w = 1*/ - *addrl = DoMaskRRop (*addrl, piQxelAnd[0], piQxelXor[0], 0xFFFFFF); - break; - case 0: /*never*/ - break; - default: - { - if (rop == GXcopy){ - switch(leftIndex){ - case 0: - break; - case 1: - *addrl = ((*addrl) & 0xFFFFFF) | (piQxelXor[0] & 0xFF000000); - addrl++; - *addrl++ = piQxelXor[1]; - *addrl++ = piQxelXor[2]; - break; - case 2: - *addrl = ((*addrl) & 0xFFFF) | (piQxelXor[1] & 0xFFFF0000); - addrl++; - *addrl++ = piQxelXor[2]; - break; - case 3: - *addrl = ((*addrl) & 0xFF) | (piQxelXor[2] & 0xFFFFFF00); - addrl++; - break; - } - while(nlmiddle--){ - *addrl++ = piQxelXor[0]; - *addrl++ = piQxelXor[1]; - *addrl++ = piQxelXor[2]; - } - switch(rightIndex){ - case 0: - break; - case 1: - *addrl = ((*addrl) & 0xFF000000) | (piQxelXor[0] & 0xFFFFFF); - break; - case 2: - *addrl++ = piQxelXor[0]; - *addrl = ((*addrl) & 0xFFFF0000) | (piQxelXor[1] & 0xFFFF); - break; - case 3: - *addrl++ = piQxelXor[0]; - *addrl++ = piQxelXor[1]; - *addrl = ((*addrl) & 0xFFFFFF00) | (piQxelXor[2] & 0xFF); - break; - } - } - else{ - if(rop == GXxor){ - switch(leftIndex){ - case 0: - break; - case 1: - *addrl++ ^= (piQxelXor[0]&0xFF000000); - *addrl++ ^= piQxelXor[1]; - *addrl++ ^= piQxelXor[2]; - break; - case 2: - *addrl++ ^= (piQxelXor[1]& 0xFFFF0000); - *addrl++ ^= piQxelXor[2]; - break; - case 3: - *addrl++ ^= (piQxelXor[2]& 0xFFFFFF00); - break; - } - while(nlmiddle--){ - *addrl++ ^= piQxelXor[0]; - *addrl++ ^= piQxelXor[1]; - *addrl++ ^= piQxelXor[2]; - } - switch(rightIndex){ - case 0: - break; - case 1: - *addrl ^= (piQxelXor[0]& 0xFFFFFF); - break; - case 2: - *addrl++ ^= piQxelXor[0]; - *addrl ^= (piQxelXor[1]&0xFFFF); - break; - case 3: - *addrl++ ^= piQxelXor[0]; - *addrl++ ^= piQxelXor[1]; - *addrl ^= (piQxelXor[2]&0xFF); - break; - } - } - else{ - switch(leftIndex){ - case 0: - break; - case 1: - *addrl = DoMaskRRop (*addrl, piQxelAnd[0], piQxelXor[0], 0xFF000000); - addrl++; - *addrl = DoRRop (*addrl, piQxelAnd[1], piQxelXor[1]); - addrl++; - *addrl = DoRRop (*addrl, piQxelAnd[2], piQxelXor[2]); - addrl++; - break; - case 2: - *addrl = DoMaskRRop (*addrl, piQxelAnd[1], piQxelXor[1], 0xFFFF0000); - addrl++; - *addrl = DoRRop (*addrl, piQxelAnd[2], piQxelXor[2]); - addrl++; - break; - case 3: - *addrl = DoMaskRRop (*addrl, piQxelAnd[2], piQxelXor[2], 0xFFFFFF00); - addrl++; - break; - } - while(nlmiddle--){ - *addrl = DoRRop (*addrl, piQxelAnd[0], piQxelXor[0]); - addrl++; - *addrl = DoRRop (*addrl, piQxelAnd[1], piQxelXor[1]); - addrl++; - *addrl = DoRRop (*addrl, piQxelAnd[2], piQxelXor[2]); - addrl++; - } - switch(rightIndex){ - case 0: - break; - case 1: - *addrl = DoMaskRRop (*addrl, piQxelAnd[0], piQxelXor[0], 0xFFFFFF); - addrl++; - break; - case 2: - *addrl = DoRRop (*addrl, piQxelAnd[0], piQxelXor[0]); - addrl++; - *addrl = DoMaskRRop (*addrl, piQxelAnd[1], piQxelXor[1], 0xFFFF); - break; - case 3: - *addrl = DoRRop (*addrl, piQxelAnd[0], piQxelXor[0]); - addrl++; - *addrl = DoRRop (*addrl, piQxelAnd[1], piQxelXor[1]); - addrl++; - *addrl = DoMaskRRop (*addrl, piQxelAnd[2], piQxelXor[2], 0xFF); - break; - } - - } - } - } - } -#else - register CfbBits startmask; - register CfbBits endmask; - - addrl = addrl + (y1 * nlwidth) + (x1 >> PWSH); - - /* all bits inside same longword */ - if ( ((x1 & PIM) + len) < PPW) - { - maskpartialbits(x1, len, startmask); - *addrl = DoMaskRRop (*addrl, and, xor, startmask); - } - else - { - maskbits(x1, len, startmask, endmask, nlmiddle); - if (rop == GXcopy) - { - if (startmask) - { - *addrl = (*addrl & ~startmask) | (xor & startmask); - addrl++; - } - while (nlmiddle--) - *addrl++ = xor; - if (endmask) - *addrl = (*addrl & ~endmask) | (xor & endmask); - } - else - { - if (startmask) - { - *addrl = DoMaskRRop (*addrl, and, xor, startmask); - addrl++; - } - if (rop == GXxor) - { - while (nlmiddle--) - *addrl++ ^= xor; - } - else - { - while (nlmiddle--) - { - *addrl = DoRRop (*addrl, and, xor); - addrl++; - } - } - if (endmask) - *addrl = DoMaskRRop (*addrl, and, xor, endmask); - } - } -#endif -} - -/* vertical solid line */ - -void -cfbVertS(rop, and, xor, addrl, nlwidth, x1, y1, len) -int rop; -register CfbBits and, xor; -register CfbBits *addrl; /* pointer to base of bitmap */ -register int nlwidth; /* width in longwords of bitmap */ -int x1, y1; /* initial point */ -register int len; /* length of line */ -{ -#if PSZ == 24 - int xIdx; - CfbBits and2 = 0, xor2 = 0, mask = 0, mask2; -#endif -#ifdef PIXEL_ADDR - register PixelType *bits = (PixelType *) addrl; - -#if PSZ == 24 - nlwidth <<= PWSH; - xIdx = x1 & 3; - bits = (PixelType *)(addrl + (y1 * nlwidth) + ((x1*3) >> 2)); -#else - nlwidth <<= PWSH; - bits = bits + (y1 * nlwidth) + x1; -#endif -#if PSZ == 24 - mask2 = 0; - switch(xIdx){ - case 0: - mask = 0xFF000000; - xor &= 0xFFFFFF; - and |= 0xFF000000; - break; - case 3: - mask = 0xFF; - xor &= 0xFFFFFF; - xor <<= 8; - and <<= 8; - and |= 0xFF; - break; - case 1: - mask = 0xFFFFFF; - mask2 = 0xFFFF0000; - xor2 = (xor>>8) & 0xFFFF; - xor &= 0xFF; - xor <<= 24; - and2 = (and >> 8 ) | 0xFFFF0000; - and <<= 24; - and |= 0xFFFFFF; - break; - case 2: - mask = 0x0000FFFF; - mask2 = 0xFFFFFF00; - xor2 = (xor >> 16) & 0xFF; - xor <<= 16; - xor &= 0xFFFF0000; - and2 = (and >> 16) | 0xFFFFFF00; - and <<= 16; - and |= 0xFFFF; - break; - } -#endif - - /* - * special case copy and xor to avoid a test per pixel - */ - if (rop == GXcopy) - { -#if PSZ == 24 - switch(xIdx){ - case 0: - case 3: - while (len--){ - *bits = (*bits & mask)| xor; - bits += nlwidth; - } - break; - case 1: - case 2: - while (len--){ - *bits = (*bits & mask)| xor; - bits++; - *bits = (*bits & mask2)| xor2; - bits--; - bits += nlwidth; - } - break; - } -#else - while (len--) - { - *bits = xor; - bits += nlwidth; - } -#endif - } - else if (rop == GXxor) - { -#if PSZ == 24 - switch(xIdx){ - case 0: - case 3: - while (len--){ - *bits ^= xor; - bits += nlwidth; - } - break; - case 1: - case 2: - while (len--){ - *bits ^= xor; - bits++; - *bits ^= xor2; - bits--; - bits += nlwidth; - } - break; - } -#else - while (len--) - { - *bits ^= xor; - bits += nlwidth; - } -#endif - } - else - { -#if PSZ == 24 - switch(xIdx){ - case 0: - while (len--){ - *bits = DoMaskRRop(*bits, and, xor, 0x00FFFFFF); - bits += nlwidth; - } - break; - case 3: - while (len--){ - *bits = DoMaskRRop(*bits, and, xor, 0xFFFFFF00); - bits += nlwidth; - } - break; - case 1: - while (len--){ - *bits = DoMaskRRop(*bits, and, xor, 0xFF000000); - bits++; - *bits = DoMaskRRop(*bits, and2, xor2, 0x0000FFFF); - bits--; - bits += nlwidth; - } - break; - case 2: - while (len--){ - *bits = DoMaskRRop(*bits, and, xor, 0xFFFF0000); - bits++; - *bits = DoMaskRRop(*bits, and2, xor2, 0x000000FF); - bits--; - bits += nlwidth; - } - break; - } -#else - while (len--) - { - *bits = DoRRop(*bits, and, xor); - bits += nlwidth; - } -#endif - } -#else /* !PIXEL_ADDR */ -#if PSZ == 24 - addrl = addrl + (y1 * nlwidth) + ((x1*3) >>2); - - and |= ~cfbmask[(x1 & 3)<<1]; - xor &= cfbmask[(x1 & 3)<<1]; -#else - addrl = addrl + (y1 * nlwidth) + (x1 >> PWSH); - - and |= ~cfbmask[x1 & PIM]; - xor &= cfbmask[x1 & PIM]; -#endif - - while (len--) - { - *addrl = DoRRop (*addrl, and, xor); - addrl += nlwidth; - } -#endif -} diff --git a/nx-X11/programs/Xserver/cfb/cfbigblt8.c b/nx-X11/programs/Xserver/cfb/cfbigblt8.c deleted file mode 100644 index 97356e8bd..000000000 --- a/nx-X11/programs/Xserver/cfb/cfbigblt8.c +++ /dev/null @@ -1,108 +0,0 @@ -/* - * $Xorg: cfbigblt8.c,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $ - * -Copyright 1990, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - * - * Author: Keith Packard, MIT X Consortium - */ - -/* $XFree86: xc/programs/Xserver/cfb/cfbigblt8.c,v 1.5 2001/10/28 03:33:01 tsi Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include -#include "mi.h" -#include "cfb.h" -#include -#include "dixfontstr.h" -#include "gcstruct.h" -#include "windowstr.h" -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "regionstr.h" -#include "cfbmskbits.h" -#include "cfb8bit.h" - -void -cfbImageGlyphBlt8 (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) - DrawablePtr pDrawable; - GCPtr pGC; - int x, y; - unsigned int nglyph; - CharInfoPtr *ppci; - pointer pglyphBase; -{ - ExtentInfoRec info; /* used by QueryGlyphExtents() */ - xRectangle backrect; - int fgPixel; - cfbPrivGC *priv; - - /* - * We can't avoid GC validations if calling mi functions. - */ - if ((pGC->ops->PolyFillRect == miPolyFillRect) || - (pGC->ops->PolyGlyphBlt == miPolyGlyphBlt)) - { - miImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase); - return; - } - - QueryGlyphExtents(pGC->font, ppci, (unsigned long)nglyph, &info); - - if (info.overallWidth >= 0) - { - backrect.x = x; - backrect.width = info.overallWidth; - } - else - { - backrect.x = x + info.overallWidth; - backrect.width = -info.overallWidth; - } - backrect.y = y - FONTASCENT(pGC->font); - backrect.height = FONTASCENT(pGC->font) + FONTDESCENT(pGC->font); - - priv = cfbGetGCPrivate(pGC); - - /* this code cheats by knowing that ValidateGC isn't - * necessary for PolyFillRect - */ - - fgPixel = pGC->fgPixel; - - pGC->fgPixel = pGC->bgPixel; - priv->xor = PFILL(pGC->bgPixel); - - (*pGC->ops->PolyFillRect) (pDrawable, pGC, 1, &backrect); - - pGC->fgPixel = fgPixel; - - priv->xor = PFILL(pGC->fgPixel); - - (*pGC->ops->PolyGlyphBlt) (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase); - -} diff --git a/nx-X11/programs/Xserver/cfb/cfbimage.c b/nx-X11/programs/Xserver/cfb/cfbimage.c deleted file mode 100644 index ce3909e63..000000000 --- a/nx-X11/programs/Xserver/cfb/cfbimage.c +++ /dev/null @@ -1,206 +0,0 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfbimage.c,v 1.12 2001/10/28 03:33:01 tsi Exp $ */ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $Xorg: cfbimage.c,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include "windowstr.h" -#include "pixmapstr.h" -#include "scrnintstr.h" -#include "gcstruct.h" -#include "cfb.h" -#include "cfbmskbits.h" -#include "servermd.h" -#include "mi.h" - -void -cfbPutImage(pDraw, pGC, depth, x, y, w, h, leftPad, format, pImage) - DrawablePtr pDraw; - GCPtr pGC; - int depth, x, y, w, h; - int leftPad; - int format; - char *pImage; -{ - PixmapPtr pPixmap; - - if ((w == 0) || (h == 0)) - return; - - if (format != XYPixmap) - { - pPixmap = GetScratchPixmapHeader(pDraw->pScreen, w+leftPad, h, depth, - BitsPerPixel(depth), PixmapBytePad(w+leftPad, depth), - (pointer)pImage); - if (!pPixmap) - return; - - pGC->fExpose = FALSE; - if (format == ZPixmap) - (void)(*pGC->ops->CopyArea)((DrawablePtr)pPixmap, pDraw, pGC, - leftPad, 0, w, h, x, y); - else - (void)(*pGC->ops->CopyPlane)((DrawablePtr)pPixmap, pDraw, pGC, - leftPad, 0, w, h, x, y, 1); - pGC->fExpose = TRUE; - FreeScratchPixmapHeader(pPixmap); - } - else - { - CfbBits oldFg, oldBg; - XID gcv[3]; - CfbBits oldPlanemask; - unsigned long i; - long bytesPer; - - depth = pGC->depth; - oldPlanemask = pGC->planemask; - oldFg = pGC->fgPixel; - oldBg = pGC->bgPixel; - gcv[0] = ~0L; - gcv[1] = 0; - DoChangeGC(pGC, GCForeground | GCBackground, gcv, 0); - bytesPer = (long)h * BitmapBytePad(w + leftPad); - - for (i = 1 << (depth-1); i != 0; i >>= 1, pImage += bytesPer) - { - if (i & oldPlanemask) - { - gcv[0] = i; - DoChangeGC(pGC, GCPlaneMask, gcv, 0); - ValidateGC(pDraw, pGC); - (*pGC->ops->PutImage)(pDraw, pGC, 1, x, y, w, h, leftPad, - XYBitmap, pImage); - } - } - gcv[0] = oldPlanemask; - gcv[1] = oldFg; - gcv[2] = oldBg; - DoChangeGC(pGC, GCPlaneMask | GCForeground | GCBackground, gcv, 0); - ValidateGC(pDraw, pGC); - } -} - -void -cfbGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine) - DrawablePtr pDrawable; - int sx, sy, w, h; - unsigned int format; - unsigned long planeMask; - char *pdstLine; -{ - BoxRec box; - DDXPointRec ptSrc; - RegionRec rgnDst; - ScreenPtr pScreen; - PixmapPtr pPixmap; - - if ((w == 0) || (h == 0)) - return; - if (pDrawable->bitsPerPixel == 1) - { - mfbGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine); - return; - } - pScreen = pDrawable->pScreen; - /* - * XFree86 DDX empties the root borderClip when the VT is - * switched away; this checks for that case - */ - if (!cfbDrawableEnabled (pDrawable)) - return; - if (format == ZPixmap) - { - pPixmap = GetScratchPixmapHeader(pScreen, w, h, - pDrawable->depth, pDrawable->bitsPerPixel, - PixmapBytePad(w,pDrawable->depth), (pointer)pdstLine); - if (!pPixmap) - return; - if ((planeMask & PMSK) != PMSK) - bzero((char *)pdstLine, pPixmap->devKind * h); - ptSrc.x = sx + pDrawable->x; - ptSrc.y = sy + pDrawable->y; - box.x1 = 0; - box.y1 = 0; - box.x2 = w; - box.y2 = h; - REGION_INIT(pScreen, &rgnDst, &box, 1); - cfbDoBitblt(pDrawable, (DrawablePtr)pPixmap, GXcopy, &rgnDst, - &ptSrc, planeMask); - REGION_UNINIT(pScreen, &rgnDst); - FreeScratchPixmapHeader(pPixmap); - } - else - { - -#if IMAGE_BYTE_ORDER == LSBFirst - - pPixmap = GetScratchPixmapHeader(pScreen, w, h, /*depth*/ 1, - /*bpp*/ 1, BitmapBytePad(w), (pointer)pdstLine); - if (!pPixmap) - return; - - ptSrc.x = sx + pDrawable->x; - ptSrc.y = sy + pDrawable->y; - box.x1 = 0; - box.y1 = 0; - box.x2 = w; - box.y2 = h; - REGION_INIT(pScreen, &rgnDst, &box, 1); - cfbCopyImagePlane (pDrawable, (DrawablePtr)pPixmap, GXcopy, &rgnDst, - &ptSrc, planeMask); - REGION_UNINIT(pScreen, &rgnDst); - FreeScratchPixmapHeader(pPixmap); -#else - miGetImage (pDrawable, sx, sy, w, h, format, planeMask, pdstLine); -#endif - } -} diff --git a/nx-X11/programs/Xserver/cfb/cfbline.c b/nx-X11/programs/Xserver/cfb/cfbline.c deleted file mode 100644 index 392fe483e..000000000 --- a/nx-X11/programs/Xserver/cfb/cfbline.c +++ /dev/null @@ -1,757 +0,0 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfbline.c,v 3.5 2001/10/28 03:33:01 tsi Exp $ */ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $Xorg: cfbline.c,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $ */ -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include - -#include "gcstruct.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "regionstr.h" -#include "scrnintstr.h" -#include "mistruct.h" - -#include "cfb.h" -#include "cfbmskbits.h" -#include "miline.h" - -/* single-pixel lines on a color frame buffer - - NON-SLOPED LINES - horizontal lines are always drawn left to right; we have to -move the endpoints right by one after they're swapped. - horizontal lines will be confined to a single band of a -region. the code finds that band (giving up if the lower -bound of the band is above the line we're drawing); then it -finds the first box in that band that contains part of the -line. we clip the line to subsequent boxes in that band. - vertical lines are always drawn top to bottom (y-increasing.) -this requires adding one to the y-coordinate of each endpoint -after swapping. - - SLOPED LINES - when clipping a sloped line, we bring the second point inside -the clipping box, rather than one beyond it, and then add 1 to -the length of the line before drawing it. this lets us use -the same box for finding the outcodes for both endpoints. since -the equation for clipping the second endpoint to an edge gives us -1 beyond the edge, we then have to move the point towards the -first point by one step on the major axis. - eventually, there will be a diagram here to explain what's going -on. the method uses Cohen-Sutherland outcodes to determine -outsideness, and a method similar to Pike's layers for doing the -actual clipping. - -*/ - -void -#ifdef POLYSEGMENT -cfbSegmentSS (pDrawable, pGC, nseg, pSeg) - DrawablePtr pDrawable; - GCPtr pGC; - int nseg; - register xSegment *pSeg; -#else -cfbLineSS (pDrawable, pGC, mode, npt, pptInit) - DrawablePtr pDrawable; - GCPtr pGC; - int mode; /* Origin or Previous */ - int npt; /* number of points */ - DDXPointPtr pptInit; -#endif -{ - int nboxInit; - register int nbox; - BoxPtr pboxInit; - register BoxPtr pbox; -#ifndef POLYSEGMENT - register DDXPointPtr ppt; /* pointer to list of translated points */ -#endif - - unsigned int oc1; /* outcode of point 1 */ - unsigned int oc2; /* outcode of point 2 */ - - CfbBits *addrl; /* address of destination pixmap */ - int nlwidth; /* width in longwords of destination pixmap */ - int xorg, yorg; /* origin of window */ - - int adx; /* abs values of dx and dy */ - int ady; - int signdx; /* sign of dx and dy */ - int signdy; - int e, e1, e2; /* bresenham error and increments */ - int len; /* length of segment */ - int axis; /* major axis */ - int octant; - unsigned int bias = miGetZeroLineBias(pDrawable->pScreen); - - /* a bunch of temporaries */ - int tmp; - register int y1, y2; - register int x1, x2; - RegionPtr cclip; - cfbPrivGCPtr devPriv; - CfbBits xor, and; - int alu; - - devPriv = cfbGetGCPrivate(pGC); - cclip = pGC->pCompositeClip; - pboxInit = REGION_RECTS(cclip); - nboxInit = REGION_NUM_RECTS(cclip); - - cfbGetLongWidthAndPointer (pDrawable, nlwidth, addrl) - - alu = devPriv->rop; - xor = devPriv->xor; - and = devPriv->and; - xorg = pDrawable->x; - yorg = pDrawable->y; -#ifdef POLYSEGMENT - while (nseg--) -#else - ppt = pptInit; - x2 = ppt->x + xorg; - y2 = ppt->y + yorg; - while(--npt) -#endif - { - nbox = nboxInit; - pbox = pboxInit; - -#ifdef POLYSEGMENT - x1 = pSeg->x1 + xorg; - y1 = pSeg->y1 + yorg; - x2 = pSeg->x2 + xorg; - y2 = pSeg->y2 + yorg; - pSeg++; -#else - x1 = x2; - y1 = y2; - ++ppt; - if (mode == CoordModePrevious) - { - xorg = x1; - yorg = y1; - } - x2 = ppt->x + xorg; - y2 = ppt->y + yorg; -#endif - - if (x1 == x2) /* vertical line */ - { - /* make the line go top to bottom of screen, keeping - endpoint semantics - */ - if (y1 > y2) - { - register int tmp; - - tmp = y2; - y2 = y1 + 1; - y1 = tmp + 1; -#ifdef POLYSEGMENT - if (pGC->capStyle != CapNotLast) - y1--; -#endif - } -#ifdef POLYSEGMENT - else if (pGC->capStyle != CapNotLast) - y2++; -#endif - /* get to first band that might contain part of line */ - while ((nbox) && (pbox->y2 <= y1)) - { - pbox++; - nbox--; - } - - if (nbox) - { - /* stop when lower edge of box is beyond end of line */ - while((nbox) && (y2 >= pbox->y1)) - { - if ((x1 >= pbox->x1) && (x1 < pbox->x2)) - { - int y1t, y2t; - /* this box has part of the line in it */ - y1t = max(y1, pbox->y1); - y2t = min(y2, pbox->y2); - if (y1t != y2t) - { - cfbVertS (alu, and, xor, - addrl, nlwidth, - x1, y1t, y2t-y1t); - } - } - nbox--; - pbox++; - } - } -#ifndef POLYSEGMENT - y2 = ppt->y + yorg; -#endif - } - else if (y1 == y2) /* horizontal line */ - { - /* force line from left to right, keeping - endpoint semantics - */ - if (x1 > x2) - { - register int tmp; - - tmp = x2; - x2 = x1 + 1; - x1 = tmp + 1; -#ifdef POLYSEGMENT - if (pGC->capStyle != CapNotLast) - x1--; -#endif - } -#ifdef POLYSEGMENT - else if (pGC->capStyle != CapNotLast) - x2++; -#endif - - /* find the correct band */ - while( (nbox) && (pbox->y2 <= y1)) - { - pbox++; - nbox--; - } - - /* try to draw the line, if we haven't gone beyond it */ - if ((nbox) && (pbox->y1 <= y1)) - { - /* when we leave this band, we're done */ - tmp = pbox->y1; - while((nbox) && (pbox->y1 == tmp)) - { - int x1t, x2t; - - if (pbox->x2 <= x1) - { - /* skip boxes until one might contain start point */ - nbox--; - pbox++; - continue; - } - - /* stop if left of box is beyond right of line */ - if (pbox->x1 >= x2) - { - nbox = 0; - break; - } - - x1t = max(x1, pbox->x1); - x2t = min(x2, pbox->x2); - if (x1t != x2t) - { - cfbHorzS (alu, and, xor, - addrl, nlwidth, - x1t, y1, x2t-x1t); - } - nbox--; - pbox++; - } - } -#ifndef POLYSEGMENT - x2 = ppt->x + xorg; -#endif - } - else /* sloped line */ - { - CalcLineDeltas(x1, y1, x2, y2, adx, ady, signdx, signdy, - 1, 1, octant); - - if (adx > ady) - { - axis = X_AXIS; - e1 = ady << 1; - e2 = e1 - (adx << 1); - e = e1 - adx; - } - else - { - axis = Y_AXIS; - e1 = adx << 1; - e2 = e1 - (ady << 1); - e = e1 - ady; - SetYMajorOctant(octant); - } - - FIXUP_ERROR(e, octant, bias); - - /* we have bresenham parameters and two points. - all we have to do now is clip and draw. - */ - - while(nbox--) - { - oc1 = 0; - oc2 = 0; - OUTCODES(oc1, x1, y1, pbox); - OUTCODES(oc2, x2, y2, pbox); - if ((oc1 | oc2) == 0) - { - if (axis == X_AXIS) - len = adx; - else - len = ady; -#ifdef POLYSEGMENT - if (pGC->capStyle != CapNotLast) - len++; -#endif - cfbBresS (alu, and, xor, - addrl, nlwidth, - signdx, signdy, axis, x1, y1, - e, e1, e2, len); - break; - } - else if (oc1 & oc2) - { - pbox++; - } - else - { - int new_x1 = x1, new_y1 = y1, new_x2 = x2, new_y2 = y2; - int clip1 = 0, clip2 = 0; - int clipdx, clipdy; - int err; - - if (miZeroClipLine(pbox->x1, pbox->y1, pbox->x2-1, - pbox->y2-1, - &new_x1, &new_y1, &new_x2, &new_y2, - adx, ady, &clip1, &clip2, - octant, bias, oc1, oc2) == -1) - { - pbox++; - continue; - } - - if (axis == X_AXIS) - len = abs(new_x2 - new_x1); - else - len = abs(new_y2 - new_y1); -#ifdef POLYSEGMENT - if (clip2 != 0 || pGC->capStyle != CapNotLast) - len++; -#else - len += (clip2 != 0); -#endif - if (len) - { - /* unwind bresenham error term to first point */ - if (clip1) - { - clipdx = abs(new_x1 - x1); - clipdy = abs(new_y1 - y1); - if (axis == X_AXIS) - err = e+((clipdy*e2) + ((clipdx-clipdy)*e1)); - else - err = e+((clipdx*e2) + ((clipdy-clipdx)*e1)); - } - else - err = e; - cfbBresS(alu, and, xor, - addrl, nlwidth, - signdx, signdy, axis, new_x1, new_y1, - err, e1, e2, len); - } - pbox++; - } - } /* while (nbox--) */ - } /* sloped line */ - } /* while (nline--) */ - -#ifndef POLYSEGMENT - /* paint the last point if the end style isn't CapNotLast. - (Assume that a projecting, butt, or round cap that is one - pixel wide is the same as the single pixel of the endpoint.) - */ - - if ((pGC->capStyle != CapNotLast) && - ((ppt->x + xorg != pptInit->x + pDrawable->x) || - (ppt->y + yorg != pptInit->y + pDrawable->y) || - (ppt == pptInit + 1))) - { - nbox = nboxInit; - pbox = pboxInit; - while (nbox--) - { - if ((x2 >= pbox->x1) && - (y2 >= pbox->y1) && - (x2 < pbox->x2) && - (y2 < pbox->y2)) - { - CfbBits mask; - CfbBits scrbits; - -#if PSZ == 24 - mask = cfbmask[(x2 & 3)<<1]; - addrl += (y2 * nlwidth) + ((x2*3) >> 2); -#else - mask = cfbmask[x2 & PIM]; - addrl += (y2 * nlwidth) + (x2 >> PWSH); -#endif - scrbits = *addrl; - *addrl = (scrbits & ~mask) | - (DoRRop (scrbits, and, xor) & mask); - break; - } - else - pbox++; - } - } -#endif -} - -/* - * Draw dashed 1-pixel lines. - */ - -void -#ifdef POLYSEGMENT -cfbSegmentSD (pDrawable, pGC, nseg, pSeg) - DrawablePtr pDrawable; - register GCPtr pGC; - int nseg; - register xSegment *pSeg; -#else -cfbLineSD( pDrawable, pGC, mode, npt, pptInit) - DrawablePtr pDrawable; - register GCPtr pGC; - int mode; /* Origin or Previous */ - int npt; /* number of points */ - DDXPointPtr pptInit; -#endif -{ - int nboxInit; - register int nbox; - BoxPtr pboxInit; - register BoxPtr pbox; -#ifndef POLYSEGMENT - register DDXPointPtr ppt; /* pointer to list of translated points */ -#endif - - register unsigned int oc1; /* outcode of point 1 */ - register unsigned int oc2; /* outcode of point 2 */ - - CfbBits *addrl; /* address of destination pixmap */ - int nlwidth; /* width in longwords of destination pixmap */ - int xorg, yorg; /* origin of window */ - - int adx; /* abs values of dx and dy */ - int ady; - int signdx; /* sign of dx and dy */ - int signdy; - int e, e1, e2; /* bresenham error and increments */ - int len; /* length of segment */ - int axis; /* major axis */ - int octant; - unsigned int bias = miGetZeroLineBias(pDrawable->pScreen); - int x1, x2, y1, y2; - RegionPtr cclip; - cfbRRopRec rrops[2]; - unsigned char *pDash; - int dashOffset; - int numInDashList; - int dashIndex; - int isDoubleDash; - int dashIndexTmp, dashOffsetTmp; - int unclippedlen; - cfbPrivGCPtr devPriv; - - devPriv = cfbGetGCPrivate(pGC); - cclip = pGC->pCompositeClip; - rrops[0].rop = devPriv->rop; - rrops[0].and = devPriv->and; - rrops[0].xor = devPriv->xor; - if (pGC->alu == GXcopy) - { - rrops[1].rop = GXcopy; - rrops[1].and = 0; - rrops[1].xor = PFILL (pGC->bgPixel); - } - else - { - rrops[1].rop = cfbReduceRasterOp (pGC->alu, - pGC->bgPixel, pGC->planemask, - &rrops[1].and, &rrops[1].xor); - } - pboxInit = REGION_RECTS(cclip); - nboxInit = REGION_NUM_RECTS(cclip); - - cfbGetLongWidthAndPointer (pDrawable, nlwidth, addrl) - - /* compute initial dash values */ - - pDash = (unsigned char *) pGC->dash; - numInDashList = pGC->numInDashList; - isDoubleDash = (pGC->lineStyle == LineDoubleDash); - dashIndex = 0; - dashOffset = 0; - miStepDash ((int)pGC->dashOffset, &dashIndex, pDash, - numInDashList, &dashOffset); - - xorg = pDrawable->x; - yorg = pDrawable->y; -#ifdef POLYSEGMENT - while (nseg--) -#else - ppt = pptInit; - x2 = ppt->x + xorg; - y2 = ppt->y + yorg; - while(--npt) -#endif - { - nbox = nboxInit; - pbox = pboxInit; - -#ifdef POLYSEGMENT - x1 = pSeg->x1 + xorg; - y1 = pSeg->y1 + yorg; - x2 = pSeg->x2 + xorg; - y2 = pSeg->y2 + yorg; - pSeg++; -#else - x1 = x2; - y1 = y2; - ++ppt; - if (mode == CoordModePrevious) - { - xorg = x1; - yorg = y1; - } - x2 = ppt->x + xorg; - y2 = ppt->y + yorg; -#endif - - CalcLineDeltas(x1, y1, x2, y2, adx, ady, signdx, signdy, 1, 1, octant); - - if (adx > ady) - { - axis = X_AXIS; - e1 = ady << 1; - e2 = e1 - (adx << 1); - e = e1 - adx; - unclippedlen = adx; - } - else - { - axis = Y_AXIS; - e1 = adx << 1; - e2 = e1 - (ady << 1); - e = e1 - ady; - unclippedlen = ady; - SetYMajorOctant(octant); - } - - FIXUP_ERROR(e, octant, bias); - - /* we have bresenham parameters and two points. - all we have to do now is clip and draw. - */ - - while(nbox--) - { - oc1 = 0; - oc2 = 0; - OUTCODES(oc1, x1, y1, pbox); - OUTCODES(oc2, x2, y2, pbox); - if ((oc1 | oc2) == 0) - { -#ifdef POLYSEGMENT - if (pGC->capStyle != CapNotLast) - unclippedlen++; - dashIndexTmp = dashIndex; - dashOffsetTmp = dashOffset; - cfbBresD (rrops, - &dashIndexTmp, pDash, numInDashList, - &dashOffsetTmp, isDoubleDash, - addrl, nlwidth, - signdx, signdy, axis, x1, y1, - e, e1, e2, unclippedlen); - break; -#else - cfbBresD (rrops, - &dashIndex, pDash, numInDashList, - &dashOffset, isDoubleDash, - addrl, nlwidth, - signdx, signdy, axis, x1, y1, - e, e1, e2, unclippedlen); - goto dontStep; -#endif - } - else if (oc1 & oc2) - { - pbox++; - } - else /* have to clip */ - { - int new_x1 = x1, new_y1 = y1, new_x2 = x2, new_y2 = y2; - int clip1 = 0, clip2 = 0; - int clipdx, clipdy; - int err; - - if (miZeroClipLine(pbox->x1, pbox->y1, pbox->x2-1, - pbox->y2-1, - &new_x1, &new_y1, &new_x2, &new_y2, - adx, ady, &clip1, &clip2, - octant, bias, oc1, oc2) == -1) - { - pbox++; - continue; - } - - dashIndexTmp = dashIndex; - dashOffsetTmp = dashOffset; - - if (clip1) - { - int dlen; - - if (axis == X_AXIS) - dlen = abs(new_x1 - x1); - else - dlen = abs(new_y1 - y1); - miStepDash (dlen, &dashIndexTmp, pDash, - numInDashList, &dashOffsetTmp); - } - - if (axis == X_AXIS) - len = abs(new_x2 - new_x1); - else - len = abs(new_y2 - new_y1); -#ifdef POLYSEGMENT - if (clip2 != 0 || pGC->capStyle != CapNotLast) - len++; -#else - len += (clip2 != 0); -#endif - if (len) - { - /* unwind bresenham error term to first point */ - if (clip1) - { - clipdx = abs(new_x1 - x1); - clipdy = abs(new_y1 - y1); - if (axis == X_AXIS) - err = e+((clipdy*e2) + ((clipdx-clipdy)*e1)); - else - err = e+((clipdx*e2) + ((clipdy-clipdx)*e1)); - } - else - err = e; - cfbBresD (rrops, - &dashIndexTmp, pDash, numInDashList, - &dashOffsetTmp, isDoubleDash, - addrl, nlwidth, - signdx, signdy, axis, new_x1, new_y1, - err, e1, e2, len); - } - pbox++; - } - } /* while (nbox--) */ -#ifndef POLYSEGMENT - /* - * walk the dash list around to the next line - */ - miStepDash (unclippedlen, &dashIndex, pDash, - numInDashList, &dashOffset); -dontStep: ; -#endif - } /* while (nline--) */ - -#ifndef POLYSEGMENT - /* paint the last point if the end style isn't CapNotLast. - (Assume that a projecting, butt, or round cap that is one - pixel wide is the same as the single pixel of the endpoint.) - */ - - if ((pGC->capStyle != CapNotLast) && - ((dashIndex & 1) == 0 || isDoubleDash) && - ((ppt->x + xorg != pptInit->x + pDrawable->x) || - (ppt->y + yorg != pptInit->y + pDrawable->y) || - (ppt == pptInit + 1))) - { - nbox = nboxInit; - pbox = pboxInit; - while (nbox--) - { - if ((x2 >= pbox->x1) && - (y2 >= pbox->y1) && - (x2 < pbox->x2) && - (y2 < pbox->y2)) - { - CfbBits mask; - int pix; - - pix = 0; - if (dashIndex & 1) - pix = 1; -#if PSZ == 24 - mask = cfbmask[(x2 & 3)<<1]; - addrl += (y2 * nlwidth) + ((x2 *3)>> 2); -#else - mask = cfbmask[x2 & PIM]; - addrl += (y2 * nlwidth) + (x2 >> PWSH); -#endif - *addrl = DoMaskRRop (*addrl, rrops[pix].and, rrops[pix].xor, mask); - break; - } - else - pbox++; - } - } -#endif -} diff --git a/nx-X11/programs/Xserver/cfb/cfbmap.h b/nx-X11/programs/Xserver/cfb/cfbmap.h deleted file mode 100644 index 802517aac..000000000 --- a/nx-X11/programs/Xserver/cfb/cfbmap.h +++ /dev/null @@ -1,344 +0,0 @@ -/* - * $Xorg: cfbmap.h,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $ - * -Copyright 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - * - * Author: Keith Packard, MIT X Consortium - */ - -/* $XFree86: xc/programs/Xserver/cfb/cfbmap.h,v 3.11tsi Exp $ */ - -/* - * Map names around so that multiple depths can be supported simultaneously - */ - -#if 0 -#undef QuartetBitsTable -#undef QuartetPixelMaskTable -#undef cfb8ClippedLineCopy -#undef cfb8ClippedLineGeneral -#undef cfb8ClippedLineXor -#undef cfb8LineSS1Rect -#undef cfb8LineSS1RectCopy -#undef cfb8LineSS1RectGeneral -#undef cfb8LineSS1RectPreviousCopy -#undef cfb8LineSS1RectXor -#undef cfb8SegmentSS1Rect -#undef cfb8SegmentSS1RectCopy -#undef cfb8SegmentSS1RectGeneral -#undef cfb8SegmentSS1RectShiftCopy -#undef cfb8SegmentSS1RectXor -#undef cfbAllocatePrivates -#undef cfbBSFuncRec -#undef cfbBitBlt -#undef cfbBresD -#undef cfbBresS -#undef cfbChangeWindowAttributes -#undef cfbCloseScreen -#undef cfbCopyArea -#undef cfbCopyImagePlane -#undef cfbCopyPixmap -#undef cfbCopyPlane -#undef cfbCopyPlaneReduce -#undef cfbCopyRotatePixmap -#undef cfbCopyWindow -#undef cfbCreateGC -#undef cfbCreatePixmap -#undef cfbCreateScreenResources -#undef cfbCreateWindow -#undef cfbDestroyPixmap -#undef cfbDestroyWindow -#undef cfbDoBitblt -#undef cfbDoBitbltCopy -#undef cfbDoBitbltGeneral -#undef cfbDoBitbltOr -#undef cfbDoBitbltXor -#undef cfbFillBoxSolid -#undef cfbFillBoxTile32 -#undef cfbFillBoxTile32sCopy -#undef cfbFillBoxTile32sGeneral -#undef cfbFillBoxTileOdd -#undef cfbFillBoxTileOddCopy -#undef cfbFillBoxTileOddGeneral -#undef cfbFillPoly1RectCopy -#undef cfbFillPoly1RectGeneral -#undef cfbFillRectSolidCopy -#undef cfbFillRectSolidGeneral -#undef cfbFillRectSolidXor -#undef cfbFillRectTile32Copy -#undef cfbFillRectTile32General -#undef cfbFillRectTileOdd -#undef cfbFillSpanTile32sCopy -#undef cfbFillSpanTile32sGeneral -#undef cfbFillSpanTileOddCopy -#undef cfbFillSpanTileOddGeneral -#undef cfbFinishScreenInit -#undef cfbGCFuncs -#undef cfbGCPrivateIndex -#undef cfbGetImage -#undef cfbGetScreenPixmap -#undef cfbGetSpans -#undef cfbHorzS -#undef cfbImageGlyphBlt8 -#undef cfbInitializeColormap -#undef cfbInstallColormap -#undef cfbLineSD -#undef cfbLineSS -#undef cfbListInstalledColormaps -#undef cfbMapWindow -#undef cfbMatchCommon -#undef cfbNonTEOps -#undef cfbNonTEOps1Rect -#undef cfbPadPixmap -#undef cfbPaintWindow -#undef cfbPolyFillArcSolidCopy -#undef cfbPolyFillArcSolidGeneral -#undef cfbPolyFillRect -#undef cfbPolyGlyphBlt8 -#undef cfbPolyGlyphRop8 -#undef cfbPolyPoint -#undef cfbPositionWindow -#undef cfbPutImage -#undef cfbReduceRasterOp -#undef cfbResolveColor -#undef cfbRestoreAreas -#undef cfbSaveAreas -#undef cfbScreenInit -#undef cfbScreenPrivateIndex -#undef cfbSegmentSD -#undef cfbSegmentSS -#undef cfbSetScanline -#undef cfbSetScreenPixmap -#undef cfbSetSpans -#undef cfbSetupScreen -#undef cfbSolidSpansCopy -#undef cfbSolidSpansGeneral -#undef cfbSolidSpansXor -#undef cfbStippleStack -#undef cfbStippleStackTE -#undef cfbTEGlyphBlt -#undef cfbTEOps -#undef cfbTEOps1Rect -#undef cfbTile32FSCopy -#undef cfbTile32FSGeneral -#undef cfbUninstallColormap -#undef cfbUnmapWindow -#undef cfbUnnaturalStippleFS -#undef cfbUnnaturalTileFS -#undef cfbValidateGC -#undef cfbVertS -#undef cfbWindowPrivateIndex -#undef cfbXRotatePixmap -#undef cfbYRotatePixmap -#undef cfbZeroPolyArcSS8Copy -#undef cfbZeroPolyArcSS8General -#undef cfbZeroPolyArcSS8Xor -#undef cfbendpartial -#undef cfbendtab -#undef cfbmask -#undef cfbrmask -#undef cfbstartpartial -#undef cfbstarttab -#endif - -/* a losing vendor cpp dumps core if we define CFBNAME in terms of CATNAME */ - -#if PSZ != 8 - -#if PSZ == 32 -#if !defined(UNIXCPP) || defined(ANSICPP) -#define CFBNAME(subname) cfb32##subname -#else -#define CFBNAME(subname) cfb32/**/subname -#endif -#endif - -#if PSZ == 24 -#if !defined(UNIXCPP) || defined(ANSICPP) -#define CFBNAME(subname) cfb24##subname -#else -#define CFBNAME(subname) cfb24/**/subname -#endif -#endif - -#if PSZ == 16 -#if !defined(UNIXCPP) || defined(ANSICPP) -#define CFBNAME(subname) cfb16##subname -#else -#define CFBNAME(subname) cfb16/**/subname -#endif -#endif - -#if PSZ == 4 -#if !defined(UNIXCPP) || defined(ANSICPP) -#define CFBNAME(subname) cfb4##subname -#else -#define CFBNAME(subname) cfb4/**/subname -#endif -#endif - -#ifndef CFBNAME -cfb can not hack PSZ yet -#endif - -#undef CATNAME - -#if !defined(UNIXCPP) || defined(ANSICPP) -#define CATNAME(prefix,subname) prefix##subname -#else -#define CATNAME(prefix,subname) prefix/**/subname -#endif - -#define QuartetBitsTable CFBNAME(QuartetBitsTable) -#define QuartetPixelMaskTable CFBNAME(QuartetPixelMaskTable) -#define cfb8ClippedLineCopy CFBNAME(ClippedLineCopy) -#define cfb8ClippedLineGeneral CFBNAME(ClippedLineGeneral ) -#define cfb8ClippedLineXor CFBNAME(ClippedLineXor) -#define cfb8LineSS1Rect CFBNAME(LineSS1Rect) -#define cfb8LineSS1RectCopy CFBNAME(LineSS1RectCopy) -#define cfb8LineSS1RectGeneral CFBNAME(LineSS1RectGeneral ) -#define cfb8LineSS1RectPreviousCopy CFBNAME(LineSS1RectPreviousCopy) -#define cfb8LineSS1RectXor CFBNAME(LineSS1RectXor) -#define cfb8SegmentSS1Rect CFBNAME(SegmentSS1Rect) -#define cfb8SegmentSS1RectCopy CFBNAME(SegmentSS1RectCopy) -#define cfb8SegmentSS1RectGeneral CFBNAME(SegmentSS1RectGeneral ) -#define cfb8SegmentSS1RectShiftCopy CFBNAME(SegmentSS1RectShiftCopy) -#define cfb8SegmentSS1RectXor CFBNAME(SegmentSS1RectXor) -#define cfbAllocatePrivates CFBNAME(AllocatePrivates) -#define cfbBSFuncRec CFBNAME(BSFuncRec) -#define cfbBitBlt CFBNAME(BitBlt) -#define cfbBresD CFBNAME(BresD) -#define cfbBresS CFBNAME(BresS) -#define cfbChangeWindowAttributes CFBNAME(ChangeWindowAttributes) -#define cfbClearVisualTypes CFBNAME(cfbClearVisualTypes) -#define cfbCloseScreen CFBNAME(CloseScreen) -#define cfbCreateDefColormap CFBNAME (cfbCreateDefColormap) -#define cfbCopyArea CFBNAME(CopyArea) -#define cfbCopyImagePlane CFBNAME(CopyImagePlane) -#define cfbCopyPixmap CFBNAME(CopyPixmap) -#define cfbCopyPlane CFBNAME(CopyPlane) -#define cfbCopyPlaneReduce CFBNAME(CopyPlaneReduce) -#define cfbCopyRotatePixmap CFBNAME(CopyRotatePixmap) -#define cfbCopyWindow CFBNAME(CopyWindow) -#define cfbCreateGC CFBNAME(CreateGC) -#define cfbCreatePixmap CFBNAME(CreatePixmap) -#define cfbCreateScreenResources CFBNAME(CreateScreenResources) -#define cfbCreateWindow CFBNAME(CreateWindow) -#define cfbDestroyPixmap CFBNAME(DestroyPixmap) -#define cfbDestroyWindow CFBNAME(DestroyWindow) -#define cfbDoBitblt CFBNAME(DoBitblt) -#define cfbDoBitbltCopy CFBNAME(DoBitbltCopy) -#define cfbDoBitbltGeneral CFBNAME(DoBitbltGeneral) -#define cfbDoBitbltOr CFBNAME(DoBitbltOr) -#define cfbDoBitbltXor CFBNAME(DoBitbltXor) -#define cfbExpandDirectColors CFBNAME(cfbExpandDirectColors) -#define cfbFillBoxSolid CFBNAME(FillBoxSolid) -#define cfbFillBoxTile32 CFBNAME(FillBoxTile32) -#define cfbFillBoxTile32sCopy CFBNAME(FillBoxTile32sCopy) -#define cfbFillBoxTile32sGeneral CFBNAME(FillBoxTile32sGeneral) -#define cfbFillBoxTileOdd CFBNAME(FillBoxTileOdd) -#define cfbFillBoxTileOddCopy CFBNAME(FillBoxTileOddCopy) -#define cfbFillBoxTileOddGeneral CFBNAME(FillBoxTileOddGeneral) -#define cfbFillPoly1RectCopy CFBNAME(FillPoly1RectCopy) -#define cfbFillPoly1RectGeneral CFBNAME(FillPoly1RectGeneral) -#define cfbFillRectSolidCopy CFBNAME(FillRectSolidCopy) -#define cfbFillRectSolidGeneral CFBNAME(FillRectSolidGeneral) -#define cfbFillRectSolidXor CFBNAME(FillRectSolidXor) -#define cfbFillRectTile32Copy CFBNAME(FillRectTile32Copy) -#define cfbFillRectTile32General CFBNAME(FillRectTile32General) -#define cfbFillRectTileOdd CFBNAME(FillRectTileOdd) -#define cfbFillSpanTile32sCopy CFBNAME(FillSpanTile32sCopy) -#define cfbFillSpanTile32sGeneral CFBNAME(FillSpanTile32sGeneral) -#define cfbFillSpanTileOddCopy CFBNAME(FillSpanTileOddCopy) -#define cfbFillSpanTileOddGeneral CFBNAME(FillSpanTileOddGeneral) -#define cfbFinishScreenInit CFBNAME(FinishScreenInit) -#define cfbGCFuncs CFBNAME(GCFuncs) -#define cfbGCPrivateIndex CFBNAME(GCPrivateIndex) -#define cfbGetImage CFBNAME(GetImage) -#define cfbGetScreenPixmap CFBNAME(GetScreenPixmap) -#define cfbGetSpans CFBNAME(GetSpans) -#define cfbHorzS CFBNAME(HorzS) -#define cfbImageGlyphBlt8 CFBNAME(ImageGlyphBlt8) -#define cfbInitializeColormap CFBNAME(InitializeColormap) -#define cfbInitVisuals CFBNAME(cfbInitVisuals) -#define cfbInstallColormap CFBNAME(InstallColormap) -#define cfbLineSD CFBNAME(LineSD) -#define cfbLineSS CFBNAME(LineSS) -#define cfbListInstalledColormaps CFBNAME(ListInstalledColormaps) -#define cfbMapWindow CFBNAME(MapWindow) -#define cfbMatchCommon CFBNAME(MatchCommon) -#define cfbNonTEOps CFBNAME(NonTEOps) -#define cfbNonTEOps1Rect CFBNAME(NonTEOps1Rect) -#define cfbPadPixmap CFBNAME(PadPixmap) -#define cfbPaintWindow CFBNAME(PaintWindow) -#define cfbPolyFillArcSolidCopy CFBNAME(PolyFillArcSolidCopy) -#define cfbPolyFillArcSolidGeneral CFBNAME(PolyFillArcSolidGeneral) -#define cfbPolyFillRect CFBNAME(PolyFillRect) -#define cfbPolyGlyphBlt8 CFBNAME(PolyGlyphBlt8) -#define cfbPolyGlyphRop8 CFBNAME(PolyGlyphRop8) -#define cfbPolyPoint CFBNAME(PolyPoint) -#define cfbPositionWindow CFBNAME(PositionWindow) -#define cfbPutImage CFBNAME(PutImage) -#define cfbReduceRasterOp CFBNAME(ReduceRasterOp) -#define cfbResolveColor CFBNAME(ResolveColor) -#define cfbRestoreAreas CFBNAME(RestoreAreas) -#define cfbSaveAreas CFBNAME(SaveAreas) -#define cfbScreenInit CFBNAME(ScreenInit) -#define cfbScreenPrivateIndex CFBNAME(ScreenPrivateIndex) -#define cfbSegmentSD CFBNAME(SegmentSD) -#define cfbSegmentSS CFBNAME(SegmentSS) -#define cfbSetScanline CFBNAME(SetScanline) -#define cfbSetScreenPixmap CFBNAME(SetScreenPixmap) -#define cfbSetSpans CFBNAME(SetSpans) -#define cfbSetVisualTypes CFBNAME(cfbSetVisualTypes) -#define cfbSetupScreen CFBNAME(SetupScreen) -#define cfbSolidSpansCopy CFBNAME(SolidSpansCopy) -#define cfbSolidSpansGeneral CFBNAME(SolidSpansGeneral) -#define cfbSolidSpansXor CFBNAME(SolidSpansXor) -#define cfbStippleStack CFBNAME(StippleStack) -#define cfbStippleStackTE CFBNAME(StippleStackTE) -#define cfbTEGlyphBlt CFBNAME(TEGlyphBlt) -#define cfbTEOps CFBNAME(TEOps) -#define cfbTEOps1Rect CFBNAME(TEOps1Rect) -#define cfbTile32FSCopy CFBNAME(Tile32FSCopy) -#define cfbTile32FSGeneral CFBNAME(Tile32FSGeneral) -#define cfbUninstallColormap CFBNAME(UninstallColormap) -#define cfbUnmapWindow CFBNAME(UnmapWindow) -#define cfbUnnaturalStippleFS CFBNAME(UnnaturalStippleFS) -#define cfbUnnaturalTileFS CFBNAME(UnnaturalTileFS) -#define cfbValidateGC CFBNAME(ValidateGC) -#define cfbVertS CFBNAME(VertS) -#define cfbWindowPrivateIndex CFBNAME(WindowPrivateIndex) -#define cfbXRotatePixmap CFBNAME(XRotatePixmap) -#define cfbYRotatePixmap CFBNAME(YRotatePixmap) -#define cfbZeroPolyArcSS8Copy CFBNAME(ZeroPolyArcSSCopy) -#define cfbZeroPolyArcSS8General CFBNAME(ZeroPolyArcSSGeneral) -#define cfbZeroPolyArcSS8Xor CFBNAME(ZeroPolyArcSSXor) -#define cfbendpartial CFBNAME(endpartial) -#define cfbendtab CFBNAME(endtab) -#define cfbmask CFBNAME(mask) -#define cfbrmask CFBNAME(rmask) -#define cfbstartpartial CFBNAME(startpartial) -#define cfbstarttab CFBNAME(starttab) - -#endif /* PSZ != 8 */ diff --git a/nx-X11/programs/Xserver/cfb/cfbmodule.c b/nx-X11/programs/Xserver/cfb/cfbmodule.c deleted file mode 100644 index 095bc8416..000000000 --- a/nx-X11/programs/Xserver/cfb/cfbmodule.c +++ /dev/null @@ -1,65 +0,0 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfbmodule.c,v 1.8 1999/01/26 05:53:48 dawes Exp $ */ -/* - * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the XFree86 Project shall - * not be used in advertising or otherwise to promote the sale, use or other - * dealings in this Software without prior written authorization from the - * XFree86 Project. - */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#define PSZ 8 - -#ifdef XFree86LOADER - -#include "xf86Module.h" -#include "cfb.h" - -static MODULESETUPPROTO(cfbSetup); - -static XF86ModuleVersionInfo VersRec = -{ - "cfb", - MODULEVENDORSTRING, - MODINFOSTRING1, - MODINFOSTRING2, - XORG_VERSION_CURRENT, - 1, 0, 0, - ABI_CLASS_ANSIC, /* Only need the ansic layer */ - ABI_ANSIC_VERSION, - MOD_CLASS_NONE, - {0,0,0,0} /* signature, to be patched into the file by a tool */ -}; - -XF86ModuleData cfbModuleData = { &VersRec, cfbSetup, NULL }; - -static pointer -cfbSetup(pointer module, pointer opts, int *errmaj, int *errmin) -{ - /* This modules requires mfb, so load it */ - return LoadSubModule(module, "mfb", NULL, NULL, NULL, NULL, - errmaj, errmin); -} - -#endif diff --git a/nx-X11/programs/Xserver/cfb/cfbmskbits.c b/nx-X11/programs/Xserver/cfb/cfbmskbits.c deleted file mode 100644 index 05954e62c..000000000 --- a/nx-X11/programs/Xserver/cfb/cfbmskbits.c +++ /dev/null @@ -1,1402 +0,0 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfbmskbits.c,v 3.1 1998/10/04 09:37:46 dawes Exp $ */ -/************************************************************ -Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this -software and its documentation for any purpose and without -fee is hereby granted, provided that the above copyright no- -tice appear in all copies and that both that copyright no- -tice and this permission notice appear in supporting docu- -mentation, and that the names of Sun or The Open Group -not be used in advertising or publicity pertaining to -distribution of the software without specific prior -written permission. Sun and The Open Group make no -representations about the suitability of this software for -any purpose. It is provided "as is" without any express or -implied warranty. - -SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT- -NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE LI- -ABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR -PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH -THE USE OR PERFORMANCE OF THIS SOFTWARE. - -********************************************************/ - -/* $Xorg: cfbmskbits.c,v 1.3 2000/08/17 19:48:14 cpqbld Exp $ */ - -/* - * ========================================================================== - * Converted to Color Frame Buffer by smarks@sun, April-May 1987. The "bit - * numbering" in the doc below really means "byte numbering" now. - * ========================================================================== - */ - -/* - these tables are used by several macros in the cfb code. - - the vax numbers everything left to right, so bit indices on the -screen match bit indices in longwords. the pc-rt and Sun number -bits on the screen the way they would be written on paper, -(i.e. msb to the left), and so a bit index n on the screen is -bit index 32-n in a longword - - see also cfbmskbits.h -*/ -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include -#include "cfb.h" -#include "cfbmskbits.h" - -#define _cfbBits(a) (PixelGroup)(a) - -#if (BITMAP_BIT_ORDER == MSBFirst) -#define cfbBits(v) _cfbBits(v) -#else /* BITMAP_BIT_ORDER == LSBFirst */ -#define cfbFlip2(a) ((((a) & 0x1) << 1) | (((a) & 0x2) >> 1)) -#define cfbFlip4(a) ((cfbFlip2(a) << 2) | cfbFlip2(a >> 2)) -#define cfbFlip8(a) ((cfbFlip4(a) << 4) | cfbFlip4(a >> 4)) -#define cfbFlip16(a) ((cfbFlip8(a) << 8) | cfbFlip8(a >> 8)) -#define cfbFlip32(a) ((cfbFlip16(a) << 16) | cfbFlip16(a >> 16)) -#if PGSZ == 32 -#define cfbBits(a) cfbFlip32(_cfbBits(a)) -#else /* PGSZ == 64 */ -#define cfbFlip64(a) ((cfbFlip32(a) << 32) | cfbFlip32(a >> 32)) -#define cfbBits(a) cfbFlip64(_cfbBits(a)) -#endif /* PGSZ */ -#endif /* BITMAP_BIT_ORDER */ - -/* NOTE: -the first element in starttab could be 0xffffffff. making it 0 -lets us deal with a full first word in the middle loop, rather -than having to do the multiple reads and masks that we'd -have to do if we thought it was partial. -*/ -#if PSZ == 4 -#if PGSZ == 32 -PixelGroup cfbstarttab[] = - { - cfbBits(0x00000000), - cfbBits(0x0FFFFFFF), - cfbBits(0x00FFFFFF), - cfbBits(0x000FFFFF), - cfbBits(0x0000FFFF), - cfbBits(0x00000FFF), - cfbBits(0x000000FF), - cfbBits(0x0000000F) - }; -PixelGroup cfbendtab[] = - { - cfbBits(0x00000000), - cfbBits(0xF0000000), - cfbBits(0xFF000000), - cfbBits(0xFFF00000), - cfbBits(0xFFFF0000), - cfbBits(0xFFFFF000), - cfbBits(0xFFFFFF00), - cfbBits(0xFFFFFFF0) - }; -#else /* PGSZ == 64 */ -PixelGroup cfbstarttab[] = - { - cfbBits(0x0000000000000000), - cfbBits(0x0FFFFFFFFFFFFFFF), - cfbBits(0x00FFFFFFFFFFFFFF), - cfbBits(0x000FFFFFFFFFFFFF), - cfbBits(0x0000FFFFFFFFFFFF), - cfbBits(0x00000FFFFFFFFFFF), - cfbBits(0x000000FFFFFFFFFF), - cfbBits(0x0000000FFFFFFFFF), - cfbBits(0x00000000FFFFFFFF), - cfbBits(0x000000000FFFFFFF), - cfbBits(0x0000000000FFFFFF), - cfbBits(0x00000000000FFFFF), - cfbBits(0x000000000000FFFF), - cfbBits(0x0000000000000FFF), - cfbBits(0x00000000000000FF), - cfbBits(0x000000000000000F), - }; -PixelGroup cfbendtab[] = - { - cfbBits(0x0000000000000000), - cfbBits(0xF000000000000000), - cfbBits(0xFF00000000000000), - cfbBits(0xFFF0000000000000), - cfbBits(0xFFFF000000000000), - cfbBits(0xFFFFF00000000000), - cfbBits(0xFFFFFF0000000000), - cfbBits(0xFFFFFFF000000000), - cfbBits(0xFFFFFFFF00000000), - cfbBits(0xFFFFFFFFF0000000), - cfbBits(0xFFFFFFFFFF000000), - cfbBits(0xFFFFFFFFFFF00000), - cfbBits(0xFFFFFFFFFFFF0000), - cfbBits(0xFFFFFFFFFFFFF000), - cfbBits(0xFFFFFFFFFFFFFF00), - cfbBits(0xFFFFFFFFFFFFFFF0), - }; -#endif /* PGSZ */ -#endif /* PSZ == 4 */ - -#if PSZ == 8 -#if PGSZ == 32 -PixelGroup cfbstarttab[] = - { - cfbBits(0x00000000), - cfbBits(0x00FFFFFF), - cfbBits(0x0000FFFF), - cfbBits(0x000000FF) - }; -PixelGroup cfbendtab[] = - { - cfbBits(0x00000000), - cfbBits(0xFF000000), - cfbBits(0xFFFF0000), - cfbBits(0xFFFFFF00) - }; -#else /* PGSZ == 64 */ -PixelGroup cfbstarttab[] = - { - cfbBits(0x0000000000000000), - cfbBits(0x00FFFFFFFFFFFFFF), - cfbBits(0x0000FFFFFFFFFFFF), - cfbBits(0x000000FFFFFFFFFF), - cfbBits(0x00000000FFFFFFFF), - cfbBits(0x0000000000FFFFFF), - cfbBits(0x000000000000FFFF), - cfbBits(0x00000000000000FF) - }; -PixelGroup cfbendtab[] = - { - cfbBits(0x0000000000000000), - cfbBits(0xFF00000000000000), - cfbBits(0xFFFF000000000000), - cfbBits(0xFFFFFF0000000000), - cfbBits(0xFFFFFFFF00000000), - cfbBits(0xFFFFFFFFFF000000), - cfbBits(0xFFFFFFFFFFFF0000), - cfbBits(0xFFFFFFFFFFFFFF00) - }; -#endif /* PGSZ */ -#endif /* PSZ == 8 */ - -#if PSZ == 16 -#if PGSZ == 32 -PixelGroup cfbstarttab[] = - { - cfbBits(0x00000000), - cfbBits(0x0000FFFF), - }; -PixelGroup cfbendtab[] = - { - cfbBits(0x00000000), - cfbBits(0xFFFF0000), - }; -#else /* PGSZ == 64 */ -PixelGroup cfbstarttab[] = - { - cfbBits(0x0000000000000000), - cfbBits(0x0000FFFFFFFFFFFF), - cfbBits(0x00000000FFFFFFFF), - cfbBits(0x000000000000FFFF), - }; -PixelGroup cfbendtab[] = - { - cfbBits(0x0000000000000000), - cfbBits(0xFFFF000000000000), - cfbBits(0xFFFFFFFF00000000), - cfbBits(0xFFFFFFFFFFFF0000), - }; -#endif /* PGSZ */ -#endif - -#if PSZ == 24 -#if PGSZ == 32 -PixelGroup cfbstarttab[] = - { - cfbBits(0x00000000), - cfbBits(0x000000FF), - cfbBits(0x0000FFFF), - cfbBits(0x00FFFFFF), - }; -PixelGroup cfbendtab[] = - { - cfbBits(0x00000000), - cfbBits(0xFFFFFF00), - cfbBits(0xFFFF0000), - cfbBits(0xFF000000), - }; -#else /* PGSZ == 64 */ -PixelGroup cfbstarttab[] = - { - cfbBits(0x0000000000000000), - cfbBits(0x000000FFFFFFFFFF), - cfbBits(0x000000000000FFFF), - }; -PixelGroup cfbendtab[] = - { - cfbBits(0x0000000000000000), - cfbBits(0xFFFFFFFFFF000000), - cfbBits(0xFFFF000000000000), - }; -#endif /* PGSZ */ -#endif /* PSZ == 24 */ - -#if PSZ == 32 -#if PGSZ == 32 -PixelGroup cfbstarttab[] = - { - cfbBits(0x00000000), - }; -PixelGroup cfbendtab[] = - { - cfbBits(0x00000000), - }; -#else /* PGSZ == 64 */ -PixelGroup cfbstarttab[] = - { - cfbBits(0x0000000000000000), - cfbBits(0x00000000FFFFFFFF), - }; -PixelGroup cfbendtab[] = - { - cfbBits(0x0000000000000000), - cfbBits(0xFFFFFFFF00000000), - }; -#endif /* PGSZ */ -#endif /* PSZ == 32 */ - -/* a hack, for now, since the entries for 0 need to be all - 1 bits, not all zeros. - this means the code DOES NOT WORK for segments of length - 0 (which is only a problem in the horizontal line code.) -*/ -#if PSZ == 4 -#if PGSZ == 32 -PixelGroup cfbstartpartial[] = - { - cfbBits(0xFFFFFFFF), - cfbBits(0x0FFFFFFF), - cfbBits(0x00FFFFFF), - cfbBits(0x000FFFFF), - cfbBits(0x0000FFFF), - cfbBits(0x00000FFF), - cfbBits(0x000000FF), - cfbBits(0x0000000F) - }; - -PixelGroup cfbendpartial[] = - { - cfbBits(0xFFFFFFFF), - cfbBits(0xF0000000), - cfbBits(0xFF000000), - cfbBits(0xFFF00000), - cfbBits(0xFFFF0000), - cfbBits(0xFFFFF000), - cfbBits(0xFFFFFF00), - cfbBits(0xFFFFFFF0) - }; -#else /* PGSZ == 64 */ -PixelGroup cfbstartpartial[] = - { - cfbBits(0xFFFFFFFFFFFFFFFF), - cfbBits(0x0FFFFFFFFFFFFFFF), - cfbBits(0x00FFFFFFFFFFFFFF), - cfbBits(0x000FFFFFFFFFFFFF), - cfbBits(0x0000FFFFFFFFFFFF), - cfbBits(0x00000FFFFFFFFFFF), - cfbBits(0x000000FFFFFFFFFF), - cfbBits(0x0000000FFFFFFFFF), - cfbBits(0x00000000FFFFFFFF), - cfbBits(0x000000000FFFFFFF), - cfbBits(0x0000000000FFFFFF), - cfbBits(0x00000000000FFFFF), - cfbBits(0x000000000000FFFF), - cfbBits(0x0000000000000FFF), - cfbBits(0x00000000000000FF), - cfbBits(0x000000000000000F), - }; - -PixelGroup cfbendpartial[] = - { - cfbBits(0xFFFFFFFFFFFFFFFF), - cfbBits(0xF000000000000000), - cfbBits(0xFF00000000000000), - cfbBits(0xFFF0000000000000), - cfbBits(0xFFFF000000000000), - cfbBits(0xFFFFF00000000000), - cfbBits(0xFFFFFF0000000000), - cfbBits(0xFFFFFFF000000000), - cfbBits(0xFFFFFFFF00000000), - cfbBits(0xFFFFFFFFF0000000), - cfbBits(0xFFFFFFFFFF000000), - cfbBits(0xFFFFFFFFFFF00000), - cfbBits(0xFFFFFFFFFFFF0000), - cfbBits(0xFFFFFFFFFFFFF000), - cfbBits(0xFFFFFFFFFFFFFF00), - cfbBits(0xFFFFFFFFFFFFFFF0), - }; -#endif /* PGSZ */ -#endif /* PSZ == 4 */ - -#if PSZ == 8 -#if PGSZ == 32 -PixelGroup cfbstartpartial[] = - { - cfbBits(0xFFFFFFFF), - cfbBits(0x00FFFFFF), - cfbBits(0x0000FFFF), - cfbBits(0x000000FF) - }; - -PixelGroup cfbendpartial[] = - { - cfbBits(0xFFFFFFFF), - cfbBits(0xFF000000), - cfbBits(0xFFFF0000), - cfbBits(0xFFFFFF00) - }; -#else /* PGSZ == 64 */ -PixelGroup cfbstartpartial[] = - { - cfbBits(0xFFFFFFFFFFFFFFFF), - cfbBits(0x00FFFFFFFFFFFFFF), - cfbBits(0x0000FFFFFFFFFFFF), - cfbBits(0x000000FFFFFFFFFF), - cfbBits(0x00000000FFFFFFFF), - cfbBits(0x0000000000FFFFFF), - cfbBits(0x000000000000FFFF), - cfbBits(0x00000000000000FF), - }; - -PixelGroup cfbendpartial[] = - { - cfbBits(0xFFFFFFFFFFFFFFFF), - cfbBits(0xFF00000000000000), - cfbBits(0xFFFF000000000000), - cfbBits(0xFFFFFF0000000000), - cfbBits(0xFFFFFFFF00000000), - cfbBits(0xFFFFFFFFFF000000), - cfbBits(0xFFFFFFFFFFFF0000), - cfbBits(0xFFFFFFFFFFFFFF00), - }; -#endif /* PGSZ */ -#endif /* PSZ == 8 */ - -#if PSZ == 16 -#if PGSZ == 32 -PixelGroup cfbstartpartial[] = - { - cfbBits(0xFFFFFFFF), - cfbBits(0x0000FFFF), - }; - -PixelGroup cfbendpartial[] = - { - cfbBits(0xFFFFFFFF), - cfbBits(0xFFFF0000), - }; -#else /* PGSZ == 64 */ -PixelGroup cfbstartpartial[] = - { - cfbBits(0xFFFFFFFFFFFFFFFF), - cfbBits(0x0000FFFFFFFFFFFF), - cfbBits(0x00000000FFFFFFFF), - cfbBits(0x000000000000FFFF), - }; - -PixelGroup cfbendpartial[] = - { - cfbBits(0xFFFFFFFFFFFFFFFF), - cfbBits(0xFFFF000000000000), - cfbBits(0xFFFFFFFF00000000), - cfbBits(0xFFFFFFFFFFFF0000), - }; -#endif /* PGSZ */ -#endif /* PSZ == 16 */ - -#if PSZ == 24 -#if PGSZ == 32 -PixelGroup cfbstartpartial[] = - { - cfbBits(0xFFFFFFFF), - cfbBits(0x000000FF), - cfbBits(0x0000FFFF), - cfbBits(0x00FFFFFF), - }; - -PixelGroup cfbendpartial[] = - { - cfbBits(0xFFFFFFFF), - cfbBits(0xFFFFFF00), - cfbBits(0xFFFF0000), - cfbBits(0xFF000000), - }; -#else /* PGSZ == 64 */ -PixelGroup cfbstartpartial[] = - { - cfbBits(0xFFFFFFFFFFFFFFFF), - cfbBits(0x0000FFFFFFFFFFFF), - cfbBits(0x000000FFFFFFFFFF), - cfbBits(0x00000000FFFFFFFF), - cfbBits(0x0000000000FFFFFF), - cfbBits(0x000000000000FFFF), - cfbBits(0x00000000000000FF), - }; - -PixelGroup cfbendpartial[] = - { - cfbBits(0xFFFFFFFFFFFFFFFF), - cfbBits(0xFFFFFFFFFFFF0000), - cfbBits(0xFFFFFFFFFF000000), - cfbBits(0xFFFFFFFF00000000), - cfbBits(0xFFFFFF0000000000), - cfbBits(0xFFFF000000000000), - cfbBits(0xFF00000000000000), - }; -#endif /* PGSZ */ -#endif /* PSZ == 24 */ - -#if PSZ == 32 -#if PGSZ == 32 -PixelGroup cfbstartpartial[] = - { - cfbBits(0xFFFFFFFF), - }; - -PixelGroup cfbendpartial[] = - { - cfbBits(0xFFFFFFFF), - }; -#else /* PGSZ == 64 */ -PixelGroup cfbstartpartial[] = - { - cfbBits(0xFFFFFFFFFFFFFFFF), - cfbBits(0x00000000FFFFFFFF), - }; - -PixelGroup cfbendpartial[] = - { - cfbBits(0xFFFFFFFFFFFFFFFF), - cfbBits(0xFFFFFFFF00000000), - }; -#endif /* PGSZ */ -#endif /* PSZ == 32 */ - -/* used for masking bits in bresenham lines - mask[n] is used to mask out all but bit n in a longword (n is a -screen position). - rmask[n] is used to mask out the single bit at position n (n -is a screen posiotion.) -*/ - -#if PSZ == 4 -#if PGSZ == 32 -PixelGroup cfbmask[] = - { - cfbBits(0xF0000000), - cfbBits(0x0F000000), - cfbBits(0x00F00000), - cfbBits(0x000F0000), - cfbBits(0x0000F000), - cfbBits(0x00000F00), - cfbBits(0x000000F0), - cfbBits(0x0000000F) - }; -PixelGroup cfbrmask[] = - { - cfbBits(0x0FFFFFFF), - cfbBits(0xF0FFFFFF), - cfbBits(0xFF0FFFFF), - cfbBits(0xFFF0FFFF), - cfbBits(0xFFFF0FFF), - cfbBits(0xFFFFF0FF), - cfbBits(0xFFFFFF0F), - cfbBits(0xFFFFFFF0) - }; -#else /* PGSZ == 64 */ -PixelGroup cfbmask[] = - { - cfbBits(0xF000000000000000), - cfbBits(0x0F00000000000000), - cfbBits(0x00F0000000000000), - cfbBits(0x000F000000000000), - cfbBits(0x0000F00000000000), - cfbBits(0x00000F0000000000), - cfbBits(0x000000F000000000), - cfbBits(0x0000000F00000000), - cfbBits(0x00000000F0000000), - cfbBits(0x000000000F000000), - cfbBits(0x0000000000F00000), - cfbBits(0x00000000000F0000), - cfbBits(0x000000000000F000), - cfbBits(0x0000000000000F00), - cfbBits(0x00000000000000F0), - cfbBits(0x000000000000000F), - }; -PixelGroup cfbrmask[] = - { - cfbBits(0x0FFFFFFFFFFFFFFF), - cfbBits(0xF0FFFFFFFFFFFFFF), - cfbBits(0xFF0FFFFFFFFFFFFF), - cfbBits(0xFFF0FFFFFFFFFFFF), - cfbBits(0xFFFF0FFFFFFFFFFF), - cfbBits(0xFFFFF0FFFFFFFFFF), - cfbBits(0xFFFFFF0FFFFFFFFF), - cfbBits(0xFFFFFFF0FFFFFFFF), - cfbBits(0xFFFFFFFF0FFFFFFF), - cfbBits(0xFFFFFFFFF0FFFFFF), - cfbBits(0xFFFFFFFFFF0FFFFF), - cfbBits(0xFFFFFFFFFFF0FFFF), - cfbBits(0xFFFFFFFFFFFF0FFF), - cfbBits(0xFFFFFFFFFFFFF0FF), - cfbBits(0xFFFFFFFFFFFFFF0F), - cfbBits(0xFFFFFFFFFFFFFFF0), - }; -#endif /* PGSZ */ -#endif /* PSZ == 4 */ - -#if PSZ == 8 -#if PGSZ == 32 -PixelGroup cfbmask[] = - { - cfbBits(0xFF000000), - cfbBits(0x00FF0000), - cfbBits(0x0000FF00), - cfbBits(0x000000FF) - }; -PixelGroup cfbrmask[] = - { - cfbBits(0x00FFFFFF), - cfbBits(0xFF00FFFF), - cfbBits(0xFFFF00FF), - cfbBits(0xFFFFFF00) - }; -#else /* PGSZ == 64 */ -PixelGroup cfbmask[] = - { - cfbBits(0xFF00000000000000), - cfbBits(0x00FF000000000000), - cfbBits(0x0000FF0000000000), - cfbBits(0x000000FF00000000), - cfbBits(0x00000000FF000000), - cfbBits(0x0000000000FF0000), - cfbBits(0x000000000000FF00), - cfbBits(0x00000000000000FF), - }; -PixelGroup cfbrmask[] = - { - cfbBits(0x00FFFFFFFFFFFFFF), - cfbBits(0xFF00FFFFFFFFFFFF), - cfbBits(0xFFFF00FFFFFFFFFF), - cfbBits(0xFFFFFF00FFFFFFFF), - cfbBits(0xFFFFFFFF00FFFFFF), - cfbBits(0xFFFFFFFFFF00FFFF), - cfbBits(0xFFFFFFFFFFFF00FF), - cfbBits(0xFFFFFFFFFFFFFF00), - }; -#endif /* PGSZ */ -#endif /* PSZ == 8 */ - -#if PSZ == 16 -#if PGSZ == 32 -PixelGroup cfbmask[] = - { - cfbBits(0xFFFF0000), - cfbBits(0x0000FFFF), - }; -PixelGroup cfbrmask[] = - { - cfbBits(0x0000FFFF), - cfbBits(0xFFFF0000), - }; -#else /* PGSZ == 64 */ -PixelGroup cfbmask[] = - { - cfbBits(0xFFFF000000000000), - cfbBits(0x0000FFFF00000000), - cfbBits(0x00000000FFFF0000), - cfbBits(0x000000000000FFFF), - }; -PixelGroup cfbrmask[] = - { - cfbBits(0x0000FFFFFFFFFFFF), - cfbBits(0xFFFF0000FFFFFFFF), - cfbBits(0xFFFFFFFF0000FFFF), - cfbBits(0xFFFFFFFFFFFF0000), - }; -#endif /* PGSZ */ -#endif /* PSZ == 16 */ - -#if PSZ == 24 -#if PGSZ == 32 -PixelGroup cfbmask[] = - { - cfbBits(0xFFFFFF00), - cfbBits(0x00000000), - cfbBits(0x000000FF), - cfbBits(0xFFFF0000), - cfbBits(0x0000FFFF), - cfbBits(0xFF000000), - cfbBits(0x00FFFFFF), - cfbBits(0x00000000), - }; -PixelGroup cfbrmask[] = - { - cfbBits(0x000000FF), - cfbBits(0xFFFFFFFF), - cfbBits(0xFFFFFF00), - cfbBits(0x0000FFFF), - cfbBits(0xFFFF0000), - cfbBits(0x00FFFFFF), - cfbBits(0xFF000000), - cfbBits(0xFFFFFFFF), - }; -#else /* PGSZ == 64 */ -PixelGroup cfbmask[] = - { - cfbBits(0xFFFFFF0000000000), - cfbBits(0x000000FFFFFF0000), - cfbBits(0x000000000000FFFF), - }; -PixelGroup cfbmask2[] = - { - cfbBits(0x0000000000000000), - cfbBits(0x0000000000000000), - cfbBits(0xFF00000000000000), - }; -PixelGroup cfbrmask[] = - { - cfbBits(0x000000FFFFFFFFFF), - cfbBits(0xFFFFFF000000FFFF), - cfbBits(0xFFFFFFFFFFFF0000), - }; -PixelGroup cfbrmask2[] = - { - cfbBits(0x0000000000000000), - cfbBits(0x0000000000000000), - cfbBits(0x00FFFFFFFFFFFFFF), - }; -#endif /* PGSZ */ -#endif /* PSZ == 24 */ - -#if PSZ == 32 -#if PGSZ == 32 -PixelGroup cfbmask[] = - { - cfbBits(0xFFFFFFFF), - }; -PixelGroup cfbrmask[] = - { - cfbBits(0xFFFFFFFF), - }; -#else /* PGSZ == 64 */ -PixelGroup cfbmask[] = - { - cfbBits(0xFFFFFFFF00000000), - cfbBits(0x00000000FFFFFFFF), - }; -PixelGroup cfbrmask[] = - { - cfbBits(0x00000000FFFFFFFF), - cfbBits(0xFFFFFFFF00000000), - }; -#endif /* PGSZ */ -#endif /* PSZ == 32 */ - -/* - * QuartetBitsTable contains PPW+1 masks whose binary values are masks in the - * low order quartet that contain the number of bits specified in the - * index. This table is used by getstipplepixels. - */ -#if PSZ == 4 -PixelGroup QuartetBitsTable[] = { -#if PGSZ == 32 -#if (BITMAP_BIT_ORDER == MSBFirst) - 0x00000000, /* 0 - 00000000 */ - 0x00000080, /* 1 - 10000000 */ - 0x000000C0, /* 2 - 11000000 */ - 0x000000E0, /* 3 - 11100000 */ - 0x000000F0, /* 4 - 11110000 */ - 0x000000F8, /* 5 - 11111000 */ - 0x000000FC, /* 6 - 11111100 */ - 0x000000FE, /* 7 - 11111110 */ - 0x000000FF /* 8 - 11111111 */ -#else /* (BITMAP_BIT_ORDER == LSBFirst */ - 0x00000000, /* 0 - 00000000 */ - 0x00000001, /* 1 - 00000001 */ - 0x00000003, /* 2 - 00000011 */ - 0x00000007, /* 3 - 00000111 */ - 0x0000000F, /* 4 - 00001111 */ - 0x0000001F, /* 5 - 00011111 */ - 0x0000003F, /* 6 - 00111111 */ - 0x0000007F, /* 7 - 01111111 */ - 0x000000FF /* 8 - 11111111 */ -#endif /* (BITMAP_BIT_ORDER == MSBFirst) */ -#else /* PGSZ == 64 */ -#if (BITMAP_BIT_ORDER == MSBFirst) - 0x00000000, /* 0 - 0000000000000000 */ - 0x00008000, /* 1 - 1000000000000000 */ - 0x0000C000, /* 2 - 1100000000000000 */ - 0x0000E000, /* 3 - 1110000000000000 */ - 0x0000F000, /* 4 - 1111000000000000 */ - 0x0000F800, /* 5 - 1111100000000000 */ - 0x0000FC00, /* 6 - 1111110000000000 */ - 0x0000FE00, /* 7 - 1111111000000000 */ - 0x0000FF00, /* 8 - 1111111100000000 */ - 0x0000FF80, /* 9 - 1111111110000000 */ - 0x0000FFC0, /* 10- 1111111111000000 */ - 0x0000FFE0, /* 11- 1111111111100000 */ - 0x0000FFF0, /* 12- 1111111111110000 */ - 0x0000FFF8, /* 13- 1111111111111000 */ - 0x0000FFFC, /* 14- 1111111111111100 */ - 0x0000FFFE, /* 15- 1111111111111110 */ - 0x0000FFFF, /* 16- 1111111111111111 */ -#else /* (BITMAP_BIT_ORDER == LSBFirst */ - 0x00000000, /* 0 - 0000000000000000 */ - 0x00000001, /* 1 - 0000000000000001 */ - 0x00000003, /* 2 - 0000000000000011 */ - 0x00000007, /* 3 - 0000000000000111 */ - 0x0000000F, /* 4 - 0000000000001111 */ - 0x0000001F, /* 5 - 0000000000011111 */ - 0x0000003F, /* 6 - 0000000000111111 */ - 0x0000007F, /* 7 - 0000000001111111 */ - 0x000000FF, /* 8 - 0000000011111111 */ - 0x000001FF, /* 9 - 0000000111111111 */ - 0x000003FF, /* 10- 0000001111111111 */ - 0x000007FF, /* 11- 0000011111111111 */ - 0x00000FFF, /* 12- 0000111111111111 */ - 0x00001FFF, /* 13- 0001111111111111 */ - 0x00003FFF, /* 14- 0011111111111111 */ - 0x00007FFF, /* 15- 0111111111111111 */ - 0x0000FFFF, /* 16- 1111111111111111 */ -#endif /* (BITMAP_BIT_ORDER == MSBFirst) */ -#endif /* PGSZ */ -}; -#endif /* PSZ == 4 */ - -#if PSZ == 8 -PixelGroup QuartetBitsTable[] = { -#if PGSZ == 32 -#if (BITMAP_BIT_ORDER == MSBFirst) - 0x00000000, /* 0 - 0000 */ - 0x00000008, /* 1 - 1000 */ - 0x0000000C, /* 2 - 1100 */ - 0x0000000E, /* 3 - 1110 */ - 0x0000000F /* 4 - 1111 */ -#else /* (BITMAP_BIT_ORDER == LSBFirst */ - 0x00000000, /* 0 - 0000 */ - 0x00000001, /* 1 - 0001 */ - 0x00000003, /* 2 - 0011 */ - 0x00000007, /* 3 - 0111 */ - 0x0000000F /* 4 - 1111 */ -#endif /* (BITMAP_BIT_ORDER == MSBFirst) */ -#else /* PGSZ == 64 */ -#if (BITMAP_BIT_ORDER == MSBFirst) - 0x00000000, /* 0 - 00000000 */ - 0x00000080, /* 1 - 10000000 */ - 0x000000C0, /* 2 - 11000000 */ - 0x000000E0, /* 3 - 11100000 */ - 0x000000F0, /* 4 - 11110000 */ - 0x000000F8, /* 5 - 11111000 */ - 0x000000FC, /* 6 - 11111100 */ - 0x000000FE, /* 7 - 11111110 */ - 0x000000FF /* 8 - 11111111 */ -#else /* (BITMAP_BIT_ORDER == LSBFirst */ - 0x00000000, /* 0 - 00000000 */ - 0x00000001, /* 1 - 00000001 */ - 0x00000003, /* 2 - 00000011 */ - 0x00000007, /* 3 - 00000111 */ - 0x0000000F, /* 4 - 10000111 */ - 0x0000001F, /* 5 - 00011111 */ - 0x0000003F, /* 6 - 00111111 */ - 0x0000007F, /* 7 - 01111111 */ - 0x000000FF /* 8 - 11111111 */ -#endif /* (BITMAP_BIT_ORDER == MSBFirst) */ -#endif /* PGSZ */ -}; -#endif /* PSZ == 8 */ - -#if PSZ == 16 -PixelGroup QuartetBitsTable[] = { -#if PGSZ == 32 -#if (BITMAP_BIT_ORDER == MSBFirst) - 0x00000000, /* 0 - 00 */ - 0x00000002, /* 1 - 10 */ - 0x00000003, /* 2 - 11 */ -#else /* (BITMAP_BIT_ORDER == LSBFirst */ - 0x00000000, /* 0 - 00 */ - 0x00000001, /* 1 - 01 */ - 0x00000003, /* 2 - 11 */ -#endif /* (BITMAP_BIT_ORDER == MSBFirst) */ -#else /* PGSZ == 64 */ -#if (BITMAP_BIT_ORDER == MSBFirst) - 0x00000000, /* 0 - 0000 */ - 0x00000008, /* 1 - 1000 */ - 0x0000000C, /* 2 - 1100 */ - 0x0000000E, /* 3 - 1110 */ - 0x0000000F, /* 4 - 1111 */ -#else /* (BITMAP_BIT_ORDER == LSBFirst */ - 0x00000000, /* 0 - 0000 */ - 0x00000001, /* 1 - 0001 */ - 0x00000003, /* 2 - 0011 */ - 0x00000007, /* 3 - 0111 */ - 0x0000000F, /* 4 - 1111 */ -#endif /* (BITMAP_BIT_ORDER == MSBFirst) */ -#endif /* PGSZ */ -}; -#endif /* PSZ == 16 */ - -#if PSZ == 24 -PixelGroup QuartetBitsTable[] = { -#if PGSZ == 32 -#if (BITMAP_BIT_ORDER == MSBFirst) - 0x00000000, /* 0 - 0 */ - 0x00000001, /* 1 - 1 */ -#else /* (BITMAP_BIT_ORDER == LSBFirst */ - 0x00000000, /* 0 - 0 */ - 0x00000001, /* 1 - 1 */ -#endif /* (BITMAP_BIT_ORDER == MSBFirst) */ -#else /* PGSZ == 64 */ -#if (BITMAP_BIT_ORDER == MSBFirst) - 0x00000000, /* 0 - 00 */ - 0x00000002, /* 1 - 10 */ - 0x00000003, /* 2 - 11*/ -#else /* (BITMAP_BIT_ORDER == LSBFirst */ - 0x00000000, /* 0 - 00 */ - 0x00000001, /* 1 - 01 */ - 0x00000003, /* 2 - 11 */ -#endif /* (BITMAP_BIT_ORDER == MSBFirst) */ -#endif /* PGSZ */ -}; -#endif /* PSZ == 24 */ - -#if PSZ == 32 -PixelGroup QuartetBitsTable[] = { -#if PGSZ == 32 -#if (BITMAP_BIT_ORDER == MSBFirst) - 0x00000000, /* 0 - 0 */ - 0x00000001, /* 1 - 1 */ -#else /* (BITMAP_BIT_ORDER == LSBFirst */ - 0x00000000, /* 0 - 0 */ - 0x00000001, /* 1 - 1 */ -#endif /* (BITMAP_BIT_ORDER == MSBFirst) */ -#else /* PGSZ == 64 */ -#if (BITMAP_BIT_ORDER == MSBFirst) - 0x00000000, /* 0 - 00 */ - 0x00000002, /* 1 - 10 */ - 0x00000003, /* 2 - 11*/ -#else /* (BITMAP_BIT_ORDER == LSBFirst */ - 0x00000000, /* 0 - 00 */ - 0x00000001, /* 1 - 01 */ - 0x00000003, /* 2 - 11 */ -#endif /* (BITMAP_BIT_ORDER == MSBFirst) */ -#endif /* PGSZ */ -}; -#endif /* PSZ == 32 */ - -/* - * QuartetPixelMaskTable is used by getstipplepixels to get a pixel mask - * corresponding to a quartet of bits. Note: the bit/byte order dependency - * is handled by QuartetBitsTable above. - */ -#if PSZ == 4 -#if PGSZ == 32 -PixelGroup QuartetPixelMaskTable[] = { - 0x00000000, - 0x0000000F, - 0x000000F0, - 0x000000FF, - 0x00000F00, - 0x00000F0F, - 0x00000FF0, - 0x00000FFF, - 0x0000F000, - 0x0000F00F, - 0x0000F0F0, - 0x0000F0FF, - 0x0000FF00, - 0x0000FF0F, - 0x0000FFF0, - 0x0000FFFF, - 0x000F0000, - 0x000F000F, - 0x000F00F0, - 0x000F00FF, - 0x000F0F00, - 0x000F0F0F, - 0x000F0FF0, - 0x000F0FFF, - 0x000FF000, - 0x000FF00F, - 0x000FF0F0, - 0x000FF0FF, - 0x000FFF00, - 0x000FFF0F, - 0x000FFFF0, - 0x000FFFFF, - 0x00F00000, - 0x00F0000F, - 0x00F000F0, - 0x00F000FF, - 0x00F00F00, - 0x00F00F0F, - 0x00F00FF0, - 0x00F00FFF, - 0x00F0F000, - 0x00F0F00F, - 0x00F0F0F0, - 0x00F0F0FF, - 0x00F0FF00, - 0x00F0FF0F, - 0x00F0FFF0, - 0x00F0FFFF, - 0x00FF0000, - 0x00FF000F, - 0x00FF00F0, - 0x00FF00FF, - 0x00FF0F00, - 0x00FF0F0F, - 0x00FF0FF0, - 0x00FF0FFF, - 0x00FFF000, - 0x00FFF00F, - 0x00FFF0F0, - 0x00FFF0FF, - 0x00FFFF00, - 0x00FFFF0F, - 0x00FFFFF0, - 0x00FFFFFF, - 0x0F000000, - 0x0F00000F, - 0x0F0000F0, - 0x0F0000FF, - 0x0F000F00, - 0x0F000F0F, - 0x0F000FF0, - 0x0F000FFF, - 0x0F00F000, - 0x0F00F00F, - 0x0F00F0F0, - 0x0F00F0FF, - 0x0F00FF00, - 0x0F00FF0F, - 0x0F00FFF0, - 0x0F00FFFF, - 0x0F0F0000, - 0x0F0F000F, - 0x0F0F00F0, - 0x0F0F00FF, - 0x0F0F0F00, - 0x0F0F0F0F, - 0x0F0F0FF0, - 0x0F0F0FFF, - 0x0F0FF000, - 0x0F0FF00F, - 0x0F0FF0F0, - 0x0F0FF0FF, - 0x0F0FFF00, - 0x0F0FFF0F, - 0x0F0FFFF0, - 0x0F0FFFFF, - 0x0FF00000, - 0x0FF0000F, - 0x0FF000F0, - 0x0FF000FF, - 0x0FF00F00, - 0x0FF00F0F, - 0x0FF00FF0, - 0x0FF00FFF, - 0x0FF0F000, - 0x0FF0F00F, - 0x0FF0F0F0, - 0x0FF0F0FF, - 0x0FF0FF00, - 0x0FF0FF0F, - 0x0FF0FFF0, - 0x0FF0FFFF, - 0x0FFF0000, - 0x0FFF000F, - 0x0FFF00F0, - 0x0FFF00FF, - 0x0FFF0F00, - 0x0FFF0F0F, - 0x0FFF0FF0, - 0x0FFF0FFF, - 0x0FFFF000, - 0x0FFFF00F, - 0x0FFFF0F0, - 0x0FFFF0FF, - 0x0FFFFF00, - 0x0FFFFF0F, - 0x0FFFFFF0, - 0x0FFFFFFF, - 0xF0000000, - 0xF000000F, - 0xF00000F0, - 0xF00000FF, - 0xF0000F00, - 0xF0000F0F, - 0xF0000FF0, - 0xF0000FFF, - 0xF000F000, - 0xF000F00F, - 0xF000F0F0, - 0xF000F0FF, - 0xF000FF00, - 0xF000FF0F, - 0xF000FFF0, - 0xF000FFFF, - 0xF00F0000, - 0xF00F000F, - 0xF00F00F0, - 0xF00F00FF, - 0xF00F0F00, - 0xF00F0F0F, - 0xF00F0FF0, - 0xF00F0FFF, - 0xF00FF000, - 0xF00FF00F, - 0xF00FF0F0, - 0xF00FF0FF, - 0xF00FFF00, - 0xF00FFF0F, - 0xF00FFFF0, - 0xF00FFFFF, - 0xF0F00000, - 0xF0F0000F, - 0xF0F000F0, - 0xF0F000FF, - 0xF0F00F00, - 0xF0F00F0F, - 0xF0F00FF0, - 0xF0F00FFF, - 0xF0F0F000, - 0xF0F0F00F, - 0xF0F0F0F0, - 0xF0F0F0FF, - 0xF0F0FF00, - 0xF0F0FF0F, - 0xF0F0FFF0, - 0xF0F0FFFF, - 0xF0FF0000, - 0xF0FF000F, - 0xF0FF00F0, - 0xF0FF00FF, - 0xF0FF0F00, - 0xF0FF0F0F, - 0xF0FF0FF0, - 0xF0FF0FFF, - 0xF0FFF000, - 0xF0FFF00F, - 0xF0FFF0F0, - 0xF0FFF0FF, - 0xF0FFFF00, - 0xF0FFFF0F, - 0xF0FFFFF0, - 0xF0FFFFFF, - 0xFF000000, - 0xFF00000F, - 0xFF0000F0, - 0xFF0000FF, - 0xFF000F00, - 0xFF000F0F, - 0xFF000FF0, - 0xFF000FFF, - 0xFF00F000, - 0xFF00F00F, - 0xFF00F0F0, - 0xFF00F0FF, - 0xFF00FF00, - 0xFF00FF0F, - 0xFF00FFF0, - 0xFF00FFFF, - 0xFF0F0000, - 0xFF0F000F, - 0xFF0F00F0, - 0xFF0F00FF, - 0xFF0F0F00, - 0xFF0F0F0F, - 0xFF0F0FF0, - 0xFF0F0FFF, - 0xFF0FF000, - 0xFF0FF00F, - 0xFF0FF0F0, - 0xFF0FF0FF, - 0xFF0FFF00, - 0xFF0FFF0F, - 0xFF0FFFF0, - 0xFF0FFFFF, - 0xFFF00000, - 0xFFF0000F, - 0xFFF000F0, - 0xFFF000FF, - 0xFFF00F00, - 0xFFF00F0F, - 0xFFF00FF0, - 0xFFF00FFF, - 0xFFF0F000, - 0xFFF0F00F, - 0xFFF0F0F0, - 0xFFF0F0FF, - 0xFFF0FF00, - 0xFFF0FF0F, - 0xFFF0FFF0, - 0xFFF0FFFF, - 0xFFFF0000, - 0xFFFF000F, - 0xFFFF00F0, - 0xFFFF00FF, - 0xFFFF0F00, - 0xFFFF0F0F, - 0xFFFF0FF0, - 0xFFFF0FFF, - 0xFFFFF000, - 0xFFFFF00F, - 0xFFFFF0F0, - 0xFFFFF0FF, - 0xFFFFFF00, - 0xFFFFFF0F, - 0xFFFFFFF0, - 0xFFFFFFFF, -}; -#else /* PGSZ == 64 */ -No QuartetPixelMaskTable for psz=PSZ -this would be a 64K entry table, a bit much I think. -Try breaking things in two: -mask = table[index&0xff00]<<32 | table[index&0xff] -#endif /* PGSZ */ -#endif /* PSZ == 4 */ - -#if PSZ == 8 -PixelGroup QuartetPixelMaskTable[] = { -#if PGSZ == 32 - 0x00000000, - 0x000000FF, - 0x0000FF00, - 0x0000FFFF, - 0x00FF0000, - 0x00FF00FF, - 0x00FFFF00, - 0x00FFFFFF, - 0xFF000000, - 0xFF0000FF, - 0xFF00FF00, - 0xFF00FFFF, - 0xFFFF0000, - 0xFFFF00FF, - 0xFFFFFF00, - 0xFFFFFFFF -#else /* PGSZ == 64 */ - 0x0000000000000000, 0x00000000000000FF, - 0x000000000000FF00, 0x000000000000FFFF, - 0x0000000000FF0000, 0x0000000000FF00FF, - 0x0000000000FFFF00, 0x0000000000FFFFFF, - 0x00000000FF000000, 0x00000000FF0000FF, - 0x00000000FF00FF00, 0x00000000FF00FFFF, - 0x00000000FFFF0000, 0x00000000FFFF00FF, - 0x00000000FFFFFF00, 0x00000000FFFFFFFF, - 0x000000FF00000000, 0x000000FF000000FF, - 0x000000FF0000FF00, 0x000000FF0000FFFF, - 0x000000FF00FF0000, 0x000000FF00FF00FF, - 0x000000FF00FFFF00, 0x000000FF00FFFFFF, - 0x000000FFFF000000, 0x000000FFFF0000FF, - 0x000000FFFF00FF00, 0x000000FFFF00FFFF, - 0x000000FFFFFF0000, 0x000000FFFFFF00FF, - 0x000000FFFFFFFF00, 0x000000FFFFFFFFFF, - 0x0000FF0000000000, 0x0000FF00000000FF, - 0x0000FF000000FF00, 0x0000FF000000FFFF, - 0x0000FF0000FF0000, 0x0000FF0000FF00FF, - 0x0000FF0000FFFF00, 0x0000FF0000FFFFFF, - 0x0000FF00FF000000, 0x0000FF00FF0000FF, - 0x0000FF00FF00FF00, 0x0000FF00FF00FFFF, - 0x0000FF00FFFF0000, 0x0000FF00FFFF00FF, - 0x0000FF00FFFFFF00, 0x0000FF00FFFFFFFF, - 0x0000FFFF00000000, 0x0000FFFF000000FF, - 0x0000FFFF0000FF00, 0x0000FFFF0000FFFF, - 0x0000FFFF00FF0000, 0x0000FFFF00FF00FF, - 0x0000FFFF00FFFF00, 0x0000FFFF00FFFFFF, - 0x0000FFFFFF000000, 0x0000FFFFFF0000FF, - 0x0000FFFFFF00FF00, 0x0000FFFFFF00FFFF, - 0x0000FFFFFFFF0000, 0x0000FFFFFFFF00FF, - 0x0000FFFFFFFFFF00, 0x0000FFFFFFFFFFFF, - 0x00FF000000000000, 0x00FF0000000000FF, - 0x00FF00000000FF00, 0x00FF00000000FFFF, - 0x00FF000000FF0000, 0x00FF000000FF00FF, - 0x00FF000000FFFF00, 0x00FF000000FFFFFF, - 0x00FF0000FF000000, 0x00FF0000FF0000FF, - 0x00FF0000FF00FF00, 0x00FF0000FF00FFFF, - 0x00FF0000FFFF0000, 0x00FF0000FFFF00FF, - 0x00FF0000FFFFFF00, 0x00FF0000FFFFFFFF, - 0x00FF00FF00000000, 0x00FF00FF000000FF, - 0x00FF00FF0000FF00, 0x00FF00FF0000FFFF, - 0x00FF00FF00FF0000, 0x00FF00FF00FF00FF, - 0x00FF00FF00FFFF00, 0x00FF00FF00FFFFFF, - 0x00FF00FFFF000000, 0x00FF00FFFF0000FF, - 0x00FF00FFFF00FF00, 0x00FF00FFFF00FFFF, - 0x00FF00FFFFFF0000, 0x00FF00FFFFFF00FF, - 0x00FF00FFFFFFFF00, 0x00FF00FFFFFFFFFF, - 0x00FFFF0000000000, 0x00FFFF00000000FF, - 0x00FFFF000000FF00, 0x00FFFF000000FFFF, - 0x00FFFF0000FF0000, 0x00FFFF0000FF00FF, - 0x00FFFF0000FFFF00, 0x00FFFF0000FFFFFF, - 0x00FFFF00FF000000, 0x00FFFF00FF0000FF, - 0x00FFFF00FF00FF00, 0x00FFFF00FF00FFFF, - 0x00FFFF00FFFF0000, 0x00FFFF00FFFF00FF, - 0x00FFFF00FFFFFF00, 0x00FFFF00FFFFFFFF, - 0x00FFFFFF00000000, 0x00FFFFFF000000FF, - 0x00FFFFFF0000FF00, 0x00FFFFFF0000FFFF, - 0x00FFFFFF00FF0000, 0x00FFFFFF00FF00FF, - 0x00FFFFFF00FFFF00, 0x00FFFFFF00FFFFFF, - 0x00FFFFFFFF000000, 0x00FFFFFFFF0000FF, - 0x00FFFFFFFF00FF00, 0x00FFFFFFFF00FFFF, - 0x00FFFFFFFFFF0000, 0x00FFFFFFFFFF00FF, - 0x00FFFFFFFFFFFF00, 0x00FFFFFFFFFFFFFF, - 0xFF00000000000000, 0xFF000000000000FF, - 0xFF0000000000FF00, 0xFF0000000000FFFF, - 0xFF00000000FF0000, 0xFF00000000FF00FF, - 0xFF00000000FFFF00, 0xFF00000000FFFFFF, - 0xFF000000FF000000, 0xFF000000FF0000FF, - 0xFF000000FF00FF00, 0xFF000000FF00FFFF, - 0xFF000000FFFF0000, 0xFF000000FFFF00FF, - 0xFF000000FFFFFF00, 0xFF000000FFFFFFFF, - 0xFF0000FF00000000, 0xFF0000FF000000FF, - 0xFF0000FF0000FF00, 0xFF0000FF0000FFFF, - 0xFF0000FF00FF0000, 0xFF0000FF00FF00FF, - 0xFF0000FF00FFFF00, 0xFF0000FF00FFFFFF, - 0xFF0000FFFF000000, 0xFF0000FFFF0000FF, - 0xFF0000FFFF00FF00, 0xFF0000FFFF00FFFF, - 0xFF0000FFFFFF0000, 0xFF0000FFFFFF00FF, - 0xFF0000FFFFFFFF00, 0xFF0000FFFFFFFFFF, - 0xFF00FF0000000000, 0xFF00FF00000000FF, - 0xFF00FF000000FF00, 0xFF00FF000000FFFF, - 0xFF00FF0000FF0000, 0xFF00FF0000FF00FF, - 0xFF00FF0000FFFF00, 0xFF00FF0000FFFFFF, - 0xFF00FF00FF000000, 0xFF00FF00FF0000FF, - 0xFF00FF00FF00FF00, 0xFF00FF00FF00FFFF, - 0xFF00FF00FFFF0000, 0xFF00FF00FFFF00FF, - 0xFF00FF00FFFFFF00, 0xFF00FF00FFFFFFFF, - 0xFF00FFFF00000000, 0xFF00FFFF000000FF, - 0xFF00FFFF0000FF00, 0xFF00FFFF0000FFFF, - 0xFF00FFFF00FF0000, 0xFF00FFFF00FF00FF, - 0xFF00FFFF00FFFF00, 0xFF00FFFF00FFFFFF, - 0xFF00FFFFFF000000, 0xFF00FFFFFF0000FF, - 0xFF00FFFFFF00FF00, 0xFF00FFFFFF00FFFF, - 0xFF00FFFFFFFF0000, 0xFF00FFFFFFFF00FF, - 0xFF00FFFFFFFFFF00, 0xFF00FFFFFFFFFFFF, - 0xFFFF000000000000, 0xFFFF0000000000FF, - 0xFFFF00000000FF00, 0xFFFF00000000FFFF, - 0xFFFF000000FF0000, 0xFFFF000000FF00FF, - 0xFFFF000000FFFF00, 0xFFFF000000FFFFFF, - 0xFFFF0000FF000000, 0xFFFF0000FF0000FF, - 0xFFFF0000FF00FF00, 0xFFFF0000FF00FFFF, - 0xFFFF0000FFFF0000, 0xFFFF0000FFFF00FF, - 0xFFFF0000FFFFFF00, 0xFFFF0000FFFFFFFF, - 0xFFFF00FF00000000, 0xFFFF00FF000000FF, - 0xFFFF00FF0000FF00, 0xFFFF00FF0000FFFF, - 0xFFFF00FF00FF0000, 0xFFFF00FF00FF00FF, - 0xFFFF00FF00FFFF00, 0xFFFF00FF00FFFFFF, - 0xFFFF00FFFF000000, 0xFFFF00FFFF0000FF, - 0xFFFF00FFFF00FF00, 0xFFFF00FFFF00FFFF, - 0xFFFF00FFFFFF0000, 0xFFFF00FFFFFF00FF, - 0xFFFF00FFFFFFFF00, 0xFFFF00FFFFFFFFFF, - 0xFFFFFF0000000000, 0xFFFFFF00000000FF, - 0xFFFFFF000000FF00, 0xFFFFFF000000FFFF, - 0xFFFFFF0000FF0000, 0xFFFFFF0000FF00FF, - 0xFFFFFF0000FFFF00, 0xFFFFFF0000FFFFFF, - 0xFFFFFF00FF000000, 0xFFFFFF00FF0000FF, - 0xFFFFFF00FF00FF00, 0xFFFFFF00FF00FFFF, - 0xFFFFFF00FFFF0000, 0xFFFFFF00FFFF00FF, - 0xFFFFFF00FFFFFF00, 0xFFFFFF00FFFFFFFF, - 0xFFFFFFFF00000000, 0xFFFFFFFF000000FF, - 0xFFFFFFFF0000FF00, 0xFFFFFFFF0000FFFF, - 0xFFFFFFFF00FF0000, 0xFFFFFFFF00FF00FF, - 0xFFFFFFFF00FFFF00, 0xFFFFFFFF00FFFFFF, - 0xFFFFFFFFFF000000, 0xFFFFFFFFFF0000FF, - 0xFFFFFFFFFF00FF00, 0xFFFFFFFFFF00FFFF, - 0xFFFFFFFFFFFF0000, 0xFFFFFFFFFFFF00FF, - 0xFFFFFFFFFFFFFF00, 0xFFFFFFFFFFFFFFFF, -#endif /* PGSZ */ -}; -#endif /* PSZ == 8 */ - -#if PSZ == 16 -PixelGroup QuartetPixelMaskTable[] = { -#if PGSZ == 32 - 0x00000000, - 0x0000FFFF, - 0xFFFF0000, - 0xFFFFFFFF, -#else /* PGSZ == 64 */ - 0x0000000000000000, 0x000000000000FFFF, - 0x00000000FFFF0000, 0x00000000FFFFFFFF, - 0x0000FFFF00000000, 0x0000FFFF0000FFFF, - 0x0000FFFFFFFF0000, 0x0000FFFFFFFFFFFF, - 0xFFFF000000000000, 0xFFFF00000000FFFF, - 0xFFFF0000FFFF0000, 0xFFFF0000FFFFFFFF, - 0xFFFFFFFF00000000, 0xFFFFFFFF0000FFFF, - 0xFFFFFFFFFFFF0000, 0xFFFFFFFFFFFFFFFF, -#endif /* PGSZ */ -}; -#endif /* PSZ == 16 */ - -#if PSZ == 24 -PixelGroup QuartetPixelMaskTable[] = { -#if PGSZ == 32 -/* Four pixels consist three pixel groups....*/ - 0x00000000, 0x00FFFFFF, /*0x00000000, *//*0*/ -/* 0x00000000, 0x00000000, 0x00000000,*/ /*0*/ -/* 0x00FFFFFF, 0x00000000, 0x00000000,*/ /*1*/ -/* 0xFF000000, 0x0000FFFF, 0x00000000,*/ /*2*/ -/* 0xFFFFFFFF, 0x0000FFFF, 0x00000000,*/ /*3*/ -/* 0x00000000, 0xFFFF0000, 0x000000FF,*/ /*4*/ -/* 0x00FFFFFF, 0xFFFF0000, 0x000000FF,*/ /*5*/ -/* 0xFF000000, 0xFFFFFFFF, 0x000000FF,*/ /*6*/ -/* 0xFFFFFFFF, 0xFFFFFFFF, 0x000000FF,*/ /*7*/ -/* 0x00000000, 0x00000000, 0xFFFFFF00,*/ /*8*/ -/* 0x00FFFFFF, 0x00000000, 0xFFFFFF00,*/ /*9*/ -/* 0xFF000000, 0x0000FFFF, 0xFFFFFF00,*/ /*10*/ -/* 0xFFFFFFFF, 0x0000FFFF, 0xFFFFFF00,*/ /*11*/ -/* 0x00000000, 0xFFFF0000, 0xFFFFFFFF,*/ /*12*/ -/* 0x00FFFFFF, 0xFFFF0000, 0xFFFFFFFF,*/ /*13*/ -/* 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF,*/ /*14*/ -/* 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,*/ /*15*/ -#else /* PGSZ == 64 */ - 0x0000000000000000, 0x0000000000FFFFFF, - 0x0000FFFFFF000000, 0xFFFFFFFFFFFFFFFF -#endif /* PGSZ */ -}; -#endif /* PSZ == 24 */ - -#if PSZ == 32 -PixelGroup QuartetPixelMaskTable[] = { -#if PGSZ == 32 - 0x00000000, - 0xFFFFFFFF, -#else /* PGSZ == 64 */ - 0x0000000000000000, - 0x00000000FFFFFFFF, - 0xFFFFFFFF00000000, - 0xFFFFFFFFFFFFFFFF -#endif /* PGSZ */ -}; -#endif /* PSZ == 32 */ - -#if PSZ == 24 -int cfb24Shift[] = -#if (BITMAP_BIT_ORDER == MSBFirst) -{8,0,16,16,8,24,0,0}; -#else /* (BITMAP_BIT_ORDER == LSBFirst) */ -{0,0,24,8,16,16,8,0}; -#endif /* (BITMAP_BIT_ORDER == MSBFirst) */ -#endif diff --git a/nx-X11/programs/Xserver/cfb/cfbmskbits.h b/nx-X11/programs/Xserver/cfb/cfbmskbits.h deleted file mode 100644 index a803cac72..000000000 --- a/nx-X11/programs/Xserver/cfb/cfbmskbits.h +++ /dev/null @@ -1,897 +0,0 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfbmskbits.h,v 3.13tsi Exp $ */ -/************************************************************ -Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this -software and its documentation for any purpose and without -fee is hereby granted, provided that the above copyright no- -tice appear in all copies and that both that copyright no- -tice and this permission notice appear in supporting docu- -mentation, and that the names of Sun or The Open Group -not be used in advertising or publicity pertaining to -distribution of the software without specific prior -written permission. Sun and The Open Group make no -representations about the suitability of this software for -any purpose. It is provided "as is" without any express or -implied warranty. - -SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT- -NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE LI- -ABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR -PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH -THE USE OR PERFORMANCE OF THIS SOFTWARE. - -********************************************************/ - -/* $Xorg: cfbmskbits.h,v 1.3 2000/08/17 19:48:14 cpqbld Exp $ */ -/* Optimizations for PSZ == 32 added by Kyle Marvin (marvin@vitec.com) */ - -#include -#include -#include "servermd.h" -#if defined(XFREE86) || ( defined(__OpenBSD__) && defined(__alpha__) ) \ - || (defined(__bsdi__)) -#include "xf86_ansic.h" -#include "compiler.h" -#endif - -/* - * ========================================================================== - * Converted from mfb to support memory-mapped color framebuffer by smarks@sun, - * April-May 1987. - * - * The way I did the conversion was to consider each longword as an - * array of four bytes instead of an array of 32 one-bit pixels. So - * getbits() and putbits() retain much the same calling sequence, but - * they move bytes around instead of bits. Of course, this entails the - * removal of all of the one-bit-pixel dependencies from the other - * files, but the major bit-hacking stuff should be covered here. - * - * I've created some new macros that make it easier to understand what's - * going on in the pixel calculations, and that make it easier to change the - * pixel size. - * - * name explanation - * ---- ----------- - * PSZ pixel size (in bits) - * PGSZ pixel group size (in bits) - * PGSZB pixel group size (in bytes) - * PGSZBMSK mask with lowest PGSZB bits set to 1 - * PPW pixels per word (pixels per pixel group) - * PPWMSK mask with lowest PPW bits set to 1 - * PLST index of last pixel in a word (should be PPW-1) - * PIM pixel index mask (index within a pixel group) - * PWSH pixel-to-word shift (should be log2(PPW)) - * PMSK mask with lowest PSZ bits set to 1 - * - * - * Here are some sample values. In the notation cfbA,B: A is PSZ, and - * B is PGSZB. All the other values are derived from these - * two. This table does not show all combinations! - * - * name cfb8,4 cfb24,4 cfb32,4 cfb8,8 cfb24,8 cfb32,8 - * ---- ------ ------- ------ ------ ------ ------- - * PSZ 8 24 32 8 24 32 - * PGSZ 32 32 32 64 64 64 - * PGSZB 4 4 4 8 8 8 - * PGSZBMSK 0xF 0xF? 0xF 0xFF 0xFF 0xFF - * PPW 4 1 1 8 2 2 - * PPWMSK 0xF 0x1 0x1 0xFF 0x3? 0x3 - * PLST 3 0 0 7 1 1 - * PIM 0x3 0x0 0x0 0x7 0x1? 0x1 - * PWSH 2 0 0 3 1 1 - * PMSK 0xFF 0xFFFFFF 0xFFFFFFFF 0xFF 0xFFFFFF 0xFFFFFFFF - * - * - * I have also added a new macro, PFILL, that takes one pixel and - * replicates it throughout a word. This macro definition is dependent - * upon pixel and word size; it doesn't use macros like PPW and so - * forth. Examples: for monochrome, PFILL(1) => 0xffffffff, PFILL(0) => - * 0x00000000. For 8-bit color, PFILL(0x5d) => 0x5d5d5d5d. This macro - * is used primarily for replicating a plane mask into a word. - * - * Color framebuffers operations also support the notion of a plane - * mask. This mask determines which planes of the framebuffer can be - * altered; the others are left unchanged. I have added another - * parameter to the putbits and putbitsrop macros that is the plane - * mask. - * ========================================================================== - * - * Keith Packard (keithp@suse.com) - * 64bit code is no longer supported; it requires DIX support - * for repadding images which significantly impacts performance - */ - -/* - * PSZ needs to be defined before we get here. Usually it comes from a - * -DPSZ=foo on the compilation command line. - */ - -#ifndef PSZ -#define PSZ 8 -#endif - -/* - * PixelGroup is the data type used to operate on groups of pixels. - * We typedef it here to CARD32 with the assumption that you - * want to manipulate 32 bits worth of pixels at a time as you can. If CARD32 - * is not appropriate for your server, define it to something else - * before including this file. In this case you will also have to define - * PGSZB to the size in bytes of PixelGroup. - */ -#ifndef PixelGroup -#define PixelGroup CARD32 -#define PGSZB 4 -#endif /* PixelGroup */ - -#ifndef CfbBits -#define CfbBits CARD32 -#endif - -#define PGSZ (PGSZB << 3) -#define PPW (PGSZ/PSZ) -#define PLST (PPW-1) -#define PIM PLST -#define PMSK (((PixelGroup)1 << PSZ) - 1) -#define PPWMSK (((PixelGroup)1 << PPW) - 1) /* instead of BITMSK */ -#define PGSZBMSK (((PixelGroup)1 << PGSZB) - 1) - -/* set PWSH = log2(PPW) using brute force */ - -#if PPW == 1 -#define PWSH 0 -#else -#if PPW == 2 -#define PWSH 1 -#else -#if PPW == 4 -#define PWSH 2 -#else -#if PPW == 8 -#define PWSH 3 -#else -#if PPW == 16 -#define PWSH 4 -#endif /* PPW == 16 */ -#endif /* PPW == 8 */ -#endif /* PPW == 4 */ -#endif /* PPW == 2 */ -#endif /* PPW == 1 */ - -/* Defining PIXEL_ADDR means that individual pixels are addressable by this - * machine (as type PixelType). A possible CFB architecture which supported - * 8-bits-per-pixel on a non byte-addressable machine would not have this - * defined. - * - * Defining FOUR_BIT_CODE means that cfb knows how to stipple on this machine; - * eventually, stippling code for 16 and 32 bit devices should be written - * which would allow them to also use FOUR_BIT_CODE. There isn't that - * much to do in those cases, but it would make them quite a bit faster. - */ - -#if PSZ == 8 -#define PIXEL_ADDR -typedef CARD8 PixelType; -#define FOUR_BIT_CODE -#endif - -#if PSZ == 16 -#define PIXEL_ADDR -typedef CARD16 PixelType; -#endif - -#if PSZ == 24 -#undef PMSK -#define PMSK 0xFFFFFF -/*#undef PIM -#define PIM 3*/ -#define PIXEL_ADDR -typedef CARD32 PixelType; -#endif - -#if PSZ == 32 -#undef PMSK -#define PMSK 0xFFFFFFFF -#define PIXEL_ADDR -typedef CARD32 PixelType; -#endif - - -/* the following notes use the following conventions: -SCREEN LEFT SCREEN RIGHT -in this file and maskbits.c, left and right refer to screen coordinates, -NOT bit numbering in registers. - -cfbstarttab[n] - pixels[0,n-1] = 0's pixels[n,PPW-1] = 1's -cfbendtab[n] = - pixels[0,n-1] = 1's pixels[n,PPW-1] = 0's - -cfbstartpartial[], cfbendpartial[] - these are used as accelerators for doing putbits and masking out -bits that are all contained between longword boudaries. the extra -256 bytes of data seems a small price to pay -- code is smaller, -and narrow things (e.g. window borders) go faster. - -the names may seem misleading; they are derived not from which end -of the word the bits are turned on, but at which end of a scanline -the table tends to be used. - -look at the tables and macros to understand boundary conditions. -(careful readers will note that starttab[n] = ~endtab[n] for n != 0) - ------------------------------------------------------------------------ -these two macros depend on the screen's bit ordering. -in both of them x is a screen position. they are used to -combine bits collected from multiple longwords into a -single destination longword, and to unpack a single -source longword into multiple destinations. - -SCRLEFT(dst, x) - takes dst[x, PPW] and moves them to dst[0, PPW-x] - the contents of the rest of dst are 0 ONLY IF - dst is UNSIGNED. - is cast as an unsigned. - this is a right shift on the VAX, left shift on - Sun and pc-rt. - -SCRRIGHT(dst, x) - takes dst[0,x] and moves them to dst[PPW-x, PPW] - the contents of the rest of dst are 0 ONLY IF - dst is UNSIGNED. - this is a left shift on the VAX, right shift on - Sun and pc-rt. - - -the remaining macros are cpu-independent; all bit order dependencies -are built into the tables and the two macros above. - -maskbits(x, w, startmask, endmask, nlw) - for a span of width w starting at position x, returns -a mask for ragged pixels at start, mask for ragged pixels at end, -and the number of whole longwords between the ends. - -maskpartialbits(x, w, mask) - works like maskbits(), except all the pixels are in the - same longword (i.e. (x&0xPIM + w) <= PPW) - -mask32bits(x, w, startmask, endmask, nlw) - as maskbits, but does not calculate nlw. it is used by - cfbGlyphBlt to put down glyphs <= PPW bits wide. - -getbits(psrc, x, w, dst) - starting at position x in psrc (x < PPW), collect w - pixels and put them in the screen left portion of dst. - psrc is a longword pointer. this may span longword boundaries. - it special-cases fetching all w bits from one longword. - - +--------+--------+ +--------+ - | | m |n| | ==> | m |n| | - +--------+--------+ +--------+ - x x+w 0 w - psrc psrc+1 dst - m = PPW - x - n = w - m - - implementation: - get m pixels, move to screen-left of dst, zeroing rest of dst; - get n pixels from next word, move screen-right by m, zeroing - lower m pixels of word. - OR the two things together. - -putbits(src, x, w, pdst, planemask) - starting at position x in pdst, put down the screen-leftmost - w bits of src. pdst is a longword pointer. this may - span longword boundaries. - it special-cases putting all w bits into the same longword. - - +--------+ +--------+--------+ - | m |n| | ==> | | m |n| | - +--------+ +--------+--------+ - 0 w x x+w - dst pdst pdst+1 - m = PPW - x - n = w - m - - implementation: - get m pixels, shift screen-right by x, zero screen-leftmost x - pixels; zero rightmost m bits of *pdst and OR in stuff - from before the semicolon. - shift src screen-left by m, zero bits n-32; - zero leftmost n pixels of *(pdst+1) and OR in the - stuff from before the semicolon. - -putbitsrop(src, x, w, pdst, planemask, ROP) - like putbits but calls DoRop with the rasterop ROP (see cfb.h for - DoRop) - -getleftbits(psrc, w, dst) - get the leftmost w (w<=PPW) bits from *psrc and put them - in dst. this is used by the cfbGlyphBlt code for glyphs - <=PPW bits wide. -*/ - -#if (BITMAP_BIT_ORDER == MSBFirst) -#define BitRight(lw,n) ((lw) >> (n)) -#define BitLeft(lw,n) ((lw) << (n)) -#else /* (BITMAP_BIT_ORDER == LSBFirst) */ -#define BitRight(lw,n) ((lw) << (n)) -#define BitLeft(lw,n) ((lw) >> (n)) -#endif /* (BITMAP_BIT_ORDER == MSBFirst) */ - -#define SCRLEFT(lw, n) BitLeft (lw, (n) * PSZ) -#define SCRRIGHT(lw, n) BitRight(lw, (n) * PSZ) - -/* - * Note that the shift direction is independent of the byte ordering of the - * machine. The following is portable code. - */ -#if PPW == 16 -#define PFILL(p) ( ((p)&PMSK) | \ - ((p)&PMSK) << PSZ | \ - ((p)&PMSK) << 2*PSZ | \ - ((p)&PMSK) << 3*PSZ | \ - ((p)&PMSK) << 4*PSZ | \ - ((p)&PMSK) << 5*PSZ | \ - ((p)&PMSK) << 6*PSZ | \ - ((p)&PMSK) << 7*PSZ | \ - ((p)&PMSK) << 8*PSZ | \ - ((p)&PMSK) << 9*PSZ | \ - ((p)&PMSK) << 10*PSZ | \ - ((p)&PMSK) << 11*PSZ | \ - ((p)&PMSK) << 12*PSZ | \ - ((p)&PMSK) << 13*PSZ | \ - ((p)&PMSK) << 14*PSZ | \ - ((p)&PMSK) << 15*PSZ ) -#define PFILL2(p, pf) { \ - pf = (p) & PMSK; \ - pf |= (pf << PSZ); \ - pf |= (pf << 2*PSZ); \ - pf |= (pf << 4*PSZ); \ - pf |= (pf << 8*PSZ); \ -} -#endif /* PPW == 16 */ -#if PPW == 8 -#define PFILL(p) ( ((p)&PMSK) | \ - ((p)&PMSK) << PSZ | \ - ((p)&PMSK) << 2*PSZ | \ - ((p)&PMSK) << 3*PSZ | \ - ((p)&PMSK) << 4*PSZ | \ - ((p)&PMSK) << 5*PSZ | \ - ((p)&PMSK) << 6*PSZ | \ - ((p)&PMSK) << 7*PSZ ) -#define PFILL2(p, pf) { \ - pf = (p) & PMSK; \ - pf |= (pf << PSZ); \ - pf |= (pf << 2*PSZ); \ - pf |= (pf << 4*PSZ); \ -} -#endif -#if PPW == 4 -#define PFILL(p) ( ((p)&PMSK) | \ - ((p)&PMSK) << PSZ | \ - ((p)&PMSK) << 2*PSZ | \ - ((p)&PMSK) << 3*PSZ ) -#define PFILL2(p, pf) { \ - pf = (p) & PMSK; \ - pf |= (pf << PSZ); \ - pf |= (pf << 2*PSZ); \ -} -#endif -#if PPW == 2 -#define PFILL(p) ( ((p)&PMSK) | \ - ((p)&PMSK) << PSZ ) -#define PFILL2(p, pf) { \ - pf = (p) & PMSK; \ - pf |= (pf << PSZ); \ -} -#endif -#if PPW == 1 -#define PFILL(p) (p) -#define PFILL2(p,pf) (pf = (p)) -#endif - -/* - * Reduced raster op - using precomputed values, perform the above - * in three instructions - */ - -#define DoRRop(dst, and, xor) (((dst) & (and)) ^ (xor)) - -#define DoMaskRRop(dst, and, xor, mask) \ - (((dst) & ((and) | ~(mask))) ^ (xor & mask)) - -#if PSZ != 32 || PPW != 1 - -# if (PSZ == 24 && PPW == 1) -#define maskbits(x, w, startmask, endmask, nlw) {\ - startmask = cfbstarttab[(x)&3]; \ - endmask = cfbendtab[((x)+(w)) & 3]; \ - nlw = ((((x)+(w))*3)>>2) - (((x)*3 +3)>>2); \ -} - -#define mask32bits(x, w, startmask, endmask) \ - startmask = cfbstarttab[(x)&3]; \ - endmask = cfbendtab[((x)+(w)) & 3]; - -#define maskpartialbits(x, w, mask) \ - mask = cfbstartpartial[(x) & 3] & cfbendpartial[((x)+(w)) & 3]; - -#define maskbits24(x, w, startmask, endmask, nlw) \ - startmask = cfbstarttab24[(x) & 3]; \ - endmask = cfbendtab24[((x)+(w)) & 3]; \ - if (startmask){ \ - nlw = (((w) - (4 - ((x) & 3))) >> 2); \ - } else { \ - nlw = (w) >> 2; \ - } - -#define getbits24(psrc, dst, index) {\ - register int idx; \ - switch(idx = ((index)&3)<<1){ \ - case 0: \ - dst = (*(psrc) &cfbmask[idx]); \ - break; \ - case 6: \ - dst = BitLeft((*(psrc) &cfbmask[idx]), cfb24Shift[idx]); \ - break; \ - default: \ - dst = BitLeft((*(psrc) &cfbmask[idx]), cfb24Shift[idx]) | \ - BitRight(((*((psrc)+1)) &cfbmask[idx+1]), cfb24Shift[idx+1]); \ - }; \ -} - -#define putbits24(src, w, pdst, planemask, index) {\ - register PixelGroup dstpixel; \ - register unsigned int idx; \ - switch(idx = ((index)&3)<<1){ \ - case 0: \ - dstpixel = (*(pdst) &cfbmask[idx]); \ - break; \ - case 6: \ - dstpixel = BitLeft((*(pdst) &cfbmask[idx]), cfb24Shift[idx]); \ - break; \ - default: \ - dstpixel = BitLeft((*(pdst) &cfbmask[idx]), cfb24Shift[idx])| \ - BitRight(((*((pdst)+1)) &cfbmask[idx+1]), cfb24Shift[idx+1]); \ - }; \ - dstpixel &= ~(planemask); \ - dstpixel |= (src & planemask); \ - *(pdst) &= cfbrmask[idx]; \ - switch(idx){ \ - case 0: \ - *(pdst) |= (dstpixel & cfbmask[idx]); \ - break; \ - case 2: \ - case 4: \ - pdst++;idx++; \ - *(pdst) = ((*(pdst)) & cfbrmask[idx]) | \ - (BitLeft(dstpixel, cfb24Shift[idx]) & cfbmask[idx]); \ - pdst--;idx--; \ - case 6: \ - *(pdst) |= (BitRight(dstpixel, cfb24Shift[idx]) & cfbmask[idx]); \ - break; \ - }; \ -} - -#define putbitsrop24(src, x, pdst, planemask, rop) \ -{ \ - register PixelGroup t1, dstpixel; \ - register unsigned int idx; \ - switch(idx = (x)<<1){ \ - case 0: \ - dstpixel = (*(pdst) &cfbmask[idx]); \ - break; \ - case 6: \ - dstpixel = BitLeft((*(pdst) &cfbmask[idx]), cfb24Shift[idx]); \ - break; \ - default: \ - dstpixel = BitLeft((*(pdst) &cfbmask[idx]), cfb24Shift[idx])| \ - BitRight(((*((pdst)+1)) &cfbmask[idx+1]), cfb24Shift[idx+1]); \ - }; \ - DoRop(t1, rop, (src), dstpixel); \ - dstpixel &= ~planemask; \ - dstpixel |= (t1 & planemask); \ - *(pdst) &= cfbrmask[idx]; \ - switch(idx){ \ - case 0: \ - *(pdst) |= (dstpixel & cfbmask[idx]); \ - break; \ - case 2: \ - case 4: \ - *((pdst)+1) = ((*((pdst)+1)) & cfbrmask[idx+1]) | \ - (BitLeft(dstpixel, cfb24Shift[idx+1]) & (cfbmask[idx+1])); \ - case 6: \ - *(pdst) |= (BitRight(dstpixel, cfb24Shift[idx]) & cfbmask[idx]); \ - }; \ -} -# else /* PSZ == 24 && PPW == 1 */ -#define maskbits(x, w, startmask, endmask, nlw) \ - startmask = cfbstarttab[(x)&PIM]; \ - endmask = cfbendtab[((x)+(w)) & PIM]; \ - if (startmask) \ - nlw = (((w) - (PPW - ((x)&PIM))) >> PWSH); \ - else \ - nlw = (w) >> PWSH; - -#define maskpartialbits(x, w, mask) \ - mask = cfbstartpartial[(x) & PIM] & cfbendpartial[((x) + (w)) & PIM]; - -#define mask32bits(x, w, startmask, endmask) \ - startmask = cfbstarttab[(x)&PIM]; \ - endmask = cfbendtab[((x)+(w)) & PIM]; - -/* FIXME */ -#define maskbits24(x, w, startmask, endmask, nlw) \ - abort() -#define getbits24(psrc, dst, index) \ - abort() -#define putbits24(src, w, pdst, planemask, index) \ - abort() -#define putbitsrop24(src, x, pdst, planemask, rop) \ - abort() - -#endif /* PSZ == 24 && PPW == 1 */ - -#define getbits(psrc, x, w, dst) \ -if ( ((x) + (w)) <= PPW) \ -{ \ - dst = SCRLEFT(*(psrc), (x)); \ -} \ -else \ -{ \ - int m; \ - m = PPW-(x); \ - dst = (SCRLEFT(*(psrc), (x)) & cfbendtab[m]) | \ - (SCRRIGHT(*((psrc)+1), m) & cfbstarttab[m]); \ -} - - -#define putbits(src, x, w, pdst, planemask) \ -if ( ((x)+(w)) <= PPW) \ -{ \ - PixelGroup tmpmask; \ - maskpartialbits((x), (w), tmpmask); \ - tmpmask &= PFILL(planemask); \ - *(pdst) = (*(pdst) & ~tmpmask) | (SCRRIGHT(src, x) & tmpmask); \ -} \ -else \ -{ \ - unsigned int m; \ - unsigned int n; \ - PixelGroup pm = PFILL(planemask); \ - m = PPW-(x); \ - n = (w) - m; \ - *(pdst) = (*(pdst) & (cfbendtab[x] | ~pm)) | \ - (SCRRIGHT(src, x) & (cfbstarttab[x] & pm)); \ - *((pdst)+1) = (*((pdst)+1) & (cfbstarttab[n] | ~pm)) | \ - (SCRLEFT(src, m) & (cfbendtab[n] & pm)); \ -} -#if defined(__GNUC__) && defined(mc68020) -#undef getbits -#define FASTGETBITS(psrc, x, w, dst) \ - asm ("bfextu %3{%1:%2},%0" \ - : "=d" (dst) : "di" (x), "di" (w), "o" (*(char *)(psrc))) - -#define getbits(psrc,x,w,dst) \ -{ \ - FASTGETBITS(psrc, (x) * PSZ, (w) * PSZ, dst); \ - dst = SCRLEFT(dst,PPW-(w)); \ -} - -#define FASTPUTBITS(src, x, w, pdst) \ - asm ("bfins %3,%0{%1:%2}" \ - : "=o" (*(char *)(pdst)) \ - : "di" (x), "di" (w), "d" (src), "0" (*(char *) (pdst))) - -#undef putbits -#define putbits(src, x, w, pdst, planemask) \ -{ \ - if (planemask != PMSK) { \ - PixelGroup _m, _pm; \ - FASTGETBITS(pdst, (x) * PSZ , (w) * PSZ, _m); \ - PFILL2(planemask, _pm); \ - _m &= (~_pm); \ - _m |= (SCRRIGHT(src, PPW-(w)) & _pm); \ - FASTPUTBITS(_m, (x) * PSZ, (w) * PSZ, pdst); \ - } else { \ - FASTPUTBITS(SCRRIGHT(src, PPW-(w)), (x) * PSZ, (w) * PSZ, pdst); \ - } \ -} - - -#endif /* mc68020 */ - -#define putbitsrop(src, x, w, pdst, planemask, rop) \ -if ( ((x)+(w)) <= PPW) \ -{ \ - PixelGroup tmpmask; \ - PixelGroup t1, t2; \ - maskpartialbits((x), (w), tmpmask); \ - PFILL2(planemask, t1); \ - tmpmask &= t1; \ - t1 = SCRRIGHT((src), (x)); \ - DoRop(t2, rop, t1, *(pdst)); \ - *(pdst) = (*(pdst) & ~tmpmask) | (t2 & tmpmask); \ -} \ -else \ -{ \ - CfbBits m; \ - CfbBits n; \ - PixelGroup t1, t2; \ - PixelGroup pm; \ - PFILL2(planemask, pm); \ - m = PPW-(x); \ - n = (w) - m; \ - t1 = SCRRIGHT((src), (x)); \ - DoRop(t2, rop, t1, *(pdst)); \ - *(pdst) = (*(pdst) & (cfbendtab[x] | ~pm)) | (t2 & (cfbstarttab[x] & pm));\ - t1 = SCRLEFT((src), m); \ - DoRop(t2, rop, t1, *((pdst) + 1)); \ - *((pdst)+1) = (*((pdst)+1) & (cfbstarttab[n] | ~pm)) | \ - (t2 & (cfbendtab[n] & pm)); \ -} - -#else /* PSZ == 32 && PPW == 1*/ - -/* - * These macros can be optimized for 32-bit pixels since there is no - * need to worry about left/right edge masking. These macros were - * derived from the above using the following reductions: - * - * - x & PIW = 0 [since PIW = 0] - * - all masking tables are only indexed by 0 [ due to above ] - * - cfbstartab[0] and cfbendtab[0] = 0 [ no left/right edge masks] - * - cfbstartpartial[0] and cfbendpartial[0] = ~0 [no partial pixel mask] - * - * Macro reduction based upon constants cannot be performed automatically - * by the compiler since it does not know the contents of the masking - * arrays in cfbmskbits.c. - */ -#define maskbits(x, w, startmask, endmask, nlw) \ - startmask = endmask = 0; \ - nlw = (w); - -#define maskpartialbits(x, w, mask) \ - mask = 0xFFFFFFFF; - -#define mask32bits(x, w, startmask, endmask) \ - startmask = endmask = 0; - -/* - * For 32-bit operations, getbits(), putbits(), and putbitsrop() - * will only be invoked with x = 0 and w = PPW (1). The getbits() - * macro is only called within left/right edge logic, which doesn't - * happen for 32-bit pixels. - */ -#define getbits(psrc, x, w, dst) (dst) = *(psrc) - -#define putbits(src, x, w, pdst, planemask) \ - *(pdst) = (*(pdst) & ~planemask) | (src & planemask); - -#define putbitsrop(src, x, w, pdst, planemask, rop) \ -{ \ - PixelGroup t1; \ - DoRop(t1, rop, (src), *(pdst)); \ - *(pdst) = (*(pdst) & ~planemask) | (t1 & planemask); \ -} - -#endif /* PSZ != 32 */ - -/* - * Use these macros only when you're using the MergeRop stuff - * in ../mfb/mergerop.h - */ - -/* useful only when not spanning destination longwords */ -#if PSZ == 24 -#define putbitsmropshort24(src,x,w,pdst,index) {\ - PixelGroup _tmpmask; \ - PixelGroup _t1; \ - maskpartialbits ((x), (w), _tmpmask); \ - _t1 = SCRRIGHT((src), (x)); \ - DoMaskMergeRop24(_t1, pdst, _tmpmask, index); \ -} -#endif -#define putbitsmropshort(src,x,w,pdst) {\ - PixelGroup _tmpmask; \ - PixelGroup _t1; \ - maskpartialbits ((x), (w), _tmpmask); \ - _t1 = SCRRIGHT((src), (x)); \ - *pdst = DoMaskMergeRop(_t1, *pdst, _tmpmask); \ -} - -/* useful only when spanning destination longwords */ -#define putbitsmroplong(src,x,w,pdst) { \ - PixelGroup _startmask, _endmask; \ - int _m; \ - PixelGroup _t1; \ - _m = PPW - (x); \ - _startmask = cfbstarttab[x]; \ - _endmask = cfbendtab[(w) - _m]; \ - _t1 = SCRRIGHT((src), (x)); \ - pdst[0] = DoMaskMergeRop(_t1,pdst[0],_startmask); \ - _t1 = SCRLEFT ((src),_m); \ - pdst[1] = DoMaskMergeRop(_t1,pdst[1],_endmask); \ -} - -#define putbitsmrop(src,x,w,pdst) \ -if ((x) + (w) <= PPW) {\ - putbitsmropshort(src,x,w,pdst); \ -} else { \ - putbitsmroplong(src,x,w,pdst); \ -} - -#if GETLEFTBITS_ALIGNMENT == 1 -#define getleftbits(psrc, w, dst) dst = *((unsigned int *) psrc) -#define getleftbits24(psrc, w, dst, idx){ \ - regiseter int index; \ - switch(index = ((idx)&3)<<1){ \ - case 0: \ - dst = (*((unsigned int *) psrc))&cfbmask[index]; \ - break; \ - case 2: \ - case 4: \ - dst = BitLeft(((*((unsigned int *) psrc))&cfbmask[index]), cfb24Shift[index]); \ - dst |= BitRight(((*((unsigned int *) psrc)+1)&cfbmask[index]), cfb4Shift[index]); \ - break; \ - case 6: \ - dst = BitLeft((*((unsigned int *) psrc)),cfb24Shift[index]); \ - break; \ - }; \ -} -#endif /* GETLEFTBITS_ALIGNMENT == 1 */ - -#define getglyphbits(psrc, x, w, dst) \ -{ \ - dst = BitLeft((unsigned) *(psrc), (x)); \ - if ( ((x) + (w)) > 32) \ - dst |= (BitRight((unsigned) *((psrc)+1), 32-(x))); \ -} -#if GETLEFTBITS_ALIGNMENT == 2 -#define getleftbits(psrc, w, dst) \ - { \ - if ( ((int)(psrc)) & 0x01 ) \ - getglyphbits( ((unsigned int *)(((char *)(psrc))-1)), 8, (w), (dst) ); \ - else \ - dst = *((unsigned int *) psrc); \ - } -#endif /* GETLEFTBITS_ALIGNMENT == 2 */ - -#if GETLEFTBITS_ALIGNMENT == 4 -#define getleftbits(psrc, w, dst) \ - { \ - int off, off_b; \ - off_b = (off = ( ((int)(psrc)) & 0x03)) << 3; \ - getglyphbits( \ - (unsigned int *)( ((char *)(psrc)) - off), \ - (off_b), (w), (dst) \ - ); \ - } -#endif /* GETLEFTBITS_ALIGNMENT == 4 */ - -/* - * getstipplepixels( psrcstip, x, w, ones, psrcpix, destpix ) - * - * Converts bits to pixels in a reasonable way. Takes w (1 <= w <= PPW) - * bits from *psrcstip, starting at bit x; call this a quartet of bits. - * Then, takes the pixels from *psrcpix corresponding to the one-bits (if - * ones is TRUE) or the zero-bits (if ones is FALSE) of the quartet - * and puts these pixels into destpix. - * - * Example: - * - * getstipplepixels( &(0x08192A3B), 17, 4, 1, &(0x4C5D6E7F), dest ) - * - * 0x08192A3B = 0000 1000 0001 1001 0010 1010 0011 1011 - * - * This will take 4 bits starting at bit 17, so the quartet is 0x5 = 0101. - * It will take pixels from 0x4C5D6E7F corresponding to the one-bits in this - * quartet, so dest = 0x005D007F. - * - * XXX Works with both byte order. - * XXX This works for all values of x and w within a doubleword. - */ -#if (BITMAP_BIT_ORDER == MSBFirst) -#define getstipplepixels( psrcstip, x, w, ones, psrcpix, destpix ) \ -{ \ - PixelGroup q; \ - int m; \ - if ((m = ((x) - ((PPW*PSZ)-PPW))) > 0) { \ - q = (*(psrcstip)) << m; \ - if ( (x)+(w) > (PPW*PSZ) ) \ - q |= *((psrcstip)+1) >> ((PPW*PSZ)-m); \ - } \ - else \ - q = (*(psrcstip)) >> -m; \ - q = QuartetBitsTable[(w)] & ((ones) ? q : ~q); \ - *(destpix) = (*(psrcpix)) & QuartetPixelMaskTable[q]; \ -} -/* I just copied this to get the linker satisfied on PowerPC, - * so this may not be correct at all. - */ -#define getstipplepixels24(psrcstip,xt,ones,psrcpix,destpix,stipindex) \ -{ \ - PixelGroup q; \ - q = *(psrcstip) >> (xt); \ - q = ((ones) ? q : ~q) & 1; \ - *(destpix) = (*(psrcpix)) & QuartetPixelMaskTable[q]; \ -} -#else /* BITMAP_BIT_ORDER == LSB */ - -/* this must load 32 bits worth; for most machines, thats an int */ -#define CfbFetchUnaligned(x) ldl_u(x) - -#define getstipplepixels( psrcstip, xt, w, ones, psrcpix, destpix ) \ -{ \ - PixelGroup q; \ - q = CfbFetchUnaligned(psrcstip) >> (xt); \ - if ( ((xt)+(w)) > (PPW*PSZ) ) \ - q |= (CfbFetchUnaligned((psrcstip)+1)) << ((PPW*PSZ)-(xt)); \ - q = QuartetBitsTable[(w)] & ((ones) ? q : ~q); \ - *(destpix) = (*(psrcpix)) & QuartetPixelMaskTable[q]; \ -} -#if PSZ == 24 -# if 0 -#define getstipplepixels24(psrcstip,xt,w,ones,psrcpix,destpix,stipindex,srcindex,dstindex) \ -{ \ - PixelGroup q; \ - CfbBits src; \ - register unsigned int sidx; \ - register unsigned int didx; \ - sidx = ((srcindex) & 3)<<1; \ - didx = ((dstindex) & 3)<<1; \ - q = *(psrcstip) >> (xt); \ -/* if((srcindex)!=0)*/ \ -/* src = (((*(psrcpix)) << cfb24Shift[sidx]) & (cfbmask[sidx])) |*/ \ -/* (((*((psrcpix)+1)) << cfb24Shift[sidx+1]) & (cfbmask[sidx+1])); */\ -/* else */\ - src = (*(psrcpix))&0xFFFFFF; \ - if ( ((xt)+(w)) > PGSZ ) \ - q |= (*((psrcstip)+1)) << (PGSZ -(xt)); \ - q = QuartetBitsTable[(w)] & ((ones) ? q : ~q); \ - src &= QuartetPixelMaskTable[q]; \ - *(destpix) &= cfbrmask[didx]; \ - switch(didx) {\ - case 0: \ - *(destpix) |= (src &cfbmask[didx]); \ - break; \ - case 2: \ - case 4: \ - destpix++;didx++; \ - *(destpix) = ((*(destpix)) & (cfbrmask[didx]))| \ - (BitLeft(src, cfb24Shift[didx]) & (cfbmask[didx])); \ - destpix--; didx--;\ - case 6: \ - *(destpix) |= (BitRight(src, cfb24Shift[didx]) & cfbmask[didx]); \ - break; \ - }; \ -} -# else -#define getstipplepixels24(psrcstip,xt,ones,psrcpix,destpix,stipindex) \ -{ \ - PixelGroup q; \ - q = *(psrcstip) >> (xt); \ - q = ((ones) ? q : ~q) & 1; \ - *(destpix) = (*(psrcpix)) & QuartetPixelMaskTable[q]; \ -} -# endif -#endif /* PSZ == 24 */ -#endif - -extern PixelGroup cfbstarttab[]; -extern PixelGroup cfbendtab[]; -extern PixelGroup cfbstartpartial[]; -extern PixelGroup cfbendpartial[]; -extern PixelGroup cfbrmask[]; -extern PixelGroup cfbmask[]; -extern PixelGroup QuartetBitsTable[]; -extern PixelGroup QuartetPixelMaskTable[]; -#if PSZ == 24 -extern int cfb24Shift[]; -#endif diff --git a/nx-X11/programs/Xserver/cfb/cfbpixmap.c b/nx-X11/programs/Xserver/cfb/cfbpixmap.c deleted file mode 100644 index 704ab4eda..000000000 --- a/nx-X11/programs/Xserver/cfb/cfbpixmap.c +++ /dev/null @@ -1,376 +0,0 @@ -/* $Xorg: cfbpixmap.c,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $ */ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XFree86: xc/programs/Xserver/cfb/cfbpixmap.c,v 1.4 2001/01/17 22:36:36 dawes Exp $ */ -/* pixmap management - written by drewry, september 1986 - - on a monchrome device, a pixmap is a bitmap. -*/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include "servermd.h" -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "mi.h" -#include "cfb.h" -#include "cfbmskbits.h" - -PixmapPtr -cfbCreatePixmap (pScreen, width, height, depth) - ScreenPtr pScreen; - int width; - int height; - int depth; -{ - PixmapPtr pPixmap; - size_t datasize; - size_t paddedWidth; - - paddedWidth = PixmapBytePad(width, depth); - - if (paddedWidth / 4 > 32767 || height > 32767) - return NullPixmap; - datasize = height * paddedWidth; - pPixmap = AllocatePixmap(pScreen, datasize); - if (!pPixmap) - return NullPixmap; - pPixmap->drawable.type = DRAWABLE_PIXMAP; - pPixmap->drawable.class = 0; - pPixmap->drawable.pScreen = pScreen; - pPixmap->drawable.depth = depth; - pPixmap->drawable.bitsPerPixel = BitsPerPixel(depth); - pPixmap->drawable.id = 0; - pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; - pPixmap->drawable.x = 0; - pPixmap->drawable.y = 0; - pPixmap->drawable.width = width; - pPixmap->drawable.height = height; - pPixmap->devKind = paddedWidth; - pPixmap->refcnt = 1; -#ifdef PIXPRIV - pPixmap->devPrivate.ptr = datasize ? - (pointer)((char *)pPixmap + pScreen->totalPixmapSize) : NULL; -#else - pPixmap->devPrivate.ptr = (pointer)(pPixmap + 1); -#endif - return pPixmap; -} - -Bool -cfbDestroyPixmap(pPixmap) - PixmapPtr pPixmap; -{ - if(--pPixmap->refcnt) - return TRUE; - xfree(pPixmap); - return TRUE; -} - -PixmapPtr -cfbCopyPixmap(pSrc) - register PixmapPtr pSrc; -{ - register PixmapPtr pDst; - int size; - ScreenPtr pScreen; - - size = pSrc->drawable.height * pSrc->devKind; - pScreen = pSrc->drawable.pScreen; - pDst = (*pScreen->CreatePixmap) (pScreen, pSrc->drawable.width, - pSrc->drawable.height, pSrc->drawable.depth); - if (!pDst) - return NullPixmap; - memmove((char *)pDst->devPrivate.ptr, (char *)pSrc->devPrivate.ptr, size); - return pDst; -} - - -/* replicates a pattern to be a full 32 bits wide. - relies on the fact that each scnaline is longword padded. - doesn't do anything if pixmap is not a factor of 32 wide. - changes width field of pixmap if successful, so that the fast - cfbXRotatePixmap code gets used if we rotate the pixmap later. - cfbYRotatePixmap code gets used if we rotate the pixmap later. - - calculate number of times to repeat - for each scanline of pattern - zero out area to be filled with replicate - left shift and or in original as many times as needed -*/ -void -cfbPadPixmap(pPixmap) - PixmapPtr pPixmap; -{ - register int width = (pPixmap->drawable.width) * (pPixmap->drawable.bitsPerPixel); - register int h; - register CfbBits mask; - register CfbBits *p; - register CfbBits bits; /* real pattern bits */ - register int i; - int rep; /* repeat count for pattern */ - - if (width >= PGSZ) - return; - - rep = PGSZ/width; - if (rep*width != PGSZ) - return; - - mask = mfbGetendtab(width); - - p = (CfbBits *)(pPixmap->devPrivate.ptr); - for (h=0; h < pPixmap->drawable.height; h++) - { - *p &= mask; - bits = *p; - for(i=1; i>= width; -#else - bits <<= width; -#endif - *p |= bits; - } - p++; - } - pPixmap->drawable.width = PGSZ/(pPixmap->drawable.bitsPerPixel); -} - - -#ifdef notdef -/* - * cfb debugging routine -- assumes pixmap is 1 byte deep - */ -static cfbdumppixmap(pPix) - PixmapPtr pPix; -{ - unsigned int *pw; - char *psrc, *pdst; - int i, j; - char line[66]; - - ErrorF( "pPixmap: 0x%x\n", pPix); - ErrorF( "%d wide %d high\n", pPix->drawable.width, pPix->drawable.height); - if (pPix->drawable.width > 64) - { - ErrorF( "too wide to see\n"); - return; - } - - pw = (unsigned int *) pPix->devPrivate.ptr; - psrc = (char *) pw; - -/* - for ( i=0; idrawable.height; ++i ) - ErrorF( "0x%x\n", pw[i] ); -*/ - - for ( i = 0; i < pPix->drawable.height; ++i ) { - pdst = line; - for(j = 0; j < pPix->drawable.width; j++) { - *pdst++ = *psrc++ ? 'X' : ' ' ; - } - *pdst++ = '\n'; - *pdst++ = '\0'; - ErrorF( "%s", line); - } -} -#endif /* notdef */ - -/* Rotates pixmap pPix by w pixels to the right on the screen. Assumes that - * words are PGSZ bits wide, and that the least significant bit appears on the - * left. - */ -void -cfbXRotatePixmap(pPix, rw) - PixmapPtr pPix; - register int rw; -{ - register CfbBits *pw, *pwFinal; - register CfbBits t; - int rot; - - if (pPix == NullPixmap) - return; - - switch (((DrawablePtr) pPix)->bitsPerPixel) { - case PSZ: - break; - case 1: - mfbXRotatePixmap(pPix, rw); - return; - default: - ErrorF("cfbXRotatePixmap: unsupported bitsPerPixel %d\n", ((DrawablePtr) pPix)->bitsPerPixel); - return; - } - pw = (CfbBits *)pPix->devPrivate.ptr; - modulus (rw, (int) pPix->drawable.width, rot); - if(pPix->drawable.width == PPW) - { - pwFinal = pw + pPix->drawable.height; - while(pw < pwFinal) - { - t = *pw; - *pw++ = SCRRIGHT(t, rot) | - (SCRLEFT(t, (PPW-rot)) & cfbendtab[rot]); - } - } - else - { - ErrorF("cfb internal error: trying to rotate odd-sized pixmap.\n"); -#ifdef notdef - register CfbBits *pwTmp; - int size, tsize; - - tsize = PixmapBytePad(pPix->drawable.width - rot, pPix->drawable.depth); - pwTmp = (CfbBits *) ALLOCATE_LOCAL(pPix->drawable.height * tsize); - if (!pwTmp) - return; - /* divide pw (the pixmap) in two vertically at (w - rot) and swap */ - tsize >>= 2; - size = pPix->devKind >> SIZE0F(PixelGroup); - cfbQuickBlt((CfbBits *)pw, (CfbBits *)pwTmp, - 0, 0, 0, 0, - (int)pPix->drawable.width - rot, (int)pPix->drawable.height, - size, tsize); - cfbQuickBlt((CfbBits *)pw, (CfbBits *)pw, - (int)pPix->drawable.width - rot, 0, 0, 0, - rot, (int)pPix->drawable.height, - size, size); - cfbQuickBlt((CfbBits *)pwTmp, (CfbBits *)pw, - 0, 0, rot, 0, - (int)pPix->drawable.width - rot, (int)pPix->drawable.height, - tsize, size); - DEALLOCATE_LOCAL(pwTmp); -#endif - } -} - -/* Rotates pixmap pPix by h lines. Assumes that h is always less than - pPix->drawable.height - works on any width. - */ -void -cfbYRotatePixmap(pPix, rh) - register PixmapPtr pPix; - int rh; -{ - int nbyDown; /* bytes to move down to row 0; also offset of - row rh */ - int nbyUp; /* bytes to move up to line rh; also - offset of first line moved down to 0 */ - char *pbase; - char *ptmp; - int rot; - - if (pPix == NullPixmap) - return; - switch (((DrawablePtr) pPix)->bitsPerPixel) { - case PSZ: - break; - case 1: - mfbYRotatePixmap(pPix, rh); - return; - default: - ErrorF("cfbYRotatePixmap: unsupported bitsPerPixel %d\n", ((DrawablePtr) pPix)->bitsPerPixel); - return; - } - - modulus (rh, (int) pPix->drawable.height, rot); - pbase = (char *)pPix->devPrivate.ptr; - - nbyDown = rot * pPix->devKind; - nbyUp = (pPix->devKind * pPix->drawable.height) - nbyDown; - if(!(ptmp = (char *)ALLOCATE_LOCAL(nbyUp))) - return; - - memmove(ptmp, pbase, nbyUp); /* save the low rows */ - memmove(pbase, pbase+nbyUp, nbyDown); /* slide the top rows down */ - memmove(pbase+nbyDown, ptmp, nbyUp); /* move lower rows up to row rot */ - DEALLOCATE_LOCAL(ptmp); -} - -void -cfbCopyRotatePixmap(psrcPix, ppdstPix, xrot, yrot) - register PixmapPtr psrcPix, *ppdstPix; - int xrot, yrot; -{ - register PixmapPtr pdstPix; - - if ((pdstPix = *ppdstPix) && - (pdstPix->devKind == psrcPix->devKind) && - (pdstPix->drawable.height == psrcPix->drawable.height)) - { - memmove((char *)pdstPix->devPrivate.ptr, - (char *)psrcPix->devPrivate.ptr, - psrcPix->drawable.height * psrcPix->devKind); - pdstPix->drawable.width = psrcPix->drawable.width; - pdstPix->drawable.depth = psrcPix->drawable.depth; - pdstPix->drawable.bitsPerPixel = psrcPix->drawable.bitsPerPixel; - pdstPix->drawable.serialNumber = NEXT_SERIAL_NUMBER; - } - else - { - if (pdstPix) - /* FIX XBUG 6168 */ - (*pdstPix->drawable.pScreen->DestroyPixmap)(pdstPix); - *ppdstPix = pdstPix = cfbCopyPixmap(psrcPix); - if (!pdstPix) - return; - } - cfbPadPixmap(pdstPix); - if (xrot) - cfbXRotatePixmap(pdstPix, xrot); - if (yrot) - cfbYRotatePixmap(pdstPix, yrot); -} diff --git a/nx-X11/programs/Xserver/cfb/cfbply1rct.c b/nx-X11/programs/Xserver/cfb/cfbply1rct.c deleted file mode 100644 index 99a2379c9..000000000 --- a/nx-X11/programs/Xserver/cfb/cfbply1rct.c +++ /dev/null @@ -1,363 +0,0 @@ -/* - * $Xorg: cfbply1rct.c,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $ - * -Copyright 1990, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - * - * Author: Keith Packard, MIT X Consortium - */ -/* $XFree86: xc/programs/Xserver/cfb/cfbply1rct.c,v 3.10 2003/10/29 22:44:53 tsi Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include - -#include "gcstruct.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "regionstr.h" -#include "scrnintstr.h" -#include "mistruct.h" - -#include "cfb.h" -#include "cfbmskbits.h" -#include "cfbrrop.h" - -void -RROP_NAME(cfbFillPoly1Rect) (pDrawable, pGC, shape, mode, count, ptsIn) - DrawablePtr pDrawable; - GCPtr pGC; - int shape; - int mode; - int count; - DDXPointPtr ptsIn; -{ - cfbPrivGCPtr devPriv; - int nwidth; - CfbBits *addrl, *addr; -#if PSZ == 24 - CfbBits startmask, endmask; - register int pidx; -#else -#if PPW > 1 - CfbBits mask, bits = ~((CfbBits)0); -#endif -#endif - int maxy; - int origin; - register int vertex1, vertex2; - int c = 0; - BoxPtr extents; - int clip; - int y; - int *vertex1p = NULL, *vertex2p; - int *endp; - int x1 = 0, x2 = 0; - int dx1 = 0, dx2 = 0; - int dy1 = 0, dy2 = 0; - int e1 = 0, e2 = 0; - int step1 = 0, step2 = 0; - int sign1 = 0, sign2 = 0; - int h; - int l; -#if PSZ != 24 && PPW > 1 - int r; -#endif - int nmiddle; - RROP_DECLARE - - if (mode == CoordModePrevious) - { - miFillPolygon (pDrawable, pGC, shape, mode, count, ptsIn); - return; - } - - devPriv = cfbGetGCPrivate(pGC); -#ifdef NO_ONE_RECT - if (REGION_NUM_RECTS(pGC->pCompositeClip) != 1) - { - miFillPolygon (pDrawable, pGC, shape, mode, count, ptsIn); - return; - } -#endif - origin = *((int *) &pDrawable->x); - vertex2 = origin - ((origin & 0x8000) << 1); - extents = &pGC->pCompositeClip->extents; - RROP_FETCH_GCPRIV(devPriv); - vertex1 = *((int *) &extents->x1) - vertex2; - vertex2 = *((int *) &extents->x2) - vertex2 - 0x00010001; - clip = 0; - y = 32767; - maxy = 0; - vertex2p = (int *) ptsIn; - endp = vertex2p + count; - if (shape == Convex) - { - while (count--) - { - c = *vertex2p; - clip |= (c - vertex1) | (vertex2 - c); - c = intToY(c); - if (c < y) - { - y = c; - vertex1p = vertex2p; - } - vertex2p++; - if (c > maxy) - maxy = c; - } - } - else - { - int yFlip = 0; - dx1 = 1; - x2 = -1; - x1 = -1; - while (count--) - { - c = *vertex2p; - clip |= (c - vertex1) | (vertex2 - c); - c = intToY(c); - if (c < y) - { - y = c; - vertex1p = vertex2p; - } - vertex2p++; - if (c > maxy) - maxy = c; - if (c == x1) - continue; - if (dx1 > 0) - { - if (x2 < 0) - x2 = c; - else - dx2 = dx1 = (c - x1) >> 31; - } - else - if ((c - x1) >> 31 != dx1) - { - dx1 = ~dx1; - yFlip++; - } - x1 = c; - } - x1 = (x2 - c) >> 31; - if (x1 != dx1) - yFlip++; - if (x1 != dx2) - yFlip++; - if (yFlip != 2) - clip = 0x8000; - } - if (y == maxy) - return; - - if (clip & 0x80008000) - { - miFillPolygon (pDrawable, pGC, shape, mode, vertex2p - (int *) ptsIn, ptsIn); - return; - } - -#define AddrYPlus(a,y) (CfbBits *) (((unsigned char *) (a)) + (y) * nwidth) - - cfbGetTypedWidthAndPointer(pDrawable, nwidth, addrl, unsigned char, CfbBits); - addrl = AddrYPlus(addrl,y + pDrawable->y); - origin = intToX(origin); - vertex2p = vertex1p; - vertex2 = vertex1 = *vertex2p++; - if (vertex2p == endp) - vertex2p = (int *) ptsIn; -#define Setup(c,x,vertex,dx,dy,e,sign,step) {\ - x = intToX(vertex); \ - if ((dy = intToY(c) - y)) { \ - dx = intToX(c) - x; \ - step = 0; \ - if (dx >= 0) \ - { \ - e = 0; \ - sign = 1; \ - if (dx >= dy) {\ - step = dx / dy; \ - dx = dx % dy; \ - } \ - } \ - else \ - { \ - e = 1 - dy; \ - sign = -1; \ - dx = -dx; \ - if (dx >= dy) { \ - step = - (dx / dy); \ - dx = dx % dy; \ - } \ - } \ - } \ - x += origin; \ - vertex = c; \ -} - -#define Step(x,dx,dy,e,sign,step) {\ - x += step; \ - if ((e += dx) > 0) \ - { \ - x += sign; \ - e -= dy; \ - } \ -} - for (;;) - { - if (y == intToY(vertex1)) - { - do - { - if (vertex1p == (int *) ptsIn) - vertex1p = endp; - c = *--vertex1p; - Setup (c,x1,vertex1,dx1,dy1,e1,sign1,step1) - } while (y >= intToY(vertex1)); - h = dy1; - } - else - { - Step(x1,dx1,dy1,e1,sign1,step1) - h = intToY(vertex1) - y; - } - if (y == intToY(vertex2)) - { - do - { - c = *vertex2p++; - if (vertex2p == endp) - vertex2p = (int *) ptsIn; - Setup (c,x2,vertex2,dx2,dy2,e2,sign2,step2) - } while (y >= intToY(vertex2)); - if (dy2 < h) - h = dy2; - } - else - { - Step(x2,dx2,dy2,e2,sign2,step2) - if ((c = (intToY(vertex2) - y)) < h) - h = c; - } - /* fill spans for this segment */ - y += h; - for (;;) - { - l = x1; -#if PSZ != 24 && PPW > 1 - r = x2; -#endif - nmiddle = x2 - x1; - if (nmiddle < 0) - { - nmiddle = -nmiddle; - l = x2; -#if PSZ != 24 && PPW > 1 - r = x1; -#endif - } -#if PPW > 1 - c = l & PIM; - l -= c; -#endif - -#if PGSZ == 32 -#define LWRD_SHIFT 2 -#else /* PGSZ == 64 */ -#define LWRD_SHIFT 3 -#endif /* PGSZ */ - -#if PSZ == 24 - addr = (CfbBits *)((char *)addrl + ((l * 3) & ~0x03)); - if (nmiddle <= 1){ - if (nmiddle) - RROP_SOLID24(addr, l); - } else { - maskbits(l, nmiddle, startmask, endmask, nmiddle); - pidx = l & 3; - if (startmask){ - RROP_SOLID_MASK(addr, startmask, pidx-1); - addr++; - if (pidx == 3) - pidx = 0; - } - while (--nmiddle >= 0){ - RROP_SOLID(addr, pidx); - addr++; - if (++pidx == 3) - pidx = 0; - } - if (endmask) - RROP_SOLID_MASK(addr, endmask, pidx); - } -#else /* PSZ == 24 */ -#if PWSH > LWRD_SHIFT - l = l >> (PWSH - LWRD_SHIFT); -#endif -#if PWSH < LWRD_SHIFT - l = l << (LWRD_SHIFT - PWSH); -#endif - addr = (CfbBits *) (((char *) addrl) + l); -#if PPW > 1 - if (c + nmiddle < PPW) - { - mask = SCRRIGHT (bits,c) ^ SCRRIGHT (bits,c+nmiddle); - RROP_SOLID_MASK(addr,mask); - } - else - { - if (c) - { - mask = SCRRIGHT(bits, c); - RROP_SOLID_MASK(addr,mask); - nmiddle += c - PPW; - addr++; - } -#endif - nmiddle >>= PWSH; - while (--nmiddle >= 0) { - RROP_SOLID(addr); addr++; - } -#if PPW > 1 - if ((mask = ~SCRRIGHT(bits, r & PIM))) - RROP_SOLID_MASK(addr,mask); - } -#endif -#endif /* PSZ == 24 */ - if (!--h) - break; - addrl = AddrYPlus (addrl, 1); - Step(x1,dx1,dy1,e1,sign1,step1) - Step(x2,dx2,dy2,e2,sign2,step2) - } - if (y == maxy) - break; - addrl = AddrYPlus (addrl, 1); - } - RROP_UNDECLARE -} diff --git a/nx-X11/programs/Xserver/cfb/cfbpntwin.c b/nx-X11/programs/Xserver/cfb/cfbpntwin.c deleted file mode 100644 index 01b948361..000000000 --- a/nx-X11/programs/Xserver/cfb/cfbpntwin.c +++ /dev/null @@ -1,771 +0,0 @@ -/* $XdotOrg: xc/programs/Xserver/cfb/cfbpntwin.c,v 1.5 2005/07/03 07:01:15 daniels Exp $ */ -/* $Xorg: cfbpntwin.c,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $ */ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XFree86: xc/programs/Xserver/cfb/cfbpntwin.c,v 3.7tsi Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include - -#include "windowstr.h" -#include "regionstr.h" -#include "pixmapstr.h" -#include "scrnintstr.h" - -#include "cfb.h" -#include "cfbmskbits.h" -#include "mi.h" - -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" -#endif - -void -cfbPaintWindow(pWin, pRegion, what) - WindowPtr pWin; - RegionPtr pRegion; - int what; -{ - register cfbPrivWin *pPrivWin; - WindowPtr pBgWin; - - pPrivWin = cfbGetWindowPrivate(pWin); - - - switch (what) { - case PW_BACKGROUND: - switch (pWin->backgroundState) { - case None: - break; - case ParentRelative: - do { - pWin = pWin->parent; - } while (pWin->backgroundState == ParentRelative); - (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion, - what); - break; - case BackgroundPixmap: - if (pPrivWin->fastBackground) - { - cfbFillBoxTile32 ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pPrivWin->pRotatedBackground); - } - else - { - int xorg = pWin->drawable.x; - int yorg = pWin->drawable.y; -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - int index = pWin->drawable.pScreen->myNum; - if(WindowTable[index] == pWin) { - xorg -= panoramiXdataPtr[index].x; - yorg -= panoramiXdataPtr[index].y; - } - } -#endif - cfbFillBoxTileOdd ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pWin->background.pixmap, - xorg, yorg); - } - break; - case BackgroundPixel: - cfbFillBoxSolid ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pWin->background.pixel); - break; - } - break; - case PW_BORDER: - if (pWin->borderIsPixel) - { - cfbFillBoxSolid ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pWin->border.pixel); - } - else if (pPrivWin->fastBorder) - { - cfbFillBoxTile32 ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pPrivWin->pRotatedBorder); - } - else - { - int xorg, yorg; - - for (pBgWin = pWin; - pBgWin->backgroundState == ParentRelative; - pBgWin = pBgWin->parent); - - xorg = pBgWin->drawable.x; - yorg = pBgWin->drawable.y; - -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - int index = pWin->drawable.pScreen->myNum; - if(WindowTable[index] == pBgWin) { - xorg -= panoramiXdataPtr[index].x; - yorg -= panoramiXdataPtr[index].y; - } - } -#endif - - cfbFillBoxTileOdd ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pWin->border.pixmap, - xorg, yorg); - } - break; - } -} - -/* - * Use the RROP macros in copy mode - */ - -#define RROP GXcopy -#include "cfbrrop.h" - -#ifdef RROP_UNROLL -# define Expand(left,right,leftAdjust) {\ - int part = nmiddle & RROP_UNROLL_MASK; \ - int widthStep; \ - widthStep = widthDst - nmiddle - leftAdjust; \ - nmiddle >>= RROP_UNROLL_SHIFT; \ - while (h--) { \ - left \ - pdst += part; \ - switch (part) { \ - RROP_UNROLL_CASE(pdst) \ - } \ - m = nmiddle; \ - while (m) { \ - pdst += RROP_UNROLL; \ - RROP_UNROLL_LOOP(pdst) \ - m--; \ - } \ - right \ - pdst += widthStep; \ - } \ -} - -#else -# define Expand(left, right, leftAdjust) { \ - int widthStep; \ - widthStep = widthDst - nmiddle - leftAdjust; \ - while (h--) { \ - left \ - m = nmiddle; \ - while (m--) {\ - RROP_SOLID(pdst); \ - pdst++; \ - } \ - right \ - pdst += widthStep; \ - } \ -} -#endif - -void -cfbFillBoxSolid (pDrawable, nBox, pBox, pixel) - DrawablePtr pDrawable; - int nBox; - BoxPtr pBox; - unsigned long pixel; -{ - CfbBits *pdstBase; - int widthDst; - register int h; - register CfbBits *pdst; - int nmiddle; - int w; -#if PSZ == 24 - int leftIndex, rightIndex; - CfbBits piQxelArray[3], *pdstULC; /*upper left corner*/ - - piQxelArray[0] = (pixel&0xFFFFFF) | ((pixel&0xFF)<<24); - piQxelArray[1] = ((pixel&0xFFFF00)>>8) | ((pixel&0xFFFF)<<16); - piQxelArray[2] = ((pixel&0xFFFFFF)<<8) | ((pixel&0xFF0000)>>16); -#else - register CfbBits rrop_xor; - register CfbBits leftMask, rightMask; - register int m; -#endif - - cfbGetLongWidthAndPointer(pDrawable, widthDst, pdstBase); - -#if PSZ != 24 - rrop_xor = PFILL(pixel); -#endif - for (; nBox; nBox--, pBox++) - { - pdst = pdstBase + pBox->y1 * widthDst; - h = pBox->y2 - pBox->y1; - w = pBox->x2 - pBox->x1; -#if PSZ == 8 - if (w == 1) - { - register char *pdstb = ((char *) pdst) + pBox->x1; - int incr = widthDst * PGSZB; - - while (h--) - { - *pdstb = rrop_xor; - pdstb += incr; - } - } - else - { -#endif -#if PSZ == 24 -/* _Box has x1, y1, x2, y2*/ - leftIndex = pBox->x1 & 3; - rightIndex = ((leftIndex+w)<5)?0:(pBox->x2 &3); - nmiddle = w - rightIndex; - if(leftIndex){ - nmiddle -= (4 - leftIndex); - } - nmiddle >>= 2; - if(nmiddle < 0) - nmiddle = 0; - - pdst = pdstBase + pBox->y1 * widthDst + ((pBox->x1*3) >> 2); - - switch(leftIndex+w){ - case 4: - switch(leftIndex){ - case 0: - while(h--){ - *pdst++ = piQxelArray[0]; - *pdst++ = piQxelArray[1]; - *pdst = piQxelArray[2]; - pdst -=2; - pdst += widthDst; - } - break; - case 1: - while(h--){ - *pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000); - pdst++; - *pdst++ = piQxelArray[1]; - *pdst = piQxelArray[2]; - pdst -=2; - pdst += widthDst; - } - break; - case 2: - while(h--){ - *pdst = ((*pdst) & 0xFFFF) | (piQxelArray[1] & 0xFFFF0000); - pdst++; - *pdst-- = piQxelArray[2]; - pdst += widthDst; - } - break; - case 3: - while(h--){ - *pdst = ((*pdst) & 0xFF) | (piQxelArray[2] & 0xFFFFFF00); - pdst += widthDst; - } - break; - } - break; - case 3: - switch(leftIndex){ - case 0: - while(h--){ - *pdst++ = piQxelArray[0]; - *pdst++ = piQxelArray[1]; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelArray[2] & 0xFF); - pdst--; - pdst--; - pdst += widthDst; - } - break; - case 1: - while(h--){ - *pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000); - pdst++; - *pdst++ = piQxelArray[1]; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelArray[2] & 0xFF); - pdst--; - pdst--; - pdst += widthDst; - } - break; - case 2: - while(h--){ - *pdst = ((*pdst) & 0xFFFF) | (piQxelArray[1] & 0xFFFF0000); - pdst++; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelArray[2] & 0xFF); - pdst--; - pdst += widthDst; - } - break; - } - break; - case 2: - while(h--){ - if(leftIndex){ - *pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000); - pdst++; - } - else{ - *pdst++ = piQxelArray[0]; - } - *pdst = ((*pdst) & 0xFFFF0000) | (piQxelArray[1] & 0xFFFF); - pdst--; - pdst += widthDst; - } - break; - case 1: /*only if leftIndex = 0 and w = 1*/ - while(h--){ - *pdst = ((*pdst) & 0xFF000000) | (piQxelArray[0] & 0xFFFFFF); - pdst += widthDst; - } - break; - case 0: /*never*/ - break; - default: - { - w = nmiddle; - pdstULC = pdst; -/* maskbits (pBox->x1, w, leftMask, rightMask, nmiddle);*/ - while(h--){ - nmiddle = w; - pdst = pdstULC; - switch(leftIndex){ - case 0: - break; - case 1: - *pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000); - pdst++; - *pdst++ = piQxelArray[1]; - *pdst++ = piQxelArray[2]; - break; - case 2: - *pdst = ((*pdst) & 0xFFFF) | (piQxelArray[1] & 0xFFFF0000); - pdst++; - *pdst++ = piQxelArray[2]; - break; - case 3: - *pdst = ((*pdst) & 0xFF) | (piQxelArray[2] & 0xFFFFFF00); - pdst++; - break; - } - while(nmiddle--){ - *pdst++ = piQxelArray[0]; - *pdst++ = piQxelArray[1]; - *pdst++ = piQxelArray[2]; - } - switch(rightIndex){ - case 0: - break; - case 1: - *pdst = ((*pdst) & 0xFF000000) | (piQxelArray[0] & 0xFFFFFF); - break; - case 2: - *pdst++ = piQxelArray[0]; - *pdst = ((*pdst) & 0xFFFF0000) | (piQxelArray[1] & 0xFFFF); - break; - case 3: - *pdst++ = piQxelArray[0]; - *pdst++ = piQxelArray[1]; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelArray[2] & 0xFF); - break; - } - pdstULC += widthDst; - } - - } - } -#else - pdst += (pBox->x1 >> PWSH); - if ((pBox->x1 & PIM) + w <= PPW) - { - maskpartialbits(pBox->x1, w, leftMask); - while (h--) { - *pdst = (*pdst & ~leftMask) | (rrop_xor & leftMask); - pdst += widthDst; - } - } - else - { - maskbits (pBox->x1, w, leftMask, rightMask, nmiddle); - if (leftMask) - { - if (rightMask) - { - Expand (RROP_SOLID_MASK (pdst, leftMask); pdst++; , - RROP_SOLID_MASK (pdst, rightMask); , - 1) - } - else - { - Expand (RROP_SOLID_MASK (pdst, leftMask); pdst++;, - ;, - 1) - } - } - else - { - if (rightMask) - { - Expand (;, - RROP_SOLID_MASK (pdst, rightMask);, - 0) - } - else - { - Expand (;, - ;, - 0) - } - } - } -#endif -#if PSZ == 8 - } -#endif - } -} - -void -cfbFillBoxTile32 (pDrawable, nBox, pBox, tile) - DrawablePtr pDrawable; - int nBox; /* number of boxes to fill */ - BoxPtr pBox; /* pointer to list of boxes to fill */ - PixmapPtr tile; /* rotated, expanded tile */ -{ - register CfbBits *pdst; - CfbBits *psrc; - int tileHeight; - - int widthDst; - int w; - int h; - int nmiddle; - int y; - int srcy; - - CfbBits *pdstBase; -#if PSZ == 24 - int leftIndex, rightIndex; - CfbBits piQxelArray[3], *pdstULC; -#else - register CfbBits rrop_xor; - register CfbBits leftMask; - register CfbBits rightMask; - register int m; -#endif - - tileHeight = tile->drawable.height; - psrc = (CfbBits *)tile->devPrivate.ptr; - - cfbGetLongWidthAndPointer (pDrawable, widthDst, pdstBase); - - while (nBox--) - { -#if PSZ == 24 - w = pBox->x2 - pBox->x1; - h = pBox->y2 - pBox->y1; - y = pBox->y1; - leftIndex = pBox->x1 & 3; -/* rightIndex = ((leftIndex+w)<5)?0:pBox->x2 &3;*/ - rightIndex = pBox->x2 &3; - nmiddle = w - rightIndex; - if(leftIndex){ - nmiddle -= (4 - leftIndex); - } - nmiddle >>= 2; - if(nmiddle < 0) - nmiddle = 0; - - pdst = pdstBase + ((pBox->x1 *3)>> 2) + pBox->y1 * widthDst; - srcy = y % tileHeight; - -#define StepTile piQxelArray[0] = (psrc[srcy] & 0xFFFFFF) | ((psrc[srcy] & 0xFF)<<24); \ - piQxelArray[1] = (psrc[srcy] & 0xFFFF00) | ((psrc[srcy] & 0xFFFF)<<16); \ - piQxelArray[2] = ((psrc[srcy] & 0xFF0000)>>16) | \ - ((psrc[srcy] & 0xFFFFFF)<<8); \ - /*rrop_xor = psrc[srcy];*/ \ - ++srcy; \ - if (srcy == tileHeight) \ - srcy = 0; - - switch(leftIndex+w){ - case 4: - switch(leftIndex){ - case 0: - while(h--){ - StepTile - *pdst++ = piQxelArray[0]; - *pdst++ = piQxelArray[1]; - *pdst = piQxelArray[2]; - pdst-=2; - pdst += widthDst; - } - break; - case 1: - while(h--){ - StepTile - *pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000); - pdst++; - *pdst++ = piQxelArray[1]; - *pdst = piQxelArray[2]; - pdst-=2; - pdst += widthDst; - } - break; - case 2: - while(h--){ - StepTile - *pdst = ((*pdst) & 0xFFFF) | (piQxelArray[1] & 0xFFFF0000); - pdst++; - *pdst-- = piQxelArray[2]; - pdst += widthDst; - } - break; - case 3: - while(h--){ - StepTile - *pdst = ((*pdst) & 0xFF) | (piQxelArray[2] & 0xFFFFFF00); - pdst += widthDst; - } - break; - } - break; - case 3: - switch(leftIndex){ - case 0: - while(h--){ - StepTile - *pdst++ = piQxelArray[0]; - *pdst++ = piQxelArray[1]; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelArray[2] & 0xFF); - pdst--; - pdst--; - pdst += widthDst; - } - break; - case 1: - while(h--){ - StepTile - *pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000); - pdst++; - *pdst++ = piQxelArray[1]; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelArray[2] & 0xFF); - pdst--; - pdst--; - pdst += widthDst; - } - break; - case 2: - while(h--){ - StepTile - *pdst = ((*pdst) & 0xFFFF) | (piQxelArray[1] & 0xFFFF0000); - pdst++; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelArray[2] & 0xFF); - pdst--; - pdst += widthDst; - } - break; - } - break; - case 2: - while(h--){ - StepTile - if(leftIndex){ - *pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000); - pdst++; - } - else{ - *pdst++ = piQxelArray[0]; - } - *pdst = ((*pdst) & 0xFFFF0000) | (piQxelArray[1] & 0xFFFF); - pdst--; - pdst += widthDst; - } - break; - case 1: /*only if leftIndex = 0 and w = 1*/ - while(h--){ - StepTile - *pdst = ((*pdst) & 0xFF000000) | (piQxelArray[0] & 0xFFFFFF); - pdst += widthDst; - } - break; - case 0: /*never*/ - break; - default: - { - w = nmiddle; - pdstULC = pdst; - - while(h--){ - StepTile - nmiddle = w; - pdst = pdstULC; - switch(leftIndex){ - case 0: - break; - case 1: - *pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000); - pdst++; - *pdst++ = piQxelArray[1]; - *pdst++ = piQxelArray[2]; - break; - case 2: - *pdst = ((*pdst) & 0xFFFF) | (piQxelArray[1] & 0xFFFF0000); - pdst++; - *pdst++ = piQxelArray[2]; - break; - case 3: - *pdst = ((*pdst) & 0xFF) | (piQxelArray[2] & 0xFFFFFF00); - pdst++; - break; - } - while(nmiddle--){ - *pdst++ = piQxelArray[0]; - *pdst++ = piQxelArray[1]; - *pdst++ = piQxelArray[2]; - } - switch(rightIndex){ - case 0: - break; - case 1: - *pdst = ((*pdst) & 0xFF000000) | (piQxelArray[0] & 0xFFFFFF); - break; - case 2: - *pdst++ = piQxelArray[0]; - *pdst = ((*pdst) & 0xFFFF0000) | (piQxelArray[1] & 0xFFFF); - break; - case 3: - *pdst++ = piQxelArray[0]; - *pdst++ = piQxelArray[1]; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelArray[2] & 0xFF); - break; - } - pdstULC += widthDst; - } - } - } -#else - w = pBox->x2 - pBox->x1; - h = pBox->y2 - pBox->y1; - y = pBox->y1; - pdst = pdstBase + (pBox->y1 * widthDst) + (pBox->x1 >> PWSH); - srcy = y % tileHeight; - -#define StepTile rrop_xor = psrc[srcy]; \ - ++srcy; \ - if (srcy == tileHeight) \ - srcy = 0; - - if ( ((pBox->x1 & PIM) + w) < PPW) - { - maskpartialbits(pBox->x1, w, leftMask); - rightMask = ~leftMask; - while (h--) - { - StepTile - *pdst = (*pdst & rightMask) | (rrop_xor & leftMask); - pdst += widthDst; - } - } - else - { - maskbits(pBox->x1, w, leftMask, rightMask, nmiddle); - - if (leftMask) - { - if (rightMask) - { - Expand (StepTile - RROP_SOLID_MASK(pdst, leftMask); pdst++;, - RROP_SOLID_MASK(pdst, rightMask);, - 1) - } - else - { - Expand (StepTile - RROP_SOLID_MASK(pdst, leftMask); pdst++;, - ;, - 1) - } - } - else - { - if (rightMask) - { - Expand (StepTile - , - RROP_SOLID_MASK(pdst, rightMask);, - 0) - } - else - { - Expand (StepTile - , - ;, - 0) - } - } - } -#endif - pBox++; - } -} diff --git a/nx-X11/programs/Xserver/cfb/cfbpolypnt.c b/nx-X11/programs/Xserver/cfb/cfbpolypnt.c deleted file mode 100644 index 59ef0cf89..000000000 --- a/nx-X11/programs/Xserver/cfb/cfbpolypnt.c +++ /dev/null @@ -1,204 +0,0 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfbpolypnt.c,v 3.5 2001/10/28 03:33:01 tsi Exp $ */ -/************************************************************ - -Copyright 1989, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -********************************************************/ - -/* $Xorg: cfbpolypnt.c,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include "gcstruct.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "regionstr.h" -#include "scrnintstr.h" -#include "cfb.h" -#include "cfbmskbits.h" - -#define isClipped(c,ul,lr) ((((c) - (ul)) | ((lr) - (c))) & ClipMask) - -/* WARNING: pbox contains two shorts. This code assumes they are packed - * and can be referenced together as an INT32. - */ - -#define PointLoop(fill) { \ - for (nbox = REGION_NUM_RECTS(cclip), pbox = REGION_RECTS(cclip); \ - --nbox >= 0; \ - pbox++) \ - { \ - c1 = *((INT32 *) &pbox->x1) - off; \ - c2 = *((INT32 *) &pbox->x2) - off - 0x00010001; \ - for (ppt = (INT32 *) pptInit, i = npt; --i >= 0;) \ - { \ - pt = *ppt++; \ - if (!isClipped(pt,c1,c2)) { \ - fill \ - } \ - } \ - } \ -} - -#if PSZ == 24 -# include "cfbrrop24.h" -#endif - -void -cfbPolyPoint(pDrawable, pGC, mode, npt, pptInit) - DrawablePtr pDrawable; - GCPtr pGC; - int mode; - int npt; - xPoint *pptInit; -{ - register INT32 pt; - register INT32 c1, c2; - register CARD32 ClipMask = 0x80008000; - register CfbBits xor; -#ifdef PIXEL_ADDR - register PixelType *addrp; - register int npwidth; -#if PSZ != 24 - PixelType *addrpt; -#endif -#else - register CfbBits *addrl; - register int nlwidth; - register int xoffset; - CfbBits *addrlt; -#endif -#if PSZ == 24 - RROP_DECLARE - register int xtmp; - register PixelType *p; -#endif - register INT32 *ppt; - RegionPtr cclip; - int nbox; - register int i; - register BoxPtr pbox; - CfbBits and; - int rop = pGC->alu; - int off; - cfbPrivGCPtr devPriv; - xPoint *pptPrev; - - devPriv =cfbGetGCPrivate(pGC); - rop = devPriv->rop; - if (rop == GXnoop) - return; - cclip = pGC->pCompositeClip; - xor = devPriv->xor; - if ((mode == CoordModePrevious) && (npt > 1)) - { - for (pptPrev = pptInit + 1, i = npt - 1; --i >= 0; pptPrev++) - { - pptPrev->x += (pptPrev-1)->x; - pptPrev->y += (pptPrev-1)->y; - } - } - off = *((int *) &pDrawable->x); - off -= (off & 0x8000) << 1; -#ifdef PIXEL_ADDR - cfbGetPixelWidthAndPointer(pDrawable, npwidth, addrp); -#if PSZ == 24 - addrp = addrp + pDrawable->y * npwidth; -#else - addrp = addrp + pDrawable->y * npwidth + pDrawable->x; -#endif - if (rop == GXcopy) - { -#if PSZ == 24 - RROP_COPY_SETUP(xor) -#endif - if (!(npwidth & (npwidth - 1))) - { - npwidth = ffs(npwidth) - 1; -#if PSZ == 24 - PointLoop( - xtmp = pDrawable->x + intToX(pt); - p = addrp + (intToY(pt) << npwidth) + ((xtmp * 3) >>2); - RROP_SOLID24_COPY(p, xtmp)) -#else - PointLoop(*(addrp + (intToY(pt) << npwidth) + intToX(pt)) = xor;) -#endif - } -#ifdef sun - else if (npwidth == 1152) - { - register int y; - PointLoop(y = intToY(pt); *(addrp + (y << 10) + (y << 7) + intToX(pt)) = xor;) - } -#endif - else - { -#if PSZ == 24 - PointLoop( - xtmp = pDrawable->x + intToX(pt); - p = addrp + intToY(pt) * npwidth + ((xtmp * 3) >> 2); - RROP_SOLID24_COPY(p, xtmp)) -#else - PointLoop(*(addrp + intToY(pt) * npwidth + intToX(pt)) = xor;) -#endif - } - } - else - { - and = devPriv->and; -#if PSZ == 24 - RROP_SET_SETUP(xor, and) - PointLoop( - xtmp = pDrawable->x + intToX(pt); - p = addrp + intToY(pt) * npwidth + ((xtmp * 3) >> 2); - RROP_SOLID24_SET(p, xtmp)) -#else - PointLoop( addrpt = addrp + intToY(pt) * npwidth + intToX(pt); - *addrpt = DoRRop (*addrpt, and, xor);) -#endif - } -#else /* !PIXEL_ADDR */ - cfbGetLongWidthAndPointer(pDrawable, nlwidth, addrl); - addrl = addrl + pDrawable->y * nlwidth + (pDrawable->x >> PWSH); - xoffset = pDrawable->x & PIM; - and = devPriv->and; -#if PSZ == 24 - PointLoop( addrlt = addrl + intToY(pt) * nlwidth - + ((intToX(pt) + xoffset) >> PWSH); - *addrlt = DoRRop (*addrlt, - and | ~cfbmask[(intToX(pt) + xoffset) & PIM], - xor & cfbmask[(intToX(pt) + xoffset) & PIM]); - ) -#else - PointLoop( addrlt = addrl + intToY(pt) * nlwidth - + ((intToX(pt) + xoffset) >> PWSH); - *addrlt = DoRRop (*addrlt, - and | ~cfbmask[((intToX(pt) + xoffset) & 3)<<1], - xor & cfbmask[((intToX(pt) + xoffset) & 3)<<1]); - ) -#endif -#endif /* PIXEL_ADDR */ -} diff --git a/nx-X11/programs/Xserver/cfb/cfbpush8.c b/nx-X11/programs/Xserver/cfb/cfbpush8.c deleted file mode 100644 index 3492c8e25..000000000 --- a/nx-X11/programs/Xserver/cfb/cfbpush8.c +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Push Pixels for 8 bit displays. - */ - -/* $XFree86: xc/programs/Xserver/cfb/cfbpush8.c,v 1.5 2001/01/17 22:36:36 dawes Exp $ */ - -/* - -Copyright 1989, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. -*/ -/* $Xorg: cfbpush8.c,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#if PSZ == 8 - -#include -#include -#include -#include "gcstruct.h" -#include "windowstr.h" -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "regionstr.h" -#include "cfb.h" -#include "cfbmskbits.h" -#include "cfb8bit.h" -#define MFB_CONSTS_ONLY -#include "maskbits.h" - -void -cfbPushPixels8 (pGC, pBitmap, pDrawable, dx, dy, xOrg, yOrg) - GCPtr pGC; - PixmapPtr pBitmap; - DrawablePtr pDrawable; - int dx, dy, xOrg, yOrg; -{ - register CfbBits *src, *dst; - register CfbBits pixel; - register CfbBits c, bits; - CfbBits *pdstLine, *psrcLine; - CfbBits *pdstBase; - int srcWidth; - int dstWidth; - int xoff; - int nBitmapLongs, nPixmapLongs; - int nBitmapTmp, nPixmapTmp; - CfbBits rightMask; - BoxRec bbox; - cfbPrivGCPtr devPriv; - - bbox.x1 = xOrg; - bbox.y1 = yOrg; - bbox.x2 = bbox.x1 + dx; - bbox.y2 = bbox.y1 + dy; - devPriv = cfbGetGCPrivate(pGC); - - switch (RECT_IN_REGION(pGC->pScreen, pGC->pCompositeClip, &bbox)) - { - case rgnPART: - mfbPushPixels(pGC, pBitmap, pDrawable, dx, dy, xOrg, yOrg); - case rgnOUT: - return; - } - - cfbGetLongWidthAndPointer (pDrawable, dstWidth, pdstBase) - - psrcLine = (CfbBits *) pBitmap->devPrivate.ptr; - srcWidth = (int) pBitmap->devKind >> PWSH; - - pixel = devPriv->xor; - xoff = xOrg & PIM; - nBitmapLongs = (dx + xoff) >> MFB_PWSH; - nPixmapLongs = (dx + PGSZB + xoff) >> PWSH; - - rightMask = ~cfb8BitLenMasks[((dx + xoff) & MFB_PIM)]; - - pdstLine = pdstBase + (yOrg * dstWidth) + (xOrg >> PWSH); - - while (dy--) - { - c = 0; - nPixmapTmp = nPixmapLongs; - nBitmapTmp = nBitmapLongs; - src = psrcLine; - dst = pdstLine; - while (nBitmapTmp--) - { - bits = *src++; - c |= BitRight (bits, xoff); - WriteBitGroup(dst, pixel, GetBitGroup(c)); - NextBitGroup(c); - dst++; - WriteBitGroup(dst, pixel, GetBitGroup(c)); - NextBitGroup(c); - dst++; - WriteBitGroup(dst, pixel, GetBitGroup(c)); - NextBitGroup(c); - dst++; - WriteBitGroup(dst, pixel, GetBitGroup(c)); - NextBitGroup(c); - dst++; - WriteBitGroup(dst, pixel, GetBitGroup(c)); - NextBitGroup(c); - dst++; - WriteBitGroup(dst, pixel, GetBitGroup(c)); - NextBitGroup(c); - dst++; - WriteBitGroup(dst, pixel, GetBitGroup(c)); - NextBitGroup(c); - dst++; - WriteBitGroup(dst, pixel, GetBitGroup(c)); - NextBitGroup(c); - dst++; - nPixmapTmp -= 8; - c = 0; - if (xoff) - c = BitLeft (bits, PGSZ - xoff); - } - if (BitLeft (rightMask, xoff)) - c |= BitRight (*src, xoff); - c &= rightMask; - switch (nPixmapTmp) { - case 8: - WriteBitGroup(dst, pixel, GetBitGroup(c)); - NextBitGroup(c); - dst++; - case 7: - WriteBitGroup(dst, pixel, GetBitGroup(c)); - NextBitGroup(c); - dst++; - case 6: - WriteBitGroup(dst, pixel, GetBitGroup(c)); - NextBitGroup(c); - dst++; - case 5: - WriteBitGroup(dst, pixel, GetBitGroup(c)); - NextBitGroup(c); - dst++; - case 4: - WriteBitGroup(dst, pixel, GetBitGroup(c)); - NextBitGroup(c); - dst++; - case 3: - WriteBitGroup(dst, pixel, GetBitGroup(c)); - NextBitGroup(c); - dst++; - case 2: - WriteBitGroup(dst, pixel, GetBitGroup(c)); - NextBitGroup(c); - dst++; - case 1: - WriteBitGroup(dst, pixel, GetBitGroup(c)); - NextBitGroup(c); - dst++; - case 0: - break; - } - pdstLine += dstWidth; - psrcLine += srcWidth; - } -} - -#endif diff --git a/nx-X11/programs/Xserver/cfb/cfbrctstp8.c b/nx-X11/programs/Xserver/cfb/cfbrctstp8.c deleted file mode 100644 index 9f753cdd7..000000000 --- a/nx-X11/programs/Xserver/cfb/cfbrctstp8.c +++ /dev/null @@ -1,595 +0,0 @@ -/* - * Fill 32 bit stippled rectangles for 8 bit frame buffers - */ -/* $XFree86: xc/programs/Xserver/cfb/cfbrctstp8.c,v 3.5 2001/10/28 03:33:01 tsi Exp $ */ -/* - -Copyright 1989, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Author: Keith Packard, MIT X Consortium - -*/ - -/* $Xorg: cfbrctstp8.c,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#if PSZ == 8 - -#include -#include -#include "servermd.h" -#include "gcstruct.h" -#include "window.h" -#include "pixmapstr.h" -#include "scrnintstr.h" -#include "windowstr.h" - -#include "cfb.h" -#include "cfbmskbits.h" -#include "cfb8bit.h" - -#define MFB_CONSTS_ONLY -#include "maskbits.h" - -void -cfb8FillRectOpaqueStippled32 (pDrawable, pGC, nBox, pBox) - DrawablePtr pDrawable; - GCPtr pGC; - int nBox; /* number of boxes to fill */ - register BoxPtr pBox; /* pointer to list of boxes to fill */ -{ - CfbBits *src; - int stippleHeight; - - int nlwDst; /* width in longwords of the dest pixmap */ - int w; /* width of current box */ - register int h; /* height of current box */ - CfbBits startmask; - CfbBits endmask; /* masks for reggedy bits at either end of line */ - int nlwMiddle; /* number of longwords between sides of boxes */ - register int nlw; /* loop version of nlwMiddle */ - CfbBits *dstLine; - register CfbBits *dst; /* pointer to bits we're writing */ - CfbBits *dstTmp; - int y; /* current scan line */ - - CfbBits *pbits;/* pointer to start of pixmap */ - register CfbBits bits; /* bits from stipple */ - int rot; - register CfbBits xor; - PixmapPtr stipple; - int wEnd; - - stipple = pGC->pRotatedPixmap; - - cfb8CheckOpaqueStipple(pGC->alu, pGC->fgPixel, pGC->bgPixel, pGC->planemask); - - stippleHeight = stipple->drawable.height; - src = (CfbBits *)stipple->devPrivate.ptr; - - cfbGetLongWidthAndPointer (pDrawable, nlwDst, pbits) - - while (nBox--) - { - w = pBox->x2 - pBox->x1; - h = pBox->y2 - pBox->y1; - y = pBox->y1; - dstLine = pbits + (pBox->y1 * nlwDst) + ((pBox->x1 & ~PIM) >> PWSH); - if (((pBox->x1 & PIM) + w) <= PPW) - { - maskpartialbits(pBox->x1, w, startmask); - nlwMiddle = 0; - endmask = 0; - } - else - { - maskbits (pBox->x1, w, startmask, endmask, nlwMiddle); - } - rot = (pBox->x1 & ((PGSZ-1) & ~PIM)); - pBox++; - y = y % stippleHeight; -#if PPW == 4 - if (cfb8StippleRRop == GXcopy) - { - if (w < PGSZ*2) - { - while (h--) - { - bits = src[y]; - y++; - if (y == stippleHeight) - y = 0; - if (rot) - RotBitsLeft(bits,rot); - dst = dstLine; - dstLine += nlwDst; - if (startmask) - { - *dst = (*dst & ~startmask) | - (GetPixelGroup (bits) & startmask); - dst++; - RotBitsLeft (bits, PGSZB); - } - nlw = nlwMiddle; - while (nlw--) - { - *dst++ = GetPixelGroup(bits); - RotBitsLeft (bits, PGSZB); - } - if (endmask) - { - *dst = (*dst & ~endmask) | - (GetPixelGroup (bits) & endmask); - } - } - } - else - { - wEnd = 7 - (nlwMiddle & 7); - nlwMiddle = (nlwMiddle >> 3) + 1; - while (h--) - { - bits = src[y]; - y++; - if (y == stippleHeight) - y = 0; - if (rot != 0) - RotBitsLeft (bits, rot); - dstTmp = dstLine; - dstLine += nlwDst; - if (startmask) - { - *dstTmp = (*dstTmp & ~startmask) | - (GetPixelGroup (bits) & startmask); - dstTmp++; - RotBitsLeft (bits, PGSZB); - } - w = 7 - wEnd; - while (w--) - { - nlw = nlwMiddle; - dst = dstTmp; - dstTmp++; - xor = GetPixelGroup (bits); - while (nlw--) - { - *dst = xor; - dst += 8; - } - NextBitGroup (bits); - } - nlwMiddle--; - w = wEnd + 1; - if (endmask) - { - dst = dstTmp + (nlwMiddle << 3); - *dst = (*dst & ~endmask) | - (GetPixelGroup(bits) & endmask); - } - while (w--) - { - nlw = nlwMiddle; - dst = dstTmp; - dstTmp++; - xor = GetPixelGroup (bits); - while (nlw--) - { - *dst = xor; - dst += 8; - } - NextBitGroup (bits); - } - nlwMiddle++; - } - } - } - else -#endif /* PPW == 4 */ - { - while (h--) - { - bits = src[y]; - y++; - if (y == stippleHeight) - y = 0; - if (rot) - RotBitsLeft(bits,rot); - dst = dstLine; - dstLine += nlwDst; - if (startmask) - { - xor = GetBitGroup(bits); - *dst = MaskRRopPixels(*dst, xor, startmask); - dst++; - RotBitsLeft (bits, PGSZB); - } - nlw = nlwMiddle; - while (nlw--) - { - RRopBitGroup(dst, GetBitGroup(bits)); - dst++; - RotBitsLeft (bits, PGSZB); - } - if (endmask) - { - xor = GetBitGroup(bits); - *dst = MaskRRopPixels(*dst, xor, endmask); - } - } - } - } -} - -void -cfb8FillRectTransparentStippled32 (pDrawable, pGC, nBox, pBox) - DrawablePtr pDrawable; - GCPtr pGC; - int nBox; /* number of boxes to fill */ - BoxPtr pBox; /* pointer to list of boxes to fill */ -{ - int x, y, w, h; - int nlwMiddle, nlwDst; - CfbBits startmask, endmask; - register CfbBits *dst; - CfbBits *dstLine, *pbits, *dstTmp; - CfbBits *src; - register CfbBits xor; - register CfbBits bits, mask; - int rot; - int wEnd; - cfbPrivGCPtr devPriv; - PixmapPtr stipple; - int stippleHeight; - register int nlw; - - devPriv = cfbGetGCPrivate(pGC); - stipple = pGC->pRotatedPixmap; - src = (CfbBits *)stipple->devPrivate.ptr; - stippleHeight = stipple->drawable.height; - - cfb8CheckStipple (pGC->alu, pGC->fgPixel, pGC->planemask); - - cfbGetLongWidthAndPointer (pDrawable, nlwDst, pbits) - - while (nBox--) - { - x = pBox->x1; - w = pBox->x2 - x; - if (((x & PIM) + w) <= PPW) - { - maskpartialbits(x, w, startmask); - endmask = 0; - nlwMiddle = 0; - } - else - { - maskbits (x, w, startmask, endmask, nlwMiddle); - } - rot = (x & ((PGSZ-1) & ~PIM)); - y = pBox->y1; - dstLine = pbits + (y * nlwDst) + (x >> PWSH); - h = pBox->y2 - y; - pBox++; - y %= stippleHeight; -#if PPW == 4 - if (cfb8StippleRRop == GXcopy) - { - xor = devPriv->xor; - if (w < PGSZ*2) - { - while (h--) - { - bits = src[y]; - y++; - if (y == stippleHeight) - y = 0; - if (rot != 0) - RotBitsLeft (bits, rot); - dst = dstLine; - dstLine += nlwDst; - if (startmask) - { - mask = cfb8PixelMasks[GetBitGroup(bits)]; - *dst = (*dst & ~(mask & startmask)) | - (xor & (mask & startmask)); - dst++; - RotBitsLeft (bits, PGSZB); - } - nlw = nlwMiddle; - while (nlw--) - { - WriteBitGroup (dst,xor,GetBitGroup(bits)) - dst++; - RotBitsLeft (bits, PGSZB); - } - if (endmask) - { - mask = cfb8PixelMasks[GetBitGroup(bits)]; - *dst = (*dst & ~(mask & endmask)) | - (xor & (mask & endmask)); - } - } - } - else - { - wEnd = 7 - (nlwMiddle & 7); - nlwMiddle = (nlwMiddle >> 3) + 1; - while (h--) - { - bits = src[y]; - y++; - if (y == stippleHeight) - y = 0; - if (rot != 0) - RotBitsLeft (bits, rot); - dstTmp = dstLine; - dstLine += nlwDst; - if (startmask) - { - mask = cfb8PixelMasks[GetBitGroup(bits)]; - *dstTmp = (*dstTmp & ~(mask & startmask)) | - (xor & (mask & startmask)); - dstTmp++; - RotBitsLeft (bits, PGSZB); - } - w = 7 - wEnd; - while (w--) - { - nlw = nlwMiddle; - dst = dstTmp; - dstTmp++; -#if defined(__GNUC__) && defined(mc68020) - mask = cfb8PixelMasks[GetBitGroup(bits)]; - xor = xor & mask; - mask = ~mask; - while (nlw--) - { - *dst = (*dst & mask) | xor; - dst += 8; - } - xor = devPriv->xor; -#else -#define SwitchBitsLoop(body) \ - while (nlw--) \ - { \ - body \ - dst += 8; \ - } - SwitchBitGroup(dst, xor, GetBitGroup(bits)); -#undef SwitchBitsLoop -#endif - NextBitGroup (bits); - } - nlwMiddle--; - w = wEnd + 1; - if (endmask) - { - mask = cfb8PixelMasks[GetBitGroup(bits)]; - dst = dstTmp + (nlwMiddle << 3); - *dst = (*dst & ~(mask & endmask)) | - (xor & (mask & endmask)); - } - while (w--) - { - nlw = nlwMiddle; - dst = dstTmp; - dstTmp++; -#if defined(__GNUC__) && defined(mc68020) - mask = cfb8PixelMasks[GetBitGroup(bits)]; - xor = xor & mask; - mask = ~mask; - while (nlw--) - { - *dst = (*dst & mask) | xor; - dst += 8; - } - xor = devPriv->xor; -#else -#define SwitchBitsLoop(body) \ - while (nlw--) \ - { \ - body \ - dst += 8; \ - } - SwitchBitGroup(dst, xor, GetBitGroup(bits)); -#undef SwitchBitsLoop -#endif - NextBitGroup (bits); - } - nlwMiddle++; - } - } - } - else -#endif /* PPW == 4 */ - { - while (h--) - { - bits = src[y]; - y++; - if (y == stippleHeight) - y = 0; - if (rot != 0) - RotBitsLeft (bits, rot); - dst = dstLine; - dstLine += nlwDst; - if (startmask) - { - xor = GetBitGroup(bits); - *dst = MaskRRopPixels(*dst, xor, startmask); - dst++; - RotBitsLeft (bits, PGSZB); - } - nlw = nlwMiddle; - while (nlw--) - { - RRopBitGroup(dst, GetBitGroup(bits)); - dst++; - RotBitsLeft (bits, PGSZB); - } - if (endmask) - { - xor = GetBitGroup(bits); - *dst = MaskRRopPixels(*dst, xor, endmask); - } - } - } - } -} - - -void -cfb8FillRectStippledUnnatural (pDrawable, pGC, nBox, pBox) - DrawablePtr pDrawable; - GCPtr pGC; - int nBox; - register BoxPtr pBox; -{ - CfbBits *pdstBase; /* pointer to start of bitmap */ - CfbBits *pdstLine; /* current destination line */ - int nlwDst; /* width in longwords of bitmap */ - PixmapPtr pStipple; /* pointer to stipple we want to fill with */ - int nlwMiddle; - register int nlw; - int x, y, w, h, xrem, xSrc, ySrc; - int stwidth, stippleWidth; - int stippleHeight; - register CfbBits bits, inputBits; - register int partBitsLeft; - int nextPartBits; - int bitsLeft, bitsWhole; - register CfbBits *pdst; /* pointer to current word in bitmap */ - CfbBits *srcTemp, *srcStart; - CfbBits *psrcBase; - CfbBits startmask, endmask; - - if (pGC->fillStyle == FillStippled) - cfb8CheckStipple (pGC->alu, pGC->fgPixel, pGC->planemask); - else - cfb8CheckOpaqueStipple (pGC->alu, pGC->fgPixel, pGC->bgPixel, pGC->planemask); - - if (cfb8StippleRRop == GXnoop) - return; - - /* - * OK, so what's going on here? We have two Drawables: - * - * The Stipple: - * Depth = 1 - * Width = stippleWidth - * Words per scanline = stwidth - * Pointer to pixels = pStipple->devPrivate.ptr - */ - - pStipple = pGC->stipple; - - stwidth = pStipple->devKind >> PWSH; - stippleWidth = pStipple->drawable.width; - stippleHeight = pStipple->drawable.height; - psrcBase = (CfbBits *) pStipple->devPrivate.ptr; - - /* - * The Target: - * Depth = PSZ - * Width = determined from *pwidth - * Words per scanline = nlwDst - * Pointer to pixels = addrlBase - */ - - xSrc = pDrawable->x; - ySrc = pDrawable->y; - - cfbGetLongWidthAndPointer (pDrawable, nlwDst, pdstBase) - - /* this replaces rotating the stipple. Instead we just adjust the offset - * at which we start grabbing bits from the stipple. - * Ensure that ppt->x - xSrc >= 0 and ppt->y - ySrc >= 0, - * so that iline and xrem always stay within the stipple bounds. - */ - - xSrc += (pGC->patOrg.x % stippleWidth) - stippleWidth; - ySrc += (pGC->patOrg.y % stippleHeight) - stippleHeight; - - bitsWhole = stippleWidth; - - while (nBox--) - { - x = pBox->x1; - y = pBox->y1; - w = pBox->x2 - x; - h = pBox->y2 - y; - pBox++; - pdstLine = pdstBase + y * nlwDst + (x >> PWSH); - y = (y - ySrc) % stippleHeight; - srcStart = psrcBase + y * stwidth; - xrem = ((x & ~PIM) - xSrc) % stippleWidth; - if (((x & PIM) + w) < PPW) - { - maskpartialbits (x, w, startmask); - nlwMiddle = 0; - endmask = 0; - } - else - { - maskbits (x, w, startmask, endmask, nlwMiddle); - } - while (h--) - { - srcTemp = srcStart + (xrem >> MFB_PWSH); - bitsLeft = stippleWidth - (xrem & ~MFB_PIM); - NextUnnaturalStippleWord - NextSomeBits (inputBits, (xrem & MFB_PIM)); - partBitsLeft -= (xrem & MFB_PIM); - NextUnnaturalStippleBits - nlw = nlwMiddle; - pdst = pdstLine; - if (startmask) - { - *pdst = MaskRRopPixels(*pdst,bits,startmask); - pdst++; - NextUnnaturalStippleBits - } - while (nlw--) - { - *pdst = RRopPixels(*pdst,bits); - pdst++; - NextUnnaturalStippleBits - } - if (endmask) - *pdst = MaskRRopPixels(*pdst,bits,endmask); - pdstLine += nlwDst; - y++; - srcStart += stwidth; - if (y == stippleHeight) - { - y = 0; - srcStart = psrcBase; - } - } - } -} - -#endif /* PSZ == 8 */ diff --git a/nx-X11/programs/Xserver/cfb/cfbrrop.c b/nx-X11/programs/Xserver/cfb/cfbrrop.c deleted file mode 100644 index 77487bc6a..000000000 --- a/nx-X11/programs/Xserver/cfb/cfbrrop.c +++ /dev/null @@ -1,229 +0,0 @@ -/* - * $Xorg: cfbrrop.c,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $ - * -Copyright 1989, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - * - * Author: Keith Packard, MIT X Consortium - */ -/* $XFree86: xc/programs/Xserver/cfb/cfbrrop.c,v 1.5 2001/10/28 03:33:02 tsi Exp $ */ - -/* cfb reduced rasterop computations */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include -#include "cfb.h" -#include "cfbmskbits.h" - -/* A description: - * - * There are four possible operations on each bit in the destination word, - * - * 1 2 3 4 - * - * 0 0 0 1 1 - * 1 0 1 0 1 - * - * On examination of the reduced rop equation (dst = (dst & and) ^ xor), - * these four fall to reduced rops as follows: - * - * and 0 1 1 0 - * xor 0 0 1 1 - * - * or, (if 'and' is expensive) (dst = (dst | or) ^ xor) - * - * or 1 0 0 1 - * xor 1 0 1 0 - * - * The trouble with using this later equation is that trivial - * rasterop reduction is more difficult; some common rasterops - * use complicated expressions of xor/and instead of the simple - * ones while other common rasterops are not made any simpler: - * - * GXcopy: *dst = ~xor instead of *dst = xor - * GXand: *dst = *dst & ~or instead of *dst = *dst & and - * GXor: *dst = *dst | or instead of *dst = *dst | xor - * GXxor: *dst = *dst ^ xor instead of *dst = *dst ^ xor - * - * If you're really set on using this second mechanism, the changes - * are pretty simple. - * - * All that remains is to provide a mechanism for computing and/xor values - * based on the raster op and foreground value. - * - * The 16 rops fall as follows, with the associated reduced - * rop and/xor and or/xor values. The values in parenthesis following the - * reduced values gives an equation using the source value for - * the reduced value, and is one of {0, src, ~src, 1} as appropriate. - * - * clear and andReverse copy - * src 0 1 0 1 0 1 0 1 - * dst 0 0 0 0 0 0 0 0 1 0 0 1 - * 1 0 0 1 0 1 1 0 0 1 0 1 - * - * and 0 0 (0) 0 1 (src) 0 1 (src) 0 0 (0) - * xor 0 0 (0) 0 0 (0) 0 1 (src) 0 1 (src) - * - * or 1 1 (1) 1 0 (~src) 1 0 (~src) 1 1 (1) - * xor 1 1 (1) 1 0 (~src) 1 1 (1) 1 0 (~src) - * - * andInverted noop xor or - * src 0 1 0 1 0 1 0 1 - * dst 0 0 0 0 0 0 0 0 1 0 0 1 - * 1 1 0 1 1 1 1 1 0 1 1 1 - * - * and 1 0 (~src) 1 1 (1) 1 1 (1) 1 0 (~src) - * xor 0 0 (0) 0 0 (0) 0 1 (src) 0 1 (src) - * - * or 0 1 (src) 0 0 (0) 0 0 (0) 0 1 (src) - * xor 0 1 (src) 0 0 (0) 0 1 (src) 0 0 (0) - * - * nor equiv invert orReverse - * src 0 1 0 1 0 1 0 1 - * dst 0 1 0 0 1 0 0 1 1 0 1 1 - * 1 0 0 1 0 1 1 0 0 1 0 1 - * - * and 1 0 (~src) 1 1 (1) 1 1 (1) 1 0 (~src) - * xor 1 0 (~src) 1 0 (~src) 1 1 (1) 1 1 (1) - * - * or 0 1 (src) 0 0 (0) 0 0 (0) 0 1 (src) - * xor 1 1 (1) 1 0 (~src) 1 1 (1) 1 0 (~src) - * - * copyInverted orInverted nand set - * src 0 1 0 1 0 1 0 1 - * dst 0 1 0 0 1 0 0 1 1 0 1 1 - * 1 1 0 1 1 1 1 1 0 1 1 1 - * - * and 0 0 (0) 0 1 (src) 0 1 (src) 0 0 (0) - * xor 1 0 (~src) 1 0 (~src) 1 1 (1) 1 1 (1) - * - * or 1 1 (1) 1 0 (~src) 1 0 (~src) 1 1 (1) - * xor 0 1 (src) 0 0 (0) 0 1 (src) 0 0 (0) - */ - -int -cfbReduceRasterOp (rop, fg, pm, andp, xorp) - int rop; - CfbBits fg, pm; - CfbBits *andp, *xorp; -{ - CfbBits and, xor; - int rrop; - - fg = PFILL (fg); - pm = PFILL (pm); - switch (rop) - { - case GXclear: - and = 0; - xor = 0; - break; - case GXand: - and = fg; - xor = 0; - break; - case GXandReverse: - and = fg; - xor = fg; - break; - case GXcopy: - and = 0; - xor = fg; - break; - case GXandInverted: - and = ~fg; - xor = 0; - break; - case GXnoop: - and = ~0; - xor = 0; - break; - case GXxor: - and = ~0; - xor = fg; - break; - case GXor: - and = ~fg; - xor = fg; - break; - case GXnor: - and = ~fg; - xor = ~fg; - break; - case GXequiv: - and = ~0; - xor = ~fg; - break; - case GXinvert: - and = ~0; - xor = ~0; - break; - case GXorReverse: - and = ~fg; - xor = ~0; - break; - case GXcopyInverted: - and = 0; - xor = ~fg; - break; - case GXorInverted: - and = fg; - xor = ~fg; - break; - case GXnand: - and = fg; - xor = ~0; - break; - case GXset: - and = 0; - xor = ~0; - break; - default: - and = xor = 0; - break; - } - and |= ~pm; - xor &= pm; - *andp = and; - *xorp = xor; - /* check for some special cases to reduce computation */ - if (and == 0) - rrop = GXcopy; - /* nothing checks for GXnoop - else if (and == ~0 && xor == 0) - rrop = GXnoop; - */ - else if (and == ~0) - rrop = GXxor; - else if (xor == 0) - rrop = GXand; - else if ( (and ^ xor) == ~0) /* fix XBUG 6541 */ - rrop = GXor; - else - rrop = GXset; /* rop not reduced */ - return rrop; -} diff --git a/nx-X11/programs/Xserver/cfb/cfbrrop.h b/nx-X11/programs/Xserver/cfb/cfbrrop.h deleted file mode 100644 index 6deb7b899..000000000 --- a/nx-X11/programs/Xserver/cfb/cfbrrop.h +++ /dev/null @@ -1,343 +0,0 @@ -/* - * $Xorg: cfbrrop.h,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $ - * -Copyright 1989, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - * - * Author: Keith Packard, MIT X Consortium - */ - -/* $XFree86: xc/programs/Xserver/cfb/cfbrrop.h,v 3.10tsi Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifndef GXcopy -#include -#endif - -#define RROP_FETCH_GC(gc) \ - RROP_FETCH_GCPRIV(((cfbPrivGCPtr)(gc)->devPrivates[cfbGCPrivateIndex].ptr)) - -#ifndef RROP -#define RROP GXset -#endif - -#if RROP == GXcopy -#if PSZ == 24 -#define RROP_DECLARE register CfbBits rrop_xor; \ - CfbBits piQxelXor[3], spiQxelXor[8]; -#define RROP_FETCH_GCPRIV(devPriv) rrop_xor = (devPriv)->xor; \ - spiQxelXor[0] = rrop_xor & 0xFFFFFF; \ - spiQxelXor[2] = rrop_xor << 24; \ - spiQxelXor[3] = (rrop_xor & 0xFFFF00)>> 8; \ - spiQxelXor[4] = rrop_xor << 16; \ - spiQxelXor[5] = (rrop_xor & 0xFF0000)>> 16; \ - spiQxelXor[6] = rrop_xor << 8; \ - spiQxelXor[1] = spiQxelXor[7] = 0; \ - piQxelXor[0] = (rrop_xor & 0xFFFFFF)|(rrop_xor << 24); \ - piQxelXor[1] = (rrop_xor << 16)|((rrop_xor & 0xFFFF00)>> 8); \ - piQxelXor[2] = (rrop_xor << 8)|((rrop_xor & 0xFF0000)>> 16); -#define RROP_SOLID24(dst,index) {\ - register int idx = ((index) & 3)<< 1; \ - *(dst) = (*(dst) & cfbrmask[idx])|spiQxelXor[idx]; \ - if (idx == 2 || idx == 4){ \ - idx++; \ - *((dst)+1) = (*((dst)+1) & cfbrmask[idx])|spiQxelXor[idx]; \ - } \ - } -#define RROP_SOLID(dst, idx) \ - (*(dst) = piQxelXor[(idx)]) -#define RROP_SOLID_MASK(dst,mask,idx) \ - (*(dst) = (*(dst) & ~(mask))|(piQxelXor[(idx)] & (mask))) -#define RROP_UNDECLARE (void)piQxelXor; (void)spiQxelXor; -#else -#define RROP_FETCH_GCPRIV(devPriv) rrop_xor = (devPriv)->xor; -#define RROP_DECLARE register CfbBits rrop_xor; -#define RROP_SOLID(dst) (*(dst) = (rrop_xor)) -#define RROP_SOLID_MASK(dst,mask) (*(dst) = (*(dst) & ~(mask)) | ((rrop_xor) & (mask))) -#define RROP_UNDECLARE -#endif -#define RROP_NAME(prefix) RROP_NAME_CAT(prefix,Copy) -#endif /* GXcopy */ - -#if RROP == GXxor -#if PSZ == 24 -#define RROP_DECLARE register CfbBits rrop_xor; \ - CfbBits piQxelXor[3], spiQxelXor[8]; -#define RROP_FETCH_GCPRIV(devPriv) rrop_xor = (devPriv)->xor; \ - spiQxelXor[0] = rrop_xor & 0xFFFFFF; \ - spiQxelXor[2] = rrop_xor << 24; \ - spiQxelXor[3] = (rrop_xor & 0xFFFF00)>> 8; \ - spiQxelXor[4] = rrop_xor << 16; \ - spiQxelXor[5] = (rrop_xor & 0xFF0000)>> 16; \ - spiQxelXor[6] = rrop_xor << 8; \ - spiQxelXor[1] = spiQxelXor[7] = 0; \ - piQxelXor[0] = (rrop_xor & 0xFFFFFF)|(rrop_xor << 24); \ - piQxelXor[1] = (rrop_xor << 16)|((rrop_xor & 0xFFFF00)>> 8); \ - piQxelXor[2] = (rrop_xor << 8)|((rrop_xor & 0xFF0000)>> 16); -#define RROP_SOLID24(dst,index) {\ - register int idx = ((index) & 3)<< 1; \ - *(dst) ^= spiQxelXor[idx]; \ - if (idx == 2 || idx == 4) \ - *((dst)+1) ^= spiQxelXor[idx+1]; \ - } -#define RROP_SOLID(dst,idx) \ - (*(dst) ^= piQxelXor[(idx)]) -#define RROP_SOLID_MASK(dst,mask,idx) \ - (*(dst) ^= (piQxelXor[(idx)] & (mask))) -#define RROP_UNDECLARE (void)piQxelXor; (void)spiQxelXor; -#else -#define RROP_DECLARE register CfbBits rrop_xor; -#define RROP_FETCH_GCPRIV(devPriv) rrop_xor = (devPriv)->xor; -#define RROP_SOLID(dst) (*(dst) ^= (rrop_xor)) -#define RROP_SOLID_MASK(dst,mask) (*(dst) ^= ((rrop_xor) & (mask))) -#define RROP_UNDECLARE -#endif -#define RROP_NAME(prefix) RROP_NAME_CAT(prefix,Xor) -#endif /* GXxor */ - -#if RROP == GXand -#if PSZ == 24 -#define RROP_DECLARE register CfbBits rrop_and; \ - CfbBits piQxelAnd[3], spiQxelAnd[6]; -#define RROP_FETCH_GCPRIV(devPriv) rrop_and = (devPriv)->and; \ - spiQxelAnd[0] = (rrop_and & 0xFFFFFF) | 0xFF000000; \ - spiQxelAnd[2] = (rrop_and << 24) | 0xFFFFFF; \ - spiQxelAnd[3] = ((rrop_and & 0xFFFF00)>> 8) | 0xFFFF0000; \ - spiQxelAnd[4] = (rrop_and << 16) | 0xFFFF; \ - spiQxelAnd[5] = ((rrop_and & 0xFF0000)>> 16) | 0xFFFFFF00; \ - spiQxelAnd[1] = (rrop_and << 8) | 0xFF; \ - piQxelAnd[0] = (rrop_and & 0xFFFFFF)|(rrop_and << 24); \ - piQxelAnd[1] = (rrop_and << 16)|((rrop_and & 0xFFFF00)>> 8); \ - piQxelAnd[2] = (rrop_and << 8)|((rrop_and & 0xFF0000)>> 16); -#define RROP_SOLID24(dst,index) {\ - switch((index) & 3){ \ - case 0: \ - *(dst) &= spiQxelAnd[0]; \ - break; \ - case 3: \ - *(dst) &= spiQxelAnd[1]; \ - break; \ - case 1: \ - *(dst) &= spiQxelAnd[2]; \ - *((dst)+1) &= spiQxelAnd[3]; \ - break; \ - case 2: \ - *(dst) &= spiQxelAnd[4]; \ - *((dst)+1) &= spiQxelAnd[5]; \ - break; \ - } \ - } -#define RROP_SOLID(dst,idx) \ - (*(dst) &= piQxelAnd[(idx)]) -#define RROP_SOLID_MASK(dst,mask,idx) \ - (*(dst) &= (piQxelAnd[(idx)] | ~(mask))) -#define RROP_UNDECLARE (void)piQxelAnd; (void)spiQxelAnd; -#else -#define RROP_DECLARE register CfbBits rrop_and; -#define RROP_FETCH_GCPRIV(devPriv) rrop_and = (devPriv)->and; -#define RROP_SOLID(dst) (*(dst) &= (rrop_and)) -#define RROP_SOLID_MASK(dst,mask) (*(dst) &= ((rrop_and) | ~(mask))) -#define RROP_UNDECLARE -#endif -#define RROP_NAME(prefix) RROP_NAME_CAT(prefix,And) -#endif /* GXand */ - -#if RROP == GXor -#if PSZ == 24 -#define RROP_DECLARE register CfbBits rrop_or; \ - CfbBits piQxelOr[3], spiQxelOr[6]; -#define RROP_FETCH_GCPRIV(devPriv) rrop_or = (devPriv)->xor; \ - spiQxelOr[0] = rrop_or & 0xFFFFFF; \ - spiQxelOr[1] = rrop_or << 24; \ - spiQxelOr[2] = rrop_or << 16; \ - spiQxelOr[3] = rrop_or << 8; \ - spiQxelOr[4] = (rrop_or & 0xFFFF00)>> 8; \ - spiQxelOr[5] = (rrop_or & 0xFF0000)>> 16; \ - piQxelOr[0] = (rrop_or & 0xFFFFFF)|(rrop_or << 24); \ - piQxelOr[1] = (rrop_or << 16)|((rrop_or & 0xFFFF00)>> 8); \ - piQxelOr[2] = (rrop_or << 8)|((rrop_or & 0xFF0000)>> 16); -#define RROP_SOLID24(dst,index) {\ - switch((index) & 3){ \ - case 0: \ - *(dst) |= spiQxelOr[0]; \ - break; \ - case 3: \ - *(dst) |= spiQxelOr[3]; \ - break; \ - case 1: \ - *(dst) |= spiQxelOr[1]; \ - *((dst)+1) |= spiQxelOr[4]; \ - break; \ - case 2: \ - *(dst) |= spiQxelOr[2]; \ - *((dst)+1) |= spiQxelOr[5]; \ - break; \ - } \ - } -#define RROP_SOLID(dst,idx) \ - (*(dst) |= piQxelOr[(idx)]) -#define RROP_SOLID_MASK(dst,mask,idx) \ - (*(dst) |= (piQxelOr[(idx)] & (mask))) -#define RROP_UNDECLARE (void)piQxelOr; (void)spiQxelOr; -#else -#define RROP_DECLARE register CfbBits rrop_or; -#define RROP_FETCH_GCPRIV(devPriv) rrop_or = (devPriv)->xor; -#define RROP_SOLID(dst) (*(dst) |= (rrop_or)) -#define RROP_SOLID_MASK(dst,mask) (*(dst) |= ((rrop_or) & (mask))) -#define RROP_UNDECLARE -#endif -#define RROP_NAME(prefix) RROP_NAME_CAT(prefix,Or) -#endif /* GXor */ - -#if RROP == GXnoop -#define RROP_DECLARE -#define RROP_FETCH_GCPRIV(devPriv) -#define RROP_SOLID(dst) -#define RROP_SOLID_MASK(dst,mask) -#define RROP_NAME(prefix) RROP_NAME_CAT(prefix,Noop) -#define RROP_UNDECLARE -#endif /* GXnoop */ - -#if RROP == GXset -#if PSZ == 24 -#define RROP_DECLARE register CfbBits rrop_and, rrop_xor; \ - CfbBits piQxelAnd[3], piQxelXor[3], spiQxelAnd[6], spiQxelXor[6]; -#define RROP_FETCH_GCPRIV(devPriv) rrop_and = (devPriv)->and; \ - rrop_xor = (devPriv)->xor; \ - spiQxelXor[0] = rrop_xor & 0xFFFFFF; \ - spiQxelXor[1] = rrop_xor << 24; \ - spiQxelXor[2] = rrop_xor << 16; \ - spiQxelXor[3] = rrop_xor << 8; \ - spiQxelXor[4] = (rrop_xor & 0xFFFF00)>> 8; \ - spiQxelXor[5] = (rrop_xor & 0xFF0000)>> 16; \ - spiQxelAnd[0] = (rrop_and & 0xFFFFFF) | 0xFF000000; \ - spiQxelAnd[1] = (rrop_and << 24) | 0xFFFFFF; \ - spiQxelAnd[2] = (rrop_and << 16) | 0xFFFF; \ - spiQxelAnd[3] = (rrop_and << 8) | 0xFF; \ - spiQxelAnd[4] = ((rrop_and & 0xFFFF00)>> 8) | 0xFFFF0000; \ - spiQxelAnd[5] = ((rrop_and & 0xFF0000)>> 16) | 0xFFFFFF00; \ - piQxelAnd[0] = (rrop_and & 0xFFFFFF)|(rrop_and << 24); \ - piQxelAnd[1] = (rrop_and << 16)|((rrop_and & 0xFFFF00)>> 8); \ - piQxelAnd[2] = (rrop_and << 8)|((rrop_and & 0xFF0000)>> 16); \ - piQxelXor[0] = (rrop_xor & 0xFFFFFF)|(rrop_xor << 24); \ - piQxelXor[1] = (rrop_xor << 16)|((rrop_xor & 0xFFFF00)>> 8); \ - piQxelXor[2] = (rrop_xor << 8)|((rrop_xor & 0xFF0000)>> 16); -#define RROP_SOLID24(dst,index) {\ - switch((index) & 3){ \ - case 0: \ - *(dst) = ((*(dst) & (piQxelAnd[0] |0xFF000000))^(piQxelXor[0] & 0xFFFFFF)); \ - break; \ - case 3: \ - *(dst) = ((*(dst) & (piQxelAnd[2]|0xFF))^(piQxelXor[2] & 0xFFFFFF00)); \ - break; \ - case 1: \ - *(dst) = ((*(dst) & (piQxelAnd[0]|0xFFFFFF))^(piQxelXor[0] & 0xFF000000)); \ - *((dst)+1) = ((*((dst)+1) & (piQxelAnd[1]|0xFFFF0000))^(piQxelXor[1] & 0xFFFF)); \ - break; \ - case 2: \ - *(dst) = ((*(dst) & (piQxelAnd[1]|0xFFFF))^(piQxelXor[1] & 0xFFFF0000)); \ - *((dst)+1) = ((*((dst)+1) & (piQxelAnd[2]|0xFFFFFF00))^(piQxelXor[2] & 0xFF)); \ - break; \ - } \ - } -#define RROP_SOLID(dst,idx) \ - (*(dst) = DoRRop (*(dst), piQxelAnd[(idx)], piQxelXor[(idx)])) -#define RROP_SOLID_MASK(dst,mask,idx) \ - (*(dst) = DoMaskRRop (*(dst), piQxelAnd[(idx)], piQxelXor[(idx)], (mask))) -#define RROP_UNDECLARE (void)piQxelAnd; (void)piQxelXor; \ - (void)spiQxelAnd; (void)spiQxelXor; -#else -#define RROP_DECLARE register CfbBits rrop_and, rrop_xor; -#define RROP_FETCH_GCPRIV(devPriv) rrop_and = (devPriv)->and; \ - rrop_xor = (devPriv)->xor; -#define RROP_SOLID(dst) (*(dst) = DoRRop (*(dst), rrop_and, rrop_xor)) -#define RROP_SOLID_MASK(dst,mask) (*(dst) = DoMaskRRop (*(dst), rrop_and, rrop_xor, (mask))) -#define RROP_UNDECLARE -#endif -#define RROP_NAME(prefix) RROP_NAME_CAT(prefix,General) -#endif /* GXset */ - -#define RROP_UNROLL_CASE1(p,i) case (i): RROP_SOLID((p) - (i)); -#define RROP_UNROLL_CASE2(p,i) RROP_UNROLL_CASE1(p,(i)+1) RROP_UNROLL_CASE1(p,i) -#define RROP_UNROLL_CASE4(p,i) RROP_UNROLL_CASE2(p,(i)+2) RROP_UNROLL_CASE2(p,i) -#define RROP_UNROLL_CASE8(p,i) RROP_UNROLL_CASE4(p,(i)+4) RROP_UNROLL_CASE4(p,i) -#define RROP_UNROLL_CASE16(p,i) RROP_UNROLL_CASE8(p,(i)+8) RROP_UNROLL_CASE8(p,i) -#define RROP_UNROLL_CASE3(p) RROP_UNROLL_CASE2(p,2) RROP_UNROLL_CASE1(p,1) -#define RROP_UNROLL_CASE7(p) RROP_UNROLL_CASE4(p,4) RROP_UNROLL_CASE3(p) -#define RROP_UNROLL_CASE15(p) RROP_UNROLL_CASE8(p,8) RROP_UNROLL_CASE7(p) -#define RROP_UNROLL_CASE31(p) RROP_UNROLL_CASE16(p,16) RROP_UNROLL_CASE15(p) -#ifdef LONG64 -#define RROP_UNROLL_CASE63(p) RROP_UNROLL_CASE32(p,32) RROP_UNROLL_CASE31(p) -#endif /* LONG64 */ - -#define RROP_UNROLL_LOOP1(p,i) RROP_SOLID((p) + (i)); -#define RROP_UNROLL_LOOP2(p,i) RROP_UNROLL_LOOP1(p,(i)) RROP_UNROLL_LOOP1(p,(i)+1) -#define RROP_UNROLL_LOOP4(p,i) RROP_UNROLL_LOOP2(p,(i)) RROP_UNROLL_LOOP2(p,(i)+2) -#define RROP_UNROLL_LOOP8(p,i) RROP_UNROLL_LOOP4(p,(i)) RROP_UNROLL_LOOP4(p,(i)+4) -#define RROP_UNROLL_LOOP16(p,i) RROP_UNROLL_LOOP8(p,(i)) RROP_UNROLL_LOOP8(p,(i)+8) -#define RROP_UNROLL_LOOP32(p,i) RROP_UNROLL_LOOP16(p,(i)) RROP_UNROLL_LOOP16(p,(i)+16) -#ifdef LONG64 -#define RROP_UNROLL_LOOP64(p,i) RROP_UNROLL_LOOP32(p,(i)) RROP_UNROLL_LOOP32(p,(i)+32) -#endif /* LONG64 */ - -#if defined (FAST_CONSTANT_OFFSET_MODE) && defined (SHARED_IDCACHE) && (RROP == GXcopy) - -#ifdef LONG64 -#define RROP_UNROLL_SHIFT 6 -#define RROP_UNROLL_CASE(p) RROP_UNROLL_CASE63(p) -#define RROP_UNROLL_LOOP(p) RROP_UNROLL_LOOP64(p,-64) -#else /* not LONG64 */ -#define RROP_UNROLL_SHIFT 5 -#define RROP_UNROLL_CASE(p) RROP_UNROLL_CASE31(p) -#define RROP_UNROLL_LOOP(p) RROP_UNROLL_LOOP32(p,-32) -#endif /* LONG64 */ -#define RROP_UNROLL (1<>= RROP_UNROLL_SHIFT; \ - (pdst) += part * (sizeof (CfbBits) / sizeof (*pdst)); \ - switch (part) {\ - RROP_UNROLL_CASE((CfbBits *) (pdst)) \ - } \ - while (--(nmiddle) >= 0) { \ - (pdst) += RROP_UNROLL * (sizeof (CfbBits) / sizeof (*pdst)); \ - RROP_UNROLL_LOOP((CfbBits *) (pdst)) \ - } \ -} -#else -#define RROP_SPAN(pdst,nmiddle) \ - while (--(nmiddle) >= 0) { \ - RROP_SOLID((CfbBits *) (pdst)); \ - (pdst) += sizeof (CfbBits) / sizeof (*pdst); \ - } -#endif - -#if !defined(UNIXCPP) || defined(ANSICPP) -#define RROP_NAME_CAT(prefix,suffix) prefix##suffix -#else -#define RROP_NAME_CAT(prefix,suffix) prefix/**/suffix -#endif diff --git a/nx-X11/programs/Xserver/cfb/cfbscrinit.c b/nx-X11/programs/Xserver/cfb/cfbscrinit.c deleted file mode 100644 index 7299bbdf8..000000000 --- a/nx-X11/programs/Xserver/cfb/cfbscrinit.c +++ /dev/null @@ -1,232 +0,0 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfbscrinit.c,v 1.19 2001/01/17 22:36:36 dawes Exp $ */ -/************************************************************ -Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this -software and its documentation for any purpose and without -fee is hereby granted, provided that the above copyright no- -tice appear in all copies and that both that copyright no- -tice and this permission notice appear in supporting docu- -mentation, and that the names of Sun or The Open Group -not be used in advertising or publicity pertaining to -distribution of the software without specific prior -written permission. Sun and The Open Group make no -representations about the suitability of this software for -any purpose. It is provided "as is" without any express or -implied warranty. - -SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT- -NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE LI- -ABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR -PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH -THE USE OR PERFORMANCE OF THIS SOFTWARE. - -********************************************************/ -/* $Xorg: cfbscrinit.c,v 1.3 2000/08/17 19:48:15 cpqbld Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include "servermd.h" -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "resource.h" -#include "colormap.h" -#include "colormapst.h" -#include "cfb.h" -#include "mi.h" -#include "mistruct.h" -#include "dix.h" -#include "cfbmskbits.h" -#include "mibstore.h" - -BSFuncRec cfbBSFuncRec = { - cfbSaveAreas, - cfbRestoreAreas, - (BackingStoreSetClipmaskRgnProcPtr) 0, - (BackingStoreGetImagePixmapProcPtr) 0, - (BackingStoreGetSpansPixmapProcPtr) 0, -}; - -Bool -cfbCloseScreen (index, pScreen) - int index; - ScreenPtr pScreen; -{ - int d; - DepthPtr depths = pScreen->allowedDepths; - - for (d = 0; d < pScreen->numDepths; d++) - xfree (depths[d].vids); - xfree (depths); - xfree (pScreen->visuals); -#ifdef CFB_NEED_SCREEN_PRIVATE - xfree (pScreen->devPrivates[cfbScreenPrivateIndex].ptr); -#else - xfree (pScreen->devPrivate); -#endif - return TRUE; -} - -static void DestroyColormapNoop( - ColormapPtr pColormap) -{ - /* NOOP */ -} - -static void StoreColorsNoop( - ColormapPtr pColormap, - int ndef, - xColorItem * pdef) -{ - /* NOOP */ -} - -Bool -cfbSetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, width) - register ScreenPtr pScreen; - pointer pbits; /* pointer to screen bitmap */ - int xsize, ysize; /* in pixels */ - int dpix, dpiy; /* dots per inch */ - int width; /* pixel width of frame buffer */ -{ - if (!cfbAllocatePrivates(pScreen, (int *) 0, (int *) 0)) - return FALSE; - pScreen->defColormap = FakeClientID(0); - /* let CreateDefColormap do whatever it wants for pixels */ - pScreen->blackPixel = pScreen->whitePixel = (Pixel) 0; - pScreen->QueryBestSize = mfbQueryBestSizeWeak(); - /* SaveScreen */ - pScreen->GetImage = cfbGetImage; - pScreen->GetSpans = cfbGetSpans; - pScreen->CreateWindow = cfbCreateWindow; - pScreen->DestroyWindow = cfbDestroyWindow; - pScreen->PositionWindow = cfbPositionWindow; - pScreen->ChangeWindowAttributes = cfbChangeWindowAttributes; - pScreen->RealizeWindow = cfbMapWindow; - pScreen->UnrealizeWindow = cfbUnmapWindow; - pScreen->PaintWindowBackground = cfbPaintWindow; - pScreen->PaintWindowBorder = cfbPaintWindow; - pScreen->CopyWindow = cfbCopyWindow; - pScreen->CreatePixmap = cfbCreatePixmap; - pScreen->DestroyPixmap = cfbDestroyPixmap; - pScreen->RealizeFont = mfbRealizeFontWeak(); - pScreen->UnrealizeFont = mfbUnrealizeFontWeak(); - pScreen->CreateGC = cfbCreateGC; - pScreen->CreateColormap = cfbInitializeColormap; - pScreen->DestroyColormap = DestroyColormapNoop; - pScreen->InstallColormap = cfbInstallColormap; - pScreen->UninstallColormap = cfbUninstallColormap; - pScreen->ListInstalledColormaps = cfbListInstalledColormaps; - pScreen->StoreColors = StoreColorsNoop; - pScreen->ResolveColor = cfbResolveColor; - pScreen->BitmapToRegion = mfbPixmapToRegionWeak(); - - mfbRegisterCopyPlaneProc (pScreen, cfbCopyPlane); - return TRUE; -} - -#ifdef CFB_NEED_SCREEN_PRIVATE -Bool -cfbCreateScreenResources(pScreen) - ScreenPtr pScreen; -{ - Bool retval; - - pointer oldDevPrivate = pScreen->devPrivate; - pScreen->devPrivate = pScreen->devPrivates[cfbScreenPrivateIndex].ptr; - retval = miCreateScreenResources(pScreen); - pScreen->devPrivates[cfbScreenPrivateIndex].ptr = pScreen->devPrivate; - pScreen->devPrivate = oldDevPrivate; - return retval; -} -#endif - -Bool -cfbFinishScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width) - register ScreenPtr pScreen; - pointer pbits; /* pointer to screen bitmap */ - int xsize, ysize; /* in pixels */ - int dpix, dpiy; /* dots per inch */ - int width; /* pixel width of frame buffer */ -{ -#ifdef CFB_NEED_SCREEN_PRIVATE - pointer oldDevPrivate; -#endif - VisualPtr visuals; - DepthPtr depths; - int nvisuals; - int ndepths; - int rootdepth; - VisualID defaultVisual; - - rootdepth = 0; - if (!cfbInitVisuals (&visuals, &depths, &nvisuals, &ndepths, &rootdepth, - &defaultVisual,((unsigned long)1<<(PSZ-1)), 8)) - return FALSE; -#ifdef CFB_NEED_SCREEN_PRIVATE - oldDevPrivate = pScreen->devPrivate; -#endif - if (! miScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width, - rootdepth, ndepths, depths, - defaultVisual, nvisuals, visuals)) - return FALSE; - /* overwrite miCloseScreen with our own */ - pScreen->CloseScreen = cfbCloseScreen; -#ifdef CFB_NEED_SCREEN_PRIVATE - pScreen->CreateScreenResources = cfbCreateScreenResources; - pScreen->devPrivates[cfbScreenPrivateIndex].ptr = pScreen->devPrivate; - pScreen->devPrivate = oldDevPrivate; -#endif - pScreen->BackingStoreFuncs = cfbBSFuncRec; - pScreen->GetScreenPixmap = cfbGetScreenPixmap; - pScreen->SetScreenPixmap = cfbSetScreenPixmap; - return TRUE; -} - -/* dts * (inch/dot) * (25.4 mm / inch) = mm */ -Bool -cfbScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width) - register ScreenPtr pScreen; - pointer pbits; /* pointer to screen bitmap */ - int xsize, ysize; /* in pixels */ - int dpix, dpiy; /* dots per inch */ - int width; /* pixel width of frame buffer */ -{ - if (!cfbSetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, width)) - return FALSE; - return cfbFinishScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width); -} - -PixmapPtr -cfbGetScreenPixmap(pScreen) - ScreenPtr pScreen; -{ -#ifdef CFB_NEED_SCREEN_PRIVATE - return (PixmapPtr)pScreen->devPrivates[cfbScreenPrivateIndex].ptr; -#else - return (PixmapPtr)pScreen->devPrivate; -#endif -} - -void -cfbSetScreenPixmap(pPix) - PixmapPtr pPix; -{ -#ifdef CFB_NEED_SCREEN_PRIVATE - if (pPix) - pPix->drawable.pScreen->devPrivates[cfbScreenPrivateIndex].ptr = - (pointer)pPix; -#else - if (pPix) - pPix->drawable.pScreen->devPrivate = (pointer)pPix; -#endif -} diff --git a/nx-X11/programs/Xserver/cfb/cfbsetsp.c b/nx-X11/programs/Xserver/cfb/cfbsetsp.c deleted file mode 100644 index 56317cb91..000000000 --- a/nx-X11/programs/Xserver/cfb/cfbsetsp.c +++ /dev/null @@ -1,318 +0,0 @@ -/* $Xorg: cfbsetsp.c,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $ */ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XFree86: xc/programs/Xserver/cfb/cfbsetsp.c,v 3.5tsi Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include "servermd.h" - -#include "misc.h" -#include "regionstr.h" -#include "gcstruct.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "scrnintstr.h" - -#include "cfb.h" -#include "cfbmskbits.h" -#include - -/* cfbSetScanline -- copies the bits from psrc to the drawable starting at - * (xStart, y) and continuing to (xEnd, y). xOrigin tells us where psrc - * starts on the scanline. (I.e., if this scanline passes through multiple - * boxes, we may not want to start grabbing bits at psrc but at some offset - * further on.) - */ -void -cfbSetScanline(y, xOrigin, xStart, xEnd, psrc, alu, pdstBase, widthDst, planemask) - int y; - int xOrigin; /* where this scanline starts */ - int xStart; /* first bit to use from scanline */ - int xEnd; /* last bit to use from scanline + 1 */ - register unsigned int *psrc; - register int alu; /* raster op */ - int *pdstBase; /* start of the drawable */ - int widthDst; /* width of drawable in words */ - unsigned long planemask; -{ - int w; /* width of scanline in bits */ - register int *pdst; /* where to put the bits */ - register int tmpSrc; /* scratch buffer to collect bits in */ - int offSrc; - int nl; -#if PSZ == 24 - register char *psrcb, *pdstb; - register int xIndex; -#else - int dstBit; /* offset in bits from beginning of - * word */ - register int nstart; /* number of bits from first partial */ -#if PSZ != 32 || PPW != 1 - register int nend; /* " " last partial word */ -#endif - int startmask, endmask, nlMiddle; -#endif - DeclareMergeRop() - - InitializeMergeRop(alu,planemask); -#if PSZ == 24 - pdst = pdstBase + (y * widthDst); - xIndex = xStart; - pdstb = (char *)pdst + (xStart * 3); - offSrc = xStart - xOrigin; - psrcb = (char *)psrc + (offSrc * 3); -#else - pdst = pdstBase + (y * widthDst) + (xStart >> PWSH); - psrc += (xStart - xOrigin) >> PWSH; - offSrc = (xStart - xOrigin) & PIM; -#endif - w = xEnd - xStart; - -#if PSZ == 24 - nl = w; - while (nl--){ - psrc = (unsigned int *)((unsigned long)psrcb & ~0x03); - getbits24(psrc, tmpSrc, offSrc); - pdst = (int *)((unsigned long)pdstb & ~0x03); - DoMergeRop24(tmpSrc, pdst, xIndex); - offSrc++; - psrcb += 3; - xIndex++; - pdstb += 3; - } -#else /* PSZ == 24 */ - dstBit = xStart & PIM; - if (dstBit + w <= PPW) - { - maskpartialbits(dstBit, w, startmask); - endmask = 0; - nlMiddle = 0; - } - else - { - maskbits(xStart, w, startmask, endmask, nlMiddle); - } - if (startmask) - nstart = PPW - dstBit; - else - nstart = 0; -#if PSZ != 32 || PPW != 1 - if (endmask) - nend = xEnd & PIM; - else - nend = 0; -#endif - if (startmask) - { - getbits(psrc, offSrc, nstart, tmpSrc); - putbitsmropshort(tmpSrc, dstBit, nstart, pdst); - pdst++; - offSrc += nstart; - if (offSrc > PLST) - { - psrc++; - offSrc -= PPW; - } - } - nl = nlMiddle; - while (nl--) - { - getbits(psrc, offSrc, PPW, tmpSrc); - *pdst = DoMergeRop(tmpSrc, *pdst); - pdst++; - psrc++; - } - if (endmask) - { - getbits(psrc, offSrc, nend, tmpSrc); - putbitsmropshort(tmpSrc, 0, nend, pdst); - } -#endif /* PSZ == 24 */ -} - - - -/* SetSpans -- for each span copy pwidth[i] bits from psrc to pDrawable at - * ppt[i] using the raster op from the GC. If fSorted is TRUE, the scanlines - * are in increasing Y order. - * Source bit lines are server scanline padded so that they always begin - * on a word boundary. - */ -void -cfbSetSpans(pDrawable, pGC, pcharsrc, ppt, pwidth, nspans, fSorted) - DrawablePtr pDrawable; - GCPtr pGC; - char *pcharsrc; - register DDXPointPtr ppt; - int *pwidth; - int nspans; - int fSorted; -{ - unsigned int *psrc = (unsigned int *)pcharsrc; - CfbBits *pdstBase; /* start of dst bitmap */ - int widthDst; /* width of bitmap in words */ - register BoxPtr pbox, pboxLast, pboxTest; - register DDXPointPtr pptLast; - int alu; - RegionPtr prgnDst; - int xStart, xEnd; - int yMax; - - alu = pGC->alu; - prgnDst = cfbGetCompositeClip(pGC); - pptLast = ppt + nspans; - - cfbGetLongWidthAndPointer (pDrawable, widthDst, pdstBase) - - yMax = (int) pDrawable->y + (int) pDrawable->height; - - pbox = REGION_RECTS(prgnDst); - pboxLast = pbox + REGION_NUM_RECTS(prgnDst); - - if(fSorted) - { - /* scan lines sorted in ascending order. Because they are sorted, we - * don't have to check each scanline against each clip box. We can be - * sure that this scanline only has to be clipped to boxes at or after the - * beginning of this y-band - */ - pboxTest = pbox; - while(ppt < pptLast) - { - pbox = pboxTest; - if(ppt->y >= yMax) - break; - while(pbox < pboxLast) - { - if(pbox->y1 > ppt->y) - { - /* scanline is before clip box */ - break; - } - else if(pbox->y2 <= ppt->y) - { - /* clip box is before scanline */ - pboxTest = ++pbox; - continue; - } - else if(pbox->x1 > ppt->x + *pwidth) - { - /* clip box is to right of scanline */ - break; - } - else if(pbox->x2 <= ppt->x) - { - /* scanline is to right of clip box */ - pbox++; - continue; - } - - /* at least some of the scanline is in the current clip box */ - xStart = max(pbox->x1, ppt->x); - xEnd = min(ppt->x + *pwidth, pbox->x2); - cfbSetScanline(ppt->y, ppt->x, xStart, xEnd, psrc, alu, - (int *)pdstBase, widthDst, pGC->planemask); - if(ppt->x + *pwidth <= pbox->x2) - { - /* End of the line, as it were */ - break; - } - else - pbox++; - } - /* We've tried this line against every box; it must be outside them - * all. move on to the next point */ - ppt++; - psrc += PixmapWidthInPadUnits(*pwidth, pDrawable->depth); - pwidth++; - } - } - else - { - /* scan lines not sorted. We must clip each line against all the boxes */ - while(ppt < pptLast) - { - if(ppt->y >= 0 && ppt->y < yMax) - { - - for(pbox = REGION_RECTS(prgnDst); pbox< pboxLast; pbox++) - { - if(pbox->y1 > ppt->y) - { - /* rest of clip region is above this scanline, - * skip it */ - break; - } - if(pbox->y2 <= ppt->y) - { - /* clip box is below scanline */ - pbox++; - break; - } - if(pbox->x1 <= ppt->x + *pwidth && - pbox->x2 > ppt->x) - { - xStart = max(pbox->x1, ppt->x); - xEnd = min(pbox->x2, ppt->x + *pwidth); - cfbSetScanline(ppt->y, ppt->x, xStart, xEnd, psrc, alu, - (int *)pdstBase, widthDst, pGC->planemask); - } - - } - } - psrc += PixmapWidthInPadUnits(*pwidth, pDrawable->depth); - ppt++; - pwidth++; - } - } -} - diff --git a/nx-X11/programs/Xserver/cfb/cfbsolid.c b/nx-X11/programs/Xserver/cfb/cfbsolid.c deleted file mode 100644 index 9f9093647..000000000 --- a/nx-X11/programs/Xserver/cfb/cfbsolid.c +++ /dev/null @@ -1,1367 +0,0 @@ -/* - * $Xorg: cfbsolid.c,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $ - * -Copyright 1990, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - * - * Author: Keith Packard, MIT X Consortium - */ -/* $XFree86: xc/programs/Xserver/cfb/cfbsolid.c,v 3.8tsi Exp $ */ - - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include "servermd.h" -#include "gcstruct.h" -#include "window.h" -#include "pixmapstr.h" -#include "scrnintstr.h" -#include "windowstr.h" - -#include "cfb.h" -#include "cfbmskbits.h" -#include "cfbrrop.h" - -#include "mi.h" -#include "mispans.h" - -#if defined(FAST_CONSTANT_OFFSET_MODE) && (RROP != GXcopy) -# define Expand(left,right,leftAdjust) {\ - int part = nmiddle & 3; \ - int widthStep; \ - widthStep = widthDst - nmiddle - leftAdjust; \ - nmiddle >>= 2; \ - pdst = pdstRect; \ - while (h--) { \ - left \ - pdst += part; \ - switch (part) { \ - RROP_UNROLL_CASE3(pdst) \ - } \ - m = nmiddle; \ - while (m) { \ - pdst += 4; \ - RROP_UNROLL_LOOP4(pdst,-4) \ - m--; \ - } \ - right \ - pdst += widthStep; \ - } \ -} -#else -# ifdef RROP_UNROLL -# define Expand(left,right,leftAdjust) {\ - int part = nmiddle & RROP_UNROLL_MASK; \ - int widthStep; \ - widthStep = widthDst - nmiddle - leftAdjust; \ - nmiddle >>= RROP_UNROLL_SHIFT; \ - pdst = pdstRect; \ - while (h--) { \ - left \ - pdst += part; \ - switch (part) { \ - RROP_UNROLL_CASE(pdst) \ - } \ - m = nmiddle; \ - while (m) { \ - pdst += RROP_UNROLL; \ - RROP_UNROLL_LOOP(pdst) \ - m--; \ - } \ - right \ - pdst += widthStep; \ - } \ -} - -# else -# define Expand(left, right, leftAdjust) { \ - while (h--) { \ - pdst = pdstRect; \ - left \ - m = nmiddle; \ - while (m--) {\ - RROP_SOLID(pdst); \ - pdst++; \ - } \ - right \ - pdstRect += widthDst; \ - } \ -} -# endif -#endif - - -void -RROP_NAME(cfbFillRectSolid) (pDrawable, pGC, nBox, pBox) - DrawablePtr pDrawable; - GCPtr pGC; - int nBox; - BoxPtr pBox; -{ - register int m; - register CfbBits *pdst; - RROP_DECLARE - CfbBits *pdstBase, *pdstRect; - int nmiddle; - int h; - int w; - int widthDst; -#if PSZ == 24 - int leftIndex, rightIndex; -#else - register CfbBits leftMask, rightMask; -#endif - - cfbGetLongWidthAndPointer (pDrawable, widthDst, pdstBase) - - RROP_FETCH_GC(pGC) - - for (; nBox; nBox--, pBox++) - { - pdstRect = pdstBase + pBox->y1 * widthDst; - h = pBox->y2 - pBox->y1; - w = pBox->x2 - pBox->x1; -#if PSZ == 8 - if (w == 1) - { - register char *pdstb = ((char *) pdstRect) + pBox->x1; - int incr = widthDst * PGSZB; - - while (h--) - { - RROP_SOLID (pdstb); - pdstb += incr; - } - } - else - { -#endif -#if PSZ == 24 - leftIndex = pBox->x1 &3; -/* rightIndex = ((leftIndex+w)<5)?0:pBox->x2 &3;*/ - rightIndex = pBox->x2 &3; - - nmiddle = w - rightIndex; - if(leftIndex){ - nmiddle -= (4 - leftIndex); - } - nmiddle >>= 2; - if(nmiddle < 0) - nmiddle = 0; - - pdstRect += (pBox->x1 * 3) >> 2; - pdst = pdstRect; - switch(leftIndex+w){ - case 4: - switch(leftIndex){ - case 0: - while(h--){ -#if RROP == GXcopy - *pdst++ = piQxelXor[0]; - *pdst++ = piQxelXor[1]; - *pdst-- = piQxelXor[2]; -#endif -#if RROP == GXxor - *pdst++ ^= piQxelXor[0]; - *pdst++ ^= piQxelXor[1]; - *pdst-- ^= piQxelXor[2]; -#endif -#if RROP == GXand - *pdst++ &= piQxelAnd[0]; - *pdst++ &= piQxelAnd[1]; - *pdst-- &= piQxelAnd[2]; -#endif -#if RROP == GXor - *pdst++ |= piQxelOr[0]; - *pdst++ |= piQxelOr[1]; - *pdst-- |= piQxelOr[2]; -#endif -#if RROP == GXset - *pdst = DoRRop((*pdst), piQxelAnd[0], piQxelXor[0]); - pdst++; - *pdst = DoRRop((*pdst), piQxelAnd[1], piQxelXor[1]); - pdst++; - *pdst = DoRRop((*pdst), piQxelAnd[2], piQxelXor[2]); - pdst--; -#endif - pdst--; - pdst += widthDst; - } - break; - case 1: - while(h--){ -#if RROP == GXcopy - *pdst = ((*pdst) & 0xFFFFFF) | (piQxelXor[0] & 0xFF000000); - pdst++; - *pdst++ = piQxelXor[1]; - *pdst-- = piQxelXor[2]; -#endif -#if RROP == GXxor - *pdst++ ^= (piQxelXor[0] & 0xFF000000); - *pdst++ ^= piQxelXor[1]; - *pdst-- ^= piQxelXor[2]; -#endif -#if RROP == GXand - *pdst++ &= (piQxelAnd[0] | 0x00FFFFFF); - *pdst++ &= piQxelAnd[1]; - *pdst-- &= piQxelAnd[2]; -#endif -#if RROP == GXor - *pdst++ |= (piQxelOr[0] & 0xFF000000); - *pdst++ |= piQxelOr[1]; - *pdst-- |= piQxelOr[2]; -#endif -#if RROP == GXset - *pdst = DoMaskRRop((*pdst), piQxelAnd[0], piQxelXor[0], 0xFF000000); - pdst++; - *pdst = DoRRop((*pdst), piQxelAnd[1], piQxelXor[1]); - pdst++; - *pdst = DoRRop((*pdst), piQxelAnd[2], piQxelXor[2]); - pdst--; -#endif - pdst--; - pdst += widthDst; - } - break; - case 2: - while(h--){ -#if RROP == GXcopy - *pdst = ((*pdst) & 0xFFFF) | (piQxelXor[1] & 0xFFFF0000); - pdst++; - *pdst-- = piQxelXor[2]; -#endif -#if RROP == GXxor - *pdst++ ^= (piQxelXor[1] & 0xFFFF0000); - *pdst-- ^= piQxelXor[2]; -#endif -#if RROP == GXand - *pdst++ &= (piQxelAnd[1] | 0xFFFF); - *pdst-- &= piQxelAnd[2]; -#endif -#if RROP == GXor - *pdst++ |= (piQxelOr[1] & 0xFFFF0000); - *pdst-- |= piQxelOr[2]; -#endif -#if RROP == GXset - *pdst = DoMaskRRop((*pdst), piQxelAnd[1], piQxelXor[1], 0xFFFF0000); - pdst++; - *pdst = DoRRop((*pdst), piQxelAnd[2], piQxelXor[2]); - pdst--; -#endif - pdst += widthDst; - } - break; - case 3: - while(h--){ -#if RROP == GXcopy - *pdst = ((*pdst) & 0xFF) | (piQxelXor[2] & 0xFFFFFF00); -#endif -#if RROP == GXxor - *pdst ^= (piQxelXor[2] & 0xFFFFFF00); -#endif -#if RROP == GXand - *pdst &= (piQxelAnd[2] | 0xFF); -#endif -#if RROP == GXor - *pdst |= (piQxelOr[2] & 0xFFFFFF00); -#endif -#if RROP == GXset - *pdst = DoMaskRRop((*pdst), piQxelAnd[2], piQxelXor[2], 0xFFFFFF00); -#endif - pdst += widthDst; - } - break; - } - break; - case 3: - switch(leftIndex){ - case 0: - while(h--){ -#if RROP == GXcopy - *pdst++ = piQxelXor[0]; - *pdst++ = piQxelXor[1]; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelXor[2] & 0xFF); - pdst--; -#endif -#if RROP == GXxor - *pdst++ ^= piQxelXor[0]; - *pdst++ ^= piQxelXor[1]; - *pdst-- ^= (piQxelXor[2] & 0xFF); -#endif -#if RROP == GXand - *pdst++ &= piQxelAnd[0]; - *pdst++ &= piQxelAnd[1]; - *pdst-- &= (piQxeAnd[2] | 0xFFFFFF00); -#endif -#if RROP == GXor - *pdst++ |= piQxelOr[0]; - *pdst++ |= piQxelOr[1]; - *pdst-- |= (piQxelOr[2] & 0xFF); -#endif -#if RROP == GXset - *pdst = DoRRop((*pdst), piQxelAnd[0], piQxelXor[0]); - pdst++; - *pdst = DoRRop((*pdst), piQxelAnd[1], piQxelXor[1]); - pdst++; - *pdst = DoMaskRRop((*pdst), piQxelAnd[2], piQxelXor[2], 0xFF); - pdst--; -#endif - pdst--; - pdst += widthDst; - } - break; - case 1: - while(h--){ -#if RROP == GXcopy - *pdst = ((*pdst) & 0xFFFFFF) | (piQxelXor[0] & 0xFF000000); - pdst++; - *pdst++ = piQxelXor[1]; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelXor[2] & 0xFF); - pdst--; -#endif -#if RROP == GXxor - *pdst++ ^= (piQxelXor[0] & 0xFF000000); - *pdst++ ^= piQxelXor[1]; - *pdst-- ^= (piQxelXor[2] & 0xFF); -#endif -#if RROP == GXand - *pdst++ &= (piQxelAnd[0] | 0x00FFFFFF); - *pdst++ &= piQxelAnd[1]; - *pdst-- &= (piQxelAnd[2] | 0xFFFFFF00); -#endif -#if RROP == GXor - *pdst++ |= (piQxelOr[0] & 0xFF000000); - *pdst++ |= piQxelOr[1]; - *pdst-- |= (piQxelOr[2] & 0xFF); -#endif -#if RROP == GXset - *pdst = DoMaskRRop((*pdst), piQxelAnd[0], piQxelXor[0], 0xFF000000); - pdst++; - *pdst = DoRRop((*pdst), piQxelAnd[1], piQxelXor[1]); - pdst++; - *pdst = DoMaskRRop((*pdst), piQxelAnd[2], piQxelXor[2], 0xFF); - pdst--; -#endif - pdst--; - pdst += widthDst; - } - break; - case 2: - while(h--){ -#if RROP == GXcopy - *pdst = ((*pdst) & 0xFFFF) | (piQxelXor[1] & 0xFFFF0000); - pdst++; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelXor[2] & 0xFF); - pdst--; -#endif -#if RROP == GXxor - *pdst++ ^= (piQxelXor[1] & 0xFFFF0000); - *pdst-- ^= (piQxelXor[2] & 0xFF); -#endif -#if RROP == GXand - *pdst++ &= (piQxelAnd[1] | 0xFFFF); - *pdst-- &= (piQxelAnd[2] | 0xFFFFFF00); -#endif -#if RROP == GXor - *pdst++ |= (piQxelOr[1] & 0xFFFF0000); - *pdst-- |= (piQxelOr[2] & 0xFF); -#endif -#if RROP == GXset - *pdst = DoMaskRRop((*pdst), piQxelAnd[1], piQxelXor[1], 0xFFFF0000); - pdst++; - *pdst = DoMaskRRop((*pdst), piQxelAnd[2], piQxelXor[2], 0xFF); - pdst--; -#endif - pdst += widthDst; - } - break; - case 3: - while(h--){ -#if RROP == GXcopy - *pdst = ((*pdst) & 0xFF) | (piQxelXor[2] & 0xFFFFFF00); -#endif -#if RROP == GXxor - *pdst ^= (piQxelXor[2] & 0xFFFFFF00); -#endif -#if RROP == GXand - *pdst &= (piQxelAnd[2] | 0xFF); -#endif -#if RROP == GXor - *pdst |= (piQxelOr[2] & 0xFFFFFF00); -#endif -#if RROP == GXset - *pdst = DoMaskRRop((*pdst), piQxelAnd[2], piQxelXor[2], 0xFFFFFF00); -#endif - pdst += widthDst; - } - break; - } - break; - case 2: /* leftIndex + w = 2*/ - switch(leftIndex){ - case 2: - while(h--){ -#if RROP == GXcopy - *pdst = ((*pdst) & 0xFFFF) | (piQxelXor[1] & 0xFFFF0000); - pdst++; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelXor[2] & 0xFF); - pdst--; -#endif -#if RROP == GXxor - *pdst++ ^= (piQxelXor[1] & 0xFFFF0000); - *pdst-- ^= (piQxelXor[2] & 0xFF); -#endif -#if RROP == GXand - *pdst++ &= (piQxelAnd[1] | 0xFFFF0000); - *pdst-- &= (piQxelAnd[2] | 0xFF); -#endif -#if RROP == GXor - *pdst++ |= (piQxelOr[1] & 0xFFFF0000); - *pdst-- |= (piQxelOr[2] & 0xFF); -#endif -#if RROP == GXset - *pdst = DoMaskRRop((*pdst), piQxelAnd[1], piQxelXor[1], 0xFFFF0000); - pdst++; - *pdst = DoMaskRRop((*pdst), piQxelAnd[2], piQxelXor[2], 0xFF); - pdst--; -#endif - pdst += widthDst; - } - break; - case 1: - while(h--){ -#if RROP == GXcopy - *pdst = ((*pdst) & 0xFFFFFF) | (piQxelXor[0] & 0xFF000000); - pdst++; - *pdst = ((*pdst) & 0xFFFF0000) | (piQxelXor[1] & 0xFFFF); - pdst--; -#endif -#if RROP == GXxor - *pdst++ ^= (piQxelXor[0] & 0xFF000000); - *pdst-- ^= (piQxelXor[1] & 0xFFFF); -#endif -#if RROP == GXand - *pdst++ &= (piQxelAnd[0] | 0xFFFFFF); - *pdst-- &= (piQxelAnd[1] | 0xFFFF0000); -#endif -#if RROP == GXor - *pdst++ |= (piQxelOr[0] & 0xFF000000); - *pdst-- |= (piQxelOr[1] & 0xFFFF); -#endif -#if RROP == GXset - *pdst = DoMaskRRop((*pdst), piQxelAnd[0], piQxelXor[0], 0xFF000000); - pdst++; - *pdst = DoMaskRRop((*pdst), piQxelAnd[1], piQxelXor[1], 0xFFFF); - pdst--; -#endif - pdst += widthDst; - } - break; - case 0: /*case 2 leftIndex == 0 */ - while(h--){ -#if RROP == GXcopy - *pdst++ = piQxelXor[0]; - *pdst = ((*pdst) & 0xFFFF0000) | (piQxelXor[1] & 0xFFFF); - pdst--; -#endif -#if RROP == GXxor - *pdst++ ^= piQxelXor[0]; - *pdst-- ^= (piQxelXor[1] & 0xFFFF); -#endif -#if RROP == GXand - *pdst++ &= piQxelAnd[0]; - *pdst-- &= (piQxelAnd[1] | 0xFFFF0000); -#endif -#if RROP == GXor - *pdst++ |= piQxelOr[0]; - *pdst-- |= (piQxelOr[1] & 0xFFFF); -#endif -#if RROP == GXset - *pdst = DoRRop((*pdst), piQxelAnd[0], piQxelXor[0]); - pdst++; - *pdst = DoMaskRRop((*pdst), piQxelAnd[1], piQxelXor[1], 0xFFFF); - pdst--; -#endif - pdst += widthDst; - } - break; - } - break; - case 1: /*only if leftIndex = 0 and w = 1*/ - while(h--){ -#if RROP == GXcopy - *pdst = ((*pdst) & 0xFF000000) | (piQxelXor[0] & 0xFFFFFF); -#endif -#if RROP == GXxor - *pdst ^= (piQxelXor[0] & 0xFFFFFF); -#endif -#if RROP == GXand - *pdst &= (piQxelAnd[0] | 0xFF000000); -#endif -#if RROP == GXor - *pdst |= (piQxelOr[0] & 0xFFFFFF); -#endif -#if RROP == GXset - *pdst = DoMaskRRop((*pdst), piQxelAnd[0], piQxelXor[0], 0xFFFFFF); -#endif - pdst += widthDst; - } - break; - case 0: /*never*/ - break; - default: - { - while(h--){ - pdst = pdstRect; - switch(leftIndex){ - case 0: - break; - case 1: -#if RROP == GXcopy - *pdst = ((*pdst) & 0xFFFFFF) | (piQxelXor[0] & 0xFF000000); - pdst++; - *pdst++ = piQxelXor[1]; - *pdst++ = piQxelXor[2]; -#endif -#if RROP == GXxor - *pdst++ ^= (piQxelXor[0] & 0xFF000000); - *pdst++ ^= piQxelXor[1]; - *pdst++ ^= piQxelXor[2]; -#endif -#if RROP == GXand - *pdst++ &= (piQxelAnd[0] | 0xFFFFFF); - *pdst++ &= piQxelAnd[1]; - *pdst++ &= piQxelAnd[2]; -#endif -#if RROP == GXor - *pdst++ |= (piQxelOr[0] & 0xFF000000); - *pdst++ |= piQxelOr[1]; - *pdst++ |= piQxelOr[2]; -#endif -#if RROP == GXset - *pdst = DoMaskRRop((*pdst), piQxelAnd[0], piQxelXor[0], 0xFF000000); - pdst++; - *pdst = DoRRop((*pdst), piQxelAnd[1], piQxelXor[1]); - pdst++; - *pdst = DoRRop((*pdst), piQxelAnd[2], piQxelXor[2]); - pdst++; -#endif - break; - case 2: -#if RROP == GXcopy - *pdst = (((*pdst) & 0xFFFF) | (piQxelXor[1] & 0xFFFF0000)); - pdst++; - *pdst++ = piQxelXor[2]; -#endif -#if RROP == GXxor - *pdst++ ^=(piQxelXor[1] & 0xFFFF0000); - *pdst++ ^= piQxelXor[2]; -#endif -#if RROP == GXand - *pdst++ &= (piQxelAnd[1] | 0xFFFF); - *pdst++ &= piQxelAnd[2]; -#endif -#if RROP == GXor - *pdst++ |= (piQxelOr[1] & 0xFFFF0000); - *pdst++ |= piQxelOr[2]; -#endif -#if RROP == GXset - *pdst = DoMaskRRop((*pdst), piQxelAnd[1], piQxelXor[1], 0xFFFF0000); - pdst++; - *pdst = DoRRop((*pdst), piQxelAnd[2], piQxelXor[2]); - pdst++; -#endif - break; - case 3: -#if RROP == GXcopy - *pdst = ((*pdst) & 0xFF) | (piQxelXor[2] & 0xFFFFFF00); - pdst++; -#endif -#if RROP == GXxor - *pdst++ ^= (piQxelXor[2] & 0xFFFFFF00); -#endif -#if RROP == GXand - *pdst++ &= (piQxelAnd[2] | 0xFF); -#endif -#if RROP == GXor - *pdst++ |= (piQxelOr[2] & 0xFFFFFF00); -#endif -#if RROP == GXset - *pdst = DoMaskRRop((*pdst), piQxelAnd[2], piQxelXor[2], 0xFFFFFF00); - pdst++; -#endif - break; - } - m = nmiddle; - while(m--){ -#if RROP == GXcopy - *pdst++ = piQxelXor[0]; - *pdst++ = piQxelXor[1]; - *pdst++ = piQxelXor[2]; -#endif -#if RROP == GXxor - *pdst++ ^= piQxelXor[0]; - *pdst++ ^= piQxelXor[1]; - *pdst++ ^= piQxelXor[2]; -#endif -#if RROP == GXand - *pdst++ &= piQxelAnd[0]; - *pdst++ &= piQxelAnd[1]; - *pdst++ &= piQxelAnd[2]; -#endif -#if RROP == GXor - *pdst++ |= piQxelOr[0]; - *pdst++ |= piQxelOr[1]; - *pdst++ |= piQxelOr[2]; -#endif -#if RROP == GXset - *pdst = DoRRop((*pdst), piQxelAnd[0], piQxelXor[0]); - pdst++; - *pdst = DoRRop((*pdst), piQxelAnd[1], piQxelXor[1]); - pdst++; - *pdst = DoRRop((*pdst), piQxelAnd[2], piQxelXor[2]); - pdst++; -#endif - } - switch(rightIndex){ - case 0: - break; - case 1: -#if RROP == GXcopy - *pdst = ((*pdst) & 0xFF000000) | (piQxelXor[0] & 0xFFFFFF); - pdst++; -#endif -#if RROP == GXxor - *pdst++ ^= (piQxelXor[0] & 0xFFFFFF); -#endif -#if RROP == GXand - *pdst++ &= (piQxelAnd[0] | 0xFF); -#endif -#if RROP == GXor - *pdst++ |= (piQxelOr[0] & 0xFFFFFF); -#endif -#if RROP == GXset - *pdst = DoMaskRRop((*pdst), piQxelAnd[0], piQxelXor[0], 0xFFFFFF); - pdst++; -#endif - break; - case 2: -#if RROP == GXcopy - *pdst++ = piQxelXor[0]; - *pdst = ((*pdst) & 0xFFFF0000) | (piQxelXor[1] & 0xFFFF); - pdst++; -#endif -#if RROP == GXxor - *pdst++ ^= piQxelXor[0]; - *pdst++ ^= (piQxelXor[1] & 0xFFFF); -#endif -#if RROP == GXand - *pdst++ &= piQxelAnd[0]; - *pdst++ &= (piQxelAnd[1] | 0xFFFF0000); -#endif -#if RROP == GXor - *pdst++ |= piQxelOr[0]; - *pdst++ |= (piQxelOr[1] & 0xFFFF); -#endif -#if RROP == GXset - *pdst = DoRRop((*pdst), piQxelAnd[0], piQxelXor[0]); - pdst++; - *pdst = DoMaskRRop((*pdst), piQxelAnd[1], piQxelXor[1], 0xFFFF); - pdst++; -#endif - break; - case 3: -#if RROP == GXcopy - *pdst++ = piQxelXor[0]; - *pdst++ = piQxelXor[1]; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelXor[2] & 0xFF); - pdst++; -#endif -#if RROP == GXxor - *pdst++ ^= piQxelXor[0]; - *pdst++ ^= piQxelXor[1]; - *pdst++ ^= (piQxelXor[2] & 0xFF); -#endif -#if RROP == GXand - *pdst++ &= piQxelAnd[0]; - *pdst++ &= piQxelAnd[1]; - *pdst++ &= (piQxelAnd[2] | 0xFFFFFF00); -#endif -#if RROP == GXor - *pdst++ |= piQxelOr[0]; - *pdst++ |= piQxelOr[1]; - *pdst++ |= (piQxelOr[2] & 0xFF); -#endif -#if RROP == GXset - *pdst = DoRRop((*pdst), piQxelAnd[0], piQxelXor[0]); - pdst++; - *pdst = DoRRop((*pdst), piQxelAnd[1], piQxelXor[1]); - pdst++; - *pdst = DoMaskRRop((*pdst), piQxelAnd[2], piQxelXor[2], 0xFF); - pdst++; -#endif - break; - } - pdstRect += widthDst; - } - } - } -#else /* PSZ != 24 */ - pdstRect += (pBox->x1 >> PWSH); - if ((pBox->x1 & PIM) + w <= PPW) - { - maskpartialbits(pBox->x1, w, leftMask); - pdst = pdstRect; - while (h--) { - RROP_SOLID_MASK (pdst, leftMask); - pdst += widthDst; - } - } - else - { - maskbits (pBox->x1, w, leftMask, rightMask, nmiddle); - if (leftMask) - { - if (rightMask) /* left mask and right mask */ - { - Expand(RROP_SOLID_MASK (pdst, leftMask); pdst++;, - RROP_SOLID_MASK (pdst, rightMask);, 1) - } - else /* left mask and no right mask */ - { - Expand(RROP_SOLID_MASK (pdst, leftMask); pdst++;, - ;, 1) - } - } - else - { - if (rightMask) /* no left mask and right mask */ - { - Expand(;, - RROP_SOLID_MASK (pdst, rightMask);, 0) - } - else /* no left mask and no right mask */ - { - Expand(;, - ;, 0) - } - } - } -#endif -#if PSZ == 8 - } -#endif - } - RROP_UNDECLARE -} - -void -RROP_NAME(cfbSolidSpans) (pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) - DrawablePtr pDrawable; - GCPtr pGC; - int nInit; /* number of spans to fill */ - DDXPointPtr pptInit; /* pointer to list of start points */ - int *pwidthInit; /* pointer to list of n widths */ - int fSorted; -{ - CfbBits *pdstBase; - int widthDst; - - RROP_DECLARE - - register CfbBits *pdst; - register int nlmiddle; - register int w; - int x; - - /* next three parameters are post-clip */ - int n; /* number of spans to fill */ - DDXPointPtr ppt; /* pointer to list of start points */ - int *pwidthFree;/* copies of the pointers to free */ - DDXPointPtr pptFree; - int *pwidth; - cfbPrivGCPtr devPriv; -#if PSZ == 24 - int leftIndex, rightIndex; -#else - register CfbBits startmask, endmask; -#endif - - devPriv = cfbGetGCPrivate(pGC); - RROP_FETCH_GCPRIV(devPriv) - n = nInit * miFindMaxBand(pGC->pCompositeClip); - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); - if(!pptFree || !pwidthFree) - { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); - return; - } - pwidth = pwidthFree; - ppt = pptFree; - n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit, - ppt, pwidth, fSorted); - - cfbGetLongWidthAndPointer (pDrawable, widthDst, pdstBase) - - while (n--) - { - x = ppt->x; - pdst = pdstBase + (ppt->y * widthDst); - ++ppt; - w = *pwidth++; - if (!w) - continue; -#if PSZ == 24 - leftIndex = x &3; -/* rightIndex = ((leftIndex+w)<5)?0:(x+w)&3;*/ - rightIndex = (x+w)&3; - - nlmiddle = w - rightIndex; - if(leftIndex){ - nlmiddle -= (4 - leftIndex); - } -/* nlmiddle += 3;*/ - nlmiddle >>= 2; - if(nlmiddle < 0) - nlmiddle = 0; - - pdst += (x >> 2)*3; - pdst += leftIndex? (leftIndex -1):0; - switch(leftIndex+w){ - case 4: - switch(leftIndex){ - case 0: -#if RROP == GXcopy - *pdst++ = piQxelXor[0]; - *pdst++ = piQxelXor[1]; - *pdst-- = piQxelXor[2]; -#endif -#if RROP == GXxor - *pdst++ ^= piQxelXor[0]; - *pdst++ ^= piQxelXor[1]; - *pdst-- ^= piQxelXor[2]; -#endif -#if RROP == GXand - *pdst++ &= piQxelAnd[0]; - *pdst++ &= piQxelAnd[1]; - *pdst-- &= piQxelAnd[2]; -#endif -#if RROP == GXor - *pdst++ |= piQxelOr[0]; - *pdst++ |= piQxelOr[1]; - *pdst-- |= piQxelOr[2]; -#endif -#if RROP == GXset - *pdst = DoRRop((*pdst), piQxelAnd[0], piQxelXor[0]); - pdst++; - *pdst = DoRRop((*pdst), piQxelAnd[1], piQxelXor[1]); - pdst++; - *pdst = DoRRop((*pdst), piQxelAnd[2], piQxelXor[2]); - pdst--; -#endif - pdst--; - break; - case 1: -#if RROP == GXcopy - *pdst = ((*pdst) & 0xFFFFFF) | (piQxelXor[0] & 0xFF000000); - pdst++; - *pdst++ = piQxelXor[1]; - *pdst-- = piQxelXor[2]; -#endif -#if RROP == GXxor - *pdst++ ^= (piQxelXor[0] & 0xFF000000); - *pdst++ ^= piQxelXor[1]; - *pdst-- ^= piQxelXor[2]; -#endif -#if RROP == GXand - *pdst++ &= (piQxelAnd[0] | 0x00FFFFFF); - *pdst++ &= piQxelAnd[1]; - *pdst-- &= piQxelAnd[2]; -#endif -#if RROP == GXor - *pdst++ |= (piQxelOr[0] & 0xFF000000); - *pdst++ |= piQxelOr[1]; - *pdst-- |= piQxelOr[2]; -#endif -#if RROP == GXset - *pdst = DoMaskRRop((*pdst), piQxelAnd[0], piQxelXor[0], 0xFF000000); - pdst++; - *pdst = DoRRop((*pdst), piQxelAnd[1], piQxelXor[1]); - pdst++; - *pdst = DoRRop((*pdst), piQxelAnd[2], piQxelXor[2]); - pdst--; -#endif - pdst--; - break; - case 2: -#if RROP == GXcopy - *pdst = ((*pdst) & 0xFFFF) | (piQxelXor[1] & 0xFFFF0000); - pdst++; - *pdst-- = piQxelXor[2]; -#endif -#if RROP == GXxor - *pdst++ ^= (piQxelXor[1] & 0xFFFF0000); - *pdst-- ^= piQxelXor[2]; -#endif -#if RROP == GXand - *pdst++ &= (piQxelAnd[1] | 0xFFFF); - *pdst-- &= piQxelAnd[2]; -#endif -#if RROP == GXor - *pdst++ |= (piQxelOr[1] & 0xFFFF0000); - *pdst-- |= piQxelOr[2]; -#endif -#if RROP == GXset - *pdst = DoMaskRRop((*pdst), piQxelAnd[1], piQxelXor[1], 0xFFFF0000); - pdst++; - *pdst = DoRRop((*pdst), piQxelAnd[2], piQxelXor[2]); - pdst--; -#endif - break; - case 3: -#if RROP == GXcopy - *pdst = ((*pdst) & 0xFF) | (piQxelXor[2] & 0xFFFFFF00); -#endif -#if RROP == GXxor - *pdst ^= (piQxelXor[2] & 0xFFFFFF00); -#endif -#if RROP == GXand - *pdst &= (piQxelAnd[2] | 0xFF); -#endif -#if RROP == GXor - *pdst |= (piQxelOr[2] & 0xFFFFFF00); -#endif -#if RROP == GXset - *pdst = DoMaskRRop((*pdst), piQxelAnd[2], piQxelXor[2], 0xFFFFFF00); -#endif - break; - } - break; - case 3: - switch(leftIndex){ - case 0: -#if RROP == GXcopy - *pdst++ = piQxelXor[0]; - *pdst++ = piQxelXor[1]; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelXor[2] & 0xFF); - pdst--; -#endif -#if RROP == GXxor - *pdst++ ^= piQxelXor[0]; - *pdst++ ^= piQxelXor[1]; - *pdst-- ^= (piQxelXor[2] & 0xFF); -#endif -#if RROP == GXand - *pdst++ &= piQxelAnd[0]; - *pdst++ &= piQxelAnd[1]; - *pdst-- &= (piQxelAnd[2] | 0xFFFFFF00); -#endif -#if RROP == GXor - *pdst++ |= piQxelOr[0]; - *pdst++ |= piQxelOr[1]; - - *pdst-- |= (piQxelOr[2] & 0xFF); -#endif -#if RROP == GXset - *pdst = DoRRop((*pdst), piQxelAnd[0], piQxelXor[0]); - pdst++; - *pdst = DoRRop((*pdst), piQxelAnd[1], piQxelXor[1]); - pdst++; - *pdst = DoMaskRRop((*pdst), piQxelAnd[2], piQxelXor[2], 0xFF); - pdst--; -#endif - pdst--; - break; - case 1: -#if RROP == GXcopy - *pdst = ((*pdst) & 0xFFFFFF) | (piQxelXor[0] & 0xFF000000); - pdst++; - *pdst++ = piQxelXor[1]; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelXor[2] & 0xFF); - pdst--; -#endif -#if RROP == GXxor - *pdst++ ^= (piQxelXor[0] & 0xFF000000); - *pdst++ ^= piQxelXor[1]; - *pdst-- ^= (piQxelXor[2] & 0xFF); -#endif -#if RROP == GXand - *pdst++ &= (piQxelAnd[0] | 0x00FFFFFF); - *pdst++ &= piQxelAnd[1]; - *pdst-- &= (piQxelAnd[2] | 0xFFFFFF00); -#endif -#if RROP == GXor - *pdst++ |= (piQxelOr[0] & 0xFF000000); - *pdst++ |= piQxelOr[1]; - *pdst-- |= (piQxelOr[2] & 0xFF); -#endif -#if RROP == GXset - *pdst = DoMaskRRop((*pdst), piQxelAnd[0], piQxelXor[0], 0xFF000000); - pdst++; - *pdst = DoRRop((*pdst), piQxelAnd[1], piQxelXor[1]); - pdst++; - *pdst = DoMaskRRop((*pdst), piQxelAnd[2], piQxelXor[2], 0xFF); - pdst--; -#endif - pdst--; - break; - case 2: -/* pdst++;*/ -#if RROP == GXcopy - *pdst = ((*pdst) & 0xFFFF) | (piQxelXor[1] & 0xFFFF0000); - pdst++; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelXor[2] & 0xFF); - pdst--; -#endif -#if RROP == GXxor - *pdst++ ^= (piQxelXor[1] & 0xFFFF0000); - *pdst-- ^= (piQxelXor[2] & 0xFF); -#endif -#if RROP == GXand - *pdst++ &= (piQxelAnd[1] | 0xFFFF); - *pdst-- &= (piQxelAnd[2] | 0xFFFFFF00); -#endif -#if RROP == GXor - *pdst++ |= (piQxelOr[1] & 0xFFFF0000); - *pdst-- |= (piQxelOr[2] & 0xFF); -#endif -#if RROP == GXset - *pdst = DoMaskRRop((*pdst), piQxelAnd[1], piQxelXor[1], 0xFFFF0000); - pdst++; - *pdst = DoMaskRRop((*pdst), piQxelAnd[2], piQxelXor[2], 0xFF); - pdst--; -#endif - break; - } - break; - case 2: /* leftIndex + w = 2*/ - if(leftIndex){ -#if RROP == GXcopy - *pdst = ((*pdst) & 0xFFFFFF) | (piQxelXor[0] & 0xFF000000); - pdst++; - *pdst = ((*pdst) & 0xFFFF0000) | (piQxelXor[1] & 0xFFFF); - pdst--; -#endif -#if RROP == GXxor - *pdst++ ^= (piQxelXor[0] & 0xFF000000); - *pdst-- ^= (piQxelXor[1] & 0xFFFF); -#endif -#if RROP == GXand - *pdst++ &= (piQxelAnd[0] | 0xFFFFFF); - *pdst-- &= (piQxelAnd[1] | 0xFFFF0000); -#endif -#if RROP == GXor - *pdst++ |= (piQxelOr[0] & 0xFF000000); - *pdst-- |= (piQxelOr[1] & 0xFFFF); -#endif -#if RROP == GXset - *pdst = DoMaskRRop((*pdst), piQxelAnd[0], piQxelXor[0], 0xFF000000); - pdst++; - *pdst = DoMaskRRop((*pdst), piQxelAnd[1], piQxelXor[1], 0xFFFF); - pdst--; -#endif - } - else{ /*case 2 leftIndex === 0 */ -#if RROP == GXcopy - *pdst++ = piQxelXor[0]; - *pdst = ((*pdst) & 0xFFFF0000) | (piQxelXor[1] & 0xFFFF); - pdst--; -#endif -#if RROP == GXxor - *pdst++ ^= piQxelXor[0]; - *pdst-- ^= (piQxelXor[1] & 0xFFFF); -#endif -#if RROP == GXand - *pdst++ &= piQxelAnd[0]; - *pdst-- &= (piQxelAnd[1] | 0xFFFF0000); -#endif -#if RROP == GXor - *pdst++ |= piQxelOr[0]; - *pdst-- |= (piQxelOr[1] & 0xFFFF); -#endif -#if RROP == GXset - *pdst = DoRRop((*pdst), piQxelAnd[0], piQxelXor[0]); - pdst++; - *pdst = DoMaskRRop((*pdst), piQxelAnd[1], piQxelXor[1], 0xFFFF); - pdst--; -#endif - } - break; - case 1: /*only if leftIndex = 0 and w = 1*/ -#if RROP == GXcopy - *pdst = ((*pdst) & 0xFF000000) | (piQxelXor[0] & 0xFFFFFF); -#endif -#if RROP == GXxor - *pdst ^= (piQxelXor[0] & 0xFFFFFF); -#endif -#if RROP == GXand - *pdst &= (piQxelAnd[0] | 0xFF000000); -#endif -#if RROP == GXor - *pdst |= (piQxelOr[0] & 0xFFFFFF); -#endif -#if RROP == GXset - *pdst = DoMaskRRop((*pdst), piQxelAnd[0], piQxelXor[0], 0xFFFFFF); -#endif - break; - case 0: /*never*/ - break; - default: - { - switch(leftIndex){ - case 0: - break; - case 1: -#if RROP == GXcopy - *pdst = ((*pdst) & 0xFFFFFF) | (piQxelXor[0] & 0xFF000000); - pdst++; - *pdst++ = piQxelXor[1]; - *pdst++ = piQxelXor[2]; -#endif -#if RROP == GXxor - *pdst++ ^= (piQxelXor[0] & 0xFF000000); - *pdst++ ^= piQxelXor[1]; - *pdst++ ^= piQxelXor[2]; -#endif -#if RROP == GXand - *pdst++ &= (piQxelAnd[0] | 0xFFFFFF); - *pdst++ &= piQxelAnd[1]; - *pdst++ &= piQxelAnd[2]; -#endif -#if RROP == GXor - *pdst++ |= (piQxelOr[0] & 0xFF000000); - *pdst++ |= piQxelOr[1]; - *pdst++ |= piQxelOr[2]; -#endif -#if RROP == GXset - *pdst = DoMaskRRop((*pdst), piQxelAnd[0], piQxelXor[0], 0xFF000000); - pdst++; - *pdst = DoRRop((*pdst), piQxelAnd[1], piQxelXor[1]); - pdst++; - *pdst = DoRRop((*pdst), piQxelAnd[2], piQxelXor[2]); - pdst++; -#endif - break; - case 2: -#if RROP == GXcopy - *pdst = (((*pdst) & 0xFFFF) | (piQxelXor[1] & 0xFFFF0000)); - pdst++; - *pdst++ = piQxelXor[2]; -#endif -#if RROP == GXxor - *pdst++ ^=(piQxelXor[1] & 0xFFFF0000); - *pdst++ ^= piQxelXor[2]; -#endif -#if RROP == GXand - *pdst++ &= (piQxelAnd[1] | 0xFFFF); - *pdst++ &= piQxelAnd[2]; -#endif -#if RROP == GXor - *pdst++ |= (piQxelOr[1] & 0xFFFF0000); - *pdst++ |= piQxelOr[2]; -#endif -#if RROP == GXset - *pdst = DoMaskRRop((*pdst), piQxelAnd[1], piQxelXor[1], 0xFFFF0000); - pdst++; - *pdst = DoRRop((*pdst), piQxelAnd[2], piQxelXor[2]); - pdst++; -#endif - break; - case 3: -#if RROP == GXcopy - *pdst = ((*pdst) & 0xFF) | (piQxelXor[2] & 0xFFFFFF00); - pdst++; -#endif -#if RROP == GXxor - *pdst++ ^= (piQxelXor[2] & 0xFFFFFF00); -#endif -#if RROP == GXand - *pdst++ &= (piQxelAnd[2] | 0xFF); -#endif -#if RROP == GXor - *pdst++ |= (piQxelOr[2] & 0xFFFFFF00); -#endif -#if RROP == GXset - *pdst = DoMaskRRop((*pdst), piQxelAnd[2], piQxelXor[2], 0xFFFFFF00); - pdst++; -#endif - break; - } - while(nlmiddle--){ -#if RROP == GXcopy - *pdst++ = piQxelXor[0]; - *pdst++ = piQxelXor[1]; - *pdst++ = piQxelXor[2]; -#endif -#if RROP == GXxor - *pdst++ ^= piQxelXor[0]; - *pdst++ ^= piQxelXor[1]; - *pdst++ ^= piQxelXor[2]; -#endif -#if RROP == GXand - *pdst++ &= piQxelAnd[0]; - *pdst++ &= piQxelAnd[1]; - *pdst++ &= piQxelAnd[2]; -#endif -#if RROP == GXor - *pdst++ |= piQxelOr[0]; - *pdst++ |= piQxelOr[1]; - *pdst++ |= piQxelOr[2]; -#endif -#if RROP == GXset - *pdst = DoRRop((*pdst), piQxelAnd[0], piQxelXor[0]); - pdst++; - *pdst = DoRRop((*pdst), piQxelAnd[1], piQxelXor[1]); - pdst++; - *pdst = DoRRop((*pdst), piQxelAnd[2], piQxelXor[2]); - pdst++; -#endif - } - switch(rightIndex){ - case 0: - break; - case 1: -#if RROP == GXcopy - *pdst = ((*pdst) & 0xFF000000) | (piQxelXor[0] & 0xFFFFFF); - pdst++; -#endif -#if RROP == GXxor - *pdst++ ^= (piQxelXor[0] & 0xFFFFFF); -#endif -#if RROP == GXand - *pdst++ &= (piQxelAnd[0] | 0xFF); -#endif -#if RROP == GXor - *pdst++ |= (piQxelOr[0] & 0xFFFFFF); -#endif -#if RROP == GXset - *pdst = DoMaskRRop((*pdst), piQxelAnd[0], piQxelXor[0], 0xFFFFFF); -#endif - break; - case 2: -#if RROP == GXcopy - *pdst++ = piQxelXor[0]; - *pdst = ((*pdst) & 0xFFFF0000) | (piQxelXor[1] & 0xFFFF); - pdst++; -#endif -#if RROP == GXxor - *pdst++ ^= piQxelXor[0]; - *pdst++ ^= (piQxelXor[1] & 0xFFFF); -#endif -#if RROP == GXand - *pdst++ &= piQxelAnd[0]; - *pdst++ &= (piQxelAnd[1] | 0xFFFF0000); -#endif -#if RROP == GXor - *pdst++ |= piQxelOr[0]; - *pdst++ |= (piQxelOr[1] & 0xFFFF); -#endif -#if RROP == GXset - *pdst = DoRRop((*pdst), piQxelAnd[0], piQxelXor[0]); - pdst++; - *pdst = DoMaskRRop((*pdst), piQxelAnd[1], piQxelXor[1], 0xFFFF); - pdst++; -#endif - break; - case 3: -#if RROP == GXcopy - *pdst++ = piQxelXor[0]; - *pdst++ = piQxelXor[1]; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelXor[2] & 0xFF); - pdst++; -#endif -#if RROP == GXxor - *pdst++ ^= piQxelXor[0]; - *pdst++ ^= piQxelXor[1]; - *pdst++ ^= (piQxelXor[2] & 0xFF); -#endif -#if RROP == GXand - *pdst++ &= piQxelAnd[0]; - *pdst++ &= piQxelAnd[1]; - *pdst++ &= (piQxelAnd[2] | 0xFFFFFF00); -#endif -#if RROP == GXor - *pdst++ |= piQxelOr[0]; - *pdst++ |= piQxelOr[1]; - *pdst++ |= (piQxelOr[2] & 0xFF); -#endif -#if RROP == GXset - *pdst = DoRRop((*pdst), piQxelAnd[0], piQxelXor[0]); - pdst++; - *pdst = DoRRop((*pdst), piQxelAnd[1], piQxelXor[1]); - pdst++; - *pdst = DoMaskRRop((*pdst), piQxelAnd[2], piQxelXor[2], 0xFF); - pdst++; -#endif - break; - } - } -} -#else -#if PSZ == 8 - if (w <= PGSZB) - { - register char *addrb; - - addrb = ((char *) pdst) + x; - while (w--) - { - RROP_SOLID (addrb); - addrb++; - } - } -#else - if ((x & PIM) + w <= PPW) - { - pdst += x >> PWSH; - maskpartialbits (x, w, startmask); - RROP_SOLID_MASK (pdst, startmask); - } -#endif - else - { - pdst += x >> PWSH; - maskbits (x, w, startmask, endmask, nlmiddle); - if (startmask) - { - RROP_SOLID_MASK (pdst, startmask); - ++pdst; - } - - RROP_SPAN(pdst,nlmiddle) - if (endmask) - { - RROP_SOLID_MASK (pdst, endmask); - } - } -#endif - } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); - RROP_UNDECLARE -} diff --git a/nx-X11/programs/Xserver/cfb/cfbtab.h b/nx-X11/programs/Xserver/cfb/cfbtab.h deleted file mode 100644 index d95efd66d..000000000 --- a/nx-X11/programs/Xserver/cfb/cfbtab.h +++ /dev/null @@ -1,16 +0,0 @@ -/* $XFree86$ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifndef _CFBTAB_H_ -#define _CFBTAB_H_ - -/* prototypes */ -#if 0 -extern int starttab[32], endtab[32]; -extern unsigned int partmasks[32][32]; -#endif - -#endif /* _CFBTAB_H_ */ diff --git a/nx-X11/programs/Xserver/cfb/cfbteblt8.c b/nx-X11/programs/Xserver/cfb/cfbteblt8.c deleted file mode 100644 index f58a07dc6..000000000 --- a/nx-X11/programs/Xserver/cfb/cfbteblt8.c +++ /dev/null @@ -1,591 +0,0 @@ -/* - * TEGblt - ImageText expanded glyph fonts only. For - * 8 bit displays, in Copy mode with no clipping. - */ - -/* $XFree86: xc/programs/Xserver/cfb/cfbteblt8.c,v 1.5 2001/10/28 03:33:02 tsi Exp $ */ -/* - -Copyright 1989, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. -*/ - -/* $Xorg: cfbteblt8.c,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#if PSZ == 8 - -#include -#include -#include -#include "cfb.h" -#include -#include "dixfontstr.h" -#include "gcstruct.h" -#include "windowstr.h" -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "regionstr.h" -#include "cfbmskbits.h" -#include "cfb8bit.h" - -/* - * this code supports up to 5 characters at a time. The performance - * differences between 4 and 5 is usually small (~7% on PMAX) and - * frequently negative (SPARC and Sun3), so this file is compiled - * only once for now. If you want to use the other options, you'll - * need to hack cfbgc.c as well. - */ - -#ifndef NGLYPHS -#define NGLYPHS 4 -#define DO_COMMON -#endif - -#ifdef DO_COMMON -#define CFBTEGBLT8 cfbTEGlyphBlt8 -#endif - -/* - * On little-endian machines (or where fonts are padded to 32-bit - * boundaries) we can use some magic to avoid the expense of getleftbits - */ - -#if ((BITMAP_BIT_ORDER == LSBFirst && NGLYPHS >= 4) || GLYPHPADBYTES == 4) - -#if GLYPHPADBYTES == 1 -typedef unsigned char *glyphPointer; -#define USE_LEFTBITS -#endif - -#if GLYPHPADBYTES == 2 -typedef unsigned short *glyphPointer; -#define USE_LEFTBITS -#endif - -#if GLYPHPADBYTES == 4 -typedef unsigned int *glyphPointer; -#endif - -#define GetBitsL c = BitLeft (*leftChar++, lshift) -#define NGetBits1S(r) c = BitRight(*char1++ r, xoff1) -#define NGetBits1L(r) GetBitsL | BitRight(*char1++ r, xoff1) -#define NGetBits1U(r) c = *char1++ r -#define NGetBits2S(r) NGetBits1S(| BitRight(*char2++ r, widthGlyph)) -#define NGetBits2L(r) NGetBits1L(| BitRight(*char2++ r, widthGlyph)) -#define NGetBits2U(r) NGetBits1U(| BitRight(*char2++ r, widthGlyph)) -#define NGetBits3S(r) NGetBits2S(| BitRight(*char3++ r, widthGlyph)) -#define NGetBits3L(r) NGetBits2L(| BitRight(*char3++ r, widthGlyph)) -#define NGetBits3U(r) NGetBits2U(| BitRight(*char3++ r, widthGlyph)) -#define NGetBits4S(r) NGetBits3S(| BitRight(*char4++ r, widthGlyph)) -#define NGetBits4L(r) NGetBits3L(| BitRight(*char4++ r, widthGlyph)) -#define NGetBits4U(r) NGetBits3U(| BitRight(*char4++ r, widthGlyph)) -#define NGetBits5S(r) NGetBits4S(| BitRight(*char5++ r, widthGlyph)) -#define NGetBits5L(r) NGetBits4L(| BitRight(*char5++ r, widthGlyph)) -#define NGetBits5U(r) NGetBits4U(| BitRight(*char5++ r, widthGlyph)) -#define GetBits1S c = BitRight(*char1++, xoff1) -#define GetBits1L GetBitsL | BitRight(*char1++, xoff1) -#define GetBits1U c = *char1++ -#define GetBits2S NGetBits1S(| BitRight(*char2++, widthGlyph)) -#define GetBits2L NGetBits1L(| BitRight(*char2++, widthGlyph)) -#define GetBits2U NGetBits1U(| BitRight(*char2++, widthGlyph)) -#define GetBits3S NGetBits2S(| BitRight(*char3++, widthGlyph)) -#define GetBits3L NGetBits2L(| BitRight(*char3++, widthGlyph)) -#define GetBits3U NGetBits2U(| BitRight(*char3++, widthGlyph)) -#define GetBits4S NGetBits3S(| BitRight(*char4++, widthGlyph)) -#define GetBits4L NGetBits3L(| BitRight(*char4++, widthGlyph)) -#define GetBits4U NGetBits3U(| BitRight(*char4++, widthGlyph)) -#define GetBits5S NGetBits4S(| BitRight(*char5++, widthGlyph)) -#define GetBits5L NGetBits4L(| BitRight(*char5++, widthGlyph)) -#define GetBits5U NGetBits4U(| BitRight(*char5++, widthGlyph)) - -#else - -typedef unsigned int *glyphPointer; - -#define USE_LEFTBITS -#define ALL_LEFTBITS - -#define GetBitsL WGetBitsL -#define GetBits1S WGetBits1S -#define GetBits1L WGetBits1L -#define GetBits1U WGetBits1U - -#define GetBits2S GetBits1S Get1Bits (char2, tmpSrc) \ - c |= BitRight(tmpSrc, xoff2); -#define GetBits2L GetBits1L Get1Bits (char2, tmpSrc) \ - c |= BitRight(tmpSrc, xoff2); -#define GetBits2U GetBits1U Get1Bits (char2, tmpSrc) \ - c |= BitRight(tmpSrc, xoff2); - -#define GetBits3S GetBits2S Get1Bits (char3, tmpSrc) \ - c |= BitRight(tmpSrc, xoff3); -#define GetBits3L GetBits2L Get1Bits (char3, tmpSrc) \ - c |= BitRight(tmpSrc, xoff3); -#define GetBits3U GetBits2U Get1Bits (char3, tmpSrc) \ - c |= BitRight(tmpSrc, xoff3); - -#define GetBits4S GetBits3S Get1Bits (char4, tmpSrc) \ - c |= BitRight(tmpSrc, xoff4); -#define GetBits4L GetBits3L Get1Bits (char4, tmpSrc) \ - c |= BitRight(tmpSrc, xoff4); -#define GetBits4U GetBits3U Get1Bits (char4, tmpSrc) \ - c |= BitRight(tmpSrc, xoff4); - -#define GetBits5S GetBits4S Get1Bits (char5, tmpSrc) \ - c |= BitRight(tmpSrc, xoff5); -#define GetBits5L GetBits4L Get1Bits (char5, tmpSrc) \ - c |= BitRight(tmpSrc, xoff5); -#define GetBits5U GetBits4U Get1Bits (char5, tmpSrc) \ - c |= BitRight(tmpSrc, xoff5); - -#endif - -#ifdef USE_LEFTBITS - -#define IncChar(c) (c = (glyphPointer) (((char *) c) + glyphBytes)) - -#define Get1Bits(ch,dst) glyphbits (ch, widthGlyph, glyphMask, dst); \ - IncChar (ch); - -#define glyphbits(bits,width,mask,dst) getleftbits(bits,width,dst); \ - dst &= mask; - -#define WGetBitsL Get1Bits(leftChar,c); \ - c = BitLeft (c, lshift); -#define WGetBits1S Get1Bits (char1, c) \ - c = BitRight (c, xoff1); -#define WGetBits1L WGetBitsL Get1Bits (char1, tmpSrc) \ - c |= BitRight (tmpSrc, xoff1); -#define WGetBits1U Get1Bits (char1, c) - -#else -#define WGetBitsL GetBitsL -#define WGetBits1S GetBits1S -#define WGetBits1L GetBits1L -#define WGetBits1U GetBits1U -#endif - -#if NGLYPHS == 2 -# define GetBitsNS GetBits2S -# define GetBitsNL GetBits2L -# define GetBitsNU GetBits2U -# define LastChar char2 -#ifndef CFBTEGBLT8 -# define CFBTEGBLT8 cfbTEGlyphBlt8x2 -#endif -#endif -#if NGLYPHS == 3 -# define GetBitsNS GetBits3S -# define GetBitsNL GetBits3L -# define GetBitsNU GetBits3U -# define LastChar char3 -#ifndef CFBTEGBLT8 -# define CFBTEGBLT8 cfbTEGlyphBlt8x3 -#endif -#endif -#if NGLYPHS == 4 -# define GetBitsNS GetBits4S -# define GetBitsNL GetBits4L -# define GetBitsNU GetBits4U -# define LastChar char4 -#ifndef CFBTEGBLT8 -# define CFBTEGBLT8 cfbTEGlyphBlt8x4 -#endif -#endif -#if NGLYPHS == 5 -# define GetBitsNS GetBits5S -# define GetBitsNL GetBits5L -# define GetBitsNU GetBits5U -# define LastChar char5 -#ifndef CFBTEGBLT8 -# define CFBTEGBLT8 cfbTEGlyphBlt8x5 -#endif -#endif - -/* another ugly giant macro */ -#define SwitchEm switch (ew) \ - { \ - case 0: \ - break; \ - case 1: \ - while (hTmp--) { \ - GetBits; \ - StoreBits0 \ - Loop \ - } \ - break; \ - case 2: \ - while (hTmp--) { \ - GetBits; \ - StoreBits0 FirstStep StoreBits(1) \ - Loop \ - } \ - break; \ - case 3: \ - while (hTmp--) { \ - GetBits; \ - StoreBits0 FirstStep StoreBits(1) Step StoreBits(2) \ - Loop \ - } \ - break; \ - case 4: \ - while (hTmp--) { \ - GetBits; \ - StoreBits0 FirstStep StoreBits(1) Step \ - StoreBits(2) Step StoreBits(3) \ - Loop \ - } \ - break; \ - case 5: \ - while (hTmp--) { \ - GetBits; \ - StoreBits0 FirstStep StoreBits(1) Step \ - StoreBits(2) Step StoreBits(3) Step \ - StoreBits(4) \ - Loop \ - } \ - break; \ - case 6: \ - while (hTmp--) { \ - GetBits; \ - StoreBits0 FirstStep StoreBits(1) Step \ - StoreBits(2) Step StoreBits(3) Step \ - StoreBits(4) Step StoreBits(5) \ - Loop \ - } \ - break; \ - case 7: \ - while (hTmp--) { \ - GetBits; \ - StoreBits0 FirstStep StoreBits(1) Step \ - StoreBits(2) Step StoreBits(3) Step \ - StoreBits(4) Step StoreBits(5) Step \ - StoreBits(6) \ - Loop \ - } \ - break; \ - case 8: \ - while (hTmp--) { \ - GetBits; \ - StoreBits0 FirstStep StoreBits(1) Step \ - StoreBits(2) Step StoreBits(3) Step \ - StoreBits(4) Step StoreBits(5) Step \ - StoreBits(6) Step StoreBits(7) \ - Loop \ - } \ - break; \ - } - -#ifdef FAST_CONSTANT_OFFSET_MODE -#define StorePixels(o,p) dst[o] = p -#define Loop dst += widthDst; -#else -#define StorePixels(o,p) *dst++ = (p) -#define Loop dst += widthLeft; -#endif - -#define Step NextBitGroup(c); - -#if (BITMAP_BIT_ORDER == MSBFirst) -#define StoreBits(o) StorePixels(o,GetPixelGroup(c)); -#define FirstStep Step -#else -#if PGSZ == 64 -#define StoreBits(o) StorePixels(o,cfb8Pixels[(c) & PGSZBMSK]); -#define FirstStep Step -#else /* PGSZ == 32 */ -#define StoreBits(o) StorePixels(o,*((CfbBits *) (((char *) cfb8Pixels) + (c & 0x3c)))); -#define FirstStep c = BitLeft (c, 2); -#endif /* PGSZ */ -#endif /* BITMAP_BIT_ORDER */ - - -void -CFBTEGBLT8 (pDrawable, pGC, xInit, yInit, nglyph, ppci, pglyphBase) - DrawablePtr pDrawable; - GC *pGC; - int xInit, yInit; - unsigned int nglyph; - CharInfoPtr *ppci; /* array of character info */ - pointer pglyphBase; /* start of array of glyphs */ -{ - register CfbBits c; - register CfbBits *dst; - register CfbBits leftMask, rightMask; - register int hTmp; - register int xoff1; - register glyphPointer char1; - register glyphPointer char2; -#if NGLYPHS >= 3 - register glyphPointer char3; -#endif -#if NGLYPHS >= 4 - register glyphPointer char4; -#endif -#if NGLYPHS >= 5 - register glyphPointer char5; -#endif -#ifdef ALL_LEFTBITS - int xoff2, xoff3, xoff4, xoff5; -#endif - - FontPtr pfont = pGC->font; - CfbBits *dstLine; - glyphPointer oldRightChar; - CfbBits *pdstBase; - glyphPointer leftChar; - int widthDst; -#ifndef FAST_CONSTANT_OFFSET_MODE - int widthLeft; -#endif - int widthGlyph; - int h; - int ew; - int x, y; - BoxRec bbox; /* for clipping */ - int lshift; - int widthGlyphs; -#ifdef USE_LEFTBITS - register CfbBits glyphMask; - register CfbBits tmpSrc; - register int glyphBytes; -#endif - - widthGlyph = FONTMAXBOUNDS(pfont,characterWidth); - h = FONTASCENT(pfont) + FONTDESCENT(pfont); - if (!h) - return; - x = xInit + FONTMAXBOUNDS(pfont,leftSideBearing) + pDrawable->x; - y = yInit - FONTASCENT(pfont) + pDrawable->y; - bbox.x1 = x; - bbox.x2 = x + (widthGlyph * nglyph); - bbox.y1 = y; - bbox.y2 = y + h; - - switch (RECT_IN_REGION(pGC->pScreen, cfbGetCompositeClip(pGC), &bbox)) - { - case rgnPART: - cfbImageGlyphBlt8(pDrawable, pGC, xInit, yInit, nglyph, ppci, pglyphBase); - case rgnOUT: - return; - } - - if (!cfb8CheckPixels (pGC->fgPixel, pGC->bgPixel)) - cfb8SetPixels (pGC->fgPixel, pGC->bgPixel); - - leftChar = 0; - - cfbGetLongWidthAndPointer(pDrawable, widthDst, pdstBase) - -#if NGLYPHS == 2 - widthGlyphs = widthGlyph << 1; -#else -#if NGLYPHS == 4 - widthGlyphs = widthGlyph << 2; -#else - widthGlyphs = widthGlyph * NGLYPHS; -#endif -#endif - -#ifdef USE_LEFTBITS - glyphMask = mfbGetendtab(widthGlyph); - glyphBytes = GLYPHWIDTHBYTESPADDED(*ppci); -#endif - - pdstBase += y * widthDst; -#ifdef DO_COMMON - if (widthGlyphs <= 32) -#endif - while (nglyph >= NGLYPHS) - { - nglyph -= NGLYPHS; - hTmp = h; - dstLine = pdstBase + (x >> PWSH); - xoff1 = x & PIM; - char1 = (glyphPointer) FONTGLYPHBITS(pglyphBase, *ppci++); - char2 = (glyphPointer) FONTGLYPHBITS(pglyphBase, *ppci++); -#ifdef ALL_LEFTBITS - xoff2 = xoff1 + widthGlyph; -#endif -#if NGLYPHS >= 3 - char3 = (glyphPointer) FONTGLYPHBITS(pglyphBase, *ppci++); -#ifdef ALL_LEFTBITS - xoff3 = xoff2 + widthGlyph; -#endif -#endif -#if NGLYPHS >= 4 - char4 = (glyphPointer) FONTGLYPHBITS(pglyphBase, *ppci++); -#ifdef ALL_LEFTBITS - xoff4 = xoff3 + widthGlyph; -#endif -#endif -#if NGLYPHS >= 5 - char5 = (glyphPointer) FONTGLYPHBITS(pglyphBase, *ppci++); -#ifdef ALL_LEFTBITS - xoff5 = xoff4 + widthGlyph; -#endif -#endif - oldRightChar = LastChar; - dst = dstLine; - if (xoff1) - { - ew = ((widthGlyphs - (PGSZB - xoff1)) >> PWSH) + 1; -#ifndef FAST_CONSTANT_OFFSET_MODE - widthLeft = widthDst - ew; -#endif - if (!leftChar) - { - leftMask = cfbendtab[xoff1]; - rightMask = cfbstarttab[xoff1]; - -#define StoreBits0 StorePixels (0, (dst[0] & leftMask) | \ - (GetPixelGroup(c) & rightMask)); -#define GetBits GetBitsNS - - SwitchEm - -#undef GetBits -#undef StoreBits0 - - } - else - { - lshift = widthGlyph - xoff1; - -#define StoreBits0 StorePixels (0,GetPixelGroup(c)); -#define GetBits GetBitsNL - - SwitchEm - -#undef GetBits -#undef StoreBits0 - - } - } - else - { -#if NGLYPHS == 4 && PGSZ == 32 - ew = widthGlyph; /* widthGlyphs >> 2 */ -#else - ew = widthGlyphs >> PWSH; -#endif -#ifndef FAST_CONSTANT_OFFSET_MODE - widthLeft = widthDst - ew; -#endif - -#define StoreBits0 StorePixels (0,GetPixelGroup(c)); -#define GetBits GetBitsNU - - SwitchEm - -#undef GetBits -#undef StoreBits0 - - } - x += widthGlyphs; - leftChar = oldRightChar; - } - while (nglyph--) - { - xoff1 = x & PIM; - char1 = (glyphPointer) FONTGLYPHBITS(pglyphBase, *ppci++); - hTmp = h; - dstLine = pdstBase + (x >> PWSH); - oldRightChar = char1; - dst = dstLine; - if (xoff1) - { - ew = ((widthGlyph - (PGSZB - xoff1)) >> PWSH) + 1; -#ifndef FAST_CONSTANT_OFFSET_MODE - widthLeft = widthDst - ew; -#endif - if (!leftChar) - { - leftMask = cfbendtab[xoff1]; - rightMask = cfbstarttab[xoff1]; - -#define StoreBits0 StorePixels (0, (dst[0] & leftMask) | \ - (GetPixelGroup(c) & rightMask)); -#define GetBits WGetBits1S - - SwitchEm -#undef GetBits -#undef StoreBits0 - - } - else - { - lshift = widthGlyph - xoff1; - -#define StoreBits0 StorePixels (0,GetPixelGroup(c)); -#define GetBits WGetBits1L - - SwitchEm -#undef GetBits -#undef StoreBits0 - - } - } - else - { - ew = widthGlyph >> PWSH; - -#ifndef FAST_CONSTANT_OFFSET_MODE - widthLeft = widthDst - ew; -#endif - -#define StoreBits0 StorePixels (0,GetPixelGroup(c)); -#define GetBits WGetBits1U - - SwitchEm - -#undef GetBits -#undef StoreBits0 - - } - x += widthGlyph; - leftChar = oldRightChar; - } - /* - * draw the tail of the last character - */ - xoff1 = x & PIM; - if (xoff1) - { - rightMask = cfbstarttab[xoff1]; - leftMask = cfbendtab[xoff1]; - lshift = widthGlyph - xoff1; - dst = pdstBase + (x >> PWSH); - hTmp = h; - while (hTmp--) - { - GetBitsL; - *dst = (*dst & rightMask) | (GetPixelGroup(c) & leftMask); - dst += widthDst; - } - } -} -#endif /* PSZ == 8 */ diff --git a/nx-X11/programs/Xserver/cfb/cfbtegblt.c b/nx-X11/programs/Xserver/cfb/cfbtegblt.c deleted file mode 100644 index e3fb06f59..000000000 --- a/nx-X11/programs/Xserver/cfb/cfbtegblt.c +++ /dev/null @@ -1,220 +0,0 @@ -/* $Xorg: cfbtegblt.c,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $ */ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XFree86: xc/programs/Xserver/cfb/cfbtegblt.c,v 3.6tsi Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include -#include "cfb.h" -#include -#include "dixfontstr.h" -#include "gcstruct.h" -#include "windowstr.h" -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "regionstr.h" -#include "cfbmskbits.h" -#include "mi.h" -#define MFB_CONSTS_ONLY -#include "maskbits.h" - -/* - this works for fonts with glyphs <= 32 bits wide, on an - arbitrarily deep display. Use cfbTEGlyphBlt8 for 8 bit displays. - - This should be called only with a terminal-emulator font; -this means that the FIXED_METRICS flag is set, and that -glyphbounds == charbounds. - - in theory, this goes faster; even if it doesn't, it reduces the -flicker caused by writing a string over itself with image text (since -the background gets repainted per character instead of per string.) -this seems to be important for some converted X10 applications. - - Image text looks at the bits in the glyph and the fg and bg in the -GC. it paints a rectangle, as defined in the protocol dcoument, -and the paints the characters. - -*/ - -void -cfbTEGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) - DrawablePtr pDrawable; - GC *pGC; - int x, y; - unsigned int nglyph; - CharInfoPtr *ppci; /* array of character info */ - pointer pglyphBase; /* start of array of glyphs */ -{ - FontPtr pfont = pGC->font; - int widthDst; - CfbBits *pdstBase; /* pointer to longword with top row - of current glyph */ - - int w; /* width of glyph and char */ - int h; /* height of glyph and char */ - register int xpos=x; /* current x%32 */ - int ypos=y; /* current y%32 */ - register unsigned char *pglyph; - int widthGlyph; - - register CfbBits *pdst;/* pointer to current longword in dst */ - int hTmp; /* counter for height */ - BoxRec bbox; /* for clipping */ - - register int wtmp,xtemp,width; - CfbBits bgfill,fgfill,*ptemp,tmpDst1,tmpDst2,*pdtmp; -#if PSZ != 24 - int tmpx; -#endif - - xpos += pDrawable->x; - ypos += pDrawable->y; - - cfbGetLongWidthAndPointer (pDrawable, widthDst, pdstBase) - - wtmp = FONTMAXBOUNDS(pfont,characterWidth); - h = FONTASCENT(pfont) + FONTDESCENT(pfont); - widthGlyph = GLYPHWIDTHBYTESPADDED(*ppci); - - xpos += FONTMAXBOUNDS(pfont,leftSideBearing); - ypos -= FONTASCENT(pfont); - - bbox.x1 = xpos; - bbox.x2 = xpos + (wtmp * nglyph); - bbox.y1 = ypos; - bbox.y2 = ypos + h; - - fgfill = PFILL(pGC->fgPixel); - bgfill = PFILL(pGC->bgPixel); - - switch (RECT_IN_REGION(pGC->pScreen, cfbGetCompositeClip(pGC), &bbox)) - { - case rgnOUT: - break; - case rgnPART: - /* this is the WRONG thing to do, but it works. - calling the non-terminal text is easy, but slow, given - what we know about the font. - - the right thing to do is something like: - for each clip rectangle - compute at which row the glyph starts to be in it, - and at which row the glyph ceases to be in it - compute which is the first glyph inside the left - edge, and the last one inside the right edge - draw a fractional first glyph, using only - the rows we know are in - draw all the whole glyphs, using the appropriate rows - draw any pieces of the last glyph, using the right rows - - this way, the code would take advantage of knowing that - all glyphs are the same height and don't overlap. - - one day... - */ - cfbImageGlyphBlt8(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase); - break; - case rgnIN: - - pdtmp = pdstBase + (widthDst * ypos); - while(nglyph--) - { - - pglyph = FONTGLYPHBITS(pglyphBase, *ppci++); - pdst = pdtmp; - hTmp = h; - - while (hTmp--) - { - x = xpos; - width = wtmp; - xtemp = 0; - - while (width > 0) - { -#if PSZ == 24 - w = 1; - ptemp = (CfbBits *)(pglyph + ((xtemp *3)>> 2)); - getstipplepixels24(ptemp,xtemp,0,&bgfill,&tmpDst1, xtemp); - getstipplepixels24(ptemp,xtemp,1,&fgfill,&tmpDst2, xtemp); -#else - tmpx = x & PIM; - w = min(width, PPW - tmpx); - w = min(w, (PGSZ - xtemp)); - ptemp = (CfbBits *)(pglyph + (xtemp >> MFB_PWSH)); - getstipplepixels(ptemp,xtemp,w,0,&bgfill,&tmpDst1); - getstipplepixels(ptemp,xtemp,w,1,&fgfill,&tmpDst2); -#endif - - { - CfbBits tmpDst = tmpDst1 | tmpDst2; -#if PSZ == 24 - CfbBits *pdsttmp = pdst + ((x*3) >> 2); - putbits24(tmpDst,w,pdsttmp,pGC->planemask,x); -#else - CfbBits *pdsttmp = pdst + (x >> PWSH); - putbits(tmpDst,tmpx,w,pdsttmp,pGC->planemask); -#endif - } - x += w; - xtemp += w; - width -= w; - } - pglyph += widthGlyph; - pdst += widthDst; - } - xpos += wtmp; - } - break; - } -} diff --git a/nx-X11/programs/Xserver/cfb/cfbtile32.c b/nx-X11/programs/Xserver/cfb/cfbtile32.c deleted file mode 100644 index 96e5620b7..000000000 --- a/nx-X11/programs/Xserver/cfb/cfbtile32.c +++ /dev/null @@ -1,519 +0,0 @@ -/* - * Fill 32 bit tiled rectangles. Used by both PolyFillRect and PaintWindow. - * no depth dependencies. - */ -/* $XFree86: xc/programs/Xserver/cfb/cfbtile32.c,v 3.6tsi Exp $ */ - -/* - -Copyright 1989, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. -*/ - -/* $Xorg: cfbtile32.c,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include "servermd.h" -#include "gcstruct.h" -#include "window.h" -#include "pixmapstr.h" -#include "scrnintstr.h" -#include "windowstr.h" - -#include "cfb.h" -#include "cfbmskbits.h" -#include "cfb8bit.h" - -#include "mergerop.h" - -#include "mi.h" -#include "mispans.h" - -#ifdef sparc -#define SHARED_IDCACHE -#endif - -#if PSZ == 24 -#define STORE(p) (*(p) = MROP_PREBUILT_SOLID(srcpix,*(p))) -/*#define STORE24(p,index) {\ - register int idx = ((index) & 3)<< 1; \ - *(p) = (((MROP_PREBUILT_SOLID(srcpix,*(p))<>cfb24Shift[idx])&cfbmask[idx])| \ - (*(p)&cfbrmask[idx])); \ - (p)--; \ - }*/ -#define STORE24(p,index) MROP_PREBUILT_SOLID24(srcpix, (p), index) - -#define STORE_MASK(p,mask) (*(p) = MROP_PREBUILT_MASK(srcpix,*(p),(mask))) -#define QSTORE(p) ((*(p) = MROP_PREBUILT_SOLID(((srcpix<<24)|srcpix),*(p))), \ - (p)++,(*(p) = MROP_PREBUILT_SOLID(((srcpix<<16)|(srcpix>>8)),*(p))), \ - (p)++,(*(p) = MROP_PREBUILT_SOLID(((srcpix<<8)|(srcpix>>16)),*(p)))) - -#if (MROP == Mcopy) && defined(FAST_CONSTANT_OFFSET_MODE) && defined(SHARED_IDCACHE) -# define Expand(left,right) {\ - int part = nlwMiddle & ((PGSZB*2)-1); \ - nlwMiddle *= 3; \ - nlwMiddle >>= PWSH + 3; \ - while (h--) { \ - srcpix = psrc[srcy]; \ - MROP_PREBUILD(srcpix); \ - ++srcy; \ - if (srcy == tileHeight) \ - srcy = 0; \ - left \ - p += part; \ - switch (part) { \ - case 7: \ - STORE24(p - 7, xtmp - 7); \ - case 6: \ - STORE24(p - 6, xtmp - 6); \ - case 5: \ - STORE24(p - 5, xtmp - 5); \ - case 4: \ - STORE24(p - 4, xtmp - 4); \ - case 3: \ - STORE24(p - 3, xtmp - 3); \ - case 2: \ - STORE24(p - 2, xtmp - 2); \ - case 1: \ - STORE24(p - 1, xtmp - 1); \ - } \ - nlw = nlwMiddle; \ - while (nlw) { \ - STORE24 (p + 0, xtmp + 0); \ - STORE24 (p + 1, xtmp + 1); \ - STORE24 (p + 2, xtmp + 2); \ - STORE24 (p + 3, xtmp + 3); \ - STORE24 (p + 4, xtmp + 4); \ - STORE24 (p + 5, xtmp + 5); \ - STORE24 (p + 6, xtmp + 6); \ - STORE24 (p + 7, xtmp + 7); \ - p += 8; \ - xtmp += 8; \ - nlw--; \ - } \ - right \ - p += nlwExtra; \ - } \ -} -#else -#define Expand(left,right) {\ - while (h--) { \ - srcpix = psrc[srcy]; \ - MROP_PREBUILD(srcpix); \ - ++srcy; \ - if (srcy == tileHeight) \ - srcy = 0; \ - left \ - while (nlw--) \ - { \ - STORE24(p,xtmp); \ - if(xtmp&3) p++; \ - xtmp++; \ - } \ - right \ - p += nlwExtra; \ - } \ -} -#endif -#else /*PSZ != 24*/ -#define STORE(p) (*(p) = MROP_PREBUILT_SOLID(srcpix,*(p))) - -#if (MROP == Mcopy) && defined(FAST_CONSTANT_OFFSET_MODE) && defined(SHARED_IDCACHE) -# define Expand(left,right) {\ - int part = nlwMiddle & ((PGSZB*2)-1); \ - nlwMiddle >>= PWSH + 1; \ - while (h--) { \ - srcpix = psrc[srcy]; \ - MROP_PREBUILD(srcpix); \ - ++srcy; \ - if (srcy == tileHeight) \ - srcy = 0; \ - left \ - p += part; \ - switch (part) { \ - case 7: \ - STORE(p - 7); \ - case 6: \ - STORE(p - 6); \ - case 5: \ - STORE(p - 5); \ - case 4: \ - STORE(p - 4); \ - case 3: \ - STORE(p - 3); \ - case 2: \ - STORE(p - 2); \ - case 1: \ - STORE(p - 1); \ - } \ - nlw = nlwMiddle; \ - while (nlw) { \ - STORE (p + 0); \ - STORE (p + 1); \ - STORE (p + 2); \ - STORE (p + 3); \ - STORE (p + 4); \ - STORE (p + 5); \ - STORE (p + 6); \ - STORE (p + 7); \ - p += 8; \ - nlw--; \ - } \ - right \ - p += nlwExtra; \ - } \ -} -#else -#define Expand(left,right) {\ - while (h--) { \ - srcpix = psrc[srcy]; \ - MROP_PREBUILD(srcpix); \ - ++srcy; \ - if (srcy == tileHeight) \ - srcy = 0; \ - left \ - nlw = nlwMiddle; \ - while (nlw--) \ - { \ - STORE(p); \ - p++; \ - } \ - right \ - p += nlwExtra; \ - } \ -} -#endif -#endif /*PSZ == 24*/ - -void -MROP_NAME(cfbFillRectTile32) (pDrawable, pGC, nBox, pBox) - DrawablePtr pDrawable; - GCPtr pGC; - int nBox; /* number of boxes to fill */ - BoxPtr pBox; /* pointer to list of boxes to fill */ -{ - register CfbBits srcpix; - CfbBits *psrc; /* pointer to bits in tile, if needed */ - int tileHeight; /* height of the tile */ - - int nlwDst; /* width in longwords of the dest pixmap */ - int w; /* width of current box */ - register int h; /* height of current box */ - register CfbBits startmask; - register CfbBits endmask; /* masks for reggedy bits at either end of line */ - int nlwMiddle; /* number of longwords between sides of boxes */ - int nlwExtra; /* to get from right of box to left of next span */ - register int nlw = 0; /* loop version of nlwMiddle */ - register CfbBits *p; /* pointer to bits we're writing */ - int y; /* current scan line */ - int srcy; /* current tile position */ - - CfbBits *pbits;/* pointer to start of pixmap */ - PixmapPtr tile; /* rotated, expanded tile */ -#if MROP == 0 && PSZ == 24 - DeclareMergeRop() -#else - MROP_DECLARE_REG() -#endif - MROP_PREBUILT_DECLARE() -#if PSZ == 24 - CfbBits xtmp; -#endif - - tile = pGC->pRotatedPixmap; - tileHeight = tile->drawable.height; - psrc = (CfbBits *)tile->devPrivate.ptr; - -#if MROP == 0 && PSZ == 24 - InitializeMergeRop(pGC->alu, pGC->planemask); -#else - MROP_INITIALIZE(pGC->alu, pGC->planemask); -#endif - - cfbGetLongWidthAndPointer (pDrawable, nlwDst, pbits) - - while (nBox--) - { - w = pBox->x2 - pBox->x1; - h = pBox->y2 - pBox->y1; - y = pBox->y1; -#if PSZ == 24 - xtmp = pBox->x1; - p = pbits + (y * nlwDst) + ((pBox->x1*3) >> 2); -/* p = pbits + (y * nlwDst) + ((pBox->x1>> 2)*3);*/ -#else - p = pbits + (y * nlwDst) + (pBox->x1 >> PWSH); -#endif - srcy = y % tileHeight; - -#if PSZ == 24 - if (w == 1 && ((pBox->x1 & 3) == 0 || (pBox->x1 & 3) == 3)) -#else - if ( ((pBox->x1 & PIM) + w) <= PPW) -#endif - { - maskpartialbits(pBox->x1, w, startmask); - nlwExtra = nlwDst; - while (h--) - { - srcpix = psrc[srcy]; - MROP_PREBUILD(srcpix); - ++srcy; - if (srcy == tileHeight) - srcy = 0; - *p = MROP_PREBUILT_MASK (srcpix, *p, startmask); - p += nlwExtra; - } - } - else - { - maskbits(pBox->x1, w, startmask, endmask, nlwMiddle); - nlwExtra = nlwDst - nlwMiddle; - - if (startmask) - { - nlwExtra -= 1; - if (endmask) - { - Expand(*p = MROP_PREBUILT_MASK(srcpix, *p, startmask); p++;, - *p = MROP_PREBUILT_MASK(srcpix, *p, endmask);) - } - else - { - Expand(*p = MROP_PREBUILT_MASK(srcpix, *p, startmask); p++;, - ;) - } - } - else - { - if (endmask) - { - Expand(;, - *p = MROP_PREBUILT_MASK(srcpix, *p, endmask);) - } - else - { - Expand(;, - ;) - } - } - } - pBox++; - } -} - -void -MROP_NAME(cfbTile32FS)(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) - DrawablePtr pDrawable; - GCPtr pGC; - int nInit; /* number of spans to fill */ - DDXPointPtr pptInit; /* pointer to list of start points */ - int *pwidthInit; /* pointer to list of n widths */ - int fSorted; -{ - /* next three parameters are post-clip */ - int n; /* number of spans to fill */ - DDXPointPtr ppt; /* pointer to list of start points */ - int *pwidth;/* pointer to list of n widths */ - CfbBits *pbits; /* pointer to start of bitmap */ - int nlwDst; /* width in longwords of bitmap */ - register CfbBits *p; /* pointer to current longword in bitmap */ - register int w; /* current span width */ - register int nlw; - register int x; - register CfbBits startmask; - register CfbBits endmask; - register CfbBits srcpix; - int y; - int *pwidthFree;/* copies of the pointers to free */ - DDXPointPtr pptFree; - PixmapPtr tile; - CfbBits *psrc; /* pointer to bits in tile */ - int tileHeight;/* height of the tile */ -#if MROP == 0 && PSZ == 24 - DeclareMergeRop() -#else - MROP_DECLARE_REG() -#endif - MROP_PREBUILT_DECLARE() -#if PSZ == 24 - CfbBits xtmp; -#endif - - n = nInit * miFindMaxBand( cfbGetCompositeClip(pGC) ); - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); - if(!pptFree || !pwidthFree) - { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); - return; - } - pwidth = pwidthFree; - ppt = pptFree; - n = miClipSpans( cfbGetCompositeClip(pGC), - pptInit, pwidthInit, nInit, - ppt, pwidth, fSorted); - - tile = pGC->pRotatedPixmap; - tileHeight = tile->drawable.height; - psrc = (CfbBits *)tile->devPrivate.ptr; - -#if MROP == 0 && PSZ == 24 - InitializeMergeRop(pGC->alu, pGC->planemask); -#else - MROP_INITIALIZE(pGC->alu, pGC->planemask); -#endif - - cfbGetLongWidthAndPointer (pDrawable, nlwDst, pbits) - -#if MROP == Mcopy - if (!(tileHeight & (tileHeight-1))) - { - tileHeight--; - while (n--) - { - x = ppt->x; - y = ppt->y; - ++ppt; - w = *pwidth++; -#if PSZ == 24 -/* p = pbits + (y * nlwDst) + ((x*3) >> 2);*/ - xtmp = x; - p = pbits + (y * nlwDst) + ((x >> 2)*3); -#else - p = pbits + (y * nlwDst) + (x >> PWSH); -#endif - srcpix = psrc[y & tileHeight]; - MROP_PREBUILD(srcpix); - -#if PSZ == 24 - if ((x & 3) + w < 5) -#else - if ((x & PIM) + w < PPW) -#endif - { - maskpartialbits(x, w, startmask); - *p = MROP_PREBUILT_MASK (srcpix, *p, startmask); - } - else - { - maskbits(x, w, startmask, endmask, nlw); - if (startmask) - { - *p = MROP_PREBUILT_MASK(srcpix, *p, startmask); -#if PSZ == 24 - if(xtmp&3) p++; - xtmp++; -#else - p++; -#endif - } - while (nlw--) - { -#if PSZ == 24 - STORE24(p,xtmp); - if(xtmp&3) p++; - ++xtmp; -#else - STORE(p); - ++p; -#endif - } - if (endmask) - { - *p = MROP_PREBUILT_MASK(srcpix, *p, endmask); - } - } - } - } - else -#endif - { - while (n--) - { - x = ppt->x; - y = ppt->y; - ++ppt; - w = *pwidth++; -#if PSZ == 24 -/* p = pbits + (y * nlwDst) + ((x *3)>> 2);*/ - p = pbits + (y * nlwDst) + ((x >> 2)*3); - xtmp = x; -#else - p = pbits + (y * nlwDst) + (x >> PWSH); -#endif - srcpix = psrc[y % tileHeight]; - MROP_PREBUILD(srcpix); - -#if PSZ == 24 - if ((x & 3) + w < 5) -#else - if ((x & PIM) + w < PPW) -#endif - { - maskpartialbits(x, w, startmask); - *p = MROP_PREBUILT_MASK (srcpix, *p, startmask); - } - else - { - maskbits(x, w, startmask, endmask, nlw); - if (startmask) - { - *p = MROP_PREBUILT_MASK(srcpix, *p, startmask); -#if PSZ == 24 - if(xtmp&3)p++; - xtmp++; -#else - p++; -#endif - } - while (nlw--) - { -#if PSZ == 24 - STORE24(p,xtmp); - if(xtmp&3)p++; - xtmp++; -#else - STORE(p); - ++p; -#endif - } - if (endmask) - { - *p = MROP_PREBUILT_MASK(srcpix, *p, endmask); - } - } - } - } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); -} diff --git a/nx-X11/programs/Xserver/cfb/cfbtileodd.c b/nx-X11/programs/Xserver/cfb/cfbtileodd.c deleted file mode 100644 index 6c46aa4db..000000000 --- a/nx-X11/programs/Xserver/cfb/cfbtileodd.c +++ /dev/null @@ -1,1247 +0,0 @@ -/* - * Fill odd tiled rectangles and spans. - * no depth dependencies. - */ -/* $XFree86: xc/programs/Xserver/cfb/cfbtileodd.c,v 3.6tsi Exp $ */ - -/* - -Copyright 1989, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. -*/ - -/* $Xorg: cfbtileodd.c,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include "servermd.h" -#include "gcstruct.h" -#include "window.h" -#include "pixmapstr.h" -#include "scrnintstr.h" -#include "windowstr.h" - -#include "cfb.h" -#include "cfbmskbits.h" -#include "cfb8bit.h" - -#include "mergerop.h" - -#if PSZ == 24 -#define LEFTSHIFT_AMT (3) -#else /* PSZ != 24 */ -#define LEFTSHIFT_AMT (5 - PWSH) -#endif /* PSZ == 24*/ - -#define LastTileBits {\ - tmp = bits; \ - if (tileEndPart) \ - bits = (*pSrc & tileEndMask) | BitRight (*pSrcLine, tileEndLeftShift); \ - else \ - bits = *pSrc; \ -} - -#if PSZ == 24 -#define ResetTileBits {\ - pSrc = pSrcLine; \ - nlwSrc = widthSrc;\ - if (tileEndPart) { \ - if (4 - xoff + tileEndPart <= 4) {\ - bits = *pSrc++; \ - nlwSrc--; \ - } else \ - bits = BitLeft(tmp, tileEndLeftShift) | \ - BitRight(bits, tileEndRightShift); \ - xoff = (xoff + xoffStep) & 3; \ - leftShift = xoff << LEFTSHIFT_AMT; \ - rightShift = PGSZ - leftShift; \ - }\ -} -#else -#define ResetTileBits {\ - pSrc = pSrcLine; \ - nlwSrc = widthSrc;\ - if (tileEndPart) { \ - if (PPW - xoff + tileEndPart <= PPW) {\ - bits = *pSrc++; \ - nlwSrc--; \ - } else \ - bits = BitLeft(tmp, tileEndLeftShift) | \ - BitRight(bits, tileEndRightShift); \ - xoff = (xoff + xoffStep) & PIM; \ - leftShift = xoff << LEFTSHIFT_AMT; \ - rightShift = PGSZ - leftShift; \ - }\ -} -#endif - -#define NextTileBits {\ - if (nlwSrc == 1) {\ - LastTileBits\ - } else { \ - if (nlwSrc == 0) {\ - ResetTileBits\ - } \ - if (nlwSrc == 1) {\ - LastTileBits\ - } else {\ - tmp = bits; \ - bits = *pSrc++; \ - }\ - }\ - nlwSrc--; \ -} - -void -MROP_NAME(cfbFillBoxTileOdd) (pDrawable, nBox, pBox, tile, xrot, yrot, alu, planemask) - DrawablePtr pDrawable; - int nBox; /* number of boxes to fill */ - register BoxPtr pBox; /* pointer to list of boxes to fill */ - PixmapPtr tile; /* tile */ - int xrot, yrot; - int alu; - unsigned long planemask; -{ - int tileWidth; /* width of tile in pixels */ - int tileHeight; /* height of the tile */ - int widthSrc; - - int widthDst; /* width in longwords of the dest pixmap */ - int w; /* width of current box */ - int h; /* height of current box */ - CfbBits startmask; - CfbBits endmask;/* masks for reggedy bits at either end of line */ - int nlwMiddle; /* number of longwords between sides of boxes */ - int nlwSrc; /* number of whole longwords in source */ - - register int nlw; /* loop version of nlwMiddle */ - int srcy; /* current tile y position */ - int srcx; /* current tile x position */ - int xoffDst, xoffSrc; - int leftShift, rightShift; - -#if MROP == 0 && PSZ == 24 - DeclareMergeRop24() -#else - MROP_DECLARE_REG() -#endif - - CfbBits *pdstBase; /* pointer to start of dest */ - CfbBits *pDstLine; /* poitner to start of dest box */ - CfbBits *pSrcBase; /* pointer to start of source */ - CfbBits *pSrcLine; /* pointer to start of source line */ - register CfbBits *pDst; - register CfbBits *pSrc; - register CfbBits bits, tmp = 0; - int xoffStart, xoff; - int leftShiftStart, rightShiftStart, nlwSrcStart; - CfbBits tileEndMask; - int tileEndLeftShift, tileEndRightShift; - int xoffStep; - int tileEndPart; - int needFirst; - CfbBits narrow[2]; - CfbBits narrowMask = 0; - int narrowShift = 0; - Bool narrowTile; - -#if MROP == 0 && PSZ == 24 - InitializeMergeRop24 (alu, planemask) -#else - MROP_INITIALIZE (alu, planemask) -#endif - - tileHeight = tile->drawable.height; - tileWidth = tile->drawable.width; - widthSrc = tile->devKind / PGSZB; - narrowTile = FALSE; - if (widthSrc == 1) - { - narrowShift = tileWidth; - narrowMask = cfbendpartial [tileWidth]; - tileWidth *= 2; - widthSrc = 2; - narrowTile = TRUE; - } - pSrcBase = (CfbBits *)tile->devPrivate.ptr; - - cfbGetLongWidthAndPointer (pDrawable, widthDst, pdstBase) - -#if PSZ == 24 - tileEndPart = (4 - tileWidth) & 3; - tileEndMask = cfbendpartial[tileWidth & 3]; -#else - tileEndPart = tileWidth & PIM; - tileEndMask = cfbendpartial[tileEndPart]; -#endif /* PSZ == 24 */ - tileEndLeftShift = (tileEndPart) << LEFTSHIFT_AMT; - tileEndRightShift = PGSZ - tileEndLeftShift; -#if PSZ == 24 - xoffStep = 4 - tileEndPart; -#else - xoffStep = PPW - tileEndPart; -#endif /* PSZ == 24 */ - /* - * current assumptions: tile > 32 bits wide. - */ - while (nBox--) - { - w = pBox->x2 - pBox->x1; - h = pBox->y2 - pBox->y1; - modulus (pBox->x1 - xrot, tileWidth, srcx); - modulus (pBox->y1 - yrot, tileHeight, srcy); -#if PSZ == 24 - xoffDst = (4 - pBox->x1) & 3; - if (w == 1 && (xoffDst == 0 || xoffDst == 1)) -#else - xoffDst = pBox->x1 & PIM; - if (xoffDst + w < PPW) -#endif - { - maskpartialbits(pBox->x1, w, startmask); - endmask = 0; - nlwMiddle = 0; - } - else - { - maskbits (pBox->x1, w, startmask, endmask, nlwMiddle) - } -#if PSZ == 24 - pDstLine = pdstBase + (pBox->y1 * widthDst) + ((pBox->x1*3) >> 2); -#else - pDstLine = pdstBase + (pBox->y1 * widthDst) + (pBox->x1 >> PWSH); -#endif - pSrcLine = pSrcBase + (srcy * widthSrc); -#if PSZ == 24 - xoffSrc = (4 - srcx) & 3; -#else - xoffSrc = srcx & PIM; -#endif - if (xoffSrc >= xoffDst) - { - xoffStart = xoffSrc - xoffDst; - needFirst = 1; - } - else - { -#if PSZ == 24 - xoffStart = 4 - (xoffDst - xoffSrc); -#else - xoffStart = PPW - (xoffDst - xoffSrc); -#endif - needFirst = 0; - } - leftShiftStart = (xoffStart) << LEFTSHIFT_AMT; - rightShiftStart = PGSZ - leftShiftStart; -#if PSZ == 24 - nlwSrcStart = widthSrc - ((srcx*3) >> 2); -#else - nlwSrcStart = widthSrc - (srcx >> PWSH); -#endif - while (h--) - { - /* XXX only works when narrowShift >= PPW/2 */ - if (narrowTile) - { - tmp = pSrcBase[srcy] & narrowMask; /* source width == 1 */ - narrow[0] = tmp | SCRRIGHT (tmp, narrowShift); -#if PSZ == 24 - narrow[1] = BitLeft (tmp, 8) | - BitRight(tmp, 16); -#else - narrow[1] = SCRLEFT (tmp, PPW - narrowShift) | - SCRRIGHT(tmp, 2 * narrowShift - PPW); -#endif - pSrcLine = narrow; - } - xoff = xoffStart; - leftShift = leftShiftStart; - rightShift = rightShiftStart; - nlwSrc = nlwSrcStart; -#if PSZ == 24 - pSrc = pSrcLine + ((srcx * 3) >> 2); -#else - pSrc = pSrcLine + (srcx >> PWSH); -#endif - pDst = pDstLine; - bits = 0; - if (needFirst) - { - NextTileBits - } - if (startmask) - { - NextTileBits - tmp = BitLeft(tmp, leftShift); - if (rightShift != PGSZ) - tmp |= BitRight(bits,rightShift); - *pDst = MROP_MASK (tmp, *pDst, startmask); - ++pDst; - } - nlw = nlwMiddle; - while (nlw) - { -#if MROP == Mcopy - if (nlwSrc > 1) - { - int nlwPart = nlw; - - if (nlwPart >= nlwSrc) - nlwPart = nlwSrc - 1; - nlw -= nlwPart; - nlwSrc -= nlwPart; - if (rightShift != PGSZ) - { - while (nlwPart--) - { - tmp = bits; - bits = *pSrc++; - *pDst = MROP_SOLID(BitLeft(tmp, leftShift) | - BitRight (bits, rightShift), - *pDst); - ++pDst; - } - } - else - { - if (nlwPart) - { - *pDst = MROP_SOLID (bits, *pDst); - ++pDst; - nlwPart--; - while (nlwPart--) - { - *pDst = MROP_SOLID(*pSrc, *pDst); - ++pDst; ++pSrc; - } - bits = *pSrc++; - } - } - } - else -#endif - { - NextTileBits - if (rightShift != PGSZ) - { - *pDst = MROP_SOLID(BitLeft(tmp, leftShift) | - BitRight(bits, rightShift), - *pDst); - } - else - { - *pDst = MROP_SOLID (tmp, *pDst); - } - ++pDst; - nlw--; - } - } - if (endmask) - { - NextTileBits - if (rightShift == PGSZ) - bits = 0; - *pDst = MROP_MASK (BitLeft(tmp, leftShift) | - BitRight(bits,rightShift), - *pDst, endmask); - } - pDstLine += widthDst; - pSrcLine += widthSrc; - if (++srcy == tileHeight) - { - srcy = 0; - pSrcLine = pSrcBase; - } - } - pBox++; - } -} - -void -MROP_NAME(cfbFillSpanTileOdd) (pDrawable, n, ppt, pwidth, tile, xrot, yrot, alu, planemask) - DrawablePtr pDrawable; - int n; - DDXPointPtr ppt; - int *pwidth; - PixmapPtr tile; - int xrot, yrot; - int alu; - unsigned long planemask; -{ - int tileWidth; /* width of tile in pixels */ - int tileHeight; /* height of the tile */ - int widthSrc; - - int widthDst; /* width in longwords of the dest pixmap */ - int w; /* width of current span */ - CfbBits startmask; - CfbBits endmask; /* masks for reggedy bits at either end of line */ - int nlwSrc; /* number of whole longwords in source */ - - register int nlw; /* loop version of nlwMiddle */ - int srcy; /* current tile y position */ - int srcx; /* current tile x position */ - int xoffDst, xoffSrc; - int leftShift, rightShift; - -#if MROP == 0 && PSZ == 24 - DeclareMergeRop24() -#else - MROP_DECLARE_REG() -#endif - - CfbBits *pdstBase; /* pointer to start of dest */ - CfbBits *pDstLine; /* poitner to start of dest box */ - CfbBits *pSrcBase; /* pointer to start of source */ - CfbBits *pSrcLine; /* pointer to start of source line */ - register CfbBits *pDst; - register CfbBits *pSrc; - register CfbBits bits, tmp = 0; - int xoffStart, xoff; - int leftShiftStart, rightShiftStart, nlwSrcStart; - CfbBits tileEndMask; - int tileEndLeftShift, tileEndRightShift; - int xoffStep; - int tileEndPart; - int needFirst; - CfbBits narrow[2]; - CfbBits narrowMask = 0; - int narrowShift = 0; - Bool narrowTile; - -#if MROP == 0 && PSZ == 24 - InitializeMergeRop24 (alu, planemask) -#else - MROP_INITIALIZE (alu, planemask) -#endif - - tileHeight = tile->drawable.height; - tileWidth = tile->drawable.width; - widthSrc = tile->devKind / PGSZB; - narrowTile = FALSE; - if (widthSrc == 1) - { - narrowShift = tileWidth; - narrowMask = cfbendpartial [tileWidth]; - tileWidth *= 2; - widthSrc = 2; - narrowTile = TRUE; - } - pSrcBase = (CfbBits *)tile->devPrivate.ptr; - - cfbGetLongWidthAndPointer (pDrawable, widthDst, pdstBase) - -#if PSZ == 24 - tileEndPart = (4 - tileWidth) & 3; - tileEndMask = cfbendpartial[tileWidth & 3]; -#else - tileEndPart = tileWidth & PIM; - tileEndMask = cfbendpartial[tileEndPart]; -#endif - tileEndLeftShift = (tileEndPart) << LEFTSHIFT_AMT; - tileEndRightShift = PGSZ - tileEndLeftShift; -#if PSZ == 24 - xoffStep = 4 - tileEndPart; -#else - xoffStep = PPW - tileEndPart; -#endif - while (n--) - { - w = *pwidth++; - modulus (ppt->x - xrot, tileWidth, srcx); - modulus (ppt->y - yrot, tileHeight, srcy); -#if PSZ == 24 - xoffDst = (4 - ppt->x) & 3; - if (w == 1 && (xoffDst == 0 || xoffDst == 1)) -#else - xoffDst = ppt->x & PIM; - if (xoffDst + w < PPW) -#endif - { - maskpartialbits(ppt->x, w, startmask); - endmask = 0; - nlw = 0; - } - else - { - maskbits (ppt->x, w, startmask, endmask, nlw) - } -#if PSZ == 24 - pDstLine = pdstBase + (ppt->y * widthDst) + ((ppt->x *3)>> 2); -#else - pDstLine = pdstBase + (ppt->y * widthDst) + (ppt->x >> PWSH); -#endif - pSrcLine = pSrcBase + (srcy * widthSrc); -#if PSZ == 24 - xoffSrc = (4 - srcx) & 3; -#else - xoffSrc = srcx & PIM; -#endif - if (xoffSrc >= xoffDst) - { - xoffStart = xoffSrc - xoffDst; - needFirst = 1; - } - else - { -#if PSZ == 24 - xoffStart = 4 - (xoffDst - xoffSrc); -#else - xoffStart = PPW - (xoffDst - xoffSrc); -#endif - needFirst = 0; - } - leftShiftStart = (xoffStart) << LEFTSHIFT_AMT; - rightShiftStart = PGSZ - leftShiftStart; -#if PSZ == 24 - nlwSrcStart = widthSrc - ((srcx*3) >> 2); -#else - nlwSrcStart = widthSrc - (srcx >> PWSH); -#endif - /* XXX only works when narrowShift >= PPW/2 */ - if (narrowTile) - { - tmp = pSrcBase[srcy] & narrowMask; /* source width == 1 */ - narrow[0] = tmp | SCRRIGHT (tmp, narrowShift); -#if PSZ == 24 - narrow[1] = BitLeft (tmp, 8) | - BitRight(tmp, 16); -#else - narrow[1] = SCRLEFT (tmp, PPW - narrowShift) | - SCRRIGHT(tmp, 2 * narrowShift - PPW); -#endif - pSrcLine = narrow; - } - xoff = xoffStart; - leftShift = leftShiftStart; - rightShift = rightShiftStart; - nlwSrc = nlwSrcStart; -#if PSZ == 24 - pSrc = pSrcLine + ((srcx * 3) >> 2); -#else - pSrc = pSrcLine + (srcx >> PWSH); -#endif - pDst = pDstLine; - bits = 0; - if (needFirst) - { - NextTileBits - } - if (startmask) - { - NextTileBits - tmp = BitLeft(tmp, leftShift); - if (rightShift != PGSZ) - tmp |= BitRight(bits,rightShift); - *pDst = MROP_MASK (tmp, *pDst, startmask); - ++pDst; - } - while (nlw) - { -#if MROP == Mcopy - if (nlwSrc > 1) - { - int nlwPart = nlw; - - if (nlwPart >= nlwSrc) - nlwPart = nlwSrc - 1; - nlw -= nlwPart; - nlwSrc -= nlwPart; - if (rightShift != PGSZ) - { - while (nlwPart--) - { - tmp = bits; - bits = *pSrc++; - *pDst = MROP_SOLID(BitLeft(tmp, leftShift) | - BitRight (bits, rightShift), - *pDst); - ++pDst; - } - } - else - { - if (nlwPart) - { - *pDst = MROP_SOLID (bits, *pDst); - ++pDst; - nlwPart--; - while (nlwPart--) - { - *pDst = MROP_SOLID(*pSrc, *pDst); - ++pDst; ++pSrc; - } - bits = *pSrc++; - } - } - } - else -#endif - { - NextTileBits - if (rightShift != PGSZ) - { - *pDst = MROP_SOLID(BitLeft(tmp, leftShift) | - BitRight(bits, rightShift), - *pDst); - ++pDst; - } - else - { - *pDst = MROP_SOLID (tmp, *pDst); - ++pDst; - } - nlw--; - } - } - if (endmask) - { - NextTileBits - if (rightShift == PGSZ) - bits = 0; - *pDst = MROP_MASK (BitLeft(tmp, leftShift) | - BitRight(bits,rightShift), - *pDst, endmask); - } - ppt++; - } -} - -# include "fastblt.h" - -#define IncSrcPtr psrc++; if (!--srcRemaining) { srcRemaining = widthSrc; psrc = psrcStart; } - -void -MROP_NAME(cfbFillBoxTile32s) (pDrawable, nBox, pBox, tile, xrot, yrot, alu, planemask) - DrawablePtr pDrawable; - int nBox; /* number of boxes to fill */ - register BoxPtr pBox; /* pointer to list of boxes to fill */ - PixmapPtr tile; /* tile */ - int xrot, yrot; - int alu; - unsigned long planemask; -{ - int tileWidth; /* width of tile */ - int tileHeight; /* height of the tile */ - int widthSrc; /* width in longwords of the source tile */ - - int widthDst; /* width in longwords of the dest pixmap */ - int w; /* width of current box */ - int h; /* height of current box */ - CfbBits startmask; - CfbBits endmask;/* masks for reggedy bits at either end of line */ - int nlMiddle; /* number of longwords between sides of boxes */ - - register int nl; /* loop version of nlMiddle */ - int srcy; /* current tile y position */ - int srcx; /* current tile x position */ - int srcRemaining; /* number of longwords remaining in source */ - int xoffDst, xoffSrc; - int srcStart; /* number of longwords source offset at left of box */ - int leftShift, rightShift; - -#if MROP == 0 && PSZ == 24 - DeclareMergeRop24() -#else - MROP_DECLARE_REG() -#endif - - CfbBits *pdstBase; /* pointer to start of dest */ - CfbBits *pdstLine; /* poitner to start of dest box */ - CfbBits *psrcBase; /* pointer to start of source */ - CfbBits *psrcLine; /* pointer to fetch point of source */ - CfbBits *psrcStart; /* pointer to start of source line */ - register CfbBits *pdst; - register CfbBits *psrc; - register CfbBits bits, bits1; - register int nlTemp; - -#if MROP == 0 && PSZ == 24 - InitializeMergeRop24 (alu, planemask) -#else - MROP_INITIALIZE (alu, planemask) -#endif - - psrcBase = (CfbBits *)tile->devPrivate.ptr; - tileHeight = tile->drawable.height; - tileWidth = tile->drawable.width; -#if PSZ == 24 - widthSrc = tile->devKind / PGSZB; -#else - widthSrc = tileWidth >> PWSH; -#endif - - cfbGetLongWidthAndPointer (pDrawable, widthDst, pdstBase) - - while (nBox--) - { - w = pBox->x2 - pBox->x1; - h = pBox->y2 - pBox->y1; - - /* set up source */ - modulus (pBox->x1 - xrot, tileWidth, srcx); - modulus (pBox->y1 - yrot, tileHeight, srcy); -#if PSZ == 24 - xoffSrc = (4 - srcx) & 3; - srcStart = (srcx * 3) >> 2; -#else - xoffSrc = srcx & PIM; - srcStart = (srcx >> PWSH); -#endif - psrcStart = psrcBase + (srcy * widthSrc); - psrcLine = psrcStart + srcStart; - - /* set up dest */ -#if PSZ == 24 - xoffDst = (4 - pBox->x1) & 3; - pdstLine = pdstBase + (pBox->y1 * widthDst) + ((pBox->x1*3) >> 2); -#else - xoffDst = pBox->x1 & PIM; - pdstLine = pdstBase + (pBox->y1 * widthDst) + (pBox->x1 >> PWSH); -#endif - /* set up masks */ -#if PSZ == 24 - if (w == 1 && (xoffDst == 0 || xoffDst == 1)) -#else - if (xoffDst + w < PPW) -#endif - { - maskpartialbits(pBox->x1, w, startmask); - endmask = 0; - nlMiddle = 0; - } - else - { - maskbits (pBox->x1, w, startmask, endmask, nlMiddle) - } - if (xoffSrc == xoffDst) - { - while (h--) - { - psrc = psrcLine; - pdst = pdstLine; - srcRemaining = widthSrc - srcStart; - if (startmask) - { - *pdst = MROP_MASK (*psrc, *pdst, startmask); - pdst++; - IncSrcPtr - } - nlTemp = nlMiddle; - while (nlTemp) - { - nl = nlTemp; - if (nl > srcRemaining) - nl = srcRemaining; - - nlTemp -= nl; - srcRemaining -= nl; - -#if MROP == Mcopy -#ifdef LARGE_INSTRUCTION_CACHE -#ifdef FAST_CONSTANT_OFFSET_MODE - - psrc += nl & (UNROLL-1); - pdst += nl & (UNROLL-1); - -#define BodyOdd(n) pdst[-n] = MROP_SOLID (psrc[-n], pdst[-n]); -#define BodyEven(n) pdst[-n] = MROP_SOLID (psrc[-n], pdst[-n]); - -#define LoopReset \ -pdst += UNROLL; \ -psrc += UNROLL; - -#else - -#define BodyOdd(n) *pdst = MROP_SOLID (*psrc, *pdst); pdst++; psrc++; -#define BodyEven(n) BodyOdd(n) - -#define LoopReset ; - -#endif - PackedLoop - -#undef BodyOdd -#undef BodyEven -#undef LoopReset - -#else - DuffL(nl, label1, - *pdst = MROP_SOLID (*psrc, *pdst); - pdst++; psrc++;) -#endif -#else - while (nl--) { - *pdst = MROP_SOLID (*psrc, *pdst); - pdst++; psrc++; - } -#endif - if (!srcRemaining) - { - srcRemaining = widthSrc; - psrc = psrcStart; - } - } - if (endmask) - { - *pdst = MROP_MASK (*psrc, *pdst, endmask); - } - pdstLine += widthDst; - psrcLine += widthSrc; - psrcStart += widthSrc; - if (++srcy == tileHeight) - { - psrcStart = psrcBase; - psrcLine = psrcStart + srcStart; - srcy = 0; - } - } - } - else - { - if (xoffSrc > xoffDst) - { - leftShift = (xoffSrc - xoffDst) << LEFTSHIFT_AMT; - rightShift = PGSZ - leftShift; - } - else - { - rightShift = (xoffDst - xoffSrc) << LEFTSHIFT_AMT; - leftShift = PGSZ - rightShift; - } - while (h--) - { - psrc = psrcLine; - pdst = pdstLine; - bits = 0; - srcRemaining = widthSrc - srcStart; - if (xoffSrc > xoffDst) - { - bits = *psrc; - IncSrcPtr - } - if (startmask) - { - bits1 = BitLeft(bits,leftShift); - bits = *psrc; - IncSrcPtr - bits1 |= BitRight(bits,rightShift); - *pdst = MROP_MASK(bits1, *pdst, startmask); - pdst++; - } - nlTemp = nlMiddle; - while (nlTemp) - { - nl = nlTemp; - if (nl > srcRemaining) - nl = srcRemaining; - - nlTemp -= nl; - srcRemaining -= nl; - -#if MROP == Mcopy -#ifdef LARGE_INSTRUCTION_CACHE - bits1 = bits; - -#ifdef FAST_CONSTANT_OFFSET_MODE - - psrc += nl & (UNROLL-1); - pdst += nl & (UNROLL-1); - -#define BodyOdd(n) \ - bits = psrc[-n]; \ - pdst[-n] = MROP_SOLID(BitLeft(bits1, leftShift) | BitRight(bits, rightShift), pdst[-n]); - -#define BodyEven(n) \ - bits1 = psrc[-n]; \ - pdst[-n] = MROP_SOLID(BitLeft(bits, leftShift) | BitRight(bits1, rightShift), pdst[-n]); - -#define LoopReset \ - pdst += UNROLL; \ - psrc += UNROLL; - -#else - -#define BodyOdd(n) \ - bits = *psrc++; \ - *pdst = MROP_SOLID(BitLeft(bits1, leftShift) | BitRight(bits, rightShift), *pdst); \ - pdst++; - -#define BodyEven(n) \ - bits1 = *psrc++; \ - *pdst = MROP_SOLID(BitLeft(bits, leftShift) | BitRight(bits1, rightShift), *pdst); \ - pdst++; - -#define LoopReset ; - -#endif /* !FAST_CONSTANT_OFFSET_MODE */ - - PackedLoop - -#undef BodyOdd -#undef BodyEven -#undef LoopReset - -#else - DuffL (nl,label2, - bits1 = BitLeft(bits, leftShift); - bits = *psrc++; - *pdst = MROP_SOLID (bits1 | BitRight(bits, rightShift), *pdst); - pdst++; - ) -#endif -#else - while (nl--) { - bits1 = BitLeft(bits, leftShift); - bits = *psrc++; - *pdst = MROP_SOLID (bits1 | BitRight(bits, rightShift), *pdst); - pdst++; - } -#endif - if (!srcRemaining) - { - srcRemaining = widthSrc; - psrc = psrcStart; - } - } - - if (endmask) - { - bits1 = BitLeft(bits, leftShift); - if (BitLeft(endmask, rightShift)) - { - bits = *psrc; - bits1 |= BitRight(bits, rightShift); - } - *pdst = MROP_MASK (bits1, *pdst, endmask); - } - pdstLine += widthDst; - psrcLine += widthSrc; - psrcStart += widthSrc; - if (++srcy == tileHeight) - { - psrcStart = psrcBase; - psrcLine = psrcStart + srcStart; - srcy = 0; - } - } - } - pBox++; - } -} - -void -MROP_NAME(cfbFillSpanTile32s) (pDrawable, n, ppt, pwidth, tile, xrot, yrot, alu, planemask) - DrawablePtr pDrawable; - int n; - DDXPointPtr ppt; - int *pwidth; - PixmapPtr tile; - int xrot, yrot; - int alu; - unsigned long planemask; -{ - int tileWidth; /* width of tile */ - int tileHeight; /* height of the tile */ - int widthSrc; /* width in longwords of the source tile */ - - int widthDst; /* width in longwords of the dest pixmap */ - int w; /* width of current box */ - CfbBits startmask; - CfbBits endmask;/* masks for reggedy bits at either end of line */ - int nlMiddle; /* number of longwords between sides of boxes */ - - register int nl; /* loop version of nlMiddle */ - int srcy; /* current tile y position */ - int srcx; /* current tile x position */ - int srcRemaining; /* number of longwords remaining in source */ - int xoffDst, xoffSrc; - int srcStart; /* number of longwords source offset at left of box */ - int leftShift, rightShift; - -#if MROP == 0 && PSZ == 24 - DeclareMergeRop24() -#else - MROP_DECLARE_REG() -#endif - - CfbBits *pdstBase; /* pointer to start of dest */ - CfbBits *pdstLine; /* poitner to start of dest box */ - CfbBits *psrcBase; /* pointer to start of source */ - CfbBits *psrcLine; /* pointer to fetch point of source */ - CfbBits *psrcStart; /* pointer to start of source line */ - register CfbBits *pdst; - register CfbBits *psrc; - register CfbBits bits, bits1; - register int nlTemp; - -#if MROP == 0 && PSZ == 24 - InitializeMergeRop24 (alu, planemask) -#else - MROP_INITIALIZE (alu, planemask) -#endif - - psrcBase = (CfbBits *)tile->devPrivate.ptr; - tileHeight = tile->drawable.height; - tileWidth = tile->drawable.width; -#if PSZ == 24 - widthSrc = tile->devKind / PGSZB; -#else - widthSrc = tileWidth >> PWSH; -#endif - - cfbGetLongWidthAndPointer (pDrawable, widthDst, pdstBase) - - while (n--) - { - w = *pwidth++; - - /* set up source */ - modulus (ppt->x - xrot, tileWidth, srcx); - modulus (ppt->y - yrot, tileHeight, srcy); -#if PSZ == 24 - xoffSrc = (4 - srcx) & 3; - srcStart = (srcx * 3) >> 2; -#else - xoffSrc = srcx & PIM; - srcStart = (srcx >> PWSH); -#endif - psrcStart = psrcBase + (srcy * widthSrc); - psrcLine = psrcStart + srcStart; - - /* set up dest */ -#if PSZ == 24 - xoffDst = (4 - ppt->x) & 3; - pdstLine = pdstBase + (ppt->y * widthDst) + ((ppt->x *3) >> 2); - /* set up masks */ - if (w == 1 && (xoffDst == 0 || xoffDst == 1)) -#else - xoffDst = ppt->x & PIM; - pdstLine = pdstBase + (ppt->y * widthDst) + (ppt->x >> PWSH); - /* set up masks */ - if (xoffDst + w < PPW) -#endif - { - maskpartialbits(ppt->x, w, startmask); - endmask = 0; - nlMiddle = 0; - } - else - { - maskbits (ppt->x, w, startmask, endmask, nlMiddle) - } - - if (xoffSrc == xoffDst) - { - psrc = psrcLine; - pdst = pdstLine; - srcRemaining = widthSrc - srcStart; - if (startmask) - { - *pdst = MROP_MASK (*psrc, *pdst, startmask); - pdst++; - IncSrcPtr - } - nlTemp = nlMiddle; - while (nlTemp) - { - nl = nlTemp; - if (nl > srcRemaining) - nl = srcRemaining; - - nlTemp -= nl; - srcRemaining -= nl; - -#if MROP == Mcopy -#ifdef LARGE_INSTRUCTION_CACHE -#ifdef FAST_CONSTANT_OFFSET_MODE - - psrc += nl & (UNROLL-1); - pdst += nl & (UNROLL-1); - -#define BodyOdd(n) pdst[-n] = MROP_SOLID (psrc[-n], pdst[-n]); -#define BodyEven(n) pdst[-n] = MROP_SOLID (psrc[-n], pdst[-n]); - -#define LoopReset \ -pdst += UNROLL; \ -psrc += UNROLL; - -#else - -#define BodyOdd(n) *pdst = MROP_SOLID (*psrc, *pdst); pdst++; psrc++; -#define BodyEven(n) BodyOdd(n) - -#define LoopReset ; - -#endif - PackedLoop - -#undef BodyOdd -#undef BodyEven -#undef LoopReset - -#else - DuffL(nl, label1, - *pdst = MROP_SOLID (*psrc, *pdst); - pdst++; psrc++;) -#endif -#else - while (nl--) { - *pdst = MROP_SOLID (*psrc, *pdst); - pdst++; psrc++; - } -#endif - if (!srcRemaining) - { - srcRemaining = widthSrc; - psrc = psrcStart; - } - } - if (endmask) - { - *pdst = MROP_MASK (*psrc, *pdst, endmask); - } - } - else - { - if (xoffSrc > xoffDst) - { - leftShift = (xoffSrc - xoffDst) << LEFTSHIFT_AMT; - rightShift = PGSZ - leftShift; - } - else - { - rightShift = (xoffDst - xoffSrc) << LEFTSHIFT_AMT; - leftShift = PGSZ - rightShift; - } - psrc = psrcLine; - pdst = pdstLine; - bits = 0; - srcRemaining = widthSrc - srcStart; - if (xoffSrc > xoffDst) - { - bits = *psrc; - IncSrcPtr - } - if (startmask) - { - bits1 = BitLeft(bits,leftShift); - bits = *psrc; - IncSrcPtr - bits1 |= BitRight(bits,rightShift); - *pdst = MROP_MASK(bits1, *pdst, startmask); - pdst++; - } - nlTemp = nlMiddle; - while (nlTemp) - { - nl = nlTemp; - if (nl > srcRemaining) - nl = srcRemaining; - - nlTemp -= nl; - srcRemaining -= nl; - -#if MROP == Mcopy -#ifdef LARGE_INSTRUCTION_CACHE - bits1 = bits; - -#ifdef FAST_CONSTANT_OFFSET_MODE - - psrc += nl & (UNROLL-1); - pdst += nl & (UNROLL-1); - -#define BodyOdd(n) \ -bits = psrc[-n]; \ -pdst[-n] = MROP_SOLID(BitLeft(bits1, leftShift) | BitRight(bits, rightShift), pdst[-n]); - -#define BodyEven(n) \ -bits1 = psrc[-n]; \ -pdst[-n] = MROP_SOLID(BitLeft(bits, leftShift) | BitRight(bits1, rightShift), pdst[-n]); - -#define LoopReset \ -pdst += UNROLL; \ -psrc += UNROLL; - -#else - -#define BodyOdd(n) \ -bits = *psrc++; \ -*pdst = MROP_SOLID(BitLeft(bits1, leftShift) | BitRight(bits, rightShift), *pdst); \ -pdst++; - -#define BodyEven(n) \ -bits1 = *psrc++; \ -*pdst = MROP_SOLID(BitLeft(bits, leftShift) | BitRight(bits1, rightShift), *pdst); \ -pdst++; - -#define LoopReset ; - -#endif /* !FAST_CONSTANT_OFFSET_MODE */ - - PackedLoop - -#undef BodyOdd -#undef BodyEven -#undef LoopReset - -#else - DuffL (nl,label2, - bits1 = BitLeft(bits, leftShift); - bits = *psrc++; - *pdst = MROP_SOLID (bits1 | BitRight(bits, rightShift), *pdst); - pdst++; - ) -#endif -#else - while (nl--) { - bits1 = BitLeft(bits,leftShift); - bits = *psrc++; - *pdst = MROP_SOLID(bits1|BitRight(bits,rightShift), *pdst); - pdst++; - } -#endif - if (!srcRemaining) - { - srcRemaining = widthSrc; - psrc = psrcStart; - } - } - - if (endmask) - { - bits1 = BitLeft(bits, leftShift); - if (BitLeft(endmask, rightShift)) - { - bits = *psrc; - bits1 |= BitRight(bits, rightShift); - } - *pdst = MROP_MASK (bits1, *pdst, endmask); - } - } - ppt++; - } -} diff --git a/nx-X11/programs/Xserver/cfb/cfbunmap.h b/nx-X11/programs/Xserver/cfb/cfbunmap.h deleted file mode 100644 index bccdf0f0f..000000000 --- a/nx-X11/programs/Xserver/cfb/cfbunmap.h +++ /dev/null @@ -1,165 +0,0 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfbunmap.h,v 1.6 2003/07/19 13:22:28 tsi Exp $ */ -/* - * Copyright (C) 1994-1998 The XFree86 Project, Inc. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the XFree86 Project shall - * not be used in advertising or otherwise to promote the sale, use or other - * dealings in this Software without prior written authorization from the - * XFree86 Project. - */ - -/* - * Unmap names - */ - -#undef CFBNAME -#undef CATNAME - -#undef QuartetBitsTable -#undef QuartetPixelMaskTable -#undef cfb8ClippedLineCopy -#undef cfb8ClippedLineGeneral -#undef cfb8ClippedLineXor -#undef cfb8LineSS1Rect -#undef cfb8LineSS1RectCopy -#undef cfb8LineSS1RectGeneral -#undef cfb8LineSS1RectPreviousCopy -#undef cfb8LineSS1RectXor -#undef cfb8SegmentSS1Rect -#undef cfb8SegmentSS1RectCopy -#undef cfb8SegmentSS1RectGeneral -#undef cfb8SegmentSS1RectShiftCopy -#undef cfb8SegmentSS1RectXor -#undef cfbAllocatePrivates -#undef cfbBSFuncRec -#undef cfbBitBlt -#undef cfbBresD -#undef cfbBresS -#undef cfbChangeWindowAttributes -#undef cfbClearVisualTypes -#undef cfbCloseScreen -#undef cfbCreateDefColormap -#undef cfbCopyArea -#undef cfbCopyImagePlane -#undef cfbCopyPixmap -#undef cfbCopyPlane -#undef cfbCopyPlaneReduce -#undef cfbCopyRotatePixmap -#undef cfbCopyWindow -#undef cfbCreateGC -#undef cfbCreatePixmap -#undef cfbCreateScreenResources -#undef cfbCreateWindow -#undef cfbDestroyPixmap -#undef cfbDestroyWindow -#undef cfbDoBitblt -#undef cfbDoBitbltCopy -#undef cfbDoBitbltGeneral -#undef cfbDoBitbltOr -#undef cfbDoBitbltXor -#undef cfbExpandDirectColors -#undef cfbFillBoxSolid -#undef cfbFillBoxTile32 -#undef cfbFillBoxTile32sCopy -#undef cfbFillBoxTile32sGeneral -#undef cfbFillBoxTileOdd -#undef cfbFillBoxTileOddCopy -#undef cfbFillBoxTileOddGeneral -#undef cfbFillPoly1RectCopy -#undef cfbFillPoly1RectGeneral -#undef cfbFillRectSolidCopy -#undef cfbFillRectSolidGeneral -#undef cfbFillRectSolidXor -#undef cfbFillRectTile32Copy -#undef cfbFillRectTile32General -#undef cfbFillRectTileOdd -#undef cfbFillSpanTile32sCopy -#undef cfbFillSpanTile32sGeneral -#undef cfbFillSpanTileOddCopy -#undef cfbFillSpanTileOddGeneral -#undef cfbFinishScreenInit -#undef cfbGCFuncs -#undef cfbGCPrivateIndex -#undef cfbGetImage -#undef cfbGetScreenPixmap -#undef cfbGetSpans -#undef cfbHorzS -#undef cfbImageGlyphBlt8 -#undef cfbInitializeColormap -#undef cfbInitVisuals -#undef cfbInstallColormap -#undef cfbLineSD -#undef cfbLineSS -#undef cfbListInstalledColormaps -#undef cfbMapWindow -#undef cfbMatchCommon -#undef cfbNonTEOps -#undef cfbNonTEOps1Rect -#undef cfbPadPixmap -#undef cfbPaintWindow -#undef cfbPolyFillArcSolidCopy -#undef cfbPolyFillArcSolidGeneral -#undef cfbPolyFillRect -#undef cfbPolyGlyphBlt8 -#undef cfbPolyGlyphRop8 -#undef cfbPolyPoint -#undef cfbPositionWindow -#undef cfbPutImage -#undef cfbReduceRasterOp -#undef cfbResolveColor -#undef cfbRestoreAreas -#undef cfbSaveAreas -#undef cfbScreenInit -#undef cfbScreenPrivateIndex -#undef cfbSegmentSD -#undef cfbSegmentSS -#undef cfbSetScanline -#undef cfbSetScreenPixmap -#undef cfbSetSpans -#undef cfbSetVisualTypes -#undef cfbSetupScreen -#undef cfbSolidSpansCopy -#undef cfbSolidSpansGeneral -#undef cfbSolidSpansXor -#undef cfbStippleStack -#undef cfbStippleStackTE -#undef cfbTEGlyphBlt -#undef cfbTEOps -#undef cfbTEOps1Rect -#undef cfbTile32FSCopy -#undef cfbTile32FSGeneral -#undef cfbUninstallColormap -#undef cfbUnmapWindow -#undef cfbUnnaturalStippleFS -#undef cfbUnnaturalTileFS -#undef cfbValidateGC -#undef cfbVertS -#undef cfbWindowPrivateIndex -#undef cfbXRotatePixmap -#undef cfbYRotatePixmap -#undef cfbZeroPolyArcSS8Copy -#undef cfbZeroPolyArcSS8General -#undef cfbZeroPolyArcSS8Xor -#undef cfbendpartial -#undef cfbendtab -#undef cfbmask -#undef cfbrmask -#undef cfbstartpartial -#undef cfbstarttab diff --git a/nx-X11/programs/Xserver/cfb/cfbwindow.c b/nx-X11/programs/Xserver/cfb/cfbwindow.c deleted file mode 100644 index 7160f5436..000000000 --- a/nx-X11/programs/Xserver/cfb/cfbwindow.c +++ /dev/null @@ -1,337 +0,0 @@ -/* $Xorg: cfbwindow.c,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $ */ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XFree86: xc/programs/Xserver/cfb/cfbwindow.c,v 1.5tsi Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include "scrnintstr.h" -#include "windowstr.h" -#include "cfb.h" -#include "mistruct.h" -#include "regionstr.h" -#include "cfbmskbits.h" - -Bool -cfbCreateWindow(pWin) - WindowPtr pWin; -{ - cfbPrivWin *pPrivWin; - - pPrivWin = cfbGetWindowPrivate(pWin); - pPrivWin->pRotatedBorder = NullPixmap; - pPrivWin->pRotatedBackground = NullPixmap; - pPrivWin->fastBackground = FALSE; - pPrivWin->fastBorder = FALSE; - pPrivWin->oldRotate.x = 0; - pPrivWin->oldRotate.y = 0; - -#ifdef PIXMAP_PER_WINDOW - /* Setup pointer to Screen pixmap */ - pWin->devPrivates[frameWindowPrivateIndex].ptr = - (pointer) cfbGetScreenPixmap(pWin->drawable.pScreen); -#endif - - return TRUE; -} - -Bool -cfbDestroyWindow(pWin) - WindowPtr pWin; -{ - cfbPrivWin *pPrivWin; - - pPrivWin = cfbGetWindowPrivate(pWin); - - if (pPrivWin->pRotatedBorder) - (*pWin->drawable.pScreen->DestroyPixmap)(pPrivWin->pRotatedBorder); - if (pPrivWin->pRotatedBackground) - (*pWin->drawable.pScreen->DestroyPixmap)(pPrivWin->pRotatedBackground); - return(TRUE); -} - -/*ARGSUSED*/ -Bool -cfbMapWindow(pWindow) - WindowPtr pWindow; -{ - return(TRUE); -} - -/* (x, y) is the upper left corner of the window on the screen - do we really need to pass this? (is it a;ready in pWin->absCorner?) - we only do the rotation for pixmaps that are 32 bits wide (padded -or otherwise.) - cfbChangeWindowAttributes() has already put a copy of the pixmap -in pPrivWin->pRotated* -*/ -/*ARGSUSED*/ -Bool -cfbPositionWindow(pWin, x, y) - WindowPtr pWin; - int x, y; -{ - cfbPrivWin *pPrivWin; - int setxy = 0; - - pPrivWin = cfbGetWindowPrivate(pWin); - if (pWin->backgroundState == BackgroundPixmap && pPrivWin->fastBackground) - { - cfbXRotatePixmap(pPrivWin->pRotatedBackground, - pWin->drawable.x - pPrivWin->oldRotate.x); - cfbYRotatePixmap(pPrivWin->pRotatedBackground, - pWin->drawable.y - pPrivWin->oldRotate.y); - setxy = 1; - } - - if (!pWin->borderIsPixel && pPrivWin->fastBorder) - { - while (pWin->backgroundState == ParentRelative) - pWin = pWin->parent; - cfbXRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.x - pPrivWin->oldRotate.x); - cfbYRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.y - pPrivWin->oldRotate.y); - setxy = 1; - } - if (setxy) - { - pPrivWin->oldRotate.x = pWin->drawable.x; - pPrivWin->oldRotate.y = pWin->drawable.y; - } - return (TRUE); -} - -/*ARGSUSED*/ -Bool -cfbUnmapWindow(pWindow) - WindowPtr pWindow; -{ - return (TRUE); -} - -/* UNCLEAN! - this code calls the bitblt helper code directly. - - cfbCopyWindow copies only the parts of the destination that are -visible in the source. -*/ - - -void -cfbCopyWindow(pWin, ptOldOrg, prgnSrc) - WindowPtr pWin; - DDXPointRec ptOldOrg; - RegionPtr prgnSrc; -{ - DDXPointPtr pptSrc; - register DDXPointPtr ppt; - RegionRec rgnDst; - register BoxPtr pbox; - register int dx, dy; - register int i, nbox; - WindowPtr pwinRoot; - - pwinRoot = WindowTable[pWin->drawable.pScreen->myNum]; - - REGION_NULL(pWin->drawable.pScreen, &rgnDst); - - dx = ptOldOrg.x - pWin->drawable.x; - dy = ptOldOrg.y - pWin->drawable.y; - REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy); - REGION_INTERSECT(pWin->drawable.pScreen, &rgnDst, &pWin->borderClip, prgnSrc); - - pbox = REGION_RECTS(&rgnDst); - nbox = REGION_NUM_RECTS(&rgnDst); - if(!nbox || !(pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))) - { - REGION_UNINIT(pWin->drawable.pScreen, &rgnDst); - return; - } - ppt = pptSrc; - - for (i = nbox; --i >= 0; ppt++, pbox++) - { - ppt->x = pbox->x1 + dx; - ppt->y = pbox->y1 + dy; - } - - cfbDoBitbltCopy((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot, - GXcopy, &rgnDst, pptSrc, ~0L); - DEALLOCATE_LOCAL(pptSrc); - REGION_UNINIT(pWin->drawable.pScreen, &rgnDst); -} - - - -/* swap in correct PaintWindow* routine. If we can use a fast output -routine (i.e. the pixmap is paddable to 32 bits), also pre-rotate a copy -of it in devPrivates[cfbWindowPrivateIndex].ptr. -*/ -Bool -cfbChangeWindowAttributes(pWin, mask) - WindowPtr pWin; - unsigned long mask; -{ - register unsigned long index; - register cfbPrivWin *pPrivWin; - int width; - WindowPtr pBgWin; - - pPrivWin = cfbGetWindowPrivate(pWin); - - /* - * When background state changes from ParentRelative and - * we had previously rotated the fast border pixmap to match - * the parent relative origin, rerotate to match window - */ - if (mask & (CWBackPixmap | CWBackPixel) && - pWin->backgroundState != ParentRelative && - pPrivWin->fastBorder && - (pPrivWin->oldRotate.x != pWin->drawable.x || - pPrivWin->oldRotate.y != pWin->drawable.y)) - { - cfbXRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.x - pPrivWin->oldRotate.x); - cfbYRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.y - pPrivWin->oldRotate.y); - pPrivWin->oldRotate.x = pWin->drawable.x; - pPrivWin->oldRotate.y = pWin->drawable.y; - } - while(mask) - { - index = lowbit (mask); - mask &= ~index; - switch(index) - { - case CWBackPixmap: - if (pWin->backgroundState == None) - { - pPrivWin->fastBackground = FALSE; - } - else if (pWin->backgroundState == ParentRelative) - { - pPrivWin->fastBackground = FALSE; - /* Rotate border to match parent origin */ - if (pPrivWin->pRotatedBorder) { - for (pBgWin = pWin->parent; - pBgWin->backgroundState == ParentRelative; - pBgWin = pBgWin->parent); - cfbXRotatePixmap(pPrivWin->pRotatedBorder, - pBgWin->drawable.x - pPrivWin->oldRotate.x); - cfbYRotatePixmap(pPrivWin->pRotatedBorder, - pBgWin->drawable.y - pPrivWin->oldRotate.y); - pPrivWin->oldRotate.x = pBgWin->drawable.x; - pPrivWin->oldRotate.y = pBgWin->drawable.y; - } - } - else if (((width = (pWin->background.pixmap->drawable.width * PSZ)) - <= PGSZ) && !(width & (width - 1))) - { - cfbCopyRotatePixmap(pWin->background.pixmap, - &pPrivWin->pRotatedBackground, - pWin->drawable.x, - pWin->drawable.y); - if (pPrivWin->pRotatedBackground) - { - pPrivWin->fastBackground = TRUE; - pPrivWin->oldRotate.x = pWin->drawable.x; - pPrivWin->oldRotate.y = pWin->drawable.y; - } - else - { - pPrivWin->fastBackground = FALSE; - } - } - else - { - pPrivWin->fastBackground = FALSE; - } - break; - - case CWBackPixel: - pPrivWin->fastBackground = FALSE; - break; - - case CWBorderPixmap: - if (((width = (pWin->border.pixmap->drawable.width * PSZ)) <= PGSZ) && - !(width & (width - 1))) - { - for (pBgWin = pWin; - pBgWin->backgroundState == ParentRelative; - pBgWin = pBgWin->parent); - cfbCopyRotatePixmap(pWin->border.pixmap, - &pPrivWin->pRotatedBorder, - pBgWin->drawable.x, - pBgWin->drawable.y); - if (pPrivWin->pRotatedBorder) - { - pPrivWin->fastBorder = TRUE; - pPrivWin->oldRotate.x = pBgWin->drawable.x; - pPrivWin->oldRotate.y = pBgWin->drawable.y; - } - else - { - pPrivWin->fastBorder = FALSE; - } - } - else - { - pPrivWin->fastBorder = FALSE; - } - break; - case CWBorderPixel: - pPrivWin->fastBorder = FALSE; - break; - } - } - return (TRUE); -} - diff --git a/nx-X11/programs/Xserver/cfb/cfbzerarc.c b/nx-X11/programs/Xserver/cfb/cfbzerarc.c deleted file mode 100644 index a9e0b2f9d..000000000 --- a/nx-X11/programs/Xserver/cfb/cfbzerarc.c +++ /dev/null @@ -1,322 +0,0 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfbzerarc.c,v 3.4tsi Exp $ */ -/************************************************************ - -Copyright 1989, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -********************************************************/ - -/* $Xorg: cfbzerarc.c,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $ */ - -/* Derived from: - * "Algorithm for drawing ellipses or hyperbolae with a digital plotter" - * by M. L. V. Pitteway - * The Computer Journal, November 1967, Volume 10, Number 3, pp. 282-289 - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include "regionstr.h" -#include "gcstruct.h" -#include "pixmapstr.h" -#include "scrnintstr.h" -#include "cfb.h" -#include "cfbmskbits.h" -#include "mizerarc.h" -#include "cfbrrop.h" -#include "mi.h" - -#ifdef PIXEL_ADDR - -static void -RROP_NAME(cfbZeroArcSS8)( - DrawablePtr pDraw, - GCPtr pGC, - xArc *arc) -{ - miZeroArcRec info; - Bool do360; - register int x; - PixelType *addrp; - register PixelType *yorgp, *yorgop; -#if PSZ == 24 - int xorg, xorg3, xorgo, xorgo3; - register int xtmp; -#endif - RROP_DECLARE - register int yoffset; - int npwidth, dyoffset; - register int y, a, b, d, mask; - register int k1, k3, dx, dy; - - cfbGetPixelWidthAndPointer(pDraw,npwidth, addrp) - - RROP_FETCH_GC (pGC); - do360 = miZeroArcSetup(arc, &info, TRUE); - yorgp = addrp + ((info.yorg + pDraw->y) * npwidth); - yorgop = addrp + ((info.yorgo + pDraw->y) * npwidth); - info.xorg += pDraw->x; - info.xorgo += pDraw->x; -#if PSZ == 24 - xorg = info.xorg; - xorg3 = xorg * 3; - info.xorg = (info.xorg * 3) >> 2; - xorgo = info.xorgo; - xorgo3 = xorgo * 3; - info.xorgo = (info.xorgo * 3) >> 2; -#endif - MIARCSETUP(); - yoffset = y ? npwidth : 0; - dyoffset = 0; - mask = info.initialMask; - if (!(arc->width & 1)) - { -#if PSZ == 24 - if (mask & 2) - RROP_SOLID24((yorgp + info.xorgo), xorgo); - if (mask & 8) - RROP_SOLID24((yorgop + info.xorgo), xorgo); -#else - if (mask & 2) - RROP_SOLID((yorgp + info.xorgo)); - if (mask & 8) - RROP_SOLID((yorgop + info.xorgo)); -#endif /* PSZ == 24 */ - } - if (!info.end.x || !info.end.y) - { - mask = info.end.mask; - info.end = info.altend; - } - if (do360 && (arc->width == arc->height) && !(arc->width & 1)) - { - register int xoffset = npwidth; -#if PSZ == 24 - PixelType *yorghb = yorgp + (info.h * npwidth); - register int tmp1, tmp2, tmp1_3, tmp2_3; - - tmp1 = xorg + info.h; - tmp1_3 = tmp1 * 3; - tmp2 = xorg - info.h; - tmp2_3 = tmp2 * 3; - while (1) - { - xtmp = (xorg3 + x * 3) >> 2; - RROP_SOLID24(yorgp + yoffset + xtmp, xorg + x); - RROP_SOLID24(yorgop - yoffset + xtmp, xorg + x); - xtmp = (xorg3 - x * 3) >> 2; - RROP_SOLID24(yorgp + yoffset + xtmp, xorg - x); - RROP_SOLID24(yorgop - yoffset + xtmp, xorg - x); - if (a < 0) - break; - xtmp = (tmp1_3 - y * 3) >> 2; - RROP_SOLID24(yorghb - xoffset + xtmp, tmp1 - y); - RROP_SOLID24(yorghb + xoffset + xtmp, tmp1 - y); - xtmp = (tmp2_3 + y * 3) >> 2; - RROP_SOLID24(yorghb - xoffset + xtmp, tmp2 + y); - RROP_SOLID24(yorghb + xoffset + xtmp, tmp2 + y); - xoffset += npwidth; - MIARCCIRCLESTEP(yoffset += npwidth;); - } -#else - PixelType *yorghb = yorgp + (info.h * npwidth) + info.xorg; - PixelType *yorgohb = yorghb - info.h; - - yorgp += info.xorg; - yorgop += info.xorg; - yorghb += info.h; - while (1) - { - RROP_SOLID(yorgp + yoffset + x); - RROP_SOLID(yorgp + yoffset - x); - RROP_SOLID(yorgop - yoffset - x); - RROP_SOLID(yorgop - yoffset + x); - if (a < 0) - break; - RROP_SOLID(yorghb - xoffset - y); - RROP_SOLID(yorgohb - xoffset + y); - RROP_SOLID(yorgohb + xoffset + y); - RROP_SOLID(yorghb + xoffset - y); - xoffset += npwidth; - MIARCCIRCLESTEP(yoffset += npwidth;); - } - yorgp -= info.xorg; - yorgop -= info.xorg; -#endif /* PSZ == 24 */ - x = info.w; - yoffset = info.h * npwidth; - } - else if (do360) - { - while (y < info.h || x < info.w) - { - MIARCOCTANTSHIFT(dyoffset = npwidth;); -#if PSZ == 24 - xtmp = (xorg3 + x * 3) >> 2; - RROP_SOLID24(yorgp + yoffset + xtmp, xorg + x); - RROP_SOLID24(yorgop - yoffset + xtmp, xorg + x); - xtmp = (xorgo3 - x * 3) >> 2; - RROP_SOLID24(yorgp + yoffset + xtmp, xorgo - x); - RROP_SOLID24(yorgop - yoffset + xtmp, xorgo - x); -#else - RROP_SOLID(yorgp + yoffset + info.xorg + x); - RROP_SOLID(yorgp + yoffset + info.xorgo - x); - RROP_SOLID(yorgop - yoffset + info.xorgo - x); - RROP_SOLID(yorgop - yoffset + info.xorg + x); -#endif - MIARCSTEP(yoffset += dyoffset;, yoffset += npwidth;); - } - } - else - { - while (y < info.h || x < info.w) - { - MIARCOCTANTSHIFT(dyoffset = npwidth;); - if ((x == info.start.x) || (y == info.start.y)) - { - mask = info.start.mask; - info.start = info.altstart; - } -#if PSZ == 24 - if (mask & 1){ - xtmp = (xorg3 + x * 3) >> 2; - RROP_SOLID24(yorgp + yoffset + xtmp, xorg + x); - } - if (mask & 2){ - xtmp = (xorgo3 - x * 3) >> 2; - RROP_SOLID24(yorgp + yoffset + xtmp, xorgo - x); - } - if (mask & 4){ - xtmp = (xorgo3 - x * 3) >> 2; - RROP_SOLID24(yorgop - yoffset + xtmp, xorgo - x); - } - if (mask & 8){ - xtmp = (xorg3 + x * 3) >> 2; - RROP_SOLID24(yorgop - yoffset + xtmp, xorg + x); - } -#else - if (mask & 1) - RROP_SOLID(yorgp + yoffset + info.xorg + x); - if (mask & 2) - RROP_SOLID(yorgp + yoffset + info.xorgo - x); - if (mask & 4) - RROP_SOLID(yorgop - yoffset + info.xorgo - x); - if (mask & 8) - RROP_SOLID(yorgop - yoffset + info.xorg + x); -#endif /* PSZ == 24 */ - if ((x == info.end.x) || (y == info.end.y)) - { - mask = info.end.mask; - info.end = info.altend; - } - MIARCSTEP(yoffset += dyoffset;, yoffset += npwidth;); - } - } - if ((x == info.start.x) || (y == info.start.y)) - mask = info.start.mask; -#if PSZ == 24 - if (mask & 1){ - xtmp = (xorg3 + x * 3) >> 2; - RROP_SOLID24(yorgp + yoffset + xtmp, xorg + x); - } - if (mask & 4){ - xtmp = (xorgo3 - x * 3) >> 2; - RROP_SOLID24(yorgop - yoffset + xtmp, xorgo - x); - } -#else - if (mask & 1) - RROP_SOLID(yorgp + yoffset + info.xorg + x); - if (mask & 4) - RROP_SOLID(yorgop - yoffset + info.xorgo - x); -#endif /* PSZ == 24 */ - if (arc->height & 1) - { -#if PSZ == 24 - if (mask & 2){ - xtmp = (xorgo3 - x * 3) >> 2; - RROP_SOLID24(yorgp + yoffset + xtmp, xorgo - x); - } - if (mask & 8){ - xtmp = (xorg3 + x * 3) >> 2; - RROP_SOLID24(yorgop - yoffset + xtmp, xorg + x); - } -#else - if (mask & 2) - RROP_SOLID(yorgp + yoffset + info.xorgo - x); - if (mask & 8) - RROP_SOLID(yorgop - yoffset + info.xorg + x); -#endif /* PSZ == 24 */ - } - RROP_UNDECLARE -} - -void -RROP_NAME (cfbZeroPolyArcSS8) (pDraw, pGC, narcs, parcs) - register DrawablePtr pDraw; - GCPtr pGC; - int narcs; - xArc *parcs; -{ - register xArc *arc; - register int i; - BoxRec box; - int x2, y2; - RegionPtr cclip; - - cclip = cfbGetCompositeClip(pGC); - for (arc = parcs, i = narcs; --i >= 0; arc++) - { - if (miCanZeroArc(arc)) - { - box.x1 = arc->x + pDraw->x; - box.y1 = arc->y + pDraw->y; - /* - * Because box.x2 and box.y2 get truncated to 16 bits, and the - * RECT_IN_REGION test treats the resulting number as a signed - * integer, the RECT_IN_REGION test alone can go the wrong way. - * This can result in a server crash because the rendering - * routines in this file deal directly with cpu addresses - * of pixels to be stored, and do not clip or otherwise check - * that all such addresses are within their respective pixmaps. - * So we only allow the RECT_IN_REGION test to be used for - * values that can be expressed correctly in a signed short. - */ - x2 = box.x1 + (int)arc->width + 1; - box.x2 = x2; - y2 = box.y1 + (int)arc->height + 1; - box.y2 = y2; - if ( (x2 <= MAXSHORT) && (y2 <= MAXSHORT) && - (RECT_IN_REGION(pDraw->pScreen, cclip, &box) == rgnIN) ) - RROP_NAME (cfbZeroArcSS8) (pDraw, pGC, arc); - else - miZeroPolyArc(pDraw, pGC, 1, arc); - } - else - miPolyArc(pDraw, pGC, 1, arc); - } -} - -#endif diff --git a/nx-X11/programs/Xserver/cfb/module/Imakefile b/nx-X11/programs/Xserver/cfb/module/Imakefile deleted file mode 100644 index feb27baa3..000000000 --- a/nx-X11/programs/Xserver/cfb/module/Imakefile +++ /dev/null @@ -1,11 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/cfb/module/Imakefile,v 1.1 2002/05/31 15:12:56 dawes Exp $ - -#define IHaveModules - -#define PixelSize 8 -#define LinkDirectory .. -#ifdef OS2Architecture -CFBCMAP = cfbcmap.o -#endif - -#include "../Imakefile.inc" diff --git a/nx-X11/programs/Xserver/cfb/stip68kgnu.h b/nx-X11/programs/Xserver/cfb/stip68kgnu.h deleted file mode 100644 index 01bb939e8..000000000 --- a/nx-X11/programs/Xserver/cfb/stip68kgnu.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * $Xorg: stip68kgnu.h,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $ - * -Copyright 1990, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - * - * Author: Keith Packard, MIT X Consortium - */ -/* $XFree86: xc/programs/Xserver/cfb/stip68kgnu.h,v 3.3 2001/01/17 22:36:37 dawes Exp $ */ - -/* - * Stipple stack macro for 68k GCC - */ - -#define STIPPLE(addr,stipple,value,width,count,shift) \ - __asm volatile ( \ - "lea 5f,%/a1\n\ - moveq #28,%/d2\n\ - addl %2,%/d2\n\ - moveq #28,%/d3\n\ - subql #4,%2\n\ - negl %2\n\ -1:\n\ - movel %0,%/a0\n\ - addl %6,%0\n\ - movel %3@+,%/d1\n\ - jeq 3f\n\ - movel %/d1,%/d0\n\ - lsrl %/d2,%/d0\n\ - lsll #5,%/d0\n\ - lsll %2,%/d1\n\ - jmp %/a1@(%/d0:l)\n\ -2:\n\ - addl #4,%/a0\n\ - movel %/d1,%/d0\n\ - lsrl %/d3,%/d0\n\ - lsll #5,%/d0\n\ - lsll #4,%/d1\n\ - jmp %/a1@(%/d0:l)\n\ -5:\n\ - jne 2b ; dbra %1,1b ; jra 4f\n\ - . = 5b + 0x20\n\ - moveb %5,%/a0@(3)\n\ - andl %/d1,%/d1 ; jne 2b ; dbra %1,1b ; jra 4f\n\ - . = 5b + 0x40\n\ - moveb %5,%/a0@(2)\n\ - andl %/d1,%/d1 ; jne 2b ; dbra %1,1b ; jra 4f\n\ - . = 5b + 0x60\n\ - movew %5,%/a0@(2)\n\ - andl %/d1,%/d1 ; jne 2b ; dbra %1,1b ; jra 4f\n\ - . = 5b + 0x80\n\ - moveb %5,%/a0@(1)\n\ - andl %/d1,%/d1 ; jne 2b ; dbra %1,1b ; jra 4f ;\n\ - . = 5b + 0xa0\n\ - moveb %5,%/a0@(3) ; moveb %5,%/a0@(1)\n\ - andl %/d1,%/d1 ; jne 2b ; dbra %1,1b ; jra 4f ;\n\ - . = 5b + 0xc0\n\ - movew %5,%/a0@(1)\n\ - andl %/d1,%/d1 ; jne 2b ; dbra %1,1b ; jra 4f ;\n\ - . = 5b + 0xe0\n\ - movew %5,%/a0@(2) ; moveb %5,%/a0@(1)\n\ - andl %/d1,%/d1 ; jne 2b ; dbra %1,1b ; jra 4f ;\n\ - . = 5b + 0x100\n\ - moveb %5,%/a0@\n\ - andl %/d1,%/d1 ; jne 2b ; dbra %1,1b ; jra 4f ;\n\ - . = 5b + 0x120\n\ - moveb %5,%/a0@(3) ; moveb %5,%/a0@\n\ - andl %/d1,%/d1 ; jne 2b ; dbra %1,1b ; jra 4f ;\n\ - . = 5b + 0x140\n\ - moveb %5,%/a0@(2) ; moveb %5,%/a0@\n\ - andl %/d1,%/d1 ; jne 2b ; dbra %1,1b ; jra 4f ;\n\ - . = 5b + 0x160\n\ - movew %5,%/a0@(2) ; moveb %5,%/a0@\n\ - andl %/d1,%/d1 ; jne 2b ; dbra %1,1b ; jra 4f ;\n\ - . = 5b + 0x180\n\ - movew %5,%/a0@\n\ - andl %/d1,%/d1 ; jne 2b ; dbra %1,1b ; jra 4f ;\n\ - . = 5b + 0x1a0\n\ - moveb %5,%/a0@(3) ; movew %5,%/a0@\n\ - andl %/d1,%/d1 ; jne 2b ; dbra %1,1b ; jra 4f ;\n\ - . = 5b + 0x1c0\n\ - moveb %5,%/a0@(2) ; movew %5,%/a0@\n\ - andl %/d1,%/d1 ; jne 2b ; dbra %1,1b ; jra 4f ;\n\ - . = 5b + 0x1e0\n\ - movel %5,%/a0@\n\ - andl %/d1,%/d1 ; jne 2b ; \n\ -3: dbra %1,1b ; \n\ -4:\n"\ - : "=a" (addr), /* %0 */ \ - "=d" (count), /* %1 */ \ - "=d" (shift), /* %2 */ \ - "=a" (stipple) /* %3 */ \ - : "0" (addr), /* %4 */ \ - "d" (value), /* %5 */ \ - "a" (width), /* %6 */ \ - "1" (count-1), /* %7 */ \ - "2" (shift), /* %8 */ \ - "3" (stipple) /* %9 */ \ - : /* ctemp */ "d0", \ - /* c */ "d1", \ - /* lshift */ "d2", \ - /* rshift */ "d3", \ - /* atemp */ "a0", \ - /* case */ "a1") diff --git a/nx-X11/programs/Xserver/cfb/stipmips.s b/nx-X11/programs/Xserver/cfb/stipmips.s deleted file mode 100644 index c42d9b5ae..000000000 --- a/nx-X11/programs/Xserver/cfb/stipmips.s +++ /dev/null @@ -1,281 +0,0 @@ -/* - * $Xorg: stipmips.s,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $ - * -Copyright 1990, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - * - * Author: Keith Packard, MIT X Consortium - */ - -/* - * MIPS assembly code for optimized text rendering. - * - * Other stippling could be done in assembly, but the payoff is - * not nearly as large. Mostly because large areas are heavily - * optimized already. - */ - -#ifdef MIPSEL -# define BitsR sll -# define BitsL srl -# define BO(o) o -# define HO(o) o -# define WO(o) o -# define FourBits(dest,bits) and dest, bits, 0xf -#else -# define BitsR srl -# define BitsL sll -# define BO(o) 3-o -# define HO(o) 2-o -# define WO(o) o -# define FourBits(dest,bits) srl dest, bits, 28 -#endif - -/* reordering instructions would be fatal here */ - .set noreorder - - -/* - * cfbStippleStack(addr, stipple, value, stride, Count, Shift) - * 4 5 6 7 16(sp) 20(sp) - * - * Apply successive 32-bit stipples starting at addr, addr+stride, ... - * - * Used for text rendering, but only when no data could be lost - * when the stipple is shifted left by Shift bits - */ -/* arguments */ -#define addr $4 -#define stipple $5 -#define value $6 -#define stride $7 -#define Count 16($sp) -#define Shift 20($sp) - -/* local variables */ -#define count $14 -#define shift $13 -#define atemp $12 -#define bits $11 -#define lshift $9 -#define sbase $8 -#define stemp $2 - -#define CASE_SIZE 5 /* case blocks are 2^5 bytes each */ -#define CASE_MASK 0x1e0 /* first case mask */ - -#define ForEachLine $200 -#define NextLine $201 -#define NextLine1 $202 -#define CaseBegin $203 -#define ForEachBits $204 -#define ForEachBits1 $205 -#define NextBits $206 - -#ifdef TETEXT -#define cfbStippleStack cfbStippleStackTE -#endif - - .globl cfbStippleStack - .ent cfbStippleStack 2 -cfbStippleStack: - .frame $sp, 0, $31 - lw count, Count /* fetch stack params */ - la sbase,CaseBegin /* load up switch table */ - lw shift, Shift - li lshift, 4 /* compute offset within */ - subu lshift, lshift, shift /* stipple of remaining bits */ -#ifdef MIPSEL - addu shift, shift, CASE_SIZE /* first shift for LSB */ -#else - addu shift, shift, 28-CASE_SIZE /* first shift for MSB */ -#endif - /* do ... while (--count > 0); */ -ForEachLine: - lw bits, 0(stipple) /* get stipple bits */ - move atemp, addr /* set up for this line */ -#ifdef TETEXT - /* Terminal emulator fonts are expanded and have many 0 rows */ - beqz bits, NextLine /* skip out early on 0 */ -#endif - addu addr, addr, stride /* step for the loop */ - BitsR stemp, bits, shift /* get first bits */ - and stemp, stemp, CASE_MASK /* compute first branch */ - addu stemp, stemp, sbase /* ... */ - j stemp /* ... */ - BitsL bits, bits, lshift /* set remaining bits */ - -ForEachBits: - addu atemp, atemp, 4 -ForEachBits1: - FourBits(stemp, bits) /* compute jump for */ - sll stemp, stemp, CASE_SIZE /* next four bits */ - addu stemp, stemp, sbase /* ... */ - j stemp /* ... */ - BitsL bits, bits, 4 /* step for remaining bits */ -CaseBegin: - bnez bits, ForEachBits1 /* 0 */ - addu atemp, atemp, 4 -NextLine: - addu count, count, -1 - bnez count, ForEachLine - addu stipple, stipple, 4 - j $31 - nop - nop - - bnez bits, ForEachBits /* 1 */ - sb value, BO(0)(atemp) - addu count, count, -1 - bnez count, ForEachLine - addu stipple, stipple, 4 - j $31 - nop - nop - - bnez bits, ForEachBits /* 2 */ - sb value, BO(1)(atemp) - addu count, count, -1 - bnez count, ForEachLine - addu stipple, stipple, 4 - j $31 - nop - nop - - bnez bits, ForEachBits /* 3 */ - sh value, HO(0)(atemp) - addu count, count, -1 - bnez count, ForEachLine - addu stipple, stipple, 4 - j $31 - nop - nop - - bnez bits, ForEachBits /* 4 */ - sb value, BO(2)(atemp) - addu count, count, -1 - bnez count, ForEachLine - addu stipple, stipple, 4 - j $31 - nop - nop - - sb value, BO(0)(atemp) /* 5 */ - bnez bits, ForEachBits - sb value, BO(2)(atemp) - addu count, count, -1 - bnez count, ForEachLine - addu stipple, stipple, 4 - j $31 - nop - - sb value, BO(1)(atemp) /* 6 */ - bnez bits, ForEachBits - sb value, BO(2)(atemp) - addu count, count, -1 - bnez count, ForEachLine - addu stipple, stipple, 4 - j $31 - nop - - bnez bits, ForEachBits /* 7 */ - swl value, BO(2)(atemp) /* untested on MSB */ - addu count, count, -1 - bnez count, ForEachLine - addu stipple, stipple, 4 - j $31 - nop - nop - - bnez bits, ForEachBits /* 8 */ - sb value, BO(3)(atemp) - addu count, count, -1 - bnez count, ForEachLine - addu stipple, stipple, 4 - j $31 - nop - nop - - sb value, BO(0)(atemp) /* 9 */ - bnez bits, ForEachBits - sb value, BO(3)(atemp) - addu count, count, -1 - bnez count, ForEachLine - addu stipple, stipple, 4 - j $31 - nop - - sb value, BO(1)(atemp) /* a */ - bnez bits, ForEachBits - sb value, BO(3)(atemp) - addu count, count, -1 - bnez count, ForEachLine - addu stipple, stipple, 4 - j $31 - nop - - sh value, HO(0)(atemp) /* b */ - bnez bits, ForEachBits - sb value, BO(3)(atemp) - addu count, count, -1 - bnez count, ForEachLine - addu stipple, stipple, 4 - j $31 - nop - - bnez bits, ForEachBits /* c */ - sh value, HO(2)(atemp) - addu count, count, -1 - bnez count, ForEachLine - addu stipple, stipple, 4 - j $31 - nop - nop - - sb value, BO(0)(atemp) /* d */ - bnez bits, ForEachBits - sh value, HO(2)(atemp) - addu count, count, -1 - bnez count, ForEachLine - addu stipple, stipple, 4 - j $31 - nop - - bnez bits, ForEachBits /* e */ - swr value, BO(1)(atemp) /* untested on MSB */ - addu count, count, -1 - bnez count, ForEachLine - addu stipple, stipple, 4 - j $31 - nop - nop - - bnez bits, ForEachBits /* f */ - sw value, WO(0)(atemp) - addu count, count, -1 - bnez count, ForEachLine - addu stipple, stipple, 4 - j $31 - nop - nop - - .end cfbStippleStack diff --git a/nx-X11/programs/Xserver/cfb/stipple68k.s b/nx-X11/programs/Xserver/cfb/stipple68k.s deleted file mode 100644 index 2f892b386..000000000 --- a/nx-X11/programs/Xserver/cfb/stipple68k.s +++ /dev/null @@ -1,231 +0,0 @@ -/* - * $Xorg: stipple68k.s,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $ - * -Copyright 1990, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - * - * Author: Keith Packard, MIT X Consortium - */ -/* $XFree86: xc/programs/Xserver/cfb/stipple68k.s,v 3.2 2001/01/17 22:36:38 dawes Exp $ */ - -/* - * Stipple code for 68k processors - */ - -#ifdef __ELF__ -#ifdef TETEXT -#define _cfbStippleStack cfbStippleStackTE -#else -#define _cfbStippleStack cfbStippleStack -#endif -#else -#ifdef TETEXT -#define _cfbStippleStack _cfbStippleStackTE -#endif -#endif - - -#define atemp a0 -#define addr a1 -#define stipple a2 -#define stride a3 -#define case a4 - -#define ctemp d0 -#define value d1 -#define count d2 -#define shift d3 -#define c d4 -#define lshift d5 -#define rshift d6 - -#define PushMask #0x3e38 -#define PopMask #0x1c7c -#define NumReg 8 -#define arg0 36 -#define arg1 40 -#define arg2 44 -#define arg3 48 -#define arg4 52 -#define arg5 56 -#define arg6 60 - -#ifdef __ELF__ -#define ForEachLine .L2 -#define ForEachBits .L5 -#define a0 %A0 -#define a1 %A1 -#define a2 %A2 -#define a3 %A3 -#define a4 %A4 -#define a5 %A5 -#define a6 %A6 -#define sp %SP -#define d0 %D0 -#define d1 %D1 -#define d2 %D2 -#define d3 %D3 -#define d4 %D4 -#define d5 %D5 -#define d6 %D6 -#define d7 %D7 -#else -#define ForEachLine L2 -#define ForEachBits L5 -#endif -#define CASE_SIZE 5 - -.text - .even - .globl _cfbStippleStack -_cfbStippleStack: - moveml PushMask,sp@- - movel sp@(arg0),addr - movel sp@(arg1),stipple - movel sp@(arg2),value - movel sp@(arg3),stride - movew sp@(arg4+2),count - movel sp@(arg5),shift - subqw #1,count /* predecrement count */ - lea CaseBegin,case - movew #28,lshift - addl shift,lshift - movew #28,rshift - subql #4,shift - negl shift -ForEachLine: - movel addr,atemp - addl stride,addr - movel stipple@+,c -#ifdef TETEXT - jeq NextLine -#endif - /* Get first few bits */ - movel c,ctemp - lsrl lshift,ctemp - lsll #CASE_SIZE,ctemp - lsll shift,c /* set up for next bits */ - jmp case@(ctemp:l) - -ForEachBits: - addl #4,atemp - movel c,ctemp - lsrl rshift,ctemp /* better than lsrl, andi */ - lsll #CASE_SIZE,ctemp - lsll #4,c /* set up for next bits */ - jmp case@(ctemp:l) - -#define Break \ - andl c,c ; \ - jne ForEachBits ; \ - dbra count,ForEachLine ; \ - moveml sp@+,PopMask ; \ - rts ; - -CaseBegin: - jne ForEachBits /* 0 */ -NextLine: - dbra count,ForEachLine - moveml sp@+,PopMask - rts - - . = CaseBegin + 0x20 - - moveb value,atemp@(3) /* 1 */ - Break - - . = CaseBegin + 0x40 - - moveb value,atemp@(2) /* 2 */ - Break - - . = CaseBegin + 0x60 - - movew value,atemp@(2) /* 3 */ - Break - - . = CaseBegin + 0x80 - - moveb value,atemp@(1) /* 4 */ - Break - - . = CaseBegin + 0xa0 - - moveb value,atemp@(3) /* 5 */ - moveb value,atemp@(1) - Break - - . = CaseBegin + 0xc0 - - movew value,atemp@(1) /* 6 */ - Break - - . = CaseBegin + 0xe0 - - movew value,atemp@(2) /* 7 */ - moveb value,atemp@(1) - Break - - . = CaseBegin + 0x100 - - moveb value,atemp@ /* 8 */ - Break - - . = CaseBegin + 0x120 - - moveb value,atemp@(3) /* 9 */ - moveb value,atemp@ - Break - - . = CaseBegin + 0x140 - - moveb value,atemp@(2) /* a */ - moveb value,atemp@ - Break - - . = CaseBegin + 0x160 - - movew value,atemp@(2) /* b */ - moveb value,atemp@ - Break - - . = CaseBegin + 0x180 - - movew value,atemp@ /* c */ - Break - - . = CaseBegin + 0x1a0 - - moveb value,atemp@(3) /* d */ - movew value,atemp@ - Break - - . = CaseBegin + 0x1c0 - - moveb value,atemp@(2) /* e */ - movew value,atemp@ - Break - - . = CaseBegin + 0x1e0 - - movel value,atemp@ /* f */ - Break diff --git a/nx-X11/programs/Xserver/cfb/stipsparc.s b/nx-X11/programs/Xserver/cfb/stipsparc.s deleted file mode 100644 index 8ee5e2698..000000000 --- a/nx-X11/programs/Xserver/cfb/stipsparc.s +++ /dev/null @@ -1,290 +0,0 @@ -/* - * $Xorg: stipsparc.s,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $ - * $XdotOrg: xc/programs/Xserver/cfb/stipsparc.s,v 1.3 2004/04/26 02:39:58 alanc Exp $ - * -Copyright 1990, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - * - * Author: Keith Packard, MIT X Consortium - */ -/* $XFree86: xc/programs/Xserver/cfb/stipsparc.s,v 1.4 2001/01/17 22:36:38 dawes Exp $ */ - -/* - * SPARC assembly code for optimized text rendering. - * - * Other stippling could be done in assembly, but the payoff is - * not nearly as large. Mostly because large areas are heavily - * optimized already. - */ - -/* not that I expect to ever see an LSB SPARC, but ... */ -#ifdef LITTLE_ENDIAN -# define BitsR sll -# define BitsL srl -# define BO(o) o -# define HO(o) o -# define WO(o) o -# define FourBits(dest,bits) and bits, 0xf, dest -#else -# define BitsR srl -# define BitsL sll -# define BO(o) 3-o -# define HO(o) 2-o -# define WO(o) o -# define FourBits(dest,bits) srl bits, 28, dest -#endif - -/* - * cfbStippleStack(addr, stipple, value, stride, Count, Shift) - * 4 5 6 7 16(sp) 20(sp) - * - * Apply successive 32-bit stipples starting at addr, addr+stride, ... - * - * Used for text rendering, but only when no data could be lost - * when the stipple is shifted left by Shift bits - */ -/* arguments */ -#define addr %i0 -#define stipple %i1 -#define value %i2 -#define stride %i3 -#define count %i4 -#define shift %i5 - -/* local variables */ -#define atemp %l0 -#define bits %l1 -#define lshift %l2 -#define sbase %l3 -#define stemp %l4 - -#define CASE_SIZE 5 /* case blocks are 2^5 bytes each */ -#define CASE_MASK 0x1e0 /* first case mask */ - -#define ForEachLine LY1 -#define NextLine LY2 -#define CaseBegin LY3 -#define ForEachBits LY4 -#define NextBits LY5 - -#if defined(SVR4) || defined(__ELF__) -#ifdef TETEXT -#define _cfbStippleStack cfbStippleStackTE -#else -#define _cfbStippleStack cfbStippleStack -#endif -#else -#ifdef TETEXT -#define _cfbStippleStack _cfbStippleStackTE -#endif -#endif - .seg "text" - .proc 16 - .globl _cfbStippleStack -_cfbStippleStack: - save %sp,-64,%sp -#ifdef SHAREDCODE -1: - call 2f - nop -2: - mov %o7,sbase /* sbase = 1b(1:) */ - add sbase, CaseBegin-1b, sbase -#else /* !SHAREDCODE */ - sethi %hi(CaseBegin),sbase /* load up switch table */ - or sbase,%lo(CaseBegin),sbase -#endif /* SHAREDCODE */ - mov 4,lshift /* compute offset within */ - sub lshift, shift, lshift /* stipple of remaining bits */ -#ifdef LITTLE_ENDIAN - inc CASE_SIZE, shift /* first shift for LSB */ -#else - inc 28-CASE_SIZE, shift /* first shift for MSB */ -#endif - /* do ... while (--count > 0); */ -ForEachLine: - ld [stipple],bits /* get stipple bits */ - mov addr,atemp /* set up for this line */ -#ifdef TETEXT - /* Terminal emulator fonts are expanded and have many 0 rows */ - tst bits - bz NextLine /* skip out early on 0 */ -#endif - add addr, stride, addr /* step for the loop */ - BitsR bits, shift, stemp /* get first bits */ - and stemp, CASE_MASK, stemp /* compute first jump */ - BitsL bits, lshift, bits /* set remaining bits */ - jmp sbase+stemp /* ... */ - tst bits - -ForEachBits: - inc 4, atemp -ForEachBits1: - FourBits(stemp, bits) /* compute jump for */ - sll stemp, CASE_SIZE, stemp /* these four bits */ - BitsL bits, 4, bits /* step for remaining bits */ - jmp sbase+stemp /* jump */ - tst bits -CaseBegin: - bnz,a ForEachBits1 /* 0 */ - inc 4, atemp -NextLine: - deccc 1, count - bnz,a ForEachLine - inc 4, stipple - ret - restore - nop - - bnz ForEachBits /* 1 */ - stb value, [atemp+BO(0)] - deccc 1, count - bnz,a ForEachLine - inc 4, stipple - ret - restore - nop - - bnz ForEachBits /* 2 */ - stb value, [atemp+BO(1)] - deccc 1, count - bnz,a ForEachLine - inc 4, stipple - ret - restore - nop - - bnz ForEachBits /* 3 */ - sth value, [atemp+HO(0)] - deccc 1, count - bnz,a ForEachLine - inc 4, stipple - ret - restore - nop - - bnz ForEachBits /* 4 */ - stb value, [atemp+BO(2)] - deccc 1, count - bnz,a ForEachLine - inc 4, stipple - ret - restore - nop - - stb value, [atemp+BO(0)] /* 5 */ - bnz ForEachBits - stb value, [atemp+BO(2)] - deccc 1, count - bnz,a ForEachLine - inc 4, stipple - ret - restore - - stb value, [atemp+BO(1)] /* 6 */ - bnz ForEachBits - stb value, [atemp+BO(2)] - deccc 1, count - bnz,a ForEachLine - inc 4, stipple - ret - restore - - sth value, [atemp+HO(0)] /* 7 */ - bnz ForEachBits - stb value, [atemp+BO(2)] - deccc 1, count - bnz,a ForEachLine - inc 4, stipple - ret - restore - - bnz ForEachBits /* 8 */ - stb value, [atemp+BO(3)] - deccc 1, count - bnz,a ForEachLine - inc 4, stipple - ret - restore - nop - - stb value, [atemp+BO(0)] /* 9 */ - bnz ForEachBits - stb value, [atemp+BO(3)] - deccc 1, count - bnz,a ForEachLine - inc 4, stipple - ret - restore - - stb value, [atemp+BO(1)] /* a */ - bnz ForEachBits - stb value, [atemp+BO(3)] - deccc 1, count - bnz,a ForEachLine - inc 4, stipple - ret - restore - - sth value, [atemp+HO(0)] /* b */ - bnz ForEachBits - stb value, [atemp+BO(3)] - deccc 1, count - bnz,a ForEachLine - inc 4, stipple - ret - restore - - bnz ForEachBits /* c */ - sth value, [atemp+HO(2)] - deccc 1, count - bnz,a ForEachLine - inc 4, stipple - ret - restore - nop - - stb value, [atemp+BO(0)] /* d */ - bnz ForEachBits - sth value, [atemp+HO(2)] - deccc 1, count - bnz,a ForEachLine - inc 4, stipple - ret - restore - - stb value, [atemp+BO(1)] /* e */ - bnz ForEachBits - sth value, [atemp+HO(2)] - deccc 1, count - bnz,a ForEachLine - inc 4, stipple - ret - restore - - bnz ForEachBits /* f */ - st value, [atemp+WO(0)] - deccc 1, count - bnz,a ForEachLine - inc 4, stipple - ret - restore diff --git a/nx-X11/programs/Xserver/cfb/stipsprc32.s b/nx-X11/programs/Xserver/cfb/stipsprc32.s deleted file mode 100644 index 59d953f3b..000000000 --- a/nx-X11/programs/Xserver/cfb/stipsprc32.s +++ /dev/null @@ -1,291 +0,0 @@ -/* - * $Xorg: stipsprc32.s,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $ - * $XdotOrg: xc/programs/Xserver/cfb/stipsprc32.s,v 1.3 2004/04/26 02:39:58 alanc Exp $ - * -Copyright 1990, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - * - * Author: Keith Packard, MIT X Consortium - */ -/* $XFree86: xc/programs/Xserver/cfb/stipsprc32.s,v 1.4 2001/01/17 22:36:38 dawes Exp $ */ - -/* - * SPARC assembly code for optimized text rendering. - * - * Other stippling could be done in assembly, but the payoff is - * not nearly as large. Mostly because large areas are heavily - * optimized already. - */ - -/* not that I expect to ever see an LSB SPARC, but ... */ -#ifdef LITTLE_ENDIAN -# define BitsR sll -# define BitsL srl -# define WO(o) 3-o -# define FourBits(dest,bits) and bits, 0xf, dest -#else -# define BitsR srl -# define BitsL sll -# define WO(o) o -# define FourBits(dest,bits) srl bits, 28, dest -#endif - -/* - * cfb32StippleStack(addr, stipple, value, stride, Count, Shift) - * 4 5 6 7 16(sp) 20(sp) - * - * Apply successive 32-bit stipples starting at addr, addr+stride, ... - * - * Used for text rendering, but only when no data could be lost - * when the stipple is shifted left by Shift bits - */ -/* arguments */ -#define addr %i0 -#define stipple %i1 -#define value %i2 -#define stride %i3 -#define count %i4 -#define shift %i5 - -/* local variables */ -#define atemp %l0 -#define bits %l1 -#define lshift %l2 -#define sbase %l3 -#define stemp %l4 - -#define CASE_SIZE 5 /* case blocks are 2^5 bytes each */ -#define CASE_MASK 0x1e0 /* first case mask */ - -#define ForEachLine LY1 -#define NextLine LY2 -#define CaseBegin LY3 -#define ForEachBits LY4 -#define NextBits LY5 - -#if defined(SVR4) || defined(__ELF__) -#ifdef TETEXT -#define _cfb32StippleStack cfb32StippleStackTE -#else -#define _cfb32StippleStack cfb32StippleStack -#endif -#else -#ifdef TETEXT -#define _cfb32StippleStack _cfb32StippleStackTE -#endif -#endif - - .seg "text" - .proc 16 - .globl _cfb32StippleStack -_cfb32StippleStack: - save %sp,-64,%sp -#ifdef SHAREDCODE -1: - call 2f - nop -2: - mov %o7,sbase /* sbase = 1b(1:) */ - add sbase, CaseBegin-1b, sbase -#else /* !SHAREDCODE */ - sethi %hi(CaseBegin),sbase /* load up switch table */ - or sbase,%lo(CaseBegin),sbase -#endif /* !SHAREDCODE */ - mov 4,lshift /* compute offset within */ - sub lshift, shift, lshift /* stipple of remaining bits */ -#ifdef LITTLE_ENDIAN - inc CASE_SIZE, shift /* first shift for LSB */ -#else - inc 28-CASE_SIZE, shift /* first shift for MSB */ -#endif - /* do ... while (--count > 0); */ -ForEachLine: - ld [stipple],bits /* get stipple bits */ - mov addr,atemp /* set up for this line */ -#ifdef TETEXT - /* Terminal emulator fonts are expanded and have many 0 rows */ - tst bits - bz NextLine /* skip out early on 0 */ -#endif - add addr, stride, addr /* step for the loop */ - BitsR bits, shift, stemp /* get first bits */ - and stemp, CASE_MASK, stemp /* compute first jump */ - BitsL bits, lshift, bits /* set remaining bits */ - jmp sbase+stemp /* ... */ - tst bits - -ForEachBits: - inc 16, atemp -ForEachBits1: - FourBits(stemp, bits) /* compute jump for */ - sll stemp, CASE_SIZE, stemp /* these four bits */ - BitsL bits, 4, bits /* step for remaining bits */ - jmp sbase+stemp /* jump */ - tst bits -CaseBegin: - bnz,a ForEachBits1 /* 0 */ - inc 16, atemp -NextLine: - deccc 1, count -NextLine1: - bnz,a ForEachLine - inc 4, stipple - ret - restore - nop - - bnz ForEachBits /* 1 */ - st value, [atemp+WO(12)] - deccc 1, count - bnz,a ForEachLine - inc 4, stipple - ret - restore - nop - - bnz ForEachBits /* 2 */ - st value, [atemp+WO(8)] - deccc 1, count - bnz,a ForEachLine - inc 4, stipple - ret - restore - nop - - st value, [atemp+WO(8)] /* 3 */ - bnz ForEachBits - st value, [atemp+WO(12)] - deccc 1, count - bnz,a ForEachLine - inc 4, stipple - ret - restore - - bnz ForEachBits /* 4 */ - st value, [atemp+WO(4)] - deccc 1, count - bnz,a ForEachLine - inc 4, stipple - ret - restore - nop - - st value, [atemp+WO(4)] /* 5 */ - bnz ForEachBits - st value, [atemp+WO(12)] - deccc 1, count - bnz,a ForEachLine - inc 4, stipple - ret - restore - - st value, [atemp+WO(4)] /* 6 */ - bnz ForEachBits - st value, [atemp+WO(8)] - deccc 1, count - bnz,a ForEachLine - inc 4, stipple - ret - restore - - st value, [atemp+WO(4)] /* 7 */ - st value, [atemp+WO(8)] - bnz ForEachBits - st value, [atemp+WO(12)] - b NextLine1 - deccc 1, count - nop - nop - - bnz ForEachBits /* 8 */ - st value, [atemp+WO(0)] - deccc 1, count - bnz,a ForEachLine - inc 4, stipple - ret - restore - nop - - st value, [atemp+WO(0)] /* 9 */ - bnz ForEachBits - st value, [atemp+WO(12)] - deccc 1, count - bnz,a ForEachLine - inc 4, stipple - ret - restore - - st value, [atemp+WO(0)] /* a */ - bnz ForEachBits - st value, [atemp+WO(8)] - deccc 1, count - bnz,a ForEachLine - inc 4, stipple - ret - restore - - st value, [atemp+WO(0)] /* b */ - st value, [atemp+WO(8)] - bnz ForEachBits - st value, [atemp+WO(12)] - b NextLine1 - deccc 1, count - nop - nop - - st value, [atemp+WO(0)] /* c */ - bnz ForEachBits - st value, [atemp+WO(4)] - deccc 1, count - bnz,a ForEachLine - inc 4, stipple - ret - restore - - st value, [atemp+WO(0)] /* d */ - st value, [atemp+WO(4)] - bnz ForEachBits - st value, [atemp+WO(12)] - b NextLine1 - deccc 1, count - nop - nop - - st value, [atemp+WO(0)] /* e */ - st value, [atemp+WO(4)] - bnz ForEachBits - st value, [atemp+WO(8)] - b NextLine1 - deccc 1, count - nop - nop - - st value, [atemp+WO(0)] /* f */ - st value, [atemp+WO(4)] - st value, [atemp+WO(8)] - bnz ForEachBits - st value, [atemp+WO(12)] - deccc 1, count - bnz,a ForEachLine - inc 4, stipple - ret - restore diff --git a/nx-X11/programs/Xserver/cfb16/Imakefile b/nx-X11/programs/Xserver/cfb16/Imakefile deleted file mode 100644 index 06f129986..000000000 --- a/nx-X11/programs/Xserver/cfb16/Imakefile +++ /dev/null @@ -1,10 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:48:16 cpqbld Exp $ - - - -XCOMM $XFree86$ - -#define PixelSize 16 -#define LinkDirectory ../cfb - -#include "../cfb/Imakefile.inc" diff --git a/nx-X11/programs/Xserver/cfb16/cfbmodule.c b/nx-X11/programs/Xserver/cfb16/cfbmodule.c deleted file mode 100644 index f5ad48f4d..000000000 --- a/nx-X11/programs/Xserver/cfb16/cfbmodule.c +++ /dev/null @@ -1,65 +0,0 @@ -/* $XFree86: xc/programs/Xserver/cfb16/cfbmodule.c,v 1.8 1999/01/26 05:53:49 dawes Exp $ */ -/* - * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the XFree86 Project shall - * not be used in advertising or otherwise to promote the sale, use or other - * dealings in this Software without prior written authorization from the - * XFree86 Project. - */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#define PSZ 16 - -#ifdef XFree86LOADER - -#include "xf86Module.h" -#include "cfb.h" - -static MODULESETUPPROTO(cfb16Setup); - -static XF86ModuleVersionInfo VersRec = -{ - "cfb16", - MODULEVENDORSTRING, - MODINFOSTRING1, - MODINFOSTRING2, - XORG_VERSION_CURRENT, - 1, 0, 0, - ABI_CLASS_ANSIC, /* Only need the ansic layer */ - ABI_ANSIC_VERSION, - MOD_CLASS_NONE, - {0,0,0,0} /* signature, to be patched into the file by a tool */ -}; - -XF86ModuleData cfb16ModuleData = { &VersRec, cfb16Setup, NULL }; - -static pointer -cfb16Setup(pointer module, pointer opts, int *errmaj, int *errmin) -{ - /* This modules requires cfb, so load it */ - return LoadSubModule(module, "cfb", NULL, NULL, NULL, NULL, - errmaj, errmin); -} - -#endif diff --git a/nx-X11/programs/Xserver/cfb16/module/Imakefile b/nx-X11/programs/Xserver/cfb16/module/Imakefile deleted file mode 100644 index 55105034f..000000000 --- a/nx-X11/programs/Xserver/cfb16/module/Imakefile +++ /dev/null @@ -1,12 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:48:16 cpqbld Exp $ - - - -XCOMM $XFree86$ - -#define IHaveModules - -#define PixelSize 16 -#define LinkDirectory ../../cfb - -#include "../../cfb/Imakefile.inc" diff --git a/nx-X11/programs/Xserver/cfb24/Imakefile b/nx-X11/programs/Xserver/cfb24/Imakefile deleted file mode 100644 index af31096be..000000000 --- a/nx-X11/programs/Xserver/cfb24/Imakefile +++ /dev/null @@ -1,6 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/cfb24/Imakefile,v 3.1 2002/05/31 15:12:56 dawes Exp $ - -#define PixelSize 24 -#define LinkDirectory ../cfb - -#include "../cfb/Imakefile.inc" diff --git a/nx-X11/programs/Xserver/cfb24/cfbmodule.c b/nx-X11/programs/Xserver/cfb24/cfbmodule.c deleted file mode 100644 index c2fb2bcf5..000000000 --- a/nx-X11/programs/Xserver/cfb24/cfbmodule.c +++ /dev/null @@ -1,65 +0,0 @@ -/* $XFree86: xc/programs/Xserver/cfb24/cfbmodule.c,v 1.8 1999/01/26 05:53:49 dawes Exp $ */ -/* - * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the XFree86 Project shall - * not be used in advertising or otherwise to promote the sale, use or other - * dealings in this Software without prior written authorization from the - * XFree86 Project. - */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#define PSZ 24 - -#ifdef XFree86LOADER - -#include "xf86Module.h" -#include "cfb.h" - -static MODULESETUPPROTO(cfb24Setup); - -static XF86ModuleVersionInfo VersRec = -{ - "cfb24", - MODULEVENDORSTRING, - MODINFOSTRING1, - MODINFOSTRING2, - XORG_VERSION_CURRENT, - 1, 0, 0, - ABI_CLASS_ANSIC, /* Only need the ansic layer */ - ABI_ANSIC_VERSION, - MOD_CLASS_NONE, - {0,0,0,0} /* signature, to be patched into the file by a tool */ -}; - -XF86ModuleData cfb24ModuleData = { &VersRec, cfb24Setup, NULL }; - -static pointer -cfb24Setup(pointer module, pointer opts, int *errmaj, int *errmin) -{ - /* This modules requires cfb, so load it */ - return LoadSubModule(module, "cfb", NULL, NULL, NULL, NULL, - errmaj, errmin); -} - -#endif diff --git a/nx-X11/programs/Xserver/cfb24/cfbrrop24.h b/nx-X11/programs/Xserver/cfb24/cfbrrop24.h deleted file mode 100644 index 9f15d1a82..000000000 --- a/nx-X11/programs/Xserver/cfb24/cfbrrop24.h +++ /dev/null @@ -1,54 +0,0 @@ -/* $XFree86: xc/programs/Xserver/cfb24/cfbrrop24.h,v 3.1tsi Exp $ */ - -#define RROP_DECLARE \ - unsigned long piQxelAnd[3], piQxelXor[3], spiQxelXor[8]; - -#define RROP_COPY_SETUP(ptn) \ - spiQxelXor[0] = ptn & 0xFFFFFF; \ - spiQxelXor[2] = ptn << 24; \ - spiQxelXor[3] = (ptn & 0xFFFF00)>> 8; \ - spiQxelXor[4] = ptn << 16; \ - spiQxelXor[5] = (ptn & 0xFF0000)>> 16; \ - spiQxelXor[6] = ptn << 8; \ - spiQxelXor[1] = spiQxelXor[7] = 0; - -#define RROP_SOLID24_COPY(dst,index) {\ - register int idx = ((index) & 3)<< 1; \ - *(dst) = (*(dst) & cfbrmask[idx])|spiQxelXor[idx]; \ - idx++; \ - *((dst)+1) = (*((dst)+1) & cfbrmask[idx])|spiQxelXor[idx]; \ - } - -#define RROP_SET_SETUP(xor, and) \ - spiQxelXor[0] = xor & 0xFFFFFF; \ - spiQxelXor[1] = xor << 24; \ - spiQxelXor[2] = xor << 16; \ - spiQxelXor[3] = xor << 8; \ - spiQxelXor[4] = (xor >> 8) & 0xFFFF; \ - spiQxelXor[5] = (xor >> 16) & 0xFF; \ - piQxelAnd[0] = (and & 0xFFFFFF)|(and << 24); \ - piQxelAnd[1] = (and << 16)|((and >> 8) & 0xFFFF); \ - piQxelAnd[2] = (and << 8)|((and >> 16) & 0xFF); \ - piQxelXor[0] = (xor & 0xFFFFFF)|(xor << 24); \ - piQxelXor[1] = (xor << 16)|((xor >> 8) & 0xFFFF); \ - piQxelXor[2] = (xor << 8)|((xor >> 16) & 0xFF); - - -#define RROP_SOLID24_SET(dst,index) {\ - switch((index) & 3){ \ - case 0: \ - *(dst) = ((*(dst) & (piQxelAnd[0] |0xFF000000))^(piQxelXor[0] & 0xFFFFFF)); \ - break; \ - case 3: \ - *(dst) = ((*(dst) & (piQxelAnd[2]|0xFF))^(piQxelXor[2] & 0xFFFFFF00)); \ - break; \ - case 1: \ - *(dst) = ((*(dst) & (piQxelAnd[0]|0xFFFFFF))^(piQxelXor[0] & 0xFF000000)); \ - *((dst)+1) = ((*((dst)+1) & (piQxelAnd[1]|0xFFFF0000))^(piQxelXor[1] & 0xFFFF)); \ - break; \ - case 2: \ - *(dst) = ((*(dst) & (piQxelAnd[1]|0xFFFF))^(piQxelXor[1] & 0xFFFF0000)); \ - *((dst)+1) = ((*((dst)+1) & (piQxelAnd[2]|0xFFFFFF00))^(piQxelXor[2] & 0xFF)); \ - break; \ - } \ - } diff --git a/nx-X11/programs/Xserver/cfb24/module/Imakefile b/nx-X11/programs/Xserver/cfb24/module/Imakefile deleted file mode 100644 index d9da99214..000000000 --- a/nx-X11/programs/Xserver/cfb24/module/Imakefile +++ /dev/null @@ -1,12 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:48:16 cpqbld Exp $ - - - -XCOMM $XFree86$ - -#define IHaveModules - -#define PixelSize 24 -#define LinkDirectory ../../cfb - -#include "../../cfb/Imakefile.inc" diff --git a/nx-X11/programs/Xserver/cfb32/Imakefile b/nx-X11/programs/Xserver/cfb32/Imakefile deleted file mode 100644 index 865b714ea..000000000 --- a/nx-X11/programs/Xserver/cfb32/Imakefile +++ /dev/null @@ -1,10 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:48:16 cpqbld Exp $ - - - -XCOMM $XFree86$ - -#define PixelSize 32 -#define LinkDirectory ../cfb - -#include "../cfb/Imakefile.inc" diff --git a/nx-X11/programs/Xserver/cfb32/cfbmodule.c b/nx-X11/programs/Xserver/cfb32/cfbmodule.c deleted file mode 100644 index 0ead3ef93..000000000 --- a/nx-X11/programs/Xserver/cfb32/cfbmodule.c +++ /dev/null @@ -1,65 +0,0 @@ -/* $XFree86: xc/programs/Xserver/cfb32/cfbmodule.c,v 1.8 1999/01/26 05:53:49 dawes Exp $ */ -/* - * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the XFree86 Project shall - * not be used in advertising or otherwise to promote the sale, use or other - * dealings in this Software without prior written authorization from the - * XFree86 Project. - */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#define PSZ 32 - -#ifdef XFree86LOADER - -#include "xf86Module.h" -#include "cfb.h" - -static MODULESETUPPROTO(cfb32Setup); - -static XF86ModuleVersionInfo VersRec = -{ - "cfb32", - MODULEVENDORSTRING, - MODINFOSTRING1, - MODINFOSTRING2, - XORG_VERSION_CURRENT, - 1, 0, 0, - ABI_CLASS_ANSIC, /* Only need the ansic layer */ - ABI_ANSIC_VERSION, - MOD_CLASS_NONE, - {0,0,0,0} /* signature, to be patched into the file by a tool */ -}; - -XF86ModuleData cfb32ModuleData = { &VersRec, cfb32Setup, NULL }; - -static pointer -cfb32Setup(pointer module, pointer opts, int *errmaj, int *errmin) -{ - /* This modules requires cfb, so load it */ - return LoadSubModule(module, "cfb", NULL, NULL, NULL, NULL, - errmaj, errmin); -} - -#endif diff --git a/nx-X11/programs/Xserver/cfb32/module/Imakefile b/nx-X11/programs/Xserver/cfb32/module/Imakefile deleted file mode 100644 index 58c6a6f06..000000000 --- a/nx-X11/programs/Xserver/cfb32/module/Imakefile +++ /dev/null @@ -1,12 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:48:16 cpqbld Exp $ - - - -XCOMM $XFree86$ - -#define IHaveModules - -#define PixelSize 32 -#define LinkDirectory ../../cfb - -#include "../../cfb/Imakefile.inc" diff --git a/nx-X11/programs/Xserver/hw/darwin/Imakefile b/nx-X11/programs/Xserver/hw/darwin/Imakefile deleted file mode 100644 index 213816647..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/Imakefile +++ /dev/null @@ -1,92 +0,0 @@ -XCOMM $XdotOrg: xc/programs/Xserver/hw/darwin/Imakefile,v 1.6 2004/11/08 06:35:27 fabbione Exp $ -XCOMM $XFree86: xc/programs/Xserver/hw/darwin/Imakefile,v 1.19 2003/05/14 05:27:55 torrey Exp $ - -#include -#define IHaveSubdirs - -LinkSourceFile(Xorg.man,../xfree86) - -/* The version of miinitext.c in mi is built with many extensions off. */ -LinkSourceFile(miinitext.c,$(SERVERSRC)/mi) -SpecialCObjectRule(miinitext,$(ICONFIGFILES),$(EXT_DEFINES)) - -#if BuildXInputExt -XINPUTSRCS = darwinXinput.c -XINPUTOBJS = darwinXinput.o -#endif - -SRCS = darwin.c \ - darwinEvents.c \ - darwinKeyboard.c \ - miinitext.c \ - $(XINPUTSRCS) - -OBJS = darwin.o \ - darwinEvents.o \ - darwinKeyboard.o \ - miinitext.o \ - $(XINPUTOBJS) - -INCLUDES = -I. -I$(SERVERSRC)/mi -I$(SERVERSRC)/fb -I$(EXTINCSRC) \ - -I$(SERVERSRC)/render -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ - -I$(SERVERSRC)/os -I$(INCLUDESRC) -I$(FONTINCSRC) \ - -I$(SERVERSRC)/miext/shadow -I$(SERVERSRC)/hw/xfree86 \ - -I$(SERVERSRC)/Xi - -OSNAME = OSName -OSVENDOR = OSVendor -OSNAMEDEF = -DOSNAME='" $(OSNAME)"' -DOSVENDOR='" $(OSVENDOR)"' -#if defined(XorgCustomVersion) || defined(XFree86CustomVersion) -# if defined(XorgCustomVersion) -CUSTOMVERSION = XorgCustomVersion -# else -CUSTOMVERSION = XFree86CustomVersion -# endif /* XorgCustomVersion */ -CUSTOMVERDEF = -DXORG_CUSTOM_VERSION='$(CUSTOMVERSION)' -#endif /* XorgCustomVersion || XFree86CustomVersion */ -#if defined(BuilderString) -BUILDERSTRING = BuilderString -BUILDERMSG = -DBUILDERSTRING='$(BUILDERSTRING)' -#endif -XORGREL = XOrgReleaseString -XORGREL_DEF = -DXORG_RELEASE="\"$(XORGREL)\"" - -#if defined(BuildDate) - BUILD_DATE = BuildDate -#else - BUILD_DATE = 0 -#endif - -#if defined(ChangelogDate) - CLOG_DATE = ChangelogDate -#else - CLOG_DATE = 0 -#endif - -#if OSMajorVersion >= 6 -CLUTDEF = -DUSE_NEW_CLUT -#endif - -#if DarwinQuartzSupport -SUBDIRS = iokit bundle quartz utils -QUARTZDEF = -DDARWIN_WITH_QUARTZ -#else -SUBDIRS = iokit utils -#endif - -DEFINES = $(QUARTZDEF) $(VENDORSUPPORTDEFS) -EXTRAMANDEFS = $(QUARTZDEF) -D__logdir__=$(LOGDIRECTORY) - -SpecialCObjectRule(darwin,$(ICONFIGFILES),$(OSNAMEDEF) $(BUILDERMSG) \ - $(CUSTOMVERDEF) $(XORGREL_DEF) $(CLUTDEF) $(VENDOR_DEFINES)) - -NormalLibraryObjectRule() -NormalLibraryTarget(darwin,$(OBJS)) - -InstallManPage(XDarwin,$(MANDIR)) -InstallManPage(Xorg,$(MANDIR)) - -DependTarget() - -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) diff --git a/nx-X11/programs/Xserver/hw/darwin/XDarwin.man b/nx-X11/programs/Xserver/hw/darwin/XDarwin.man deleted file mode 100644 index eb1b9dcb8..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/XDarwin.man +++ /dev/null @@ -1,205 +0,0 @@ -.\" $XFree86: xc/programs/Xserver/hw/darwin/XDarwin.man,v 1.3 2001/09/23 23:02:37 torrey Exp $ -.\" -.TH XDARWIN 1 __vendorversion__ -.SH NAME -XDarwin \- X window system server for Darwin operating system -.SH SYNOPSIS -.B XDarwin -[ options ] ... -.SH DESCRIPTION -#ifdef DARWIN_WITH_QUARTZ -.I XDarwin -is the X window server for Mac OS X and the Darwin operating system -provided by the X.Org Foundation. -.I XDarwin -can run in three different modes. On Mac OS X, -.I XDarwin -runs in parallel with Aqua in full screen or rootless modes. These modes -are called Quartz modes, named after the Quartz 2D compositing engine used -by Aqua. XDarwin can also be run from the Darwin text console in IOKit mode. -.PP -When running from the console, -.I XDarwin -acts as the window server and uses IOKit services to access the display -framebuffer, mouse and keyboard and to provide a layer of hardware -abstraction. In console mode, -.I XDarwin -will normally be started by the \fIxdm(1)\fP display manager or by a script -that runs the program \fIxinit(1)\fP. -.PP -When running with the Mac OS X Aqua GUI, -.I XDarwin -will normally be started by launching from the Finder, but it may also be -started from the command line with the \fB\-quartz\fP, \fB\-fullscreen\fP, or -\fB\-rootless\fP options. Note that the defaults for various command line -options are set by the -.I XDarwin -application preferences in the Quartz modes. -.PP -In full screen Quartz mode, when the X Window System is active, it takes over -the entire screen. CoreGraphics is used to capture and draw to the screen. The -.I XDarwin -application allows easy switching between the Mac OS X and X window -desktops. More information is available in the Help menu of the -.I XDarwin -application. -.PP -In rootless mode, the X window system and Aqua share your display. The root -window of the X11 display is the size of the screen and contains all the -other windows. The X11 root window is not displayed in rootless mode as Aqua -handles the desktop background. -#else -.I XDarwin -is the X window server for Mac OS X and the Darwin operating system -provided by the X.Org Foundation. This version of -.I XDarwin -can only be started from the Darwin text console. The Mac OS X Aqua GUI, if -present, must be shut down. -.I XDarwin -uses IOKit services to access the display -framebuffer, mouse and keyboard and to provide a layer of hardware -abstraction. -.I XDarwin -will normally be started by the \fIxdm(1)\fP display manager or by a script -that runs the program \fIxinit(1)\fP. -#endif -.SH OPTIONS -.PP -In addition to the normal server options described in the \fIXserver(1)\fP -manual page, \fIXDarwin\fP accepts the following command line switches: -.TP 8 -.B \-fakebuttons -Emulates a 3 button mouse using modifier keys. By default, the Command modifier -is used to emulate button 2 and Option is used for button 3. Thus, clicking the -first mouse button while holding down Command will act like clicking -button 2. Holding down Option will simulate button 3. -.TP 8 -.B \-nofakebuttons -Do not emulate a 3 button mouse. This is the default. -.TP 8 -.B "\-fakemouse2 \fImodifiers\fP" -Change the modifier keys used to emulate the second mouse button. By default, -Command is used to emulate the second button. Any combination of the following -modifier names may be used: Shift, Option, Control, Command, Fn. For example, -.B \-fakemouse2 """Option,Shift"" -will set holding Option, Shift and clicking on button one as equivalent to -clicking the second mouse button. -.TP 8 -.B "\-fakemouse3 \fImodifiers\fP" -Change the modifier keys used to emulate the third mouse button. By default, -Option is used to emulate the third button. Any combination of the following -modifier names may be used: Shift, Option, Control, Command, Fn. For example, -.B \-fakemouse3 """Control,Shift"" -will set holding Control, Shift and clicking on button one as equivalent to -clicking the third mouse button. -.TP 8 -.B "\-keymap \fIfile\fP" -On startup \fIXDarwin\fP translates a Darwin keymapping into an X keymap. -The default is to read this keymapping from USA.keymapping. With this option -the keymapping will be read from \fIfile\fP instead. If the file's path is -not specified, it will be searched for in Library/Keyboards/ underneath the -following directories (in order): ~, /, /Network, /System. -.TP 8 -.B \-nokeymap -On startup \fIXDarwin\fP translates a Darwin keymapping into an X keymap. -With this option XDarwin queries the kernel for the current keymapping -instead of reading it from a file. This will often fail on newer kernels. -#ifdef DARWIN_WITH_QUARTZ -.TP 8 -.B "\-size \fIwidth\fP \fIheight\fP" -Sets the screen resolution for the X server to use. -Ignored in rootless mode. -.TP 8 -.B "\-depth \fIdepth\fP" -Specifies the color bit depth to use. Currently only 8, 15, and 24 color bits -per pixel are supported. -Ignored in rootless mode. -.TP 8 -.B "\-refresh \fIrate\fP" -Gives the refresh rate to use in Hz. For LCD displays this should be 0. -Ignored in rootless mode. -.TP 8 -.B \-fullscreen -Run full screen in parallel with Mac OS X Aqua GUI. -.TP 8 -.B \-rootless -Run rootless inside Mac OS X Aqua GUI. -.TP 8 -.B \-quartz -Run in parallel with the Mac OS X Aqua GUI using the default mode. -#else -.TP 8 -.B "\-size \fIwidth\fP \fIheight\fP" -Sets the screen resolution for the X server to use. -.TP 8 -.B "\-depth \fIdepth\fP" -Specifies the color bit depth to use. Currently only 8, 15, and 24 color bits -per pixel are supported. -.TP 8 -.B "\-refresh \fIrate\fP" -Gives the refresh rate to use in Hz. For LCD displays this should be 0. -#endif -.TP 8 -.B \-showconfig -Print out the server version and patchlevel. -.TP 8 -.B \-version -Same as \fB\-showconfig\fP. -.SH "SEE ALSO" -.PP -X(__miscmansuffix__), Xorg(1), Xserver(1), xdm(1), xinit(1) -.SH BUGS -.I XDarwin -and this man page still have many limitations. Some of the more obvious -ones are: -.br -- The display mode cannot be changed once the X server has started. -.br -- A screen saver is not supported. -.PP -.SH AUTHORS -XFree86 was originally ported to Mac OS X Server by John Carmack. Dave -Zarzycki used this as the basis of his port of XFree86 4.0 to Darwin 1.0. -Torrey T. Lyons improved and integrated this code into the XFree86 -Project's mainline for the 4.0.2 release. -.PP -The following members of the XonX Team contributed to the following -releases (in alphabetical order): -.TP 4 -XFree86 4.1.0: -.br -Rob Braun - Darwin x86 support -.br -Torrey T. Lyons - Project Lead -.br -Andreas Monitzer - Cocoa version of XDarwin front end -.br -Gregory Robert Parker - Original Quartz implementation -.br -Christoph Pfisterer - Dynamic shared X libraries -.br -Toshimitsu Tanaka - Japanese localization -.TP 4 -XFree86 4.2.0: -.br -Rob Braun - Darwin x86 support -.br -Pablo Di Noto - Spanish localization -.br -Paul Edens - Dutch localization -.br -Kyunghwan Kim - Korean localization -.br -Mario Klebsch - Non-US keyboard support -.br -Torrey T. Lyons - Project Lead -.br -Andreas Monitzer - German localization -.br -Patrik Montgomery - Swedish localization -.br -Greg Parker - Rootless support -.br -Toshimitsu Tanaka - Japanese localization -.br -Olivier Verdier - French localization diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/Dutch.lproj/Credits.rtf b/nx-X11/programs/Xserver/hw/darwin/bundle/Dutch.lproj/Credits.rtf deleted file mode 100644 index 5858e5933..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/bundle/Dutch.lproj/Credits.rtf +++ /dev/null @@ -1,168 +0,0 @@ -{\rtf1\mac\ansicpg10000\cocoartf102 -{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;\f2\fswiss\fcharset77 Helvetica-Oblique; -} -{\colortbl;\red255\green255\blue255;} -\vieww9000\viewh9000\viewkind0 -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural - -\f0\fs24 \cf0 This product includes software developed by The XFree86 Project, Inc (http://www.xfree86.org/) and its contributors. The following people contributed to Darwin/Mac OS X support.\ -\ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc - -\f1\b \cf0 Contributors to Xorg Foundation Release: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Kaleb KEITHLEY\ - -\f2\i Working left and right Ctrl, Alt (Option), Meta (Command) and Shift keys. -\f0\i0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f1\b \cf0 \ -\f1\b \cf0 Contributors to XFree86 4.4: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 John Harper\ - -\f2\i Rootless acceleration and Apple-WM extension -\f0\i0 \ -Torrey T. Lyons\ - -\f2\i Project Lead -\f0\i0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f1\b \cf0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\cf0 Additional XonX Contributors to XFree86 4.3: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Fabr\'92cio Luis de Castro\ - -\f2\i Portuguese localization -\f0\i0 \ -Michael Oland\ - -\f2\i New XDarwin icon -\f0\i0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f1\b \cf0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\cf0 XonX Contributors to XFree86 4.2: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Rob Braun\ - -\f2\i Darwin x86 support -\f0\i0 \ -Pablo Di Noto\ - -\f2\i Spanish localization -\f0\i0 \ -Paul Edens\ - -\f2\i Dutch localization -\f0\i0 \ -Kyunghwan Kim\ - -\f2\i Korean localization -\f0\i0 \ -Mario Klebsch\ - -\f2\i Non-US keyboard support -\f0\i0 \ -Torrey T. Lyons\ - -\f2\i Project Lead -\f0\i0 \ -Andreas Monitzer\ - -\f2\i German localization -\f0\i0 \ -Patrik Montgomery\ - -\f2\i Swedish localization -\f0\i0 \ -Greg Parker\ - -\f2\i Rootless support -\f0\i0 \ -Toshimitsu Tanaka\ - -\f2\i Japanese localization -\f0\i0 \ -Olivier Verdier\ - -\f2\i French localization -\f0\i0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f1\b \cf0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\cf0 Special Thanks: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Devin Poolman and Zero G Software, Inc.\ - -\f2\i Installer -\f0\i0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f1\b \cf0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\cf0 XonX Team Members\ -Contributing to XFree86 4.1: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Rob Braun\ - -\f2\i Darwin x86 support -\f0\i0 \ -Torrey T. Lyons\ - -\f2\i Project Lead -\f0\i0 \ -Andreas Monitzer\ - -\f2\i Cocoa version of XDarwin front end -\f0\i0 \ -Greg Parker\ - -\f2\i Original Quartz implementation -\f0\i0 \ -Christoph Pfisterer\ - -\f2\i Dynamic shared libraries -\f0\i0 \ -Toshimitsu Tanaka\ - -\f2\i Japanese localization -\f0\i0 \ -\ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc - -\f1\b \cf0 Special Thanks: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Tiago Ribeiro\ - -\f2\i XDarwin icon -\f0\i0 \ -\ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc - -\f1\b \cf0 History: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 John Carmack\ - -\f2\i Original XFree86 port to Mac OS X Server -\f0\i0 \ -Dave Zarzycki\ - -\f2\i XFree86 4.0 port to Darwin 1.0 -\f0\i0 \ -Torrey T. Lyons\ - -\f2\i Integration into XFree86 Project for 4.0.2} \ No newline at end of file diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/Dutch.lproj/Imakefile b/nx-X11/programs/Xserver/hw/darwin/bundle/Dutch.lproj/Imakefile deleted file mode 100644 index d367fbcee..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/bundle/Dutch.lproj/Imakefile +++ /dev/null @@ -1,36 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/Imakefile,v 1.1 2001/05/21 01:42:17 torrey Exp $ - -#include - -LinkSourceFile(InfoPlist.strings.cpp,../English.lproj) - -INCLUDES = -I$(SERVERSRC)/include - -#if defined (XorgVersionString) -VERS = XorgVersionString -PRE = XORG_VERSION_SNAP -NAME = "X Version 11" -LINK = 'X.Org Foundation' -#elif defined XFree86VersionString -VERS = XFree86VersionString -PRE = XF86_VERSION_SNAP -NAME = "XFree86" -LINK = 'XFree86 Project, Inc.' -#endif -DATE = XFree86DateString -X_DEFS = $(INCLUDES) -DX_VERSION=$(VERS) -DX_PRE_RELEASE=$(PRE) \ - -DX_REL_DATE=$(DATE) -DX_VENDOR_NAME=$(NAME) -DX_VENDOR_LINK=$(LINK) - -AllTarget(XDarwinHelp.html) -CppFileTarget(XDarwinHelp.html,XDarwinHelp.html.cpp,$(X_DEFS), \ - NullParameter) - -AllTarget(InfoPlist.strings) -InfoPlist.strings: InfoPlist.strings.cpp - RemoveFile($@) - ClearmakeOSName \ - $(CPP) CppNoLineInfoOption $(X_DEFS) $@ - -clean:: - RemoveFiles(InfoPlist.strings) diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/Dutch.lproj/Localizable.strings b/nx-X11/programs/Xserver/hw/darwin/bundle/Dutch.lproj/Localizable.strings deleted file mode 100644 index 6abd91072..000000000 Binary files a/nx-X11/programs/Xserver/hw/darwin/bundle/Dutch.lproj/Localizable.strings and /dev/null differ diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/Dutch.lproj/MainMenu.nib/classes.nib b/nx-X11/programs/Xserver/hw/darwin/bundle/Dutch.lproj/MainMenu.nib/classes.nib deleted file mode 100644 index 77f345a4e..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/bundle/Dutch.lproj/MainMenu.nib/classes.nib +++ /dev/null @@ -1,72 +0,0 @@ -{ - IBClasses = ( - { - ACTIONS = {showHelp = id; }; - CLASS = FirstResponder; - LANGUAGE = ObjC; - SUPERCLASS = NSObject; - }, - { - ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; }; - CLASS = Preferences; - LANGUAGE = ObjC; - OUTLETS = { - addToPathButton = id; - addToPathField = id; - button2ModifiersMatrix = id; - button3ModifiersMatrix = id; - depthButton = id; - displayField = id; - dockSwitchButton = id; - fakeButton = id; - keymapFileField = id; - modeMatrix = id; - modeWindowButton = id; - mouseAccelChangeButton = id; - startupHelpButton = id; - switchKeyButton = id; - systemBeepButton = id; - useDefaultShellMatrix = id; - useOtherShellField = id; - useXineramaButton = id; - window = id; - }; - SUPERCLASS = NSObject; - }, - { - CLASS = XApplication; - LANGUAGE = ObjC; - OUTLETS = {preferences = id; xserver = id; }; - SUPERCLASS = NSApplication; - }, - { - ACTIONS = { - bringAllToFront = id; - closeHelpAndShow = id; - itemSelected = id; - nextWindow = id; - previousWindow = id; - showAction = id; - showSwitchPanel = id; - startFullScreen = id; - startRootless = id; - }; - CLASS = XServer; - LANGUAGE = ObjC; - OUTLETS = { - dockMenu = NSMenu; - helpWindow = NSWindow; - modeWindow = NSWindow; - startFullScreenButton = NSButton; - startRootlessButton = NSButton; - startupHelpButton = NSButton; - startupModeButton = NSButton; - switchWindow = NSPanel; - windowMenu = NSMenu; - windowSeparator = NSMenuItem; - }; - SUPERCLASS = NSObject; - } - ); - IBVersion = 1; -} \ No newline at end of file diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/Dutch.lproj/MainMenu.nib/objects.nib b/nx-X11/programs/Xserver/hw/darwin/bundle/Dutch.lproj/MainMenu.nib/objects.nib deleted file mode 100644 index 8e9224cb6..000000000 Binary files a/nx-X11/programs/Xserver/hw/darwin/bundle/Dutch.lproj/MainMenu.nib/objects.nib and /dev/null differ diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/Dutch.lproj/XDarwinHelp.html.cpp b/nx-X11/programs/Xserver/hw/darwin/bundle/Dutch.lproj/XDarwinHelp.html.cpp deleted file mode 100644 index 1113b8ae6..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/bundle/Dutch.lproj/XDarwinHelp.html.cpp +++ /dev/null @@ -1,103 +0,0 @@ - - - - -XDarwin Help - - -
-

XDarwin X Server for Mac OS X

- X_VENDOR_NAME X_VERSION
- Release Date: X_REL_DATE -
-

Inhoud

-
    -
  1. Belangrijke Informatie
  2. -
  3. Gebruik
  4. -
  5. Instellen van het Path
  6. -
  7. Voorkeursinstellingen
  8. -
  9. Licentie
  10. -
-
-

Belangrijke Informatie

-
-
-#if X_PRE_RELEASE -Dit is een pre-release van XDarwin, waarvoor geen ondersteuning beschikbaar is. Rapporteren van bugs en aanleveren van patches kan op de XonX project pagina bij SourceForge. Kijk alvorens een bug te rapporteren in een pre-release eerst of een nieuwe versie beschikbaar is bij XonX of de X_VENDOR_LINK. -#else -Als de server ouder is dan 6-12 maanden, of als uw hardware nieuwer is dan de bovenstaande datum, kijk dan of een nieuwe versie beschikbaar is voor u een probleem aanmeldt. Rapporteren van bugs en aanleveren van patches kan op de XonX project pagina bij SourceForge. -#endif -
-
-Deze software is beschikbaar gesteld onder de voorwaarden van de MIT X11 / X Consortium Licentie en is beschikbaar 'AS IS',zonder enige garantie. Lees s.v.p. de Licentie voor gebruik.
- -

Gebruik

-

XDarwin is een open-source X server van het X Window Systeem. This version of XDarwin was produced by the X_VENDOR_LINK. XDarwin werkt op Mac OS X in schermvullende of rootless modus.

-

Het X window systeem in schermvullende modus neemt het hele beeldscherm in beslag. U schakelt terug naar de Mac OS X desktop door de toesten Command-Option-A in te drukken. Deze toetsencombinatie kunt u veranderen in de Voorkeuren. Op de Mac OS X desktop klikt u op de XDarwin icoon in de Dock om weer naar het X window systeem te schakelen. (In de Voorkeuren kunt er voor kiezen om een apart XDarwin schakelpaneel te gebruiken op de Mac OS X desktop.)

-

In rootless modus verschijnen het X window systeem en Aqua (de Mac OS X desktop) tegelijk op het scherm. Het achtergrondscherm van X11, waarbinnen alle X11 vensters vallen, is net zo groot als het gehele scherm, maar het achtergrondscherm zelf is onzichtbaar.

- -

Meerknopsmuis emulatie

-

Voor veel X11 programma's hebt u een 3-knops muis nodig. Met een 1-knops muis kunt u een 3-knops muis nabootsen door een toets in te drukken terwijl u klikt met de muis. Het instellen hiervan kan bij Voorkeuren, "Meerknopsmuis emulatie" in "Algemeen". Emulatie is standaard ingeschakeld: ingedrukt houden van de "command" toets terwijl u klikt emuleert knop 2, ingedrukt houden van "option" emuleert knop 3. Deze toetsen kunt u dus wijzigen in de Voorkeuren. Let op: als u xmodmap gebruikt om de indeling van het toetsenbord te wijzigen, moet u toch de oorspronkelijke toetsen op het toetsenbord gebruiken voor deze functie.

- -

Instellen van het Path

-

Het path is de lijst van directories waarin gezocht wordt naar commando's. De X11 commando's staan in de directory /usr/X11R6/bin, die dus aan uw path moet worden toegevoegd. XDarwin doet dit automatisch voor u en kan extra directories toevoegen waarin u commando's hebt geïnstalleerd.

- -

Ervaren gebruikers zullen het path al correct hebben ingesteld in de configuratiebestanden voor hun shell. In dat geval kunt u XDarwin via de Voorkeuren vertellen het path niet te wijzigen. XDarwin start de eerste X11 clients binnen de standaard login shell van de gebruiker (bij de Voorkeuren kunt u een afwijkende shell opgeven). Het instellen van het path is afhankelijk van de shell. Zie hiervoor de man pages voor de shell.

- -

Het kan handig zijn de manualpages voor X11 toe te voegen aan de lijst waarin gezocht wordt als u documentatie opvraagt. De manualpages voor X11 staan in /usr/X11R6/man en de MANPATH environment variable bevat de lijst van directories waarin naar documentatie wordt gezocht.

- -

Voorkeursinstellingen

-

Een aantal instellingen kan worden gewijzigd door "Voorkeuren..." te kiezen in het "XDarwin" menu. Wijzigingen van de instellingen genoemd onder "Start" gaan pas in als u XDarwin opnieuw hebt gestart. Een wijziging van de overige instellingen is direct effectief. Hier onder vindt u de verschillende mogelijkheden beschreven:

- -

Algemeen

-
    -
  • Gebruik systeempiep voor X11: Als u dit inschakelt wordt het Mac OS X waarschuwingssignaal ook gebruikt door X11, anders gebruikt X11 een simpele pieptoon (dit is de standaardinstelling).
  • -
  • Wijzigen muis-versnelling door X11 mogelijk: In een standaard X window systeem kan de window manager de muis-versnelling aanpassen. Dit kan verwarrend zijn omdat de snelheid onder X11 dan verschillend kan zijn van de snelheid die u in Mac OS X bij Systeemvoorkeuren hebt ingesteld. Om verwarring te voorkomen is de standaardinstelling dat X11 de versnelling niet kan wijzigen.
  • -
  • Meerknopsmuis emulatie: Dit is hierboven beschreven bij Gebruik. Als emulatie is ingeschakeld moet u de gekozen toetsen ingedrukt houden terwijl u met de muis klikt om de tweede en derde muisknop na te bootsen.
  • -
- -

Start

-
    -
  • Standaard modus: Hier kiest u de standaard scherm-modus: schermvullend of rootless (hierboven beschreven bij Gebruik). U kunt ook kiezen tijdens het starten van XDarwin, zie de optie hieronder.
  • -
  • Kies scherm-modus tijdens start: Dit is standaard ingeschakeld zodat u tijdens het starten van XDarwin kunt kiezen tussen schermvullend en rootless scherm-modus. Als u dit uitschakelt start XDarwin in de standaard modus zonder u iets te vragen.
  • -
  • X11 scherm nummer: Met X11 kunnen meerdere schermen worden aangestuurd door verschillende X servers op dezelfde computer. Als u meerdere X servers tegelijk wilt gebruiken stelt u hier het scherm nummer in dat door XDarwin wordt gebruikt.
  • -
  • Xinerama multi-monitor ondersteuning mogelijk: XDarwin ondersteunt het gebruik van meerdere monitoren met Xinerama, waarbij elke monitor wordt gezien als deel van één groot rechthoekig scherm. U kunt Xinerama hier uitschakelen, maar XDarwin werkt op dit moment zonder Xinerama niet goed met meerdere monitoren. Als u maar 1 monitor gebruikt is deze instelling automatisch uitgeschakeld.
  • -
  • Toetsenbordindeling-bestand: Een toetsenbordindeling-bestand wordt bij het starten geladen en omgezet naar een X11 toetsenbordindeling. Voor verschillende talen vindt u toetsenbordindelingen in de directory /System/Library/Keyboards.
  • -
  • Bij starten eerste X11 clients: Als XDarwin start, wordt xinit uitgevoerd om de X window manager en andere X clients te starten (zie "man xinit"). Voordat XDarwin xinit uitvoert voegt het de opgegeven directories toe aan het path. Standaard wordt alleen /usr/X11R6/bin toegevoegd. U kunt meerdere directories opgeven, gescheiden door een dubbelepunt. X clients worden gestart met de standaard login shell van de gebruiker met gebruik van de configuratiebestanden voor die shell. U kunt een afwijkende shell opgeven.
  • -
- -

Schermvullend

-
    -
  • Toetscombinatie knop: Klik op deze knop om de toetscombinatie te wijzigen waarmee u tussen de Mac OS X desktop en X11 schakelt. Als toetscombinatie kunt u elke combinatie gebruiken van de shift, control, command en option toetsen samen met één normale toets.
  • -
  • Klikken op icoon in Dock schakelt naar X11: Hiermee is een klik op de XDarwin icoon in de Dock voldoende om naar X11 te schakelen. In sommige versies van Mac OS X verdwijnt soms de cursor als u deze mogelijkheid gebruikt en daarna terugkeert naar de Mac OS X desktop.
  • -
  • Toon help bij schermvullend starten: Hiermee wordt een inleidend scherm getoond als XDarwin schermvullend start.
  • -
  • Kleurdiepte: In de schermvullende modus kan X11 een andere kleurdiepte gebruiken dan Aqua (en de Mac OS X desktop). Als u "Huidig" kiest, neemt XDarwin bij het starten de kleurdiepte over van Aqua. U kunt ook kiezen voor 8, 15 of 24 bits.
  • -
- -

Licentie

-The main license for XDarwin is one based on the traditional MIT X11 / X Consortium License, which does not impose any conditions on modification or redistribution of source code or binaries other than requiring that copyright/license notices are left intact. For more information and additional copyright/licensing notices covering some sections of the code, please refer to the source code. -

X Consortium License

-

Copyright (C) 1996 X Consortium

-

Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without -limitation the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to permit persons to -whom the Software is furnished to do so, subject to the following conditions:

-

The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software.

-

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE.

-

Except as contained in this notice, the name of the X Consortium shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization from -the X Consortium.

-

X Window System is a trademark of X Consortium, Inc.

- - - diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/English.lproj/Credits.rtf b/nx-X11/programs/Xserver/hw/darwin/bundle/English.lproj/Credits.rtf deleted file mode 100644 index 34408e78c..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/bundle/English.lproj/Credits.rtf +++ /dev/null @@ -1,168 +0,0 @@ -{\rtf1\mac\ansicpg10000\cocoartf102 -{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;\f2\fswiss\fcharset77 Helvetica-Oblique; -} -{\colortbl;\red255\green255\blue255;} -\vieww5160\viewh6300\viewkind0 -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural - -\f0\fs24 \cf0 This product includes software developed by The XFree86 Project, Inc (http://www.xfree86.org/) and its contributors. The following people contributed to Darwin/Mac OS X support.\ -\ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc - -\f1\b \cf0 Contributors to Xorg Foundation Release: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Kaleb KEITHLEY\ - -\f2\i Working left and right Ctrl, Alt (Option), Meta (Command) and Shift keys. -\f0\i0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f1\b \cf0 \ -\f1\b \cf0 Contributors to XFree86 4.4: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 John Harper\ - -\f2\i Rootless acceleration and Apple-WM extension -\f0\i0 \ -Torrey T. Lyons\ - -\f2\i Project Lead -\f0\i0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f1\b \cf0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\cf0 Additional XonX Contributors to XFree86 4.3: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Fabr\'92cio Luis de Castro\ - -\f2\i Portuguese localization -\f0\i0 \ -Michael Oland\ - -\f2\i New XDarwin icon -\f0\i0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f1\b \cf0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\cf0 XonX Contributors to XFree86 4.2: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Rob Braun\ - -\f2\i Darwin x86 support -\f0\i0 \ -Pablo Di Noto\ - -\f2\i Spanish localization -\f0\i0 \ -Paul Edens\ - -\f2\i Dutch localization -\f0\i0 \ -Kyunghwan Kim\ - -\f2\i Korean localization -\f0\i0 \ -Mario Klebsch\ - -\f2\i Non-US keyboard support -\f0\i0 \ -Torrey T. Lyons\ - -\f2\i Project Lead -\f0\i0 \ -Andreas Monitzer\ - -\f2\i German localization -\f0\i0 \ -Patrik Montgomery\ - -\f2\i Swedish localization -\f0\i0 \ -Greg Parker\ - -\f2\i Rootless support -\f0\i0 \ -Toshimitsu Tanaka\ - -\f2\i Japanese localization -\f0\i0 \ -Olivier Verdier\ - -\f2\i French localization -\f0\i0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f1\b \cf0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\cf0 Special Thanks: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Devin Poolman and Zero G Software, Inc.\ - -\f2\i Installer -\f0\i0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f1\b \cf0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\cf0 XonX Team Members\ -Contributing to XFree86 4.1: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Rob Braun\ - -\f2\i Darwin x86 support -\f0\i0 \ -Torrey T. Lyons\ - -\f2\i Project Lead -\f0\i0 \ -Andreas Monitzer\ - -\f2\i Cocoa version of XDarwin front end -\f0\i0 \ -Greg Parker\ - -\f2\i Original Quartz implementation -\f0\i0 \ -Christoph Pfisterer\ - -\f2\i Dynamic shared libraries -\f0\i0 \ -Toshimitsu Tanaka\ - -\f2\i Japanese localization -\f0\i0 \ -\ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc - -\f1\b \cf0 Special Thanks: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Tiago Ribeiro\ - -\f2\i XDarwin icon -\f0\i0 \ -\ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc - -\f1\b \cf0 History: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 John Carmack\ - -\f2\i Original XFree86 port to Mac OS X Server -\f0\i0 \ -Dave Zarzycki\ - -\f2\i XFree86 4.0 port to Darwin 1.0 -\f0\i0 \ -Torrey T. Lyons\ - -\f2\i Integration into XFree86 Project for 4.0.2} \ No newline at end of file diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/English.lproj/Imakefile b/nx-X11/programs/Xserver/hw/darwin/bundle/English.lproj/Imakefile deleted file mode 100644 index 66a7a6baf..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/bundle/English.lproj/Imakefile +++ /dev/null @@ -1,34 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/Imakefile,v 1.1 2001/05/21 01:42:17 torrey Exp $ - -#include - -INCLUDES = -I$(SERVERSRC)/include - -#if defined (XorgVersionString) -VERS = XorgVersionString -PRE = XORG_VERSION_SNAP -NAME = "X Version 11" -LINK = 'X.Org Foundation' -#elif defined XFree86VersionString -VERS = XFree86VersionString -PRE = XF86_VERSION_SNAP -NAME = "XFree86" -LINK = 'XFree86 Project, Inc.' -#endif -DATE = XFree86DateString -X_DEFS = $(INCLUDES) -DX_VERSION=$(VERS) -DX_PRE_RELEASE=$(PRE) \ - -DX_REL_DATE=$(DATE) -DX_VENDOR_NAME=$(NAME) -DX_VENDOR_LINK=$(LINK) - -AllTarget(XDarwinHelp.html) -CppFileTarget(XDarwinHelp.html,XDarwinHelp.html.cpp,$(X_DEFS), \ - NullParameter) - -AllTarget(InfoPlist.strings) -InfoPlist.strings: InfoPlist.strings.cpp - RemoveFile($@) - ClearmakeOSName \ - $(CPP) CppNoLineInfoOption $(X_DEFS) $@ - -clean:: - RemoveFiles(InfoPlist.strings) diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp b/nx-X11/programs/Xserver/hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp deleted file mode 100644 index aeb210342..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp +++ /dev/null @@ -1,5 +0,0 @@ -/* English versions of the Info.plist keys; used by most localizations. */ -/* Most of these are set in the target application settings. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp,v 1.3 2002/07/17 01:24:55 torrey Exp $ */ - -NSHumanReadableCopyright = __quote__ X_VENDOR_NAME X_VERSION __quote__; diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/English.lproj/Localizable.strings b/nx-X11/programs/Xserver/hw/darwin/bundle/English.lproj/Localizable.strings deleted file mode 100644 index 2c25c1dc3..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/bundle/English.lproj/Localizable.strings +++ /dev/null @@ -1,23 +0,0 @@ -/* English localized versions of strings used by the Mac OS X front end. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/Localizable.strings,v 1.3 2002/01/30 06:50:46 torrey Exp $ */ - -/* Title of alert panel */ -"Quit X server?" = "Quit X server?"; - -/* Text of alert panel */ -"Quitting the X server will terminate any running X Window System programs." = "Quitting the X server will terminate any running X Window System programs."; - -/* Quit */ -"Quit" = "Quit"; - -/* Cancel */ -"Cancel" = "Cancel"; - -/* Default keymapping file */ -"USA.keymapping" = "USA.keymapping"; - -/* Default switch string */ -"Cmd-Opt-a" = "Cmd-Opt-a"; - -/* Button title when changing switch key */ -"Press key" = "Press key"; diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib b/nx-X11/programs/Xserver/hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib deleted file mode 100644 index 77f345a4e..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib +++ /dev/null @@ -1,72 +0,0 @@ -{ - IBClasses = ( - { - ACTIONS = {showHelp = id; }; - CLASS = FirstResponder; - LANGUAGE = ObjC; - SUPERCLASS = NSObject; - }, - { - ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; }; - CLASS = Preferences; - LANGUAGE = ObjC; - OUTLETS = { - addToPathButton = id; - addToPathField = id; - button2ModifiersMatrix = id; - button3ModifiersMatrix = id; - depthButton = id; - displayField = id; - dockSwitchButton = id; - fakeButton = id; - keymapFileField = id; - modeMatrix = id; - modeWindowButton = id; - mouseAccelChangeButton = id; - startupHelpButton = id; - switchKeyButton = id; - systemBeepButton = id; - useDefaultShellMatrix = id; - useOtherShellField = id; - useXineramaButton = id; - window = id; - }; - SUPERCLASS = NSObject; - }, - { - CLASS = XApplication; - LANGUAGE = ObjC; - OUTLETS = {preferences = id; xserver = id; }; - SUPERCLASS = NSApplication; - }, - { - ACTIONS = { - bringAllToFront = id; - closeHelpAndShow = id; - itemSelected = id; - nextWindow = id; - previousWindow = id; - showAction = id; - showSwitchPanel = id; - startFullScreen = id; - startRootless = id; - }; - CLASS = XServer; - LANGUAGE = ObjC; - OUTLETS = { - dockMenu = NSMenu; - helpWindow = NSWindow; - modeWindow = NSWindow; - startFullScreenButton = NSButton; - startRootlessButton = NSButton; - startupHelpButton = NSButton; - startupModeButton = NSButton; - switchWindow = NSPanel; - windowMenu = NSMenu; - windowSeparator = NSMenuItem; - }; - SUPERCLASS = NSObject; - } - ); - IBVersion = 1; -} \ No newline at end of file diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/English.lproj/MainMenu.nib/objects.nib b/nx-X11/programs/Xserver/hw/darwin/bundle/English.lproj/MainMenu.nib/objects.nib deleted file mode 100644 index ebbfd8317..000000000 Binary files a/nx-X11/programs/Xserver/hw/darwin/bundle/English.lproj/MainMenu.nib/objects.nib and /dev/null differ diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp b/nx-X11/programs/Xserver/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp deleted file mode 100644 index 5996285ae..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp +++ /dev/null @@ -1,96 +0,0 @@ - - - - -XDarwin Help - - -
-

XDarwin X Server for Mac OS X

- X_VENDOR_NAME X_VERSION
- Release Date: X_REL_DATE -
-

Contents

-
    -
  1. Important Notice
  2. -
  3. Usage
  4. -
  5. Setting Your Path
  6. -
  7. User Preferences
  8. -
  9. License
  10. -
-
-

Important Notice

-
-
-#if X_PRE_RELEASE -This is a pre-release version of XDarwin, and is not supported in any way. Bugs may be reported and patches may be submitted to the XonX project page at SourceForge. Before reporting bugs in pre-release versions, please check the latest version from XonX or the X_VENDOR_LINK. -#else -If the server is older than 6-12 months, or if your hardware is newer than the above date, look for a newer version before reporting problems. Bugs may be reported and patches may be submitted to the XonX project page at SourceForge. -#endif -
-
-This software is distributed under the terms of the MIT X11 / X Consortium License and is provided AS IS, with no warranty. Please read the License before using.
- -

Usage

-

XDarwin is a freely redistributable open-source X server for the X Window System. This version of XDarwin was produced by the X_VENDOR_LINK. XDarwin runs on Mac OS X in full screen or rootless modes.

-

In full screen mode, when the X window system is active, it takes over the entire screen. You can switch back to the Mac OS X desktop by holding down Command-Option-A. This key combination can be changed in the user preferences. From the Mac OS X desktop, click on the XDarwin icon in the Dock to switch back to the X window system. (You can change this behavior in the user preferences so that you must click the XDarwin icon in the floating switch window instead.)

-

In rootless mode, the X window system and Aqua share your display. The root window of the X11 display is the size of the screen and contains all the other windows. The X11 root window is not displayed in rootless mode as Aqua handles the desktop background.

-

Multi-Button Mouse Emulation

-

Many X11 applications rely on the use of a 3-button mouse. You can emulate a 3-button mouse with a single button by holding down various modifier keys while you click the mouse button. This is controlled by settings in the "Multi-Button Mouse Emulation" section of the "General" preferences. By default, emulation is on and holding down the command key and clicking the mouse button will simulate clicking the second mouse button. Holding down the option key and clicking will simulate the third button. You can change to any combination of modifiers to emulate buttons two and three in the preferences. Note, even if the modifiers keys are mapped to some other key with xmodmap, you still must use the actual keys specified in the preferences for multi-button mouse emulation.

- -

Setting Your Path

-

Your path is the list of directories to be searched for executable commands. The X11 commands are located in /usr/X11R6/bin, which needs to be added to your path. XDarwin does this for you by default and can also add additional directories where you have installed command line applications.

-

More experienced users will have already set their path correctly using the initialization files for their shell. In this case, you can inform XDarwin not to modify your path in the preferences. XDarwin launches the initial X11 clients in the user's default login shell. (An alternate shell can also be specified in the preferences.) The way to set the path depends on the shell you are using. This is described in the man page documentation for the shell.

-

In addition you may also want to add the X11 man pages to the list of pages to be searched when you are looking for documentation. The X11 man pages are located in /usr/X11R6/man and the MANPATH environment variable contains the list of directories to search.

- -

User Preferences

-

A number of options may be set from the user preferences, accessible from the "Preferences..." menu item in the "XDarwin" menu. The options listed as start up options will not take effect until you have restarted XDarwin. All other options take effect immediately. The various options are described below:

-

General

-
    -
  • Use System beep for X11: When enabled the standard Mac OS X alert sound is used as the X11 bell. When disabled (default) a simple tone is used.
  • -
  • Allow X11 to change mouse acceleration: In a standard X window system implementation, the window manager can change the mouse acceleration. This can lead to confusion as the mouse acceleration may be set to different values by the Mac OS X System Preferences and the X window manager. By default, X11 is not allowed to change the mouse acceleration to avoid this problem.
  • -
  • Multi-Button Mouse Emulation: This is described above under Usage. When emulation is enabled the selected modifiers must be held down when the mouse button is pushed to emulate the second or third mouse buttons.
  • -
-

Start Up

-
    -
  • Default Mode: If the user does not indicate whether to run in full screen or rootless mode, the mode specified here will be used.
  • -
  • Show mode pick panel on startup: By default, a panel is displayed when XDarwin is started to allow the user to choose between full screen or rootless mode. If this option is turned off, the default mode will be started automatically.
  • -
  • X11 Display number: X11 allows there to be multiple displays managed by separate X servers on a single computer. The user may specify an integer display number for XDarwin to use if more than one X server is going to be run simultaneously.
  • -
  • Allow Xinerama multiple monitor support: XDarwin supports multiple monitors with Xinerama, which treats all monitors as being part of one large rectangular screen. You can disable Xinerama with this option, but currently XDarwin does not handle multiple monitors correctly without it. If you only have a single monitor, Xinerama is automatically disabled.
  • -
  • Keymapping File: A keymapping file is read at startup and translated to an X11 keymap. Keymapping files, available for a wide variety of languages, are found in /System/Library/Keyboards.
  • -
  • Starting First X11 Clients: When XDarwin is started from the Finder, it will run xinit to launch the X window manager and other X clients. (See "man xinit" for more information.) Before XDarwin runs xinit it will add the specified directories to the user's path. By default only /usr/X11R6/bin is added. Additional directories may added, separated by a colon. The X clients are started in the user's default login shell so that the user's shell initialization files are read. If desired, an alternate shell may be specified.
  • -
-

Full Screen

-
    -
  • Key combination button: Click this button and then press any number of modifiers followed by a standard key to change the key combination to switch between Aqua and X11.
  • -
  • Click on icon in Dock switches to X11: Enable this to activate switching to X11 by clicking on the XDarwin icon in the Dock. On some versions of Mac OS X, switching by clicking in the Dock can cause the cursor to disappear on returning to Aqua.
  • -
  • Show help on startup: This will show an introductory splash screen when XDarwin is started in full screen mode.
  • -
  • Color bit depth: In full screen mode, the X11 display can use a different color bit depth than is used by Aqua. If "Current" is specified, the depth used by Aqua when XDarwin starts will be used. Otherwise 8, 15, or 24 bits may be specified.
  • -
- -

License

-The main license for XDarwin is based on the traditional MIT X11 / X Consortium License, which does not impose any conditions on modification or redistribution of source code or binaries other than requiring that copyright/license notices are left intact. For more information and additional copyright/licensing notices covering some sections of the code, please refer to the source code. -

X Consortium License

-

Copyright (C) 1996 X Consortium

-

Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without -limitation the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to permit persons to -whom the Software is furnished to do so, subject to the following conditions:

-

The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software.

-

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE.

-

Except as contained in this notice, the name of the X Consortium shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization from -the X Consortium.

-

X Window System is a trademark of X Consortium, Inc.

- - diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/French.lproj/Credits.rtf b/nx-X11/programs/Xserver/hw/darwin/bundle/French.lproj/Credits.rtf deleted file mode 100644 index 17e0a0d70..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/bundle/French.lproj/Credits.rtf +++ /dev/null @@ -1,166 +0,0 @@ -{\rtf1\mac\ansicpg10000\cocoartf102 -{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;\f2\fswiss\fcharset77 Helvetica-Oblique; -} -{\colortbl;\red255\green255\blue255;} -\vieww5160\viewh4480\viewkind0 -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural - -\f0\fs24 \cf0 This product includes software developed by The XFree86 Project, Inc (http://www.xfree86.org/) and its contributors. The following people contributed to Darwin/Mac OS X support.\ -\ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc - -\f1\b \cf0 Contributors to Xorg Foundation Release: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Kaleb KEITHLEY\ - -\f2\i Working left and right Ctrl, Alt (Option), Meta (Command) and Shift keys. -\f0\i0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f1\b \cf0 \ -\f1\b \cf0 Contributors to XFree86 4.4: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 John Harper\ - -\f2\i Rootless acceleration and Apple-WM extension -\f0\i0 \ -Torrey T. Lyons\ - -\f2\i Project Lead -\f0\i0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f1\b \cf0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\cf0 Additional XonX Contributors to XFree86 4.3: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Fabr\'92cio Luis de Castro\ - -\f2\i Portuguese localization -\f0\i0 \ -Michael Oland\ - -\f2\i New XDarwin icon -\f0\i0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc - -\f1\b \cf0 \ -Participants \'88 XonX pour XFree86 4.2 : -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Rob Braun\ - -\f2\i Version pour Darwin x86 -\f0\i0 \ -Pablo Di Noto\ - -\f2\i Traduction en espagnol -\f0\i0 \ -Paul Edens\ - -\f2\i Traduction en allemand -\f0\i0 \ -Kyunghwan Kim\ - -\f2\i Traduction en cor\'8een -\f0\i0 \ -Mario Klebsch\ - -\f2\i Claviers non-US -\f0\i0 \ -Torrey T. Lyons\ - -\f2\i Direction du projet -\f0\i0 \ -Andreas Monitzer\ - -\f2\i Traduction en allemand -\f0\i0 \ -Patrik Montgomery\ - -\f2\i Traduction en su\'8edois -\f0\i0 \ -Greg Parker\ - -\f2\i Version \'c7 rootless \'c8 -\f0\i0 \ -Toshimitsu Tanaka\ - -\f2\i Traduction en japonais -\f0\i0 \ -Olivier Verdier\ - -\f2\i Traduction en fran\'8dais -\f0\i0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f1\b \cf0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\cf0 Remerciements : -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Devin Poolman et Zero G Software, Inc.\ - -\f2\i Installeur -\f0\i0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f1\b \cf0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\cf0 Participants \'88 XonX pour XFree86 4.2 : -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Rob Braun\ - -\f2\i Version pour Darwin x86 -\f0\i0 \ -Torrey T. Lyons\ - -\f2\i Direction du projet -\f0\i0 \ -Andreas Monitzer\ - -\f2\i Version Cocoa de l'interface de XDarwin -\f0\i0 \ -Greg Parker\ - -\f2\i Impl\'8ementation initiale sur Quartz -\f0\i0 \ -Christoph Pfisterer\ - -\f2\i Librairies partag\'8ees dynamiquement -\f0\i0 \ -Toshimitsu Tanaka\ - -\f2\i Traduction en japonais -\f0\i0 \ -\ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc - -\f1\b \cf0 Remerciements : -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Tiago Ribeiro\ - Ic\'99ne -\f2\i XDarwin -\f0\i0 \ -\ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc - -\f1\b \cf0 Historique : -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 John Carmack\ - -\f2\i Premi\'8fre adaptation de XFree86 sur Mac OS X Server -\f0\i0 \ -Dave Zarzycki\ - -\f2\i Adaptation de Free86 4.0 pour Darwin 1.0 -\f0\i0 \ -Torrey T. Lyons\ - -\f2\i Int\'8egration dans le projet XFree86 pour la version 4.0.2} \ No newline at end of file diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/French.lproj/Imakefile b/nx-X11/programs/Xserver/hw/darwin/bundle/French.lproj/Imakefile deleted file mode 100644 index d367fbcee..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/bundle/French.lproj/Imakefile +++ /dev/null @@ -1,36 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/Imakefile,v 1.1 2001/05/21 01:42:17 torrey Exp $ - -#include - -LinkSourceFile(InfoPlist.strings.cpp,../English.lproj) - -INCLUDES = -I$(SERVERSRC)/include - -#if defined (XorgVersionString) -VERS = XorgVersionString -PRE = XORG_VERSION_SNAP -NAME = "X Version 11" -LINK = 'X.Org Foundation' -#elif defined XFree86VersionString -VERS = XFree86VersionString -PRE = XF86_VERSION_SNAP -NAME = "XFree86" -LINK = 'XFree86 Project, Inc.' -#endif -DATE = XFree86DateString -X_DEFS = $(INCLUDES) -DX_VERSION=$(VERS) -DX_PRE_RELEASE=$(PRE) \ - -DX_REL_DATE=$(DATE) -DX_VENDOR_NAME=$(NAME) -DX_VENDOR_LINK=$(LINK) - -AllTarget(XDarwinHelp.html) -CppFileTarget(XDarwinHelp.html,XDarwinHelp.html.cpp,$(X_DEFS), \ - NullParameter) - -AllTarget(InfoPlist.strings) -InfoPlist.strings: InfoPlist.strings.cpp - RemoveFile($@) - ClearmakeOSName \ - $(CPP) CppNoLineInfoOption $(X_DEFS) $@ - -clean:: - RemoveFiles(InfoPlist.strings) diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/French.lproj/Localizable.strings b/nx-X11/programs/Xserver/hw/darwin/bundle/French.lproj/Localizable.strings deleted file mode 100644 index 21c4a99c1..000000000 Binary files a/nx-X11/programs/Xserver/hw/darwin/bundle/French.lproj/Localizable.strings and /dev/null differ diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/French.lproj/MainMenu.nib/classes.nib b/nx-X11/programs/Xserver/hw/darwin/bundle/French.lproj/MainMenu.nib/classes.nib deleted file mode 100644 index 77f345a4e..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/bundle/French.lproj/MainMenu.nib/classes.nib +++ /dev/null @@ -1,72 +0,0 @@ -{ - IBClasses = ( - { - ACTIONS = {showHelp = id; }; - CLASS = FirstResponder; - LANGUAGE = ObjC; - SUPERCLASS = NSObject; - }, - { - ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; }; - CLASS = Preferences; - LANGUAGE = ObjC; - OUTLETS = { - addToPathButton = id; - addToPathField = id; - button2ModifiersMatrix = id; - button3ModifiersMatrix = id; - depthButton = id; - displayField = id; - dockSwitchButton = id; - fakeButton = id; - keymapFileField = id; - modeMatrix = id; - modeWindowButton = id; - mouseAccelChangeButton = id; - startupHelpButton = id; - switchKeyButton = id; - systemBeepButton = id; - useDefaultShellMatrix = id; - useOtherShellField = id; - useXineramaButton = id; - window = id; - }; - SUPERCLASS = NSObject; - }, - { - CLASS = XApplication; - LANGUAGE = ObjC; - OUTLETS = {preferences = id; xserver = id; }; - SUPERCLASS = NSApplication; - }, - { - ACTIONS = { - bringAllToFront = id; - closeHelpAndShow = id; - itemSelected = id; - nextWindow = id; - previousWindow = id; - showAction = id; - showSwitchPanel = id; - startFullScreen = id; - startRootless = id; - }; - CLASS = XServer; - LANGUAGE = ObjC; - OUTLETS = { - dockMenu = NSMenu; - helpWindow = NSWindow; - modeWindow = NSWindow; - startFullScreenButton = NSButton; - startRootlessButton = NSButton; - startupHelpButton = NSButton; - startupModeButton = NSButton; - switchWindow = NSPanel; - windowMenu = NSMenu; - windowSeparator = NSMenuItem; - }; - SUPERCLASS = NSObject; - } - ); - IBVersion = 1; -} \ No newline at end of file diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/French.lproj/MainMenu.nib/objects.nib b/nx-X11/programs/Xserver/hw/darwin/bundle/French.lproj/MainMenu.nib/objects.nib deleted file mode 100644 index 109d5cc6f..000000000 Binary files a/nx-X11/programs/Xserver/hw/darwin/bundle/French.lproj/MainMenu.nib/objects.nib and /dev/null differ diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/French.lproj/XDarwinHelp.html.cpp b/nx-X11/programs/Xserver/hw/darwin/bundle/French.lproj/XDarwinHelp.html.cpp deleted file mode 100644 index 2a14793db..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/bundle/French.lproj/XDarwinHelp.html.cpp +++ /dev/null @@ -1,101 +0,0 @@ - - - - -XDarwin Help - - -
-

XDarwin X Server pour Mac OS X

- X_VENDOR_NAME X_VERSION
- Date : X_REL_DATE -
-

Sommaire

-
    -
  1. Avertissement
  2. -
  3. Utilisation
  4. -
  5. Chemins d'accès
  6. -
  7. Préférences
  8. -
  9. Licence
  10. -
-
-

Avertissement

-
-
-#if PRE_RELEASE -Ceci est une pré-version de XDarwin et ne fait par conséquent l'objet d'aucun support client. Les bogues peuvent être signalés et des patches peuvent être soumis sur la -page du projet XonX chez SourceForge. Veuillez prendre connaissance de la dernière version sur XonX ou le X_VENDOR_LINK avant de signaler un bogue d'une pré-version. -#else -Si le serveur date de plus de 6-12 mois ou si votre matériel est plus récent que la date indiquée ci-dessus, veuillez vous procurer une version plus récente avant de signaler toute anomalie. Les bogues peuvent être signalés et des patches peuvent être soumis sur la page du projet XonX chez SourceForge. -#endif -
-
-Ce logiciel est distribué sous la -Licence du Consortium X/X11 du MIT et est fourni TEL QUEL, sans garanties. Veuillez prendre connaissance de la Licence avant toute utilisation.
- -

Utilisation

-

XDarwin est une X server libre et distribuable sans contrainte du X Window System. This version of XDarwin was produced by the X_VENDOR_LINK. XDarwin fonctionne sous Mac OS X en mode « rootless » ou plein écran.

-

Lorsque le système X window est actif en mode plein écran, il prend en charge la totalité de l'écran. Il est possible de revenir sur le bureau de Mac OS X en appuyant sur Commande-Option-A. Cette combinaison de touches peut être modifiée dans les préférences. Pour revenir dans X window, cliquer sur l'icône de XDarwin dans le Dock de Mac OS X. (Un réglage des préférences permet d'effectuer cette opération en cliquant dans une fenêtre flottante au lieu de l'icône du Dock)

-

En mode « rootless », X window system et Aqua utilisent le même affichage. La fenêtre-mère de l'affichage X11 est de la taille de l'écran et contient toutes les autre fenêtres. En mode « rootless » cette fenêtre-mère n'est pas affichée car Aqua gère le fond d'écran.

-

Émulation de souris à plusieurs boutons

-

Le fonctionnement de la plupart des applications X11 repose sur l'utilisation d'une souris à 3 boutons. Il est possible d'émuler une souris à 3 boutons avec un seul bouton en appuyant sur des touches de modification. Ceci est réglé dans la section "Émulation de souris à plusieurs boutons" de l'onglet "Général" des préférences. L'émulation est activée par défaut. Dans ce cas, cliquer en appuyant simultanément sur la touche "commande" simulera le bouton du milieu. Cliquer en appuyant simultanément sur la touche "option" simulera le bouton de droite. Les préférences permettent de régler n'importe quelle combinaison de touches de modification pour émuler les boutons du milieu et de droite. Notez que même si les touches de modifications sont mises en correspondance avec d'autres touches par xmodmap, ce sont les touches originelles spécifiées dans les préférences qui assureront l'émulation d'une souris à plusieurs boutons. - -

Réglage du chemin d'accès

-

Le chemin d'accès est une liste de répertoires utilisés pour la recherche d'exécutables. Les commandes X11 sont situées dans /usr/X11R6/bin, qui doit être ajouté à votre chemin d'accès. XDarwin fait cela par défaut, et peut également ajouter d'autres répertoires dans lesquels vous auriez installé d'autre commandes unix.

-

Les utilisateurs plus expérimentés auront déjà réglé leur chemin d'accès correctement par le biais des fichiers d'initialisation de leur shell. Dans ce cas, il est possible de demander à XDarwin de ne pas modifier le chemin d'accès initial. XDarwin lance les premiers clients X11 dans le shell d'ouverture de session par défaut. (Un shell de remplacement peut être spécifié dans les préférences.) La façon de régler le chemin d'accès dépend du shell utilisé. Ceci est documenté dans les pages "man" du shell.

-

De plus, il est possible d'ajouter les pages "man" de X11 à la liste des pages recherchées pour la documentation "man". Les pages "man" X11 se trouvent dans /usr/X11R6/man et la variable d'environnement MANPATH contient la liste des répertoires dans lesquels chercher.

- - -

Préférences

-

Un certain nombre d'options peuvent être réglées dans les préférences. On accède aux préférences en choisissant "Préférences..." dans le menu "XDarwin". Les options décrites comme options de démarrage ne prendront pas effet avant le redémarrage de XDarwin. Les autres options prennent immédiatement effet. Les différentes options sont détaillées ci-après :

-

Général

-
    -
  • Utiliser le bip d'alerte Système dans X11 : Cocher cette option pour que le son d'alerte standard de Mac OS X soit utilisé à la place du son d'alerte de X11. L'option n'est pas cochée ar défaut. Dans ce cas, un simple signal sonore est utilisé.
  • -
  • Autoriser X11 à changer la vitesse de la souris : Dans une implémentation classique du sytème X window, le gestionnaire de fenêtres peut modifier la vitesse de la souris. Cela peut s'avérer déroutant puisque le réglage de la vitesse de la souris peut être différent dans les préférences de Mac OS X et dans le gestionnaire X window. Par défaut, X11 n'est pas autorisé à changer la vitesse de la souris.
  • -
  • Émulation de souris à plusieurs boutons : Ceci est décrit ci-dessus à la rubrique Usage. Lorsque l'émulation est activée, il suffit d'appuyer simultanément sur les touches modificatrices sélectionnées et sur le bouton de la souris afin d'émuler les boutons du milieu et de droite.
  • -
-

Démarrage

-
    -
  • Mode par défaut : Le mode spécifié à cet endroit sera utilisé si l'utilisateur ne l'indique pas au démarrage.
  • -
  • Choix du mode d'affichage au démarrage Par défaut, une fenêtre de dialogue est affichée au démarrage de XDarwin pour permettre à l'utilisateur de choisir entre le mode plein écran et le mode « rootless ». Si cette option est désactivée, le mode par défaut sera automatiquement utilisé.
  • -
  • Numéro d'affichage (Display) X11 offre la possibilité de plusieurs serveurs X sur un ordinateur. L'utilisateur doit spécifier ici le numéro d'affichage utilisé par XDarwin dans le cas où plusieurs serveurs X seraient en service simultanément.
  • -
  • Autoriser la prise en charge Xinerama de plusieurs moniteurs : XDarwin peut être utilisé avec plusieurs moniteur avec Xinerama, qui considère les différents moniteurs comme des parties d'un écran rectugulaire plus grand. Cette option permet de désactiver Xinerama mais XDarwin ne prend alors pour l'instant pas correctement en charge l'affichage sur plusieurs écrans. Si il n'y a qu'un seul moniteur, Xinerama est automatiquement désactivé.
  • -
  • Fichier clavier : Un fichier de correspondance de clavier est lu au démarrage puis transformé en un fihcier de correspondance clavier pour X11. Les fichiers de correspondance clavier, disponibles pour de nombreuses langues, se trouvent dans /System/Library/Keyboards.
  • -
  • Démarrage des premiers clients X11 : Lorsque XDarwin est démarré à partir du Finder, il lance xinit qui lance à son tour le gestionnaire X window ainsi que d'autres clients X. (Voir "man xinit" pour plus d'informations.) Avant de lancer xinit, XDarwin ajoute les répertoires ainsi spécifiés au chemin d'accès de l'utilisateur. Par défaut, seul /usr/X11R6/bin est ajouté. Il est possible d'ajouter d'autres répertoires en les séparants à l'aide de deux points (:). Les clients X sont démarrés à partir du shell par défaut de l'utilisateur. Ainsi, le fichier d'initialisation de shell de l'utilisateur est lu. Un autre shell peut éventuellement être spécifié.
  • -
-

Plein écran

-
    -
  • Combinaison de touches : Appuyer sur ce bouton, puis appuyer sur une ou plusieurs touches modificatrices suivies d'une touche ordinaire. Cette combinaison de touche servira à commuter entre Aqua et X11.
  • -
  • Basculer dans X11 en cliquant sur l'icône du Dock : Cette option permet de passer dans X11 en cliquant dans l'icône de XDarwin dans le Dock. Sur certaines versions de Mac OS X, la commutation en utilisant le Dock peut faire disparaître le curseur lors du retour dans Aqua.
  • -
  • Afficher l'aide du mode plein écran au démarrage : Permet l'affichage d'une fenêtre d'introduction lorsque XDarwin est démarré en mode plein écran.
  • -
  • Profondeur de couleur : En mode plein écran, l'affichage X11 peut utiliser une autre profondeur de couleur que celle employée par Aqua. Si "Actuelle" est choisi, XDarwin utilisera la même profondeur de couleur qu'Aqua. Les autres choix sont 8 (256 couleurs), 15 (milliers de couleurs) et 24 bits (millions de couleurs).
  • -
- -

Licence

-The main license for XDarwin is one based on the traditional MIT X11 / X Consortium License, which does not impose any conditions on modification or redistribution of source code or binaries other than requiring that copyright/license notices are left intact. For more information and additional copyright/licensing notices covering some sections of the code, please refer to the source code. -

X Consortium License

-

Copyright (C) 1996 X Consortium

-

Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without -limitation the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to permit persons to -whom the Software is furnished to do so, subject to the following conditions:

-

The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software.

-

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE.

-

Except as contained in this notice, the name of the X Consortium shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization from -the X Consortium.

-

X Window System is a trademark of X Consortium, Inc.

- - - diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/German.lproj/Credits.rtf b/nx-X11/programs/Xserver/hw/darwin/bundle/German.lproj/Credits.rtf deleted file mode 100644 index 34408e78c..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/bundle/German.lproj/Credits.rtf +++ /dev/null @@ -1,168 +0,0 @@ -{\rtf1\mac\ansicpg10000\cocoartf102 -{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;\f2\fswiss\fcharset77 Helvetica-Oblique; -} -{\colortbl;\red255\green255\blue255;} -\vieww5160\viewh6300\viewkind0 -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural - -\f0\fs24 \cf0 This product includes software developed by The XFree86 Project, Inc (http://www.xfree86.org/) and its contributors. The following people contributed to Darwin/Mac OS X support.\ -\ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc - -\f1\b \cf0 Contributors to Xorg Foundation Release: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Kaleb KEITHLEY\ - -\f2\i Working left and right Ctrl, Alt (Option), Meta (Command) and Shift keys. -\f0\i0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f1\b \cf0 \ -\f1\b \cf0 Contributors to XFree86 4.4: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 John Harper\ - -\f2\i Rootless acceleration and Apple-WM extension -\f0\i0 \ -Torrey T. Lyons\ - -\f2\i Project Lead -\f0\i0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f1\b \cf0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\cf0 Additional XonX Contributors to XFree86 4.3: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Fabr\'92cio Luis de Castro\ - -\f2\i Portuguese localization -\f0\i0 \ -Michael Oland\ - -\f2\i New XDarwin icon -\f0\i0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f1\b \cf0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\cf0 XonX Contributors to XFree86 4.2: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Rob Braun\ - -\f2\i Darwin x86 support -\f0\i0 \ -Pablo Di Noto\ - -\f2\i Spanish localization -\f0\i0 \ -Paul Edens\ - -\f2\i Dutch localization -\f0\i0 \ -Kyunghwan Kim\ - -\f2\i Korean localization -\f0\i0 \ -Mario Klebsch\ - -\f2\i Non-US keyboard support -\f0\i0 \ -Torrey T. Lyons\ - -\f2\i Project Lead -\f0\i0 \ -Andreas Monitzer\ - -\f2\i German localization -\f0\i0 \ -Patrik Montgomery\ - -\f2\i Swedish localization -\f0\i0 \ -Greg Parker\ - -\f2\i Rootless support -\f0\i0 \ -Toshimitsu Tanaka\ - -\f2\i Japanese localization -\f0\i0 \ -Olivier Verdier\ - -\f2\i French localization -\f0\i0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f1\b \cf0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\cf0 Special Thanks: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Devin Poolman and Zero G Software, Inc.\ - -\f2\i Installer -\f0\i0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f1\b \cf0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\cf0 XonX Team Members\ -Contributing to XFree86 4.1: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Rob Braun\ - -\f2\i Darwin x86 support -\f0\i0 \ -Torrey T. Lyons\ - -\f2\i Project Lead -\f0\i0 \ -Andreas Monitzer\ - -\f2\i Cocoa version of XDarwin front end -\f0\i0 \ -Greg Parker\ - -\f2\i Original Quartz implementation -\f0\i0 \ -Christoph Pfisterer\ - -\f2\i Dynamic shared libraries -\f0\i0 \ -Toshimitsu Tanaka\ - -\f2\i Japanese localization -\f0\i0 \ -\ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc - -\f1\b \cf0 Special Thanks: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Tiago Ribeiro\ - -\f2\i XDarwin icon -\f0\i0 \ -\ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc - -\f1\b \cf0 History: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 John Carmack\ - -\f2\i Original XFree86 port to Mac OS X Server -\f0\i0 \ -Dave Zarzycki\ - -\f2\i XFree86 4.0 port to Darwin 1.0 -\f0\i0 \ -Torrey T. Lyons\ - -\f2\i Integration into XFree86 Project for 4.0.2} \ No newline at end of file diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/German.lproj/Imakefile b/nx-X11/programs/Xserver/hw/darwin/bundle/German.lproj/Imakefile deleted file mode 100644 index d367fbcee..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/bundle/German.lproj/Imakefile +++ /dev/null @@ -1,36 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/Imakefile,v 1.1 2001/05/21 01:42:17 torrey Exp $ - -#include - -LinkSourceFile(InfoPlist.strings.cpp,../English.lproj) - -INCLUDES = -I$(SERVERSRC)/include - -#if defined (XorgVersionString) -VERS = XorgVersionString -PRE = XORG_VERSION_SNAP -NAME = "X Version 11" -LINK = 'X.Org Foundation' -#elif defined XFree86VersionString -VERS = XFree86VersionString -PRE = XF86_VERSION_SNAP -NAME = "XFree86" -LINK = 'XFree86 Project, Inc.' -#endif -DATE = XFree86DateString -X_DEFS = $(INCLUDES) -DX_VERSION=$(VERS) -DX_PRE_RELEASE=$(PRE) \ - -DX_REL_DATE=$(DATE) -DX_VENDOR_NAME=$(NAME) -DX_VENDOR_LINK=$(LINK) - -AllTarget(XDarwinHelp.html) -CppFileTarget(XDarwinHelp.html,XDarwinHelp.html.cpp,$(X_DEFS), \ - NullParameter) - -AllTarget(InfoPlist.strings) -InfoPlist.strings: InfoPlist.strings.cpp - RemoveFile($@) - ClearmakeOSName \ - $(CPP) CppNoLineInfoOption $(X_DEFS) $@ - -clean:: - RemoveFiles(InfoPlist.strings) diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/German.lproj/Localizable.strings b/nx-X11/programs/Xserver/hw/darwin/bundle/German.lproj/Localizable.strings deleted file mode 100644 index 5db6306ec..000000000 Binary files a/nx-X11/programs/Xserver/hw/darwin/bundle/German.lproj/Localizable.strings and /dev/null differ diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/German.lproj/MainMenu.nib/classes.nib b/nx-X11/programs/Xserver/hw/darwin/bundle/German.lproj/MainMenu.nib/classes.nib deleted file mode 100644 index 77f345a4e..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/bundle/German.lproj/MainMenu.nib/classes.nib +++ /dev/null @@ -1,72 +0,0 @@ -{ - IBClasses = ( - { - ACTIONS = {showHelp = id; }; - CLASS = FirstResponder; - LANGUAGE = ObjC; - SUPERCLASS = NSObject; - }, - { - ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; }; - CLASS = Preferences; - LANGUAGE = ObjC; - OUTLETS = { - addToPathButton = id; - addToPathField = id; - button2ModifiersMatrix = id; - button3ModifiersMatrix = id; - depthButton = id; - displayField = id; - dockSwitchButton = id; - fakeButton = id; - keymapFileField = id; - modeMatrix = id; - modeWindowButton = id; - mouseAccelChangeButton = id; - startupHelpButton = id; - switchKeyButton = id; - systemBeepButton = id; - useDefaultShellMatrix = id; - useOtherShellField = id; - useXineramaButton = id; - window = id; - }; - SUPERCLASS = NSObject; - }, - { - CLASS = XApplication; - LANGUAGE = ObjC; - OUTLETS = {preferences = id; xserver = id; }; - SUPERCLASS = NSApplication; - }, - { - ACTIONS = { - bringAllToFront = id; - closeHelpAndShow = id; - itemSelected = id; - nextWindow = id; - previousWindow = id; - showAction = id; - showSwitchPanel = id; - startFullScreen = id; - startRootless = id; - }; - CLASS = XServer; - LANGUAGE = ObjC; - OUTLETS = { - dockMenu = NSMenu; - helpWindow = NSWindow; - modeWindow = NSWindow; - startFullScreenButton = NSButton; - startRootlessButton = NSButton; - startupHelpButton = NSButton; - startupModeButton = NSButton; - switchWindow = NSPanel; - windowMenu = NSMenu; - windowSeparator = NSMenuItem; - }; - SUPERCLASS = NSObject; - } - ); - IBVersion = 1; -} \ No newline at end of file diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/German.lproj/MainMenu.nib/objects.nib b/nx-X11/programs/Xserver/hw/darwin/bundle/German.lproj/MainMenu.nib/objects.nib deleted file mode 100644 index 28fff8920..000000000 Binary files a/nx-X11/programs/Xserver/hw/darwin/bundle/German.lproj/MainMenu.nib/objects.nib and /dev/null differ diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/German.lproj/XDarwinHelp.html.cpp b/nx-X11/programs/Xserver/hw/darwin/bundle/German.lproj/XDarwinHelp.html.cpp deleted file mode 100644 index 5996285ae..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/bundle/German.lproj/XDarwinHelp.html.cpp +++ /dev/null @@ -1,96 +0,0 @@ - - - - -XDarwin Help - - -
-

XDarwin X Server for Mac OS X

- X_VENDOR_NAME X_VERSION
- Release Date: X_REL_DATE -
-

Contents

-
    -
  1. Important Notice
  2. -
  3. Usage
  4. -
  5. Setting Your Path
  6. -
  7. User Preferences
  8. -
  9. License
  10. -
-
-

Important Notice

-
-
-#if X_PRE_RELEASE -This is a pre-release version of XDarwin, and is not supported in any way. Bugs may be reported and patches may be submitted to the XonX project page at SourceForge. Before reporting bugs in pre-release versions, please check the latest version from XonX or the X_VENDOR_LINK. -#else -If the server is older than 6-12 months, or if your hardware is newer than the above date, look for a newer version before reporting problems. Bugs may be reported and patches may be submitted to the XonX project page at SourceForge. -#endif -
-
-This software is distributed under the terms of the MIT X11 / X Consortium License and is provided AS IS, with no warranty. Please read the License before using.
- -

Usage

-

XDarwin is a freely redistributable open-source X server for the X Window System. This version of XDarwin was produced by the X_VENDOR_LINK. XDarwin runs on Mac OS X in full screen or rootless modes.

-

In full screen mode, when the X window system is active, it takes over the entire screen. You can switch back to the Mac OS X desktop by holding down Command-Option-A. This key combination can be changed in the user preferences. From the Mac OS X desktop, click on the XDarwin icon in the Dock to switch back to the X window system. (You can change this behavior in the user preferences so that you must click the XDarwin icon in the floating switch window instead.)

-

In rootless mode, the X window system and Aqua share your display. The root window of the X11 display is the size of the screen and contains all the other windows. The X11 root window is not displayed in rootless mode as Aqua handles the desktop background.

-

Multi-Button Mouse Emulation

-

Many X11 applications rely on the use of a 3-button mouse. You can emulate a 3-button mouse with a single button by holding down various modifier keys while you click the mouse button. This is controlled by settings in the "Multi-Button Mouse Emulation" section of the "General" preferences. By default, emulation is on and holding down the command key and clicking the mouse button will simulate clicking the second mouse button. Holding down the option key and clicking will simulate the third button. You can change to any combination of modifiers to emulate buttons two and three in the preferences. Note, even if the modifiers keys are mapped to some other key with xmodmap, you still must use the actual keys specified in the preferences for multi-button mouse emulation.

- -

Setting Your Path

-

Your path is the list of directories to be searched for executable commands. The X11 commands are located in /usr/X11R6/bin, which needs to be added to your path. XDarwin does this for you by default and can also add additional directories where you have installed command line applications.

-

More experienced users will have already set their path correctly using the initialization files for their shell. In this case, you can inform XDarwin not to modify your path in the preferences. XDarwin launches the initial X11 clients in the user's default login shell. (An alternate shell can also be specified in the preferences.) The way to set the path depends on the shell you are using. This is described in the man page documentation for the shell.

-

In addition you may also want to add the X11 man pages to the list of pages to be searched when you are looking for documentation. The X11 man pages are located in /usr/X11R6/man and the MANPATH environment variable contains the list of directories to search.

- -

User Preferences

-

A number of options may be set from the user preferences, accessible from the "Preferences..." menu item in the "XDarwin" menu. The options listed as start up options will not take effect until you have restarted XDarwin. All other options take effect immediately. The various options are described below:

-

General

-
    -
  • Use System beep for X11: When enabled the standard Mac OS X alert sound is used as the X11 bell. When disabled (default) a simple tone is used.
  • -
  • Allow X11 to change mouse acceleration: In a standard X window system implementation, the window manager can change the mouse acceleration. This can lead to confusion as the mouse acceleration may be set to different values by the Mac OS X System Preferences and the X window manager. By default, X11 is not allowed to change the mouse acceleration to avoid this problem.
  • -
  • Multi-Button Mouse Emulation: This is described above under Usage. When emulation is enabled the selected modifiers must be held down when the mouse button is pushed to emulate the second or third mouse buttons.
  • -
-

Start Up

-
    -
  • Default Mode: If the user does not indicate whether to run in full screen or rootless mode, the mode specified here will be used.
  • -
  • Show mode pick panel on startup: By default, a panel is displayed when XDarwin is started to allow the user to choose between full screen or rootless mode. If this option is turned off, the default mode will be started automatically.
  • -
  • X11 Display number: X11 allows there to be multiple displays managed by separate X servers on a single computer. The user may specify an integer display number for XDarwin to use if more than one X server is going to be run simultaneously.
  • -
  • Allow Xinerama multiple monitor support: XDarwin supports multiple monitors with Xinerama, which treats all monitors as being part of one large rectangular screen. You can disable Xinerama with this option, but currently XDarwin does not handle multiple monitors correctly without it. If you only have a single monitor, Xinerama is automatically disabled.
  • -
  • Keymapping File: A keymapping file is read at startup and translated to an X11 keymap. Keymapping files, available for a wide variety of languages, are found in /System/Library/Keyboards.
  • -
  • Starting First X11 Clients: When XDarwin is started from the Finder, it will run xinit to launch the X window manager and other X clients. (See "man xinit" for more information.) Before XDarwin runs xinit it will add the specified directories to the user's path. By default only /usr/X11R6/bin is added. Additional directories may added, separated by a colon. The X clients are started in the user's default login shell so that the user's shell initialization files are read. If desired, an alternate shell may be specified.
  • -
-

Full Screen

-
    -
  • Key combination button: Click this button and then press any number of modifiers followed by a standard key to change the key combination to switch between Aqua and X11.
  • -
  • Click on icon in Dock switches to X11: Enable this to activate switching to X11 by clicking on the XDarwin icon in the Dock. On some versions of Mac OS X, switching by clicking in the Dock can cause the cursor to disappear on returning to Aqua.
  • -
  • Show help on startup: This will show an introductory splash screen when XDarwin is started in full screen mode.
  • -
  • Color bit depth: In full screen mode, the X11 display can use a different color bit depth than is used by Aqua. If "Current" is specified, the depth used by Aqua when XDarwin starts will be used. Otherwise 8, 15, or 24 bits may be specified.
  • -
- -

License

-The main license for XDarwin is based on the traditional MIT X11 / X Consortium License, which does not impose any conditions on modification or redistribution of source code or binaries other than requiring that copyright/license notices are left intact. For more information and additional copyright/licensing notices covering some sections of the code, please refer to the source code. -

X Consortium License

-

Copyright (C) 1996 X Consortium

-

Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without -limitation the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to permit persons to -whom the Software is furnished to do so, subject to the following conditions:

-

The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software.

-

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE.

-

Except as contained in this notice, the name of the X Consortium shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization from -the X Consortium.

-

X Window System is a trademark of X Consortium, Inc.

- - diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/Imakefile b/nx-X11/programs/Xserver/hw/darwin/bundle/Imakefile deleted file mode 100644 index 5c50dd296..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/bundle/Imakefile +++ /dev/null @@ -1,15 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/darwin/bundle/Imakefile,v 1.24 2002/02/17 03:15:18 torrey Exp $ - -#include -#define IHaveSubdirs - -SUBDIRS = Dutch.lproj English.lproj French.lproj German.lproj Japanese.lproj \ - ko.lproj Portuguese.lproj Spanish.lproj Swedish.lproj - -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) - -AllTarget(startXClients) -MakeScriptFromCpp(startXClients, -DXINITDIR=$(XINITDIR) -DXBINDIR=$(BINDIR)) - -DependTarget() diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/Japanese.lproj/Credits.rtf b/nx-X11/programs/Xserver/hw/darwin/bundle/Japanese.lproj/Credits.rtf deleted file mode 100644 index cf9eae207..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/bundle/Japanese.lproj/Credits.rtf +++ /dev/null @@ -1,193 +0,0 @@ -{\rtf1\mac\ansicpg10001\cocoartf102 -{\fonttbl\f0\fnil\fcharset78 HiraKakuPro-W3;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Bold; -\f3\fswiss\fcharset77 Helvetica-Oblique;} -{\colortbl;\red255\green255\blue255;} -\vieww13980\viewh11160\viewkind0 -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural - -\f0\fs24 \cf0 \'82\'b1\'82\'cc\'90\'bb\'95\'69\'82\'cd -\f1 XFree86 -\f0 \'83\'76\'83\'8d\'83\'57\'83\'46\'83\'4e\'83\'67 -\f1 (http://www.xfree86.org/) -\f0 \'82\'a8\'82\'e6\'82\'d1\'82\'bb\'82\'cc\'8d\'76\'8c\'a3\'8e\'d2\'82\'c9\'82\'e6\'82\'c1\'82\'c4\'8a\'4a\'94\'ad\'82\'b3\'82\'ea\'82\'bd\'83\'5c\'83\'74\'83\'67\'83\'45\'83\'46\'83\'41\'82\'f0\'8a\'dc\'82\'f1\'82\'c5\'82\'a2\'82\'dc\'82\'b7\'81\'42\'8e\'9f\'82\'cc\'90\'6c\'81\'58\'82\'cd Darwin -\f1 /Mac OS X -\f0 \'82\'cc\'83\'54\'83\'7c\'81\'5b\'83\'67\'82\'c9\'8d\'76\'8c\'a3\'82\'b5\'82\'dc\'82\'b5\'82\'bd\'81\'42 -\f1 \ -\ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc - -\f2\b \cf0 Contributors to Xorg Foundation Release: -\f1\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Kaleb KEITHLEY\ - -\f0 \'8d\'b6\'89\'45\'82\'cc Ctrl,Alt(Option),Meta(Command) \'82\'a8\'82\'e6\'82\'d1 Shift \'83\'4c\'81\'5b\'82\'cc\'93\'ae\'8d\'ec -\f1 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f2\b \cf0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\cf0 Contributors to XFree86 4.4: -\f1\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 John Harper -\f3\i \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f0\i0 \cf0 \'83\'8b\'81\'5b\'83\'67\'83\'8c\'83\'58 \'83\'41\'83\'4e\'83\'5a\'83\'89\'83\'8c\'81\'5b\'83\'56\'83\'87\'83\'93 \'82\'a8\'82\'e6\'82\'d1 Apple-WM \'8a\'67\'92\'a3 -\f1 \ -Torrey T. Lyons\ - -\f0 \'83\'76\'83\'8d\'83\'57\'83\'46\'83\'4e\'83\'67 \'83\'8a\'81\'5b\'83\'5f\'81\'5b\ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f2\b \cf0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\cf0 Additional XonX Contributors to XFree86 4.3: -\f1\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Fabr\'92cio Luis de Castro\ - -\f0 \'83\'7c\'83\'8b\'83\'67\'83\'4b\'83\'8b\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59 -\f1 \ -Michael Oland\ - -\f0 \'90\'56\'82\'b5\'82\'a2 -\f1 XDarwin -\f0 \'83\'41\'83\'43\'83\'52\'83\'93 -\f1 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f2\b \cf0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\cf0 XonX Contributors to XFree86 4.2: -\f1\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Rob Braun\ - Darwin x86 -\f3\i -\f0\i0 \'83\'54\'83\'7c\'81\'5b\'83\'67 -\f1 \ -Pablo Di Noto\ - -\f3\i -\f0\i0 \'83\'58\'83\'79\'83\'43\'83\'93\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59 -\f1 \ -Paul Edens\ - -\f3\i -\f0\i0 \'83\'49\'83\'89\'83\'93\'83\'5f\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59 -\f1 \ -Kyunghwan Kim\ - -\f3\i -\f0\i0 \'8a\'d8\'8d\'91\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59 -\f1 \ -Mario Klebsch\ - -\f0 \'94\'f1US\'83\'4c\'81\'5b\'83\'7b\'81\'5b\'83\'68 \'83\'54\'83\'7c\'81\'5b\'83\'67 -\f1 \ -Torrey T. Lyons\ - -\f0 \'83\'76\'83\'8d\'83\'57\'83\'46\'83\'4e\'83\'67 \'83\'8a\'81\'5b\'83\'5f\'81\'5b -\f1 \ -Andreas Monitzer\ - -\f0 \'83\'68\'83\'43\'83\'63\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59 -\f1 \ -Patrik Montgomery\ - -\f3\i -\f0\i0 \'83\'58\'83\'45\'83\'46\'81\'5b\'83\'66\'83\'93\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59 -\f1 \ -Greg Parker\ - -\f0 \'83\'8b\'81\'5b\'83\'67\'83\'8c\'83\'58 \'83\'54\'83\'7c\'81\'5b\'83\'67 -\f1 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f0 \cf0 \'93\'63\'92\'86 \'8f\'72\'8c\'f5 -\f1 \ - -\f0 \'93\'fa\'96\'7b\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59 -\f1 \ -Olivier Verdier\ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f3\i \cf0 -\f0\i0 \'83\'74\'83\'89\'83\'93\'83\'58\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59 -\f1 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f2\b \cf0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\cf0 Special Thanks: -\f1\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Devin Poolman and Zero G Software, Inc.\ - -\f3\i -\f0\i0 \'83\'43\'83\'93\'83\'58\'83\'67\'81\'5b\'83\'89 -\f1 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f2\b \cf0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\cf0 XonX Team Members\ -Contributing to XFree86 4.1: -\f1\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Rob Braun\ - Darwin x86 -\f0 \'83\'54\'83\'7c\'81\'5b\'83\'67 -\f1 \ -Torrey T. Lyons\ - -\f0 \'83\'76\'83\'8d\'83\'57\'83\'46\'83\'4e\'83\'67 \'83\'8a\'81\'5b\'83\'5f\'81\'5b -\f1 \ -Andreas Monitzer\ - Cocoa -\f0 \'94\'c5 XDarwin \'83\'74\'83\'8d\'83\'93\'83\'67\'83\'47\'83\'93\'83\'68 -\f1 \ -Greg Parker\ - -\f0 \'8d\'c5\'8f\'89\'82\'cc Quartz \'83\'43\'83\'93\'83\'76\'83\'8a\'83\'81\'83\'93\'83\'67 -\f1 \ -Christoph Pfisterer\ - -\f0 \'8b\'a4\'97\'4c\'83\'89\'83\'43\'83\'75\'83\'89\'83\'8a -\f1 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f0 \cf0 \'93\'63\'92\'86 \'8f\'72\'8c\'f5 -\f1 \ - -\f0 \'93\'fa\'96\'7b\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59 -\f1 \ -\ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc - -\f2\b \cf0 Special Thanks: -\f1\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Tiago Ribeiro\ - XDarwin -\f0 \'83\'41\'83\'43\'83\'52\'83\'93 -\f1 \ -\ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc - -\f2\b \cf0 History: -\f1\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 John Carmack\ - -\f0 XFree86 \'82\'cc Mac OS X Server \'82\'d6\'82\'cc\'8d\'c5\'8f\'89\'82\'cc\'88\'da\'90\'41 -\f1 \ -Dave Zarzycki\ - XFree86 4.0 -\f0 \'82\'f0 Darwin 1.0 \'82\'c9\'88\'da\'90\'41 -\f1 \ -Torrey T. Lyons\ - XFree86 4.0.2 -\f0 \'83\'76\'83\'8d\'83\'57\'83\'46\'83\'4e\'83\'67\'82\'d6\'82\'cc\'93\'9d\'8d\'87} \ No newline at end of file diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/Japanese.lproj/Imakefile b/nx-X11/programs/Xserver/hw/darwin/bundle/Japanese.lproj/Imakefile deleted file mode 100644 index d367fbcee..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/bundle/Japanese.lproj/Imakefile +++ /dev/null @@ -1,36 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/Imakefile,v 1.1 2001/05/21 01:42:17 torrey Exp $ - -#include - -LinkSourceFile(InfoPlist.strings.cpp,../English.lproj) - -INCLUDES = -I$(SERVERSRC)/include - -#if defined (XorgVersionString) -VERS = XorgVersionString -PRE = XORG_VERSION_SNAP -NAME = "X Version 11" -LINK = 'X.Org Foundation' -#elif defined XFree86VersionString -VERS = XFree86VersionString -PRE = XF86_VERSION_SNAP -NAME = "XFree86" -LINK = 'XFree86 Project, Inc.' -#endif -DATE = XFree86DateString -X_DEFS = $(INCLUDES) -DX_VERSION=$(VERS) -DX_PRE_RELEASE=$(PRE) \ - -DX_REL_DATE=$(DATE) -DX_VENDOR_NAME=$(NAME) -DX_VENDOR_LINK=$(LINK) - -AllTarget(XDarwinHelp.html) -CppFileTarget(XDarwinHelp.html,XDarwinHelp.html.cpp,$(X_DEFS), \ - NullParameter) - -AllTarget(InfoPlist.strings) -InfoPlist.strings: InfoPlist.strings.cpp - RemoveFile($@) - ClearmakeOSName \ - $(CPP) CppNoLineInfoOption $(X_DEFS) $@ - -clean:: - RemoveFiles(InfoPlist.strings) diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/Japanese.lproj/Localizable.strings b/nx-X11/programs/Xserver/hw/darwin/bundle/Japanese.lproj/Localizable.strings deleted file mode 100644 index c5c26d61a..000000000 Binary files a/nx-X11/programs/Xserver/hw/darwin/bundle/Japanese.lproj/Localizable.strings and /dev/null differ diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/classes.nib b/nx-X11/programs/Xserver/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/classes.nib deleted file mode 100644 index 77f345a4e..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/classes.nib +++ /dev/null @@ -1,72 +0,0 @@ -{ - IBClasses = ( - { - ACTIONS = {showHelp = id; }; - CLASS = FirstResponder; - LANGUAGE = ObjC; - SUPERCLASS = NSObject; - }, - { - ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; }; - CLASS = Preferences; - LANGUAGE = ObjC; - OUTLETS = { - addToPathButton = id; - addToPathField = id; - button2ModifiersMatrix = id; - button3ModifiersMatrix = id; - depthButton = id; - displayField = id; - dockSwitchButton = id; - fakeButton = id; - keymapFileField = id; - modeMatrix = id; - modeWindowButton = id; - mouseAccelChangeButton = id; - startupHelpButton = id; - switchKeyButton = id; - systemBeepButton = id; - useDefaultShellMatrix = id; - useOtherShellField = id; - useXineramaButton = id; - window = id; - }; - SUPERCLASS = NSObject; - }, - { - CLASS = XApplication; - LANGUAGE = ObjC; - OUTLETS = {preferences = id; xserver = id; }; - SUPERCLASS = NSApplication; - }, - { - ACTIONS = { - bringAllToFront = id; - closeHelpAndShow = id; - itemSelected = id; - nextWindow = id; - previousWindow = id; - showAction = id; - showSwitchPanel = id; - startFullScreen = id; - startRootless = id; - }; - CLASS = XServer; - LANGUAGE = ObjC; - OUTLETS = { - dockMenu = NSMenu; - helpWindow = NSWindow; - modeWindow = NSWindow; - startFullScreenButton = NSButton; - startRootlessButton = NSButton; - startupHelpButton = NSButton; - startupModeButton = NSButton; - switchWindow = NSPanel; - windowMenu = NSMenu; - windowSeparator = NSMenuItem; - }; - SUPERCLASS = NSObject; - } - ); - IBVersion = 1; -} \ No newline at end of file diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/objects.nib b/nx-X11/programs/Xserver/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/objects.nib deleted file mode 100644 index 357002706..000000000 Binary files a/nx-X11/programs/Xserver/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/objects.nib and /dev/null differ diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/Japanese.lproj/XDarwinHelp.html.cpp b/nx-X11/programs/Xserver/hw/darwin/bundle/Japanese.lproj/XDarwinHelp.html.cpp deleted file mode 100644 index 6653f5bea..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/bundle/Japanese.lproj/XDarwinHelp.html.cpp +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - -XDarwin Help - -
-

XDarwin X Server for Mac OS X

- X_VENDOR_NAME X_VERSION
- Release Date: X_REL_DATE -
-

Ìܼ¡

-
    -
  1. Ãí°Õ»ö¹à
  2. -
  3. »ÈÍÑË¡
  4. -
  5. ¥Ñ¥¹¤ÎÀßÄê
  6. -
  7. ´Ä¶­ÀßÄê
  8. -
  9. ¥é¥¤¥»¥ó¥¹
  10. -
-
-

Ãí°Õ»ö¹à

-
-
-#if X_PRE_RELEASE -¤³¤ì¤Ï¡¤XDarwin ¤Î¥×¥ì¥ê¥ê¡¼¥¹¥Ð¡¼¥¸¥ç¥ó¤Ç¤¢¤ê¡¤¤¤¤«¤Ê¤ë¾ì¹ç¤Ë¤ª¤¤¤Æ¤â¥µ¥Ý¡¼¥È¤µ¤ì¤Þ¤»¤ó¡£ -¥Ð¥°¤ÎÊó¹ð¤ä¥Ñ¥Ã¥Á¤¬ SourceForge ¤Î XonX ¥×¥í¥¸¥§¥¯¥È¥Ú¡¼¥¸¤ËÄó½Ð¤µ¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£ -¥×¥ì¥ê¥ê¡¼¥¹¥Ð¡¼¥¸¥ç¥ó¤Î¥Ð¥°¤òÊó¹ð¤¹¤ëÁ°¤Ë¡¤XonX ¥×¥í¥¸¥§¥¯¥È¥Ú¡¼¥¸¤Þ¤¿¤Ï X_VENDOR_LINK¤ÇºÇ¿·ÈǤΥÁ¥§¥Ã¥¯¤ò¤·¤Æ²¼¤µ¤¤¡£ -#else -¤â¤·¡¤¥µ¡¼¥Ð¡¼¤¬ 6 -12 ¥ö·î°Ê¾åÁ°¤Î¤â¤Î¤«¡¤¤Þ¤¿¤Ï¤¢¤Ê¤¿¤Î¥Ï¡¼¥É¥¦¥§¥¢¤¬¾åµ­¤ÎÆüÉÕ¤è¤ê¤â¿·¤·¤¤¤â¤Î¤Ê¤é¤Ð¡¤ÌäÂê¤òÊó¹ð¤¹¤ëÁ°¤Ë¤è¤ê¿·¤·¤¤¥Ð¡¼¥¸¥ç¥ó¤òõ¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£ -¥Ð¥°¤ÎÊó¹ð¤ä¥Ñ¥Ã¥Á¤¬ SourceForge ¤Î XonX ¥×¥í¥¸¥§¥¯¥È¥Ú¡¼¥¸¤ËÄó½Ð¤µ¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£ -#endif -
-
-ËÜ¥½¥Õ¥È¥¦¥§¥¢¤Ï¡¤MIT X11/X Consortium License ¤Î¾ò·ï¤Ë´ð¤Å¤­¡¤ÌµÊݾڤǡ¤¡Ö¤½¤Î¤Þ¤Þ¡×¤Î·Á¤Ç¶¡µë¤µ¤ì¤Þ¤¹¡£ -¤´»ÈÍѤˤʤëÁ°¤Ë¡¤¥é¥¤¥»¥ó¥¹¾ò·ï¤ò¤ªÆɤ߲¼¤µ¤¤¡£ -
- -

»ÈÍÑË¡

-

XDarwin ¤Ï¡¤ºÆÇÛÉÛ²Äǽ¤Ê¥ª¡¼¥×¥ó¥½¡¼¥¹¤Î X Window System ¤Î¤¿¤á¤Î X ¥µ¡¼¥Ð¡¼¤Î¼ÂÁõ¤Ç¤¹¡£¤³¤Î¥Ð¡¼¥¸¥ç¥ó¤Î XDarwin ¤Ï X_VENDOR_LINK ¤Ë¤è¤Ã¤ÆºîÀ®¤µ¤ì¤Þ¤·¤¿¡£XDarwin ¤Ï¡¤Mac OS X ¾å¤Ç¥Õ¥ë¥¹¥¯¥ê¡¼¥ó¥â¡¼¥É¤Þ¤¿¤Ï¥ë¡¼¥È¥ì¥¹¥â¡¼¥É¤ÇÆ°ºî¤·¤Þ¤¹¡£

- -

¥Õ¥ë¥¹¥¯¥ê¡¼¥ó¥â¡¼¥É¤Ç¤Ï¡¤X Window System ¤¬¥¢¥¯¥Æ¥£¥Ö¤Ê»þ¡¤¤½¤ì¤ÏÁ´²èÌ̤òÀêÍ­¤·¤Þ¤¹¡£ -¤¢¤Ê¤¿¤Ï¡¤Command-Option-A ¥­¡¼¤ò²¡¤¹¤³¤È¤Ë¤è¤Ã¤Æ Mac OS X ¥Ç¥¹¥¯¥È¥Ã¥×¤ØÀÚ¤êÂؤ¨¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤³¤Î¥­¡¼¤ÎÁȤ߹ç¤ï¤»¤Ï¡¤´Ä¶­ÀßÄê¤ÇÊѹ¹²Äǽ¤Ç¤¹¡£ -Mac OS X ¥Ç¥¹¥¯¥È¥Ã¥×¤«¤é X Window System ¤ØÀÚ¤êÂؤ¨¤ë¾ì¹ç¤Ï¡¤¥É¥Ã¥¯¤Ëɽ¼¨¤µ¤ì¤¿ XDarwin ¥¢¥¤¥³¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ²¼¤µ¤¤¡£ -¡Ê´Ä¶­ÀßÄê¤Ç¡¤¥Õ¥í¡¼¥Æ¥£¥ó¥°¡¦¥¦¥£¥ó¥É¥¦¤Ëɽ¼¨¤µ¤ì¤¿ XDarwin ¥¢¥¤¥³¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤è¤¦¤ËÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¡Ë

- -

¥ë¡¼¥È¥ì¥¹¥â¡¼¥É¤Ç¤Ï¡¤X Window System ¤È Aqua ¤Ï²èÌ̤ò¶¦Í­¤·¤Þ¤¹¡£ -X11 ¤¬É½¼¨¤¹¤ë¥ë¡¼¥È¥¦¥£¥ó¥É¥¦¤Ï²èÌ̤Υµ¥¤¥º¤Ç¤¢¤ê¡¤Â¾¤ÎÁ´¤Æ¤Î¥¦¥£¥ó¥É¥¦¤ò´Þ¤ó¤Ç¤¤¤Þ¤¹¡£ -Aqua ¤¬¥Ç¥¹¥¯¥È¥Ã¥×¤ÎÇطʤòÀ©¸æ¤¹¤ë¤Î¤Ç¡¤X11 ¤Î¥ë¡¼¥È¥¦¥£¥ó¥É¥¦¤Ï¥ë¡¼¥È¥ì¥¹¥â¡¼¥É¤Ç¤Ïɽ¼¨¤µ¤ì¤Þ¤»¤ó¡£

- -

Ê£¿ô¥Ü¥¿¥ó¥Þ¥¦¥¹¤Î¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó

-

¿¤¯¤Î X11 ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡¤3 ¥Ü¥¿¥ó¥Þ¥¦¥¹¤òɬÍפȤ·¤Þ¤¹¡£ -¤¢¤Ê¤¿¤Ï¥Þ¥¦¥¹¥Ü¥¿¥ó¤Î¥¯¥ê¥Ã¥¯¤ÈƱ»þ¤Ë¤¤¤¯¤Ä¤«¤Î½¤¾þ¥­¡¼¤ò²¡¤¹¤³¤È¤Ë¤è¤Ã¤Æ¡¤°ì¤Ä¤Î¥Ü¥¿¥ó¤Ç 3 ¥Ü¥¿¥ó¥Þ¥¦¥¹¤ò¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ -¤³¤ì¤Ï¡¤´Ä¶­ÀßÄê¤Î¡Ö°ìÈÌÀßÄê¡×¤Î¡ÖÊ£¿ô¥Ü¥¿¥ó¥Þ¥¦¥¹¤Î¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó¡×¥»¥¯¥·¥ç¥ó¤ÇÀßÄꤷ¤Þ¤¹¡£ -¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¤¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó¤ÏÍ­¸ú¤Ç¡¤¥³¥Þ¥ó¥É¥­¡¼¤ò²¡¤·¤Ê¤¬¤é¥Þ¥¦¥¹¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤³¤È¤ÏÂè 2 ¥Þ¥¦¥¹¥Ü¥¿¥ó¤Î¥¯¥ê¥Ã¥¯¤ËÁêÅö¤·¤Þ¤¹¡£ -¥ª¥×¥·¥ç¥ó¥­¡¼¤ò²¡¤·¤Ê¤¬¤é¥¯¥ê¥Ã¥¯¤¹¤ë¤³¤È¤ÏÂè 3 ¥Þ¥¦¥¹¥Ü¥¿¥ó¤Î¥¯¥ê¥Ã¥¯¤ËÁêÅö¤·¤Þ¤¹¡£ -¤¢¤Ê¤¿¤Ï¡¤´Ä¶­ÀßÄê¤Ç¥Ü¥¿¥ó 2 ¤È 3 ¤ò¥¨¥ß¥å¥ì¡¼¥È¤¹¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë½¤¾þ¥­¡¼¤ÎÁȹ礻¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ -Ãí¡§½¤¾þ¥­¡¼¤ò xmodmap ¤Ç¾¤Î¥­¡¼¤Ë³ä¤êÅö¤Æ¤Æ¤¤¤ë¾ì¹ç¤Ç¤â¡¤Ê£¿ô¥Ü¥¿¥ó¥Þ¥¦¥¹¤Î¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó¤Ç¤ÏËÜÍè¤Î¥³¥Þ¥ó¥É¥­¡¼¤ä¥ª¥×¥·¥ç¥ó¥­¡¼¤ò»È¤ï¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£

- -

¥Ñ¥¹¤ÎÀßÄê

-

¥Ñ¥¹¤Ï¡¤ ¼Â¹Ô²Äǽ¤Ê¥³¥Þ¥ó¥É¤ò¸¡º÷¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î¥ê¥¹¥È¤Ç¤¹¡£ -X11 ¥Ð¥¤¥Ê¥ê¤Ï¡¤/usr/X11R6/bin ¤ËÃÖ¤«¤ì¤Þ¤¹¡£¤¢¤Ê¤¿¤Ï¤½¤ì¤ò¥Ñ¥¹¤Ë²Ã¤¨¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ -XDarwin ¤Ï¡¤¤³¤ì¤ò¥Ç¥Õ¥©¥ë¥È¤Ç¹Ô¤¤¤Þ¤¹¡£¤Þ¤¿¡¤¤¢¤Ê¤¿¤¬¥³¥Þ¥ó¥É¥é¥¤¥ó¡¦¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿ÄɲäΥǥ£¥ì¥¯¥È¥ê¤ò²Ã¤¨¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

- -

·Ð¸³Ë­¤«¤Ê¥æ¡¼¥¶¡¼¤Ï¡¤¤¹¤Ç¤Ë¼«¤é¤Î¥·¥§¥ë¤Î¤¿¤á¤Ë½é´ü²½¥Õ¥¡¥¤¥ë¤ò»ÈÍѤ·¤Æ¥Ñ¥¹¤òÀßÄꤷ¤Æ¤¤¤ë¤Ç¤·¤ç¤¦¡£ -¤³¤Î¾ì¹ç¡¤¤¢¤Ê¤¿¤Ï´Ä¶­ÀßÄê¤Ç XDarwin ¤¬¤¢¤Ê¤¿¤Î¥Ñ¥¹¤òÊѹ¹¤·¤Ê¤¤¤è¤¦¤ËÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ -XDarwin ¤Ï¡¤¥æ¡¼¥¶¡¼¤Î¥Ç¥Õ¥©¥ë¥È¤Î¥í¥°¥¤¥ó¥·¥§¥ë¤ÇºÇ½é¤Î X11 ¥¯¥é¥¤¥¢¥ó¥È¤ò³«»Ï¤·¤Þ¤¹¡£ -¡Ê´Ä¶­ÀßÄê¤ÇÂå¤ï¤ê¤Î¥·¥§¥ë¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¡Ë -¥Ñ¥¹¤òÀßÄꤹ¤ëÊýË¡¤Ï¡¤¤¢¤Ê¤¿¤¬»ÈÍѤ·¤Æ¤¤¤ë¥·¥§¥ë¤Ë°Í¸¤·¤Þ¤¹¡£ -¤³¤ì¤Ï¡¤¥·¥§¥ë¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¥É¥­¥å¥á¥ó¥È¤Ëµ­ºÜ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£ - -

¤Þ¤¿¡¤¤¢¤Ê¤¿¤Ï¥É¥­¥å¥á¥ó¥È¤òõ¤·¤Æ¤¤¤ë»þ¡¤X11 ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò¸¡º÷¤µ¤ì¤ë¥Ú¡¼¥¸¤Î¥ê¥¹¥È¤ËÄɲä·¤¿¤¤¤È»×¤¦¤«¤â¤·¤ì¤Þ¤»¤ó¡£ -X11 ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ï /usr/X11R6/man ¤ËÃÖ¤«¤ì¤Þ¤¹¡£¤½¤·¤Æ MANPATH ´Ä¶­ÊÑ¿ô¤Ï¸¡º÷¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î¥ê¥¹¥È¤ò´Þ¤ó¤Ç¤¤¤Þ¤¹¡£

- -

´Ä¶­ÀßÄê

-

¡ÖXDarwin¡×¥á¥Ë¥å¡¼¤Î¡Ö´Ä¶­ÀßÄê...¡×¥á¥Ë¥å¡¼¹àÌܤ«¤é¥¢¥¯¥»¥¹¤Ç¤­¤ë´Ä¶­ÀßÄê¥Ñ¥Í¥ë¤Ç¡¤¤¤¤¯¤Ä¤«¤Î¥ª¥×¥·¥ç¥ó¤òÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ -¡Öµ¯Æ°¥ª¥×¥·¥ç¥ó¡×¤ÎÆâÍƤϡ¤XDarwin ¤òºÆµ¯Æ°¤¹¤ë¤Þ¤ÇÍ­¸ú¤È¤Ê¤ê¤Þ¤»¤ó¡£ -¾¤ÎÁ´¤Æ¤Î¥ª¥×¥·¥ç¥ó¤ÎÆâÍƤϡ¤Ä¾¤Á¤ËÍ­¸ú¤È¤Ê¤ê¤Þ¤¹¡£ -°Ê²¼¡¤¤½¤ì¤¾¤ì¤Î¥ª¥×¥·¥ç¥ó¤Ë¤Ä¤¤¤ÆÀâÌÀ¤·¤Þ¤¹:

- -

°ìÈÌÀßÄê

-
    -
  • X11 ¤Ç¥·¥¹¥Æ¥à¤Î¥Ó¡¼¥×²»¤ò»ÈÍѤ¹¤ë: ¥ª¥ó¤Î¾ì¹ç¡¤Mac OS X ¤Î¥Ó¡¼¥×²»¤¬ X11 ¤Î¥Ù¥ë¤È¤·¤Æ»ÈÍѤµ¤ì¤Þ¤¹¡£¥ª¥Õ¤Î¾ì¹ç¡Ê¥Ç¥Õ¥©¥ë¥È¡Ë¡¤¥·¥ó¥×¥ë ¥È¡¼¥ó¤¬»È¤ï¤ì¤Þ¤¹¡£
  • -
  • X11 ¤Î¥Þ¥¦¥¹¥¢¥¯¥»¥é¥ì¡¼¥·¥ç¥ó¤òÍ­¸ú¤Ë¤¹¤ë: ɸ½àŪ¤Ê X Window System ¤Î¼ÂÁõ¤Ç¤Ï¡¤¥¦¥£¥ó¥É¥¦¥Þ¥Í¡¼¥¸¥ã¡¼¤Ï¥Þ¥¦¥¹¤Î²Ã®ÅÙ¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ - ¥Þ¥¦¥¹¤Î²Ã®ÅÙ¤Ë Mac OS X ¤Î¥·¥¹¥Æ¥à´Ä¶­ÀßÄê¤È X ¥¦¥£¥ó¥É¥¦¥Þ¥Í¡¼¥¸¥ã¡¼¤¬°Û¤Ê¤ëÃͤòÀßÄꤷ¤¿¾ì¹ç¡¤¤³¤ì¤Ïº®Íð¤ò¾·¤­¤Þ¤¹¡£ - ¤³¤ÎÌäÂê¤òÈò¤±¤ë¤¿¤á¡¤¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï X11 ¤Î¥Þ¥¦¥¹¥¢¥¯¥»¥é¥ì¡¼¥·¥ç¥ó¤òÍ­¸ú¤È¤·¤Þ¤»¤ó¡£
  • -
  • Ê£¿ô¥Ü¥¿¥ó¥Þ¥¦¥¹¤Î¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó: »ÈÍÑË¡¤ò»²¾È¤·¤Æ²¼¤µ¤¤¡£¥ª¥ó¤Î¾ì¹ç¡¤¥Þ¥¦¥¹¥Ü¥¿¥ó¤¬Âè 2 ¤Þ¤¿¤ÏÂè 3 ¤Î¥Þ¥¦¥¹¥Ü¥¿¥ó¤ò¥¨¥ß¥å¥ì¡¼¥È¤¹¤ë»þ¤Ë¡¤ÁªÂò¤·¤¿½¤¾þ¥­¡¼¤òƱ»þ¤Ë²¡¤·¤Þ¤¹¡£
  • -
- -

µ¯Æ°¥ª¥×¥·¥ç¥ó

-
    -
  • ²èÌ̥⡼¥É: ¥æ¡¼¥¶¡¼¤¬¥Õ¥ë¥¹¥¯¥ê¡¼¥ó¥â¡¼¥É¤Þ¤¿¤Ï¥ë¡¼¥È¥ì¥¹¥â¡¼¥É¤Î¤É¤Á¤é¤ò»ÈÍѤ¹¤ë¤«¤ò»ØÄꤷ¤Ê¤¤¾ì¹ç¡¤¤³¤³¤Ç»ØÄꤵ¤ì¤¿¥â¡¼¥É¤¬»È¤ï¤ì¤Þ¤¹¡£
  • -
  • µ¯Æ°»þ¤Ë¥â¡¼¥ÉÁªÂò¥Ñ¥Í¥ë¤òɽ¼¨¤¹¤ë: ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¤XDarwin ¤Îµ¯Æ°»þ¤Ë¥æ¡¼¥¶¡¼¤¬¥Õ¥ë¥¹¥¯¥ê¡¼¥ó¥â¡¼¥É¤Þ¤¿¤Ï¥ë¡¼¥È¥ì¥¹¥â¡¼¥É¤Î¤É¤Á¤é¤ò»ÈÍѤ¹¤ë¤«¤òÁªÂò¤¹¤ë¥Ñ¥Í¥ë¤òɽ¼¨¤·¤Þ¤¹¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤¬¥ª¥Õ¤Î¾ì¹ç¡¤²èÌ̥⡼¥É¤Ç»ØÄꤷ¤¿¥â¡¼¥É¤Çµ¯Æ°¤·¤Þ¤¹¡£
  • -
  • X11 ¥Ç¥£¥¹¥×¥ì¥¤ÈÖ¹æ: X11¤Ï¡¤°ì¤Ä¤Î¥³¥ó¥Ô¥å¡¼¥¿¾å¤ÇÊÌ¡¹¤Î X ¥µ¡¼¥Ð¡¼¤¬´ÉÍý¤¹¤ëÊ£¿ô¤Î¥Ç¥£¥¹¥×¥ì¥¤¤¬Â¸ºß¤¹¤ë¤³¤È¤òµö¤·¤Þ¤¹¡£Ê£¿ô¤Î X ¥µ¡¼¥Ð¡¼¤¬Æ±»þ¤Ë¼Â¹Ô¤·¤Æ¤¤¤ë»þ¡¤XDarwin ¤¬»ÈÍѤ¹¤ë¥Ç¥£¥¹¥×¥ì¥¤¤ÎÈÖ¹æ¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
  • -
  • Xinerama ¥Þ¥ë¥Á¥â¥Ë¥¿¥µ¥Ý¡¼¥È¤òÍ­¸ú¤Ë¤¹¤ë: XDarwin ¤Ï¡¤Xinerama ¥Þ¥ë¥Á¥â¥Ë¥¿¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤¹¡£¤½¤ì¤ÏÁ´¤Æ¤Î¥â¥Ë¥¿¤ò°ì¤Ä¤ÎÂ礭¤Ê²èÌ̤ΰìÉô¤È¤ß¤Ê¤·¤Þ¤¹¡£¤¢¤Ê¤¿¤Ï¤³¤Î¥ª¥×¥·¥ç¥ó¤Ç Xinerama ¤ò̵¸ú¤Ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤¿¤À¤·¡¤¸½ºß XDarwin ¤Ï¤½¤ì̵¤·¤ÇÀµ¤·¤¯Ê£¿ô¤Î¥â¥Ë¥¿¤ò°·¤¦¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£¤â¤·¡¤¤¢¤Ê¤¿¤¬°ì¤Ä¤Î¥â¥Ë¥¿¤ò»È¤¦¤À¤±¤Ê¤é¤Ð¡¤Xinerama ¤Ï¼«Æ°Åª¤Ë̵¸ú¤È¤Ê¤ê¤Þ¤¹¡£
  • -
  • ¥­¡¼¥Þ¥Ã¥Ô¥ó¥°¥Õ¥¡¥¤¥ë: ¥­¡¼¥Þ¥Ã¥Ô¥ó¥°¥Õ¥¡¥¤¥ë¤Ïµ¯Æ°»þ¤ËÆɤ߹þ¤Þ¤ì¡¤X11 ¥­¡¼¥Þ¥Ã¥×¤ËÊÑ´¹¤µ¤ì¤Þ¤¹¡£Â¾¸À¸ì¤ËÂбþ¤·¤¿¥­¡¼¥Þ¥Ã¥Ô¥ó¥°¥Õ¥¡¥¤¥ë¤Ï /System/Library/Keyboards ¤Ë¤¢¤ê¤Þ¤¹¡£¡ÊÌõÃí¡§¥­¡¼¥Þ¥Ã¥Ô¥ó¥°¤Ç Japanese ¤òÁªÂò¤¹¤ë¤È¡¤°ìÉô¤Î¥­¡¼¤¬¸ú¤«¤Ê¤¤Åù¤ÎÉÔ¶ñ¹ç¤¬È¯À¸¤¹¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£¤³¤Î¾ì¹ç¤Ï USA ¤òÁªÂò¤·¤¿¾å¤Ç ~/.Xmodmap ¤òŬÍѤ·¤Æ²¼¤µ¤¤¡£¡Ë
  • -
  • ºÇ½é¤Î X11 ¥¯¥é¥¤¥¢¥ó¥È¤Îµ¯Æ°: XDarwin ¤¬ Finder¤«¤éµ¯Æ°¤¹¤ë»þ¡¤X ¥¦¥£¥ó¥É¥¦¥Þ¥Í¡¼¥¸¥ã¡¼¤È X ¥¯¥é¥¤¥¢¥ó¥È¤Îµ¯Æ°¤Ï xinit ¤ò¼Â¹Ô¤·¤Þ¤¹¡£¡Ê¾ÜºÙ¤Ï "man xinit" ¤ò»²¾È¤·¤Æ²¼¤µ¤¤¡£¡ËXDarwin ¤Ï xinit ¤ò¼Â¹Ô¤¹¤ëÁ°¤Ë¡¤»ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ò¥æ¡¼¥¶¡¼¤Î¥Ñ¥¹¤ËÄɲä·¤Þ¤¹¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï /usr/X11R6/bin ¤À¤±¤òÄɲä·¤Þ¤¹¡£Â¾¤Î¥Ç¥£¥ì¥¯¥È¥ê¤òÄɲä·¤¿¤¤¾ì¹ç¤Ï¡¤¥³¥í¥ó¤Ç¶èÀڤäƻØÄꤷ¤Þ¤¹¡£¥æ¡¼¥¶¡¼¤Î¥·¥§¥ë½é´ü²½¥Õ¥¡¥¤¥ë¤òÆɤ߹þ¤à¤¿¤á¤Ë¡¤X ¥¯¥é¥¤¥¢¥ó¥È¤Ï¥æ¡¼¥¶¡¼¤Î¥Ç¥Õ¥©¥ë¥È¥í¥°¥¤¥ó¥·¥§¥ë¤Çµ¯Æ°¤µ¤ì¤Þ¤¹¡£É¬ÍפǤ¢¤ì¤Ð¡¤Âå¤ï¤ê¤Î¥·¥§¥ë¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
  • -
- -

¥Õ¥ë¥¹¥¯¥ê¡¼¥ó

-
    -
  • ¥­¡¼ÀßÄê¥Ü¥¿¥ó: X11 ¤È Aqua ¤òÀÚ¤êÂؤ¨¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë¥Ü¥¿¥ó¤ÎÁȤ߹ç¤ï¤»¤ò»ØÄꤷ¤Þ¤¹¡£ - ¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¡¤Ç¤°Õ¤Î¿ô¤Î½¤¾þ¥­¡¼¤Ë³¤¤¤ÆÄ̾ï¤Î¥­¡¼¤ò²¡¤·¤Þ¤¹¡£
  • -
  • ¥É¥Ã¥¯¤Î¥¢¥¤¥³¥ó¤Î¥¯¥ê¥Ã¥¯¤Ç X11 ¤ËÌá¤ë: ¥ª¥ó¤Î¾ì¹ç¡¤¥É¥Ã¥¯¤Ëɽ¼¨¤µ¤ì¤¿ XDarwin ¥¢¥¤¥³¥ó¤Î¥¯¥ê¥Ã¥¯¤Ç X11 ¤Ø¤ÎÀڤ괹¤¨¤¬²Äǽ¤È¤Ê¤ê¤Þ¤¹¡£Mac OS X ¤Î¤¤¤¯¤Ä¤«¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¤¥É¥Ã¥¯¤Î¥¢¥¤¥³¥ó¤Î¥¯¥ê¥Ã¥¯¤Ç Aqua ¤ËÌá¤Ã¤¿»þ¡¤¥«¡¼¥½¥ë¤¬¾Ã¼º¤¹¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£
  • -
  • µ¯Æ°»þ¤Ë¥Ø¥ë¥×¤òɽ¼¨¤¹¤ë: XDarwin ¤¬¥Õ¥ë¥¹¥¯¥ê¡¼¥ó¥â¡¼¥É¤Çµ¯Æ°¤¹¤ë»þ¡¤¥¹¥×¥é¥Ã¥·¥å¥¹¥¯¥ê¡¼¥ó¤òɽ¼¨¤·¤Þ¤¹¡£
  • -
  • ¿§¿¼ÅÙ: ¥Õ¥ë¥¹¥¯¥ê¡¼¥ó¥â¡¼¥É¤Ç¤Ï¡¤X11 ¥Ç¥£¥¹¥×¥ì¥¤¤¬ Aqua ¤È°Û¤Ê¤ë¿§¿¼ÅÙ¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¡ÖÊѹ¹¤Ê¤·¡×¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¤XDarwin ¤Ï Aqua ¤Ë¤è¤Ã¤Æ»ÈÍѤµ¤ì¤ë¿§¿¼ÅÙ¤ò»È¤¤¤Þ¤¹¡£¤³¤ì°Ê³°¤Ë 8¡¤15 ¤Þ¤¿¤Ï24 ¥Ó¥Ã¥È¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
  • -
- -

-¥é¥¤¥»¥ó¥¹ -

-XDarwin ¤Î¼çÍפʥ饤¥»¥ó¥¹¤ÏÅÁÅýŪ¤Ê MIT X11/X Consortium License ¤Ë´ð¤Å¤­¤Þ¤¹¡£ -¤½¤ì¤Ï½¤Àµ¤Þ¤¿¤ÏºÆÇÛÉÛ¤µ¤ì¤ë¥½¡¼¥¹¥³¡¼¥É¤Þ¤¿¤Ï¥Ð¥¤¥Ê¥ê¤Ë¡¤¤½¤ÎÃøºî¸¢/¥é¥¤¥»¥ó¥¹É½¼¨¤¬¤½¤Î¤Þ¤Þ»Ä¤µ¤ì¤ë¤³¤È¤òÍ׵᤹¤ë°Ê³°¤Î¾ò·ï¤ò¶¯À©¤·¤Þ¤»¤ó¡£ -¤è¤ê¿¤¯¤Î¾ðÊó¤È¡¤¥³¡¼¥É¤Î°ìÉô¤ò¥«¥Ð¡¼¤¹¤ëÄɲäÎÃøºî¸¢/¥é¥¤¥»¥ó¥¹É½¼¨¤Î¤¿¤á¤Ë¡¤¥½¡¼¥¹¥³¡¼¥É¤ò»²¾È¤·¤Æ²¼¤µ¤¤¡£ -

- -X Consortium License

-

Copyright (C) 1996 X Consortium

-

Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without -limitation the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to permit persons to -whom the Software is furnished to do so, subject to the following conditions:

-

The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software.

-

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE.

-

Except as contained in this notice, the name of the X Consortium shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization from -the X Consortium.

-

X Window System is a trademark of X Consortium, Inc.

- - diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/Portuguese.lproj/Credits.rtf b/nx-X11/programs/Xserver/hw/darwin/bundle/Portuguese.lproj/Credits.rtf deleted file mode 100644 index 8dcddc2f7..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/bundle/Portuguese.lproj/Credits.rtf +++ /dev/null @@ -1,171 +0,0 @@ -{\rtf1\mac\ansicpg10000\cocoartf102 -{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;\f2\fswiss\fcharset77 Helvetica-Oblique; -} -{\colortbl;\red255\green255\blue255;} -\vieww5140\viewh4980\viewkind0 -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural - -\f0\fs24 \cf0 This product includes software developed by The XFree86 Project, Inc (http://www.xfree86.org/) and its contributors. The following people contributed to Darwin/Mac OS X support.\ -\ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc - -\f1\b \cf0 Contributors to Xorg Foundation Release: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Kaleb KEITHLEY\ - -\f2\i Working left and right Ctrl, Alt (Option), Meta (Command) and Shift keys. -\f0\i0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f1\b \cf0 \ -\f1\b \cf0 Contributors to XFree86 4.4: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 John Harper\ - -\f2\i Rootless acceleration and Apple-WM extension -\f0\i0 \ -Torrey T. Lyons\ - -\f2\i Project Lead -\f0\i0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f1\b \cf0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\cf0 Contribuidores do XonX ao XFree86 4.3: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Fabr\'92cio Luis de Castro -\f1\b \ - -\f2\i\b0 Localiza\'8d\'8bo para o Portugu\'90s\ - -\f0\i0 Michael Oland\ - -\f2\i New XDarwin icon -\f1\i0\b \ -\ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\cf0 Contribuidores do XonX ao XFree86 4.2: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Rob Braun\ - -\f2\i Suporte para o Darwin x86\ - -\f0\i0 Pablo Di Noto\ - -\f2\i Localiza\'8d\'8bo para o Espanhol -\f0\i0 \ -Paul Edens\ - -\f2\i Localiza\'8d\'8bo para o Holand\'90s -\f0\i0 \ -Kyunghwan Kim\ - -\f2\i Localiza\'8d\'8bo para o Coreano -\f0\i0 \ -Mario Klebsch\ - -\f2\i Suporte para teclados Non-US -\f0\i0 \ -Torrey T. Lyons\ - -\f2\i L\'92der de Projeto -\f0\i0 \ -Andreas Monitzer\ - -\f2\i Localiza\'8d\'8bo para o Alem\'8bo -\f0\i0 \ -Patrik Montgomery\ - -\f2\i Localiza\'8d\'8bo para o Sueco -\f0\i0 \ -Greg Parker\ - -\f2\i Suporte ao modo Compartilhado (Rootless) -\f0\i0 \ -Toshimitsu Tanaka\ - -\f2\i Localiza\'8d\'8bo para o Japon\'90s -\f0\i0 \ -Olivier Verdier\ - -\f2\i Localiza\'8d\'8bo para o Fran\'8d\'90s -\f0\i0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f1\b \cf0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\cf0 Agradecimentos Especiais: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Devin Poolman and Zero G Software, Inc.\ - -\f2\i Instalador -\f0\i0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f1\b \cf0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\cf0 Membros do Time XonX\ -Contribuindo com o XFree86 4.1: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Rob Braun\ - -\f2\i Suporte ao Darwin x86\ - -\f0\i0 Torrey T. Lyons\ - -\f2\i L\'92der de Projeto -\f0\i0 \ -Andreas Monitzer\ - -\f2\i Vers\'8bo Cocoa da interface XDarwin -\f0\i0 \ -Greg Parker\ - -\f2\i Implementa\'8d\'8bo Original -\f0\i0 -\f2\i ao Quartz \ - -\f0\i0 Christoph Pfisterer\ - -\f2\i Bibliotecas Din\'89micas Compartilhadas -\f0\i0 \ -Toshimitsu Tanaka\ - -\f2\i Localiza\'8d\'8bo para o Japon\'90s -\f0\i0 \ -\ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc - -\f1\b \cf0 Agradecimento Especial: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Tiago Ribeiro\ - -\f2\i \'eacone do XDarwin -\f0\i0 \ -\ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc - -\f1\b \cf0 Hist\'97rico: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 John Carmack\ - -\f2\i Suporte Original do XFree86 no Mac OS X Server -\f0\i0 \ -Dave Zarzycki\ - -\f2\i Suporte ao -\f0\i0 -\f2\i XFree86 4.0 no Darwin 1.0 -\f0\i0 \ -Torrey T. Lyons\ - -\f2\i Integra\'8d\'8bo dentro do Projeto XFree86 na vers\'8bo 4.0.2} \ No newline at end of file diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/Portuguese.lproj/Imakefile b/nx-X11/programs/Xserver/hw/darwin/bundle/Portuguese.lproj/Imakefile deleted file mode 100644 index d367fbcee..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/bundle/Portuguese.lproj/Imakefile +++ /dev/null @@ -1,36 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/Imakefile,v 1.1 2001/05/21 01:42:17 torrey Exp $ - -#include - -LinkSourceFile(InfoPlist.strings.cpp,../English.lproj) - -INCLUDES = -I$(SERVERSRC)/include - -#if defined (XorgVersionString) -VERS = XorgVersionString -PRE = XORG_VERSION_SNAP -NAME = "X Version 11" -LINK = 'X.Org Foundation' -#elif defined XFree86VersionString -VERS = XFree86VersionString -PRE = XF86_VERSION_SNAP -NAME = "XFree86" -LINK = 'XFree86 Project, Inc.' -#endif -DATE = XFree86DateString -X_DEFS = $(INCLUDES) -DX_VERSION=$(VERS) -DX_PRE_RELEASE=$(PRE) \ - -DX_REL_DATE=$(DATE) -DX_VENDOR_NAME=$(NAME) -DX_VENDOR_LINK=$(LINK) - -AllTarget(XDarwinHelp.html) -CppFileTarget(XDarwinHelp.html,XDarwinHelp.html.cpp,$(X_DEFS), \ - NullParameter) - -AllTarget(InfoPlist.strings) -InfoPlist.strings: InfoPlist.strings.cpp - RemoveFile($@) - ClearmakeOSName \ - $(CPP) CppNoLineInfoOption $(X_DEFS) $@ - -clean:: - RemoveFiles(InfoPlist.strings) diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/Portuguese.lproj/Localizable.strings b/nx-X11/programs/Xserver/hw/darwin/bundle/Portuguese.lproj/Localizable.strings deleted file mode 100644 index c79b282f6..000000000 Binary files a/nx-X11/programs/Xserver/hw/darwin/bundle/Portuguese.lproj/Localizable.strings and /dev/null differ diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/classes.nib b/nx-X11/programs/Xserver/hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/classes.nib deleted file mode 100644 index 77f345a4e..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/classes.nib +++ /dev/null @@ -1,72 +0,0 @@ -{ - IBClasses = ( - { - ACTIONS = {showHelp = id; }; - CLASS = FirstResponder; - LANGUAGE = ObjC; - SUPERCLASS = NSObject; - }, - { - ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; }; - CLASS = Preferences; - LANGUAGE = ObjC; - OUTLETS = { - addToPathButton = id; - addToPathField = id; - button2ModifiersMatrix = id; - button3ModifiersMatrix = id; - depthButton = id; - displayField = id; - dockSwitchButton = id; - fakeButton = id; - keymapFileField = id; - modeMatrix = id; - modeWindowButton = id; - mouseAccelChangeButton = id; - startupHelpButton = id; - switchKeyButton = id; - systemBeepButton = id; - useDefaultShellMatrix = id; - useOtherShellField = id; - useXineramaButton = id; - window = id; - }; - SUPERCLASS = NSObject; - }, - { - CLASS = XApplication; - LANGUAGE = ObjC; - OUTLETS = {preferences = id; xserver = id; }; - SUPERCLASS = NSApplication; - }, - { - ACTIONS = { - bringAllToFront = id; - closeHelpAndShow = id; - itemSelected = id; - nextWindow = id; - previousWindow = id; - showAction = id; - showSwitchPanel = id; - startFullScreen = id; - startRootless = id; - }; - CLASS = XServer; - LANGUAGE = ObjC; - OUTLETS = { - dockMenu = NSMenu; - helpWindow = NSWindow; - modeWindow = NSWindow; - startFullScreenButton = NSButton; - startRootlessButton = NSButton; - startupHelpButton = NSButton; - startupModeButton = NSButton; - switchWindow = NSPanel; - windowMenu = NSMenu; - windowSeparator = NSMenuItem; - }; - SUPERCLASS = NSObject; - } - ); - IBVersion = 1; -} \ No newline at end of file diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/objects.nib b/nx-X11/programs/Xserver/hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/objects.nib deleted file mode 100644 index 9cb67cf89..000000000 Binary files a/nx-X11/programs/Xserver/hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/objects.nib and /dev/null differ diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/Portuguese.lproj/XDarwinHelp.html.cpp b/nx-X11/programs/Xserver/hw/darwin/bundle/Portuguese.lproj/XDarwinHelp.html.cpp deleted file mode 100644 index 7ef1ba5d8..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/bundle/Portuguese.lproj/XDarwinHelp.html.cpp +++ /dev/null @@ -1,211 +0,0 @@ - - - -XDarwin Help - - -
- -

XDarwin X Server para Mac OS X

- X_VENDOR_NAME X_VERSION
- Release Date: X_REL_DATE -
-

Índice

-
    -
  1. Notas importantes
  2. -
  3. Uso
  4. -
  5. Ajustando seu Path
  6. - -
  7. Preferências do usuário
  8. -
  9. Licença
  10. -
-
-

Notas importantes

-
-
-#if PRE_RELEASE - Essa é uma versão pré-lancamento - do XDarwin, e ela não é suportada de nenhuma forma. Bugs podem - ser reportados e correções podem ser enviadas para Página - do projeto XonX no SourceForge. Antes de informar bugs em versões - pré-lancamento, por favor verifique a þltima versão em XonX - or X_VENDOR_LINK. -#else -Se o servidor é mais velho que 6-12 semanas, ou seu hardware é - mais novo que a data acima, procure por uma nova versão antes de informar - problemas. Bugs podem ser reportados e correções podem ser enviadas - para a Página do projeto - XonX na SourceForge. -#endif -
-
Este software é distribuído sob os termos da licença - MIT X11 / X Consortium e é provido, sem nenhuma garantia. Por favor - leia a Licença antes de começar a usar - o programa.
- -

Uso

-

O XDarwin é uma X server "open-source" livremente - redistribuída do Sistema X Window. This version of XDarwin was produced by the X_VENDOR_LINK. - XDarwin roda sobre Mac OS X no modo Tela Cheia ou no modo Compartilhado.

-

No modo Tela Cheia, quando o sistema X window está ativo, ele ocupa - a tela toda. Você pode voltar ao desktop do Mac OS X clicando Command-Option-A. - Essa combinação de teclas pode ser mudada nas preferências. - Pelo desktop Mac OS X, clique no ícone XDarwin no Dock para voltar ao - sistema X window. (Você pode mudar esse comportamento nas preferências - daí você deverá clicar no ícone XDarwin na janela - flutuante que aparecerá.)

-

No modo Compartilhado, o sistema X window e Aqua dividem a mesma tela. A janela - raiz da tela X11 está do tamanho da tela (monitor) e contém todas - as outras janelas. A janela raiz do X11 no modo compartilhado não é - mostrada pois o Aqua controla o fundo de tela.

-

Emulação de Mouse Multi-Botões

-

Muitas aplicações X11 insistem em usar um mouse de 3 botões. - Você pode emular um mouse de 3 botões com um simples botão, - mantendo pressionando teclas modificadoras enquanto você clica no botão - do mouse. Isto é controlado pela configuração da "Emulação - de Mouse Multi-Botões" da preferência "Geral". Por - padrão, a emulação está habilitada e mantendo pressionada - a tecla Command e clicando no botão do mouse ele simulará o clique - no segundo botão do mouse. Mantendo pressionada a tecla Option e clicando - no botão do mouse ele simulará o terceiro botão. Você - pode mudar a combinação de teclas modificadoras para emular os - botões dois e três nas preferências. Nota, se a tecla modificadora - foi mapeada para alguma outra tecla no xmodmap, você ainda terá - que usar a tecla atual especificada nas preferências para a emulação - do mouse multi-botões.

-

Ajustando seu Path

-

Seu path é a lista de diretórios a serem procurados por arquivos - executáveis. O comando X11 está localizado em /usr/X11R6/bin, - que precisa ser adicionado ao seu path. XDarwin faz isso para você por - padrão e pode-se também adicionar diretórios onde você - instalou aplicações de linha de comando.

-

Usuários experientes já terão configurado corretamente - seu path usando arquivos de inicialização de seu shell. Neste - caso, você pode informar o XDarwin para não modificar seu path - nas preferências. O XDarwin inicia o cliente inicial X11 no shell padrão - do usuário corrente. (Um shell alternativo pode ser também expecificado - nas preferências.) O modo para ajustar o path depende do shell que você - está usando. Isto é descrito na man page do seu shell.

-

Você pode também querer adicionar as man pages do X11 para - a lista de páginas a serem procuradas quando você está procurando - por documentação. As man pages do X11 estão localizadas - em /usr/X11R6/man e a variável de ambiente MANPATH - contém a lista de diretórios a buscar.

-

Preferências do Usuário

-

Várias opções podem ser ajustadas nas preferências - do usuário, acessível pelo item "Preferências..." - no menu "XDarwin". As opções listadas como opções - de inicialização, não terão efeito até você - reiniciar o XDarwin. Todas as outras opções terão efeito - imediatamente. Várias das opções estão descritas - abaixo:

-

Geral

-
    -
  • Usar o Beep do Sistema para o X11: Quando habilitado som de alerta - padrão do Mac OS X será usado como alerta no X11. Quando desabilitado - (padrão) um tom simples será usado.
  • -
  • Permitir o X11 mudar a aceleração do mouse: Por implementação - padrão no sistema X window, o gerenciador de janelas pode mudar a aceleração - do mouse. Isso pode gerar uma confusão pois a aceleração - do mouse pode ser ajustada diferentemente nas preferências do Mac OS - X e nas preferências do X window. Por padrão, o X11 não - está habilitado a mudar a aceleração do mouse para evitar - este problema.
  • -
  • Emulação de Mouse de Multi-Botões: Esta opção - está escrita acima em Uso. Quando a emulação - está habilitada as teclas modificadoras selecionadas tem que estar - pressionadas quando o botão do mouse for pressionado, para emular o - segundo e terceiro botões.
  • -
-

Inicial

-
    -
  • Modo Padrão: Se o usuário não indicar qual modo - de exibição quer usar (Tela Cheia ou Compartilhado) o modo especificado - aqui será usado .
  • -
  • Mostrar o painel de escolha na inicialização: Por - padrão, uma painel é mostrado quando o XDarwin é - iniciado para permitir que o usuário escolha ente o modo tela cheia - ou modo compartilhado. Se esta opção estiver desligada, o modo - padrão será inicializado automaticamente.
  • -
  • Número do Monitor X11: O X11 permite ser administrado em multiplos - monitores por servidores X separados num mesmo computador. O usuário - pode indicar o número do monitor para o XDarwin usar se mais de um - servidor X se estiver rodando simultaneamente.
  • -
  • Habilitar suporte a múltiplos monitores pelo Xinerama: o XDarwin - suporta múltiplos monitores com o Xinerama, que trata todos os monitores - como parte de uma grande e retangular tela. Você pode desabilitar o - Xinerama com está opção, mas normalmente o XDarwin não - controla múltiplos monitores corretamente sem está opção. - Se você só tiver um monotor, Xinerama é automaticamente - desabilitado.
  • -
  • Arquivo de Mapa de Teclado: O mapa de teclado é lido na inicialização - e traduzido para um mapa de teclado X11. Arquivos de mapa de teclado, estão - disponíveis numa grande variedade de línguas e são encontradas - em /System/Library/Keyboards.
  • -
  • Iniciando Clientes X11 primeiro: Quando o XDrawin é inicializado - pelo Finder, ele irá rodar o xinit para abrir o controlador - X window e outros clientes X. (Veja o manual "man xinit" para - mais informações.) Antes do XDarwin rodar o xinit - ele irá adicionar específicos diretórios a seu path. - Por padrão somente o /usr/X11R6/bin é adicionado. - separado por um ponto-e-vírgula. Os clientes X são inicializados - no shell padrão do usuário e os arquivos de inicialização - do shell serão lidos. Se desejado, um shell alternativo pode ser especificado.
  • -
-

Tela Cheia

-
    -
  • Botão de Combinação de Teclas: Clique no botão - e pressione qualquer quantidade de teclas modificadoras seguidas por uma tecla - padrão para modificar a combinação quando se quer mudar - entre o Aqua e X11.
  • -
  • Clique no Ícone no Dock para mudar para o X11: Habilitando - esta opção você irá ativar a mudança para - o X11 clicando no ícone do XDarwin no Dock. Em algumas versões - do Mac OS X, mudando pelo clique no Dock pode causar o desaparecimento do - cursor quando retornar ao Aqua.
  • -
  • Mostrar a Ajuda na inicialização: Isto irá mostrar - uma tela introdutória quando o XDarwin for inicializado no modo Tela - Cheia.
  • -
  • Profundidade de Cores em bits: No modo Tela Cheia, a tela do X11 - pode usar uma profundiadde de cor diferente da usada no Aqua. Se a opção - "Atual" está especificada, a profundidade usada pelo Aqua - quando o XDarwin iniciar será a mesma. Além das opções - 8, 15 ou 24 bits que podem ser especificadas.
  • -
- -

Licença

-

A licença - principal nós por XDarwin baseada na licença tradicional MIT X11 - / X Consortium, que não impõe nenhuma condição sobre - modificações ou redistribuição do código-fonte - ou dos binários desde que o copyright/licença sejam mantidos intactos. - Para mais informações e notícias adicionais de copyright/licensing - em algumas seção do código, por favor refer to the source code.

-

Licença do X Consortium

-

Copyright (C) 1996 X Consortium

-

Permissões são em virtude garantidas, livre de mudanças, - para qualquer pessoa que possua uma cópia deste software e aos arquivos - de documentação associada (o "Software"), para lidar - com o software sem restrições, incluindo limitações - dos direitos de uso, cópia, modificação, inclusão, - publicação, distribuição, sub licença, e/ou - venda de cópias deste Software, e permitir pessoas to whom o Software - é fornecido para ser desta forma, verifique as seguintes condições:

-

O nota de copyright abaixo e a permissão deverão ser incluídas - em todas as cópias ou substanciais porções do Software.

-

O SOFTWARE 'E PROVIDO "COMO TAL", SEM GARANTIAS DE NENHUM TIPO, EXPLICITA - OU IMPLICITA, INCLUINDO MAS NÃO LIMITADO NOS AVISOS DE COMÉRCIO, - TAMANHO OU PARA PROPOSTAS PARTICULARES E NÃO INFRAÇÃO. - EM NENHUM ACONTECIMENTO O X CONSORTIUM SERÁ RESPONSAVÉL POR NENHUMA - RECLAMAÇÃO, DANOS OU OUTRAS RESPONSABILIDADES, SE NUMA AÇÃO - DE CONTRATO, OU OUTRA COISA, SURGINDO DE, FORA DE OU EM CONEXÃO COM O - SOFTWARE OU O USO OU OUTRO MODO DE LIDAR COM O SOFTWARE.

-

Exceto o contido nesta nota, o nome do X Consortium não pode ser usado - em propagandas ou outra forma de promoção de vendas, uso ou outro - modo de lidar com este Software sem ter recebido uma autorização - escrita pelo X Consortium.

-

O Sistema X Window é marca registrada do X Consortium, Inc.

- - - diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/Spanish.lproj/Credits.rtf b/nx-X11/programs/Xserver/hw/darwin/bundle/Spanish.lproj/Credits.rtf deleted file mode 100644 index 34408e78c..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/bundle/Spanish.lproj/Credits.rtf +++ /dev/null @@ -1,168 +0,0 @@ -{\rtf1\mac\ansicpg10000\cocoartf102 -{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;\f2\fswiss\fcharset77 Helvetica-Oblique; -} -{\colortbl;\red255\green255\blue255;} -\vieww5160\viewh6300\viewkind0 -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural - -\f0\fs24 \cf0 This product includes software developed by The XFree86 Project, Inc (http://www.xfree86.org/) and its contributors. The following people contributed to Darwin/Mac OS X support.\ -\ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc - -\f1\b \cf0 Contributors to Xorg Foundation Release: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Kaleb KEITHLEY\ - -\f2\i Working left and right Ctrl, Alt (Option), Meta (Command) and Shift keys. -\f0\i0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f1\b \cf0 \ -\f1\b \cf0 Contributors to XFree86 4.4: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 John Harper\ - -\f2\i Rootless acceleration and Apple-WM extension -\f0\i0 \ -Torrey T. Lyons\ - -\f2\i Project Lead -\f0\i0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f1\b \cf0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\cf0 Additional XonX Contributors to XFree86 4.3: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Fabr\'92cio Luis de Castro\ - -\f2\i Portuguese localization -\f0\i0 \ -Michael Oland\ - -\f2\i New XDarwin icon -\f0\i0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f1\b \cf0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\cf0 XonX Contributors to XFree86 4.2: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Rob Braun\ - -\f2\i Darwin x86 support -\f0\i0 \ -Pablo Di Noto\ - -\f2\i Spanish localization -\f0\i0 \ -Paul Edens\ - -\f2\i Dutch localization -\f0\i0 \ -Kyunghwan Kim\ - -\f2\i Korean localization -\f0\i0 \ -Mario Klebsch\ - -\f2\i Non-US keyboard support -\f0\i0 \ -Torrey T. Lyons\ - -\f2\i Project Lead -\f0\i0 \ -Andreas Monitzer\ - -\f2\i German localization -\f0\i0 \ -Patrik Montgomery\ - -\f2\i Swedish localization -\f0\i0 \ -Greg Parker\ - -\f2\i Rootless support -\f0\i0 \ -Toshimitsu Tanaka\ - -\f2\i Japanese localization -\f0\i0 \ -Olivier Verdier\ - -\f2\i French localization -\f0\i0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f1\b \cf0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\cf0 Special Thanks: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Devin Poolman and Zero G Software, Inc.\ - -\f2\i Installer -\f0\i0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f1\b \cf0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\cf0 XonX Team Members\ -Contributing to XFree86 4.1: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Rob Braun\ - -\f2\i Darwin x86 support -\f0\i0 \ -Torrey T. Lyons\ - -\f2\i Project Lead -\f0\i0 \ -Andreas Monitzer\ - -\f2\i Cocoa version of XDarwin front end -\f0\i0 \ -Greg Parker\ - -\f2\i Original Quartz implementation -\f0\i0 \ -Christoph Pfisterer\ - -\f2\i Dynamic shared libraries -\f0\i0 \ -Toshimitsu Tanaka\ - -\f2\i Japanese localization -\f0\i0 \ -\ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc - -\f1\b \cf0 Special Thanks: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Tiago Ribeiro\ - -\f2\i XDarwin icon -\f0\i0 \ -\ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc - -\f1\b \cf0 History: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 John Carmack\ - -\f2\i Original XFree86 port to Mac OS X Server -\f0\i0 \ -Dave Zarzycki\ - -\f2\i XFree86 4.0 port to Darwin 1.0 -\f0\i0 \ -Torrey T. Lyons\ - -\f2\i Integration into XFree86 Project for 4.0.2} \ No newline at end of file diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/Spanish.lproj/Imakefile b/nx-X11/programs/Xserver/hw/darwin/bundle/Spanish.lproj/Imakefile deleted file mode 100644 index d367fbcee..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/bundle/Spanish.lproj/Imakefile +++ /dev/null @@ -1,36 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/Imakefile,v 1.1 2001/05/21 01:42:17 torrey Exp $ - -#include - -LinkSourceFile(InfoPlist.strings.cpp,../English.lproj) - -INCLUDES = -I$(SERVERSRC)/include - -#if defined (XorgVersionString) -VERS = XorgVersionString -PRE = XORG_VERSION_SNAP -NAME = "X Version 11" -LINK = 'X.Org Foundation' -#elif defined XFree86VersionString -VERS = XFree86VersionString -PRE = XF86_VERSION_SNAP -NAME = "XFree86" -LINK = 'XFree86 Project, Inc.' -#endif -DATE = XFree86DateString -X_DEFS = $(INCLUDES) -DX_VERSION=$(VERS) -DX_PRE_RELEASE=$(PRE) \ - -DX_REL_DATE=$(DATE) -DX_VENDOR_NAME=$(NAME) -DX_VENDOR_LINK=$(LINK) - -AllTarget(XDarwinHelp.html) -CppFileTarget(XDarwinHelp.html,XDarwinHelp.html.cpp,$(X_DEFS), \ - NullParameter) - -AllTarget(InfoPlist.strings) -InfoPlist.strings: InfoPlist.strings.cpp - RemoveFile($@) - ClearmakeOSName \ - $(CPP) CppNoLineInfoOption $(X_DEFS) $@ - -clean:: - RemoveFiles(InfoPlist.strings) diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/Spanish.lproj/Localizable.strings b/nx-X11/programs/Xserver/hw/darwin/bundle/Spanish.lproj/Localizable.strings deleted file mode 100644 index 5bf813f1f..000000000 Binary files a/nx-X11/programs/Xserver/hw/darwin/bundle/Spanish.lproj/Localizable.strings and /dev/null differ diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/Spanish.lproj/MainMenu.nib/classes.nib b/nx-X11/programs/Xserver/hw/darwin/bundle/Spanish.lproj/MainMenu.nib/classes.nib deleted file mode 100644 index 77f345a4e..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/bundle/Spanish.lproj/MainMenu.nib/classes.nib +++ /dev/null @@ -1,72 +0,0 @@ -{ - IBClasses = ( - { - ACTIONS = {showHelp = id; }; - CLASS = FirstResponder; - LANGUAGE = ObjC; - SUPERCLASS = NSObject; - }, - { - ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; }; - CLASS = Preferences; - LANGUAGE = ObjC; - OUTLETS = { - addToPathButton = id; - addToPathField = id; - button2ModifiersMatrix = id; - button3ModifiersMatrix = id; - depthButton = id; - displayField = id; - dockSwitchButton = id; - fakeButton = id; - keymapFileField = id; - modeMatrix = id; - modeWindowButton = id; - mouseAccelChangeButton = id; - startupHelpButton = id; - switchKeyButton = id; - systemBeepButton = id; - useDefaultShellMatrix = id; - useOtherShellField = id; - useXineramaButton = id; - window = id; - }; - SUPERCLASS = NSObject; - }, - { - CLASS = XApplication; - LANGUAGE = ObjC; - OUTLETS = {preferences = id; xserver = id; }; - SUPERCLASS = NSApplication; - }, - { - ACTIONS = { - bringAllToFront = id; - closeHelpAndShow = id; - itemSelected = id; - nextWindow = id; - previousWindow = id; - showAction = id; - showSwitchPanel = id; - startFullScreen = id; - startRootless = id; - }; - CLASS = XServer; - LANGUAGE = ObjC; - OUTLETS = { - dockMenu = NSMenu; - helpWindow = NSWindow; - modeWindow = NSWindow; - startFullScreenButton = NSButton; - startRootlessButton = NSButton; - startupHelpButton = NSButton; - startupModeButton = NSButton; - switchWindow = NSPanel; - windowMenu = NSMenu; - windowSeparator = NSMenuItem; - }; - SUPERCLASS = NSObject; - } - ); - IBVersion = 1; -} \ No newline at end of file diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/Spanish.lproj/MainMenu.nib/objects.nib b/nx-X11/programs/Xserver/hw/darwin/bundle/Spanish.lproj/MainMenu.nib/objects.nib deleted file mode 100644 index 2df75ee0c..000000000 Binary files a/nx-X11/programs/Xserver/hw/darwin/bundle/Spanish.lproj/MainMenu.nib/objects.nib and /dev/null differ diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/Spanish.lproj/XDarwinHelp.html.cpp b/nx-X11/programs/Xserver/hw/darwin/bundle/Spanish.lproj/XDarwinHelp.html.cpp deleted file mode 100644 index 5cd27862d..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/bundle/Spanish.lproj/XDarwinHelp.html.cpp +++ /dev/null @@ -1,111 +0,0 @@ - - - - -XDarwin Ayuda - - -
-

XDarwin X Server for Mac OS X

- X_VENDOR_NAME X_VERSION
- Fecha de release: X_REL_DATE -
-

Contenido

-
    -
  1. Aviso Importante
  2. -
  3. Modo de uso
  4. -
  5. Configurando su Path
  6. -
  7. Preferencias del Usuario
  8. -
  9. Licencia
  10. -
-
-

Aviso Importante

-
-
-#if PRE_RELEASE -Esta es una versión pre-release de XDarwin, y no tiene ningún soporte. Patches y reportes de error pueden ser enviados a la página del proyecto XonX en SourceForge. Antes de reportar errores en versiones pre-release, por favor verifique la ultima versión en XonX o bien el X_VENDOR_LINK. -#else -Si el server el más antiguo que 6 a 12 meses, o si su hardware es posterior a la fecha indicada más arriba, por favor verifique la última versión antes de reportar problemas. Patches y reportes de error pueden ser enviados a la página del proyecto XonX en SourceForge. -#endif -
-
-Este software es distribuido bajo los términos de la Licencia MIT X11 / X Consortium y es provisto sin garantía alguna y en el estado en que se encuentra. Por favor lea la Licencia antes de utilizarlo.
- -

Modo de uso

-

XDarwin es una X server open-source de distribución libre del X Window System. This version of XDarwin was produced by the X_VENDOR_LINK. XDarwin funciona en Mac OS X en modo pantalla completa o en modo rootless (integrado al escritorio).

-

En modo pantalla completa, el X window system toma control total de la pantalla mientras esta activo. Presionando Command-Option-A puede regresar al Escritorio de Mac OS X. Esta combinación de teclas puede cambiarse en las Preferencias de Usuario. Desde el Escritorio de Mac OS X, haga click en ícono de XDarwin en el Dock para volver al X window system. (Puede cambiar esta comportamiento en las Preferencias de Usuario y configurar que XDarwin vuelva al X window system haciendo click en la ventana flotante con el logo X.)

-

En modo rootless, el X window system comparte la pantalla con Aqua. La ventana root de X11 es del tamaño de la pantalla y contiene a todas las demás ventanas. La ventana root de X11 no se muestra en este modo, ya que Aqua maneja el fondo de pantalla.

-

Emulación de mouse multi-botón

-

Muchas aplicaciones X11 requieren del uso de un mouse de 3 botones. Es posible emular un mouse de 3 botones con un mouse de solo un botón presionando teclas modificadoras mientras hace click. Esto es controlado en de la seccion "Emulación mouse" dentro de la sección "General" de las Preferencias del Usuario. Por defecto, la emulación está activa y utiliza la tecla Command para simular el 2do botón y la tecla Option para simlar el 3er botón. La conbinación para simular el 2do y 3er botón pueden ser modificada por cualquier combinación de teclas modificadoras dentro de las Preferencias del Usuario. Tenga en cuenta que aunque las teclas modificadoras hayan sido mapeadas a otras teclas con xmodmap, las teclas configuradas en las Preferencias del Usuario seguirán siendo las utilizadas por la emulación de mouse multi-botón.

- -

Configurando su Path

-

El path es la lista de directorios donde se buscarán los comandos ejecutables. Los comandos de X11 se encuentran en /usr/X11R6/bin, y éste necesita estar dentro de su path. XDarwin hace ésto automáticamente por defecto, y puede además agregar directorios adicionales donde tenga otros comandos de línea.

-

Usuarios experimentados pueden tener su path correctamente configurado mediante los archivos de inicio de su interprete de comandos. En este caso, puede informarle a XDarwin en las Preferencias de Usuario para que no modifique su path. XDarwin arrancará los clientes X11 iniciales usando el intérprete de comandos del usuario, según su configuración de login. Un intérprete de comandos alternativo puede ser especificado en las Preferencias del Usuario. La manera de configurar el path de su intérprete de comandos depende de cual está usando, y es generalmente descripta en las páginas man del mismo.

-

Además, Ud. puede agregar las páginas man de X11 a la lista de páginas que son consultadas. Estas están ubicadas en /usr/X11R6/man y MANPATH es la variable de entorno que contiene los directorios que son consultados.

- -

Preferencias del Usuario

-

Ciertas opciones pueden definirse dentro de "Preferencias...", en el menú de XDarwin. Las opciones dentro de de "Inicio" no surtirán efecto hasta que la aplicación se reinicie. Las restantes opciones surten efecto inmediatamente. Las diferentes opciones se describen a continuación:

-

General

-
    -
  • Usar beep del sistema en X11: Cuando esta opción está activa, el sonido de alerta estándar de Mac OS X se usará como alerta de X11. Cuando está desactivada, un simple tono es utilizado (esta es la opción por defecto).
  • -
  • Permitir que X11 cambie la aceleración del mouse: En una implementación estándard de X11, el window manager puede cambiar la aceleración del mouse. Esto puede llevar a una gran confusión si la aceleración es diferente en XDarwin y en Mac OS X. Por defecto, no se le permite a X11 alterar la aceleración para evitar este inconveniente.
  • -
  • Emulación de mouse multi-botón: Esta opción es descripta más arriba bajo Modo de Uso. Cuando esta emulación está activa los modificadores seleccionados deben ser presionados cuando se hace click para emular el botón 2 o el botón 3.
  • -
-

Inicio

-
    -
  • Modo inicial: Si el usuario no indica si desea utilizar la Pantalla Completa o el modo Rootless, el modo especificado aquí será el usado.
  • -
  • Mostrar panel de selección al inicio: Por defecto, un diálogo permite al usuario elegir entre Pantalla Completa o Rootless al inicio. Si esta opción esta desactivada, XDarwin arrancará utilizando el modo por defecto sin consultar al usuario.
  • -
  • Número de display X11: X11 permite que existan múltiples pantallas manejadas por servidores X11 separados funcionando en una misma computadora. El usuario puede especificar aqui un número entero para indicar el número de pantalla (display) que XDarwin utilizará si más de un servidor X funciona en forma simultánea.
  • -
  • Habilitar soporte Xinerama para múltipes monitores: XDarwin suporta múltiple monitores con Xinerama, que maneja todos los monitores como si fueran parte de una gran pantalla rectangular. Puede deshabilitar Xinerama con esta opción, pero XDarwin no maneja múltiples monitores en forma correcta sin esta opción habilitada. Si tiene solo un monitor, Xinerama es automáticamente deshabilitado.
  • -
  • Archivo de mapa de teclado: Un archivo de mapa de teclas es leído al inicio y es traducido a un keymap X11 (un archivo estándard de X11 para especificar la función de cada tecla). Estos archivos, disponibles para una amplia variedad de lenguajes, pueden encontrarse en /System/Library/Keyboards.
  • -
  • Al iniciar clientes X11: Cuando XDarwin arranca desde el Finder, éste ejecutará xinit para a su vez arrancar el window manager y otros clientes. (Vea en "man xinit" para mayor información). Antes de ejecutar xinit XDarwin agregará los directorios especificados al path del usuario. Por defecto, solo /usr/X11R6/bin es agregado. Otros directorios adicionales puede agregarse separados por dos puntos (:). Los clientes X son ejecutados con el intérprete de comandos del usuario, por lo que los archivos de inicio de éste son leídos. Si se desea, un intérprete de comandos diferente puede ser especificado.
  • -
-

Pantalla Completa

-
    -
  • Botón para definir combinación de teclas: Haga click en este botón y luego presione cualquier combinación de modificadores seguidos de una tecla convencional para definir que combinación usará para intercambiar entre X11 y Aqua.
  • -
  • Click en el ícono del Dock cambia a X11: Habilite esta opción para volver a X11 al hacer click en ícono de XDarwin en el Dock. En algunas versiones de Mac OS X, al volver haciendo click en el Dock puede causar al desaparción del cursor al volver a Aqua.
  • -
  • Mostrar ayuda al inicio: Esta opción habilitada hará que una pantalla inicial de introducción aparezca cuando XDarwin es arrancado en modo Pantalla Completa.
  • -
  • Profundidad de color (bits): En modo Pantalla Completa, el display X11 puede utilizar una profundidad de color diferente de la utilizada por Aqua. Si se especifica "Actual", la misma profundidad de color que Aqua utiliza será adoptada por X11. Al contrario, puede especificar 8, 15, o 24 bits.
  • -
- -

Licencia

-La licencia principal de XDarwin es basada en la Licencia MIT X11 tradicional, que no impone condiciones a la modificación o redistribución del código fuente o de archivos binarios más allá de requerir que los mensajes de Licencia y Copyright se mantengan intactos. Para mayor información y para mensajes adicionales de Licencia y Copyright que cubren algunas secciones del código fuente, por favor consulte the source code. -

Licencia del X Consortium

-

Copyright (C) 1996 X Consortium

-

Se otorga aqui permiso, libre de costo, a toda persona que obtenga una copia de este Software y los archivos de documentación asociados (el "Software"), -para utilizar el Software sin restricciones, incluyendo sin límites los derechos de usar, copiar, modificar, integrar con otros productos, publicar, distribuir, sub-licenciar y/o comercializar copias del Software, y de permitir a las personas que lo reciben para hacer lo propio, sujeto a las siguientes condiciones:

-

El mensaje de Copyright indicado más arriba y este permiso será incluído en todas las copias o porciones sustanciales del Software.

-

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE.

-

Excepto lo indicado en este mensaje, el nombre del X Consortium no será utilizado en propaganda o como medio de promoción para la venta, utilización u otros manejos de este Software sin previa autorización escrita del X Consortium.

-

X Window System es una marca registrada de X Consortium, Inc.

-

X Consortium License (English)

-

Copyright (C) 1996 X Consortium

-

Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without -limitation the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to permit persons to -whom the Software is furnished to do so, subject to the following conditions:

-

The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software.

-

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE.

-

Except as contained in this notice, the name of the X Consortium shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization from -the X Consortium.

-

X Window System is a trademark of X Consortium, Inc.

- - diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/Swedish.lproj/Credits.rtf b/nx-X11/programs/Xserver/hw/darwin/bundle/Swedish.lproj/Credits.rtf deleted file mode 100644 index 34408e78c..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/bundle/Swedish.lproj/Credits.rtf +++ /dev/null @@ -1,168 +0,0 @@ -{\rtf1\mac\ansicpg10000\cocoartf102 -{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;\f2\fswiss\fcharset77 Helvetica-Oblique; -} -{\colortbl;\red255\green255\blue255;} -\vieww5160\viewh6300\viewkind0 -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural - -\f0\fs24 \cf0 This product includes software developed by The XFree86 Project, Inc (http://www.xfree86.org/) and its contributors. The following people contributed to Darwin/Mac OS X support.\ -\ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc - -\f1\b \cf0 Contributors to Xorg Foundation Release: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Kaleb KEITHLEY\ - -\f2\i Working left and right Ctrl, Alt (Option), Meta (Command) and Shift keys. -\f0\i0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f1\b \cf0 \ -\f1\b \cf0 Contributors to XFree86 4.4: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 John Harper\ - -\f2\i Rootless acceleration and Apple-WM extension -\f0\i0 \ -Torrey T. Lyons\ - -\f2\i Project Lead -\f0\i0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f1\b \cf0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\cf0 Additional XonX Contributors to XFree86 4.3: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Fabr\'92cio Luis de Castro\ - -\f2\i Portuguese localization -\f0\i0 \ -Michael Oland\ - -\f2\i New XDarwin icon -\f0\i0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f1\b \cf0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\cf0 XonX Contributors to XFree86 4.2: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Rob Braun\ - -\f2\i Darwin x86 support -\f0\i0 \ -Pablo Di Noto\ - -\f2\i Spanish localization -\f0\i0 \ -Paul Edens\ - -\f2\i Dutch localization -\f0\i0 \ -Kyunghwan Kim\ - -\f2\i Korean localization -\f0\i0 \ -Mario Klebsch\ - -\f2\i Non-US keyboard support -\f0\i0 \ -Torrey T. Lyons\ - -\f2\i Project Lead -\f0\i0 \ -Andreas Monitzer\ - -\f2\i German localization -\f0\i0 \ -Patrik Montgomery\ - -\f2\i Swedish localization -\f0\i0 \ -Greg Parker\ - -\f2\i Rootless support -\f0\i0 \ -Toshimitsu Tanaka\ - -\f2\i Japanese localization -\f0\i0 \ -Olivier Verdier\ - -\f2\i French localization -\f0\i0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f1\b \cf0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\cf0 Special Thanks: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Devin Poolman and Zero G Software, Inc.\ - -\f2\i Installer -\f0\i0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f1\b \cf0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\cf0 XonX Team Members\ -Contributing to XFree86 4.1: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Rob Braun\ - -\f2\i Darwin x86 support -\f0\i0 \ -Torrey T. Lyons\ - -\f2\i Project Lead -\f0\i0 \ -Andreas Monitzer\ - -\f2\i Cocoa version of XDarwin front end -\f0\i0 \ -Greg Parker\ - -\f2\i Original Quartz implementation -\f0\i0 \ -Christoph Pfisterer\ - -\f2\i Dynamic shared libraries -\f0\i0 \ -Toshimitsu Tanaka\ - -\f2\i Japanese localization -\f0\i0 \ -\ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc - -\f1\b \cf0 Special Thanks: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Tiago Ribeiro\ - -\f2\i XDarwin icon -\f0\i0 \ -\ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc - -\f1\b \cf0 History: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 John Carmack\ - -\f2\i Original XFree86 port to Mac OS X Server -\f0\i0 \ -Dave Zarzycki\ - -\f2\i XFree86 4.0 port to Darwin 1.0 -\f0\i0 \ -Torrey T. Lyons\ - -\f2\i Integration into XFree86 Project for 4.0.2} \ No newline at end of file diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/Swedish.lproj/Imakefile b/nx-X11/programs/Xserver/hw/darwin/bundle/Swedish.lproj/Imakefile deleted file mode 100644 index d367fbcee..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/bundle/Swedish.lproj/Imakefile +++ /dev/null @@ -1,36 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/Imakefile,v 1.1 2001/05/21 01:42:17 torrey Exp $ - -#include - -LinkSourceFile(InfoPlist.strings.cpp,../English.lproj) - -INCLUDES = -I$(SERVERSRC)/include - -#if defined (XorgVersionString) -VERS = XorgVersionString -PRE = XORG_VERSION_SNAP -NAME = "X Version 11" -LINK = 'X.Org Foundation' -#elif defined XFree86VersionString -VERS = XFree86VersionString -PRE = XF86_VERSION_SNAP -NAME = "XFree86" -LINK = 'XFree86 Project, Inc.' -#endif -DATE = XFree86DateString -X_DEFS = $(INCLUDES) -DX_VERSION=$(VERS) -DX_PRE_RELEASE=$(PRE) \ - -DX_REL_DATE=$(DATE) -DX_VENDOR_NAME=$(NAME) -DX_VENDOR_LINK=$(LINK) - -AllTarget(XDarwinHelp.html) -CppFileTarget(XDarwinHelp.html,XDarwinHelp.html.cpp,$(X_DEFS), \ - NullParameter) - -AllTarget(InfoPlist.strings) -InfoPlist.strings: InfoPlist.strings.cpp - RemoveFile($@) - ClearmakeOSName \ - $(CPP) CppNoLineInfoOption $(X_DEFS) $@ - -clean:: - RemoveFiles(InfoPlist.strings) diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/Swedish.lproj/Localizable.strings b/nx-X11/programs/Xserver/hw/darwin/bundle/Swedish.lproj/Localizable.strings deleted file mode 100644 index 9709e5469..000000000 Binary files a/nx-X11/programs/Xserver/hw/darwin/bundle/Swedish.lproj/Localizable.strings and /dev/null differ diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/Swedish.lproj/MainMenu.nib/classes.nib b/nx-X11/programs/Xserver/hw/darwin/bundle/Swedish.lproj/MainMenu.nib/classes.nib deleted file mode 100644 index 77f345a4e..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/bundle/Swedish.lproj/MainMenu.nib/classes.nib +++ /dev/null @@ -1,72 +0,0 @@ -{ - IBClasses = ( - { - ACTIONS = {showHelp = id; }; - CLASS = FirstResponder; - LANGUAGE = ObjC; - SUPERCLASS = NSObject; - }, - { - ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; }; - CLASS = Preferences; - LANGUAGE = ObjC; - OUTLETS = { - addToPathButton = id; - addToPathField = id; - button2ModifiersMatrix = id; - button3ModifiersMatrix = id; - depthButton = id; - displayField = id; - dockSwitchButton = id; - fakeButton = id; - keymapFileField = id; - modeMatrix = id; - modeWindowButton = id; - mouseAccelChangeButton = id; - startupHelpButton = id; - switchKeyButton = id; - systemBeepButton = id; - useDefaultShellMatrix = id; - useOtherShellField = id; - useXineramaButton = id; - window = id; - }; - SUPERCLASS = NSObject; - }, - { - CLASS = XApplication; - LANGUAGE = ObjC; - OUTLETS = {preferences = id; xserver = id; }; - SUPERCLASS = NSApplication; - }, - { - ACTIONS = { - bringAllToFront = id; - closeHelpAndShow = id; - itemSelected = id; - nextWindow = id; - previousWindow = id; - showAction = id; - showSwitchPanel = id; - startFullScreen = id; - startRootless = id; - }; - CLASS = XServer; - LANGUAGE = ObjC; - OUTLETS = { - dockMenu = NSMenu; - helpWindow = NSWindow; - modeWindow = NSWindow; - startFullScreenButton = NSButton; - startRootlessButton = NSButton; - startupHelpButton = NSButton; - startupModeButton = NSButton; - switchWindow = NSPanel; - windowMenu = NSMenu; - windowSeparator = NSMenuItem; - }; - SUPERCLASS = NSObject; - } - ); - IBVersion = 1; -} \ No newline at end of file diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/Swedish.lproj/MainMenu.nib/objects.nib b/nx-X11/programs/Xserver/hw/darwin/bundle/Swedish.lproj/MainMenu.nib/objects.nib deleted file mode 100644 index 3157d72cb..000000000 Binary files a/nx-X11/programs/Xserver/hw/darwin/bundle/Swedish.lproj/MainMenu.nib/objects.nib and /dev/null differ diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/Swedish.lproj/XDarwinHelp.html.cpp b/nx-X11/programs/Xserver/hw/darwin/bundle/Swedish.lproj/XDarwinHelp.html.cpp deleted file mode 100644 index 4210878c0..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/bundle/Swedish.lproj/XDarwinHelp.html.cpp +++ /dev/null @@ -1,103 +0,0 @@ - - - - -XDarwin Help - - -
-

XDarwin X Server for Mac OS X

- X_VENDOR_NAME X_VERSION
- Färdigställt: X_REL_DATE -
-

Innehåll

-
    -
  1. Viktigt!
  2. -
  3. Användande
  4. -
  5. Att ställa in sin sökväg
  6. -
  7. Inställningar
  8. -
  9. Licens
  10. -
-
-

Viktigt!

-
-
-#if PRE_RELEASE -Detta är en testversion av XDarwin, och du kan inte garranteras någon som helst support för den. Buggar och fel kan rapporteras och förslag till fixar kan skickas till XonX-projektets sida på SourceForge. Innan du rapporterar buggar i testversioner, var god pröva den senaste versionen från XonX eller i X_VENDOR_LINK. -#else -Om servern är äldre än 6-12 månader, eller om din hårdvara är nyare än datumet ovan, leta efter en nyare version innan du rapporterar fel. Buggar och fel kan rapporteras och förslag till fixar kan skickas till XonX-projektets sida på SourceForge. -#endif -
-
-Denna programvara distrubueras i enlighet med MIT X11 / X Consortium License och tilhandhålls som den är, helt utan garantier. Var god läs igenom licensdokumentet (engelska) innan du använder programmet.
- -

Användande

-

XDarwin är en fritt spridd X server av X Window-systemet. This version of XDarwin was produced by the X_VENDOR_LINK. XDarwin kan köras på Mac OS X i fullskärmsläge eller rotlöst läge.

-

I fullskärmsläge kommer X window-systemet att ta över hela skärmen när det är aktivt. Du kan byta tillbaka till Mac OS Xs skrivbord genom att trycka Kommando-Alt-A. Denna tangentkombination kan ändra i inställningarna. När du är på Mac OS Xs skrivbord kan du klicka på XDarwin-ikonen i dockan för att byta tillbaka till X Window-systemet. (Du kan förändra detta beteende i inställningarna så att du istället måste klicka i det fltande bytesfönstret istället.)

-

I rotlöstläge delar X11 och Aqua på din skärm. Rotfönstret på X11-skärmen är av samma storlek som hela skärmen och innehåller alla andra fönster - det fungerar som bakgrund. I rotlöstläge visas inte detta rotfönster, eftersom Aqua hanterar skrvbordbakgrunden.

- -

Emulering av flerknapparsmus

-

Många X11-program utnyttjar en treknapparsmus. Du kan emulera en treknapparsmus med en knapp genom att hålla ner olika knappar på tangentbordet medan du klickar med musens enda knapp. Denna funktion styrs av inställningarna i "Emulera flerknapparsmus" under fliken "Diverse" i inställningarna. Grundinställningen är att emulationen är aktiv och att ett kommando-klick (Håll ner kommando och klicka) simulerar den andra musknappen. Den tredje musknappen fås genom att hålla ner alt och klicka. Du kan ändra detta till någon annan kombination av de fem tangenterna kommando, alt, kontrol, skift och fn (Powerbook/iBook). Notera att om dessa knappar har flyttats med hjälp av kommandot xmodmap kommer denna förändring inte att påverka vilka knappar som används vid flerknappsemulationen.

- -

Att ställa in sin sökväg

-

Din sökväg är en lista av kataloger som söks igenom när terminalen letar efter kommandon att exekvera. Kommandon som hör till X11 ligger i /usr/X11R6/bin, en katalog som inte ligger i din sökväg från början. XDarwin lägger till denna katalog åt dig, och du kan också lägga till ytterligare kataloger i vilka du lagt program som skall köras från kommandoraden.

-

Mer erfarna användare har antagligen redan ställt in sin sökväg i skalets inställningsfiler. Om detta gäller dig kan ställa in XDarwin så att din sökväg inte modifieras. XDarwin startar de första X11-klienterna i användarens inloggningsskal (Vill du använda ett alternativt skall, kan du specificera detta i inställningarna). Hur du ställer in din sökväg beror på vilket skal du använder. Exakt hur beskrivs i skalets man-sidor.

- -

Utöver detta kan du också vilja lägga till X11s man-sidor (dokumentation) till listan äver sidor som som skall sökas när du vill läsa efter dokumentationen. X11s man-sidor ligger i /usr/X11R6/man och listan äver kataloger att söka bestämms av variabelnMANPATH.

- -

Inställningar

-

I inställningarna finns ett antal alternativ där du kan påverka hur XDarwin beter sig i vissa fall. Inställningarna kommer du till genom att välja "Inställningar..." i menyn "XDarwin". De alternativ som finns under fliken "Starta" träder inte i kraft förrän du startat om programmet. Alla andra alternativ träder i kraft omedelbart. De olika alternativen beskrivs nedan:

-

Diverse

-
    -
  • Använd Mac OS varningsljud i X11: När detta alternativ är valt används Mac OS vanliga varningsljud är X11s varningsljud (bell). När detta alternativ inte är valt (förvalt) används en vanlig ton.
  • -
  • Tillåt X11 att ändra musens acceleration: I ett vanligt X11-system kan fönsterhanteraren ändra musens acceleration. Detta kan vara förvirrande eftersom musens acceleration kan vara olika i Mac OS Xs System Preferences och i fönsterhanteraren i X11. Förvalet är att X11 inte kan ändra musens acceleration för att på detta sätt undvika detta problem.
  • -
  • Emulera flerknapparsmus: Detta beskrivs ovan under Användande. När emulationen är aktiv måste du hålla ner de valda knapparna för att emulera en andra eller tredje musknapp.
  • -
-

Starta

-
    -
  • Förvalt läge: Om användaren inte på annat sätt väljer vilket läge som skall användas kommer alternativet här att användas.
  • -
  • Visa val av skärmläge vid start: Förvalet är att visa ett fönster när XDarwin startar som låter användaren välja mellan fullskärmsläge och rotlöst läge. Om detta alternativ inte är aktivt kommer XDarwin automatiskt att startas i det läge som valts ovan.
  • -
  • Skärmnummer i X11: X11 tillåter att det finns flera skärmar styrda av varsin X-server på en och samma dator. Användaren kan ange vilket nummer XDarwin skall använda om mer än en X-server skall användas samtidigt.
  • -
  • Aktivera Xinerama (stöd för flera skärmar): XDarwin stödjer flera skärmar genom Xinerama, vilket hanterar alla skrämar som delar av en enda stor rektangulär skärm. Du kan använda detta alternativ för att stänga av Xinerama, men för närvarande kan inte XDarwin hantera flera skärmar utan det. Om du bara har en skärm kommer Xinerama automatiskt att deaktiveras.
  • -
  • Fil med tangentbordsuppsättning: En fil som anger tangentbordsuppsättning läses vid start och översätts till en tangentborsuppsättningsfil för X11. Filer med tangentbordsuppsättningar för ett stort antal språk finns i /System/Library/Keyboards.
  • -
  • Startar första X11-klienterna: När X11 startas från Finder kommer det att exekvera filen xinit för att starta fönsterhanteraren i X11 och andra program. (Se "man xinit" för mer information.) Innan XDarwin kör xinit kommer det att lägga till katalogern här till användarens sökväg. Förvalet är att endast lägga till katalogen /usr/X11R6/bin. Ytterligare kataloger kan läggas till - separera dem med kolon. X11-klienterna startas i användarens inloggningsskal så att användarens inställningsfiler i skalet läses. Om så önskas kan de startas i ett annat skal.
  • -
-

Fullskärm

-
    -
  • Tangentkombinationsknappen: Tryck på denna knapp och en tangentkombination för att ändra den tangentkombination som används för att byta mellan X11 och Aqua.
  • -
  • Klick på ikonen i dockan byter till X11: Aktivera detta alternativ för att byta till X11 genom att klicka på ikonen i dockan. I vissa versioner av Mac OS X kommer ett bte på detta sätt att gömma pekaren när du återvänder till Aqua.
  • -
  • Visa fullskärmshjälp vid start: Detta kommer att visa en informationsruta när XDarwin startas i fullskärmsläge.
  • -
  • Färgdjup: I fullskärmsläge kan X11 använda ett annat färgdjup än Aquas. Om du väjer "Nuvarande" kommer X11 att använda det färgdjup som Aqua har just då. Annars kan du välja 8, 15, eller 24 bitare färg.
  • -
- -

Licens (svenska)

-

Den huvudsakliga licens vi använder oss av är baserad på den traditionella MIT X11 / XConsortium-licensen, vilken inte på något sätt begränsar förändringar eller vidarespridning av vare sig källkod eller kompilerad programvara annat än genom att kräva att delarna som rör copyright och licensiering lämnas intakta. För mer information och ytterligare copyright/licensieringsinfromation rörande vissa speciella delar av koden, se the source code.

- -

Licence (english)

-

The main license for XDarwin is based on the traditional MIT X11 / X Consortium License, which does not impose any conditions on modification or redistribution of source code or binaries other than requiring that copyright/license notices are left intact. For more information and additional copyright/licensing notices covering some sections of the code, please refer to the source code.

- -

X Consortium License

-

Copyright (C) 1996 X Consortium

-

Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without -limitation the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to permit persons to -whom the Software is furnished to do so, subject to the following conditions:

-

The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software.

-

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE.

-

Except as contained in this notice, the name of the X Consortium shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization from -the X Consortium.

-

X Window System is a trademark of X Consortium, Inc.

- - diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/XDarwin.icns b/nx-X11/programs/Xserver/hw/darwin/bundle/XDarwin.icns deleted file mode 100644 index 9c560846e..000000000 Binary files a/nx-X11/programs/Xserver/hw/darwin/bundle/XDarwin.icns and /dev/null differ diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/ko.lproj/Credits.rtf b/nx-X11/programs/Xserver/hw/darwin/bundle/ko.lproj/Credits.rtf deleted file mode 100644 index 34408e78c..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/bundle/ko.lproj/Credits.rtf +++ /dev/null @@ -1,168 +0,0 @@ -{\rtf1\mac\ansicpg10000\cocoartf102 -{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;\f2\fswiss\fcharset77 Helvetica-Oblique; -} -{\colortbl;\red255\green255\blue255;} -\vieww5160\viewh6300\viewkind0 -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural - -\f0\fs24 \cf0 This product includes software developed by The XFree86 Project, Inc (http://www.xfree86.org/) and its contributors. The following people contributed to Darwin/Mac OS X support.\ -\ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc - -\f1\b \cf0 Contributors to Xorg Foundation Release: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Kaleb KEITHLEY\ - -\f2\i Working left and right Ctrl, Alt (Option), Meta (Command) and Shift keys. -\f0\i0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f1\b \cf0 \ -\f1\b \cf0 Contributors to XFree86 4.4: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 John Harper\ - -\f2\i Rootless acceleration and Apple-WM extension -\f0\i0 \ -Torrey T. Lyons\ - -\f2\i Project Lead -\f0\i0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f1\b \cf0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\cf0 Additional XonX Contributors to XFree86 4.3: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Fabr\'92cio Luis de Castro\ - -\f2\i Portuguese localization -\f0\i0 \ -Michael Oland\ - -\f2\i New XDarwin icon -\f0\i0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f1\b \cf0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\cf0 XonX Contributors to XFree86 4.2: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Rob Braun\ - -\f2\i Darwin x86 support -\f0\i0 \ -Pablo Di Noto\ - -\f2\i Spanish localization -\f0\i0 \ -Paul Edens\ - -\f2\i Dutch localization -\f0\i0 \ -Kyunghwan Kim\ - -\f2\i Korean localization -\f0\i0 \ -Mario Klebsch\ - -\f2\i Non-US keyboard support -\f0\i0 \ -Torrey T. Lyons\ - -\f2\i Project Lead -\f0\i0 \ -Andreas Monitzer\ - -\f2\i German localization -\f0\i0 \ -Patrik Montgomery\ - -\f2\i Swedish localization -\f0\i0 \ -Greg Parker\ - -\f2\i Rootless support -\f0\i0 \ -Toshimitsu Tanaka\ - -\f2\i Japanese localization -\f0\i0 \ -Olivier Verdier\ - -\f2\i French localization -\f0\i0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f1\b \cf0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\cf0 Special Thanks: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Devin Poolman and Zero G Software, Inc.\ - -\f2\i Installer -\f0\i0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f1\b \cf0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\cf0 XonX Team Members\ -Contributing to XFree86 4.1: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Rob Braun\ - -\f2\i Darwin x86 support -\f0\i0 \ -Torrey T. Lyons\ - -\f2\i Project Lead -\f0\i0 \ -Andreas Monitzer\ - -\f2\i Cocoa version of XDarwin front end -\f0\i0 \ -Greg Parker\ - -\f2\i Original Quartz implementation -\f0\i0 \ -Christoph Pfisterer\ - -\f2\i Dynamic shared libraries -\f0\i0 \ -Toshimitsu Tanaka\ - -\f2\i Japanese localization -\f0\i0 \ -\ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc - -\f1\b \cf0 Special Thanks: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 Tiago Ribeiro\ - -\f2\i XDarwin icon -\f0\i0 \ -\ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc - -\f1\b \cf0 History: -\f0\b0 \ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\cf0 John Carmack\ - -\f2\i Original XFree86 port to Mac OS X Server -\f0\i0 \ -Dave Zarzycki\ - -\f2\i XFree86 4.0 port to Darwin 1.0 -\f0\i0 \ -Torrey T. Lyons\ - -\f2\i Integration into XFree86 Project for 4.0.2} \ No newline at end of file diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/ko.lproj/Imakefile b/nx-X11/programs/Xserver/hw/darwin/bundle/ko.lproj/Imakefile deleted file mode 100644 index d367fbcee..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/bundle/ko.lproj/Imakefile +++ /dev/null @@ -1,36 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/Imakefile,v 1.1 2001/05/21 01:42:17 torrey Exp $ - -#include - -LinkSourceFile(InfoPlist.strings.cpp,../English.lproj) - -INCLUDES = -I$(SERVERSRC)/include - -#if defined (XorgVersionString) -VERS = XorgVersionString -PRE = XORG_VERSION_SNAP -NAME = "X Version 11" -LINK = 'X.Org Foundation' -#elif defined XFree86VersionString -VERS = XFree86VersionString -PRE = XF86_VERSION_SNAP -NAME = "XFree86" -LINK = 'XFree86 Project, Inc.' -#endif -DATE = XFree86DateString -X_DEFS = $(INCLUDES) -DX_VERSION=$(VERS) -DX_PRE_RELEASE=$(PRE) \ - -DX_REL_DATE=$(DATE) -DX_VENDOR_NAME=$(NAME) -DX_VENDOR_LINK=$(LINK) - -AllTarget(XDarwinHelp.html) -CppFileTarget(XDarwinHelp.html,XDarwinHelp.html.cpp,$(X_DEFS), \ - NullParameter) - -AllTarget(InfoPlist.strings) -InfoPlist.strings: InfoPlist.strings.cpp - RemoveFile($@) - ClearmakeOSName \ - $(CPP) CppNoLineInfoOption $(X_DEFS) $@ - -clean:: - RemoveFiles(InfoPlist.strings) diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/ko.lproj/Localizable.strings b/nx-X11/programs/Xserver/hw/darwin/bundle/ko.lproj/Localizable.strings deleted file mode 100644 index fb8c77e0d..000000000 Binary files a/nx-X11/programs/Xserver/hw/darwin/bundle/ko.lproj/Localizable.strings and /dev/null differ diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/ko.lproj/MainMenu.nib/classes.nib b/nx-X11/programs/Xserver/hw/darwin/bundle/ko.lproj/MainMenu.nib/classes.nib deleted file mode 100644 index 77f345a4e..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/bundle/ko.lproj/MainMenu.nib/classes.nib +++ /dev/null @@ -1,72 +0,0 @@ -{ - IBClasses = ( - { - ACTIONS = {showHelp = id; }; - CLASS = FirstResponder; - LANGUAGE = ObjC; - SUPERCLASS = NSObject; - }, - { - ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; }; - CLASS = Preferences; - LANGUAGE = ObjC; - OUTLETS = { - addToPathButton = id; - addToPathField = id; - button2ModifiersMatrix = id; - button3ModifiersMatrix = id; - depthButton = id; - displayField = id; - dockSwitchButton = id; - fakeButton = id; - keymapFileField = id; - modeMatrix = id; - modeWindowButton = id; - mouseAccelChangeButton = id; - startupHelpButton = id; - switchKeyButton = id; - systemBeepButton = id; - useDefaultShellMatrix = id; - useOtherShellField = id; - useXineramaButton = id; - window = id; - }; - SUPERCLASS = NSObject; - }, - { - CLASS = XApplication; - LANGUAGE = ObjC; - OUTLETS = {preferences = id; xserver = id; }; - SUPERCLASS = NSApplication; - }, - { - ACTIONS = { - bringAllToFront = id; - closeHelpAndShow = id; - itemSelected = id; - nextWindow = id; - previousWindow = id; - showAction = id; - showSwitchPanel = id; - startFullScreen = id; - startRootless = id; - }; - CLASS = XServer; - LANGUAGE = ObjC; - OUTLETS = { - dockMenu = NSMenu; - helpWindow = NSWindow; - modeWindow = NSWindow; - startFullScreenButton = NSButton; - startRootlessButton = NSButton; - startupHelpButton = NSButton; - startupModeButton = NSButton; - switchWindow = NSPanel; - windowMenu = NSMenu; - windowSeparator = NSMenuItem; - }; - SUPERCLASS = NSObject; - } - ); - IBVersion = 1; -} \ No newline at end of file diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/ko.lproj/MainMenu.nib/objects.nib b/nx-X11/programs/Xserver/hw/darwin/bundle/ko.lproj/MainMenu.nib/objects.nib deleted file mode 100644 index 8f9b5e01c..000000000 Binary files a/nx-X11/programs/Xserver/hw/darwin/bundle/ko.lproj/MainMenu.nib/objects.nib and /dev/null differ diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/ko.lproj/XDarwinHelp.html.cpp b/nx-X11/programs/Xserver/hw/darwin/bundle/ko.lproj/XDarwinHelp.html.cpp deleted file mode 100644 index 5996285ae..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/bundle/ko.lproj/XDarwinHelp.html.cpp +++ /dev/null @@ -1,96 +0,0 @@ - - - - -XDarwin Help - - -
-

XDarwin X Server for Mac OS X

- X_VENDOR_NAME X_VERSION
- Release Date: X_REL_DATE -
-

Contents

-
    -
  1. Important Notice
  2. -
  3. Usage
  4. -
  5. Setting Your Path
  6. -
  7. User Preferences
  8. -
  9. License
  10. -
-
-

Important Notice

-
-
-#if X_PRE_RELEASE -This is a pre-release version of XDarwin, and is not supported in any way. Bugs may be reported and patches may be submitted to the XonX project page at SourceForge. Before reporting bugs in pre-release versions, please check the latest version from XonX or the X_VENDOR_LINK. -#else -If the server is older than 6-12 months, or if your hardware is newer than the above date, look for a newer version before reporting problems. Bugs may be reported and patches may be submitted to the XonX project page at SourceForge. -#endif -
-
-This software is distributed under the terms of the MIT X11 / X Consortium License and is provided AS IS, with no warranty. Please read the License before using.
- -

Usage

-

XDarwin is a freely redistributable open-source X server for the X Window System. This version of XDarwin was produced by the X_VENDOR_LINK. XDarwin runs on Mac OS X in full screen or rootless modes.

-

In full screen mode, when the X window system is active, it takes over the entire screen. You can switch back to the Mac OS X desktop by holding down Command-Option-A. This key combination can be changed in the user preferences. From the Mac OS X desktop, click on the XDarwin icon in the Dock to switch back to the X window system. (You can change this behavior in the user preferences so that you must click the XDarwin icon in the floating switch window instead.)

-

In rootless mode, the X window system and Aqua share your display. The root window of the X11 display is the size of the screen and contains all the other windows. The X11 root window is not displayed in rootless mode as Aqua handles the desktop background.

-

Multi-Button Mouse Emulation

-

Many X11 applications rely on the use of a 3-button mouse. You can emulate a 3-button mouse with a single button by holding down various modifier keys while you click the mouse button. This is controlled by settings in the "Multi-Button Mouse Emulation" section of the "General" preferences. By default, emulation is on and holding down the command key and clicking the mouse button will simulate clicking the second mouse button. Holding down the option key and clicking will simulate the third button. You can change to any combination of modifiers to emulate buttons two and three in the preferences. Note, even if the modifiers keys are mapped to some other key with xmodmap, you still must use the actual keys specified in the preferences for multi-button mouse emulation.

- -

Setting Your Path

-

Your path is the list of directories to be searched for executable commands. The X11 commands are located in /usr/X11R6/bin, which needs to be added to your path. XDarwin does this for you by default and can also add additional directories where you have installed command line applications.

-

More experienced users will have already set their path correctly using the initialization files for their shell. In this case, you can inform XDarwin not to modify your path in the preferences. XDarwin launches the initial X11 clients in the user's default login shell. (An alternate shell can also be specified in the preferences.) The way to set the path depends on the shell you are using. This is described in the man page documentation for the shell.

-

In addition you may also want to add the X11 man pages to the list of pages to be searched when you are looking for documentation. The X11 man pages are located in /usr/X11R6/man and the MANPATH environment variable contains the list of directories to search.

- -

User Preferences

-

A number of options may be set from the user preferences, accessible from the "Preferences..." menu item in the "XDarwin" menu. The options listed as start up options will not take effect until you have restarted XDarwin. All other options take effect immediately. The various options are described below:

-

General

-
    -
  • Use System beep for X11: When enabled the standard Mac OS X alert sound is used as the X11 bell. When disabled (default) a simple tone is used.
  • -
  • Allow X11 to change mouse acceleration: In a standard X window system implementation, the window manager can change the mouse acceleration. This can lead to confusion as the mouse acceleration may be set to different values by the Mac OS X System Preferences and the X window manager. By default, X11 is not allowed to change the mouse acceleration to avoid this problem.
  • -
  • Multi-Button Mouse Emulation: This is described above under Usage. When emulation is enabled the selected modifiers must be held down when the mouse button is pushed to emulate the second or third mouse buttons.
  • -
-

Start Up

-
    -
  • Default Mode: If the user does not indicate whether to run in full screen or rootless mode, the mode specified here will be used.
  • -
  • Show mode pick panel on startup: By default, a panel is displayed when XDarwin is started to allow the user to choose between full screen or rootless mode. If this option is turned off, the default mode will be started automatically.
  • -
  • X11 Display number: X11 allows there to be multiple displays managed by separate X servers on a single computer. The user may specify an integer display number for XDarwin to use if more than one X server is going to be run simultaneously.
  • -
  • Allow Xinerama multiple monitor support: XDarwin supports multiple monitors with Xinerama, which treats all monitors as being part of one large rectangular screen. You can disable Xinerama with this option, but currently XDarwin does not handle multiple monitors correctly without it. If you only have a single monitor, Xinerama is automatically disabled.
  • -
  • Keymapping File: A keymapping file is read at startup and translated to an X11 keymap. Keymapping files, available for a wide variety of languages, are found in /System/Library/Keyboards.
  • -
  • Starting First X11 Clients: When XDarwin is started from the Finder, it will run xinit to launch the X window manager and other X clients. (See "man xinit" for more information.) Before XDarwin runs xinit it will add the specified directories to the user's path. By default only /usr/X11R6/bin is added. Additional directories may added, separated by a colon. The X clients are started in the user's default login shell so that the user's shell initialization files are read. If desired, an alternate shell may be specified.
  • -
-

Full Screen

-
    -
  • Key combination button: Click this button and then press any number of modifiers followed by a standard key to change the key combination to switch between Aqua and X11.
  • -
  • Click on icon in Dock switches to X11: Enable this to activate switching to X11 by clicking on the XDarwin icon in the Dock. On some versions of Mac OS X, switching by clicking in the Dock can cause the cursor to disappear on returning to Aqua.
  • -
  • Show help on startup: This will show an introductory splash screen when XDarwin is started in full screen mode.
  • -
  • Color bit depth: In full screen mode, the X11 display can use a different color bit depth than is used by Aqua. If "Current" is specified, the depth used by Aqua when XDarwin starts will be used. Otherwise 8, 15, or 24 bits may be specified.
  • -
- -

License

-The main license for XDarwin is based on the traditional MIT X11 / X Consortium License, which does not impose any conditions on modification or redistribution of source code or binaries other than requiring that copyright/license notices are left intact. For more information and additional copyright/licensing notices covering some sections of the code, please refer to the source code. -

X Consortium License

-

Copyright (C) 1996 X Consortium

-

Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without -limitation the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to permit persons to -whom the Software is furnished to do so, subject to the following conditions:

-

The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software.

-

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE.

-

Except as contained in this notice, the name of the X Consortium shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization from -the X Consortium.

-

X Window System is a trademark of X Consortium, Inc.

- - diff --git a/nx-X11/programs/Xserver/hw/darwin/bundle/startXClients.cpp b/nx-X11/programs/Xserver/hw/darwin/bundle/startXClients.cpp deleted file mode 100644 index 51cdb5c9e..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/bundle/startXClients.cpp +++ /dev/null @@ -1,24 +0,0 @@ -XCOMM!/bin/sh - -XCOMM This script is used by XDarwin to start X clients when XDarwin is -XCOMM launched from the Finder. -XCOMM -XCOMM $XFree86: $ - -userclientrc=$HOME/.xinitrc -sysclientrc=XINITDIR/xinitrc -clientargs="" - -if [ -f $userclientrc ]; then - clientargs=$userclientrc -else if [ -f $sysclientrc ]; then - clientargs=$sysclientrc -fi -fi - -if [ "x$2" != "x" ]; then - PATH="$PATH:$2" - export PATH -fi - -exec xinit $clientargs -- XBINDIR/XDarwinStartup "$1" -idle diff --git a/nx-X11/programs/Xserver/hw/darwin/darwin.c b/nx-X11/programs/Xserver/hw/darwin/darwin.c deleted file mode 100644 index 99241d927..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/darwin.c +++ /dev/null @@ -1,1108 +0,0 @@ -/************************************************************** - * - * Shared code for the Darwin X Server - * running with Quartz or IOKit display mode - * - **************************************************************/ -/* - * Copyright (c) 2001-2004 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XdotOrg: xc/programs/Xserver/hw/darwin/darwin.c,v 1.8 2005/07/03 08:53:38 daniels Exp $ */ -/* $XFree86: xc/programs/Xserver/hw/darwin/darwin.c,v 1.55 2003/11/15 00:07:09 torrey Exp $ */ - -#include -#include -#include "os.h" -#include "servermd.h" -#include "inputstr.h" -#include "scrnintstr.h" -#include "mibstore.h" // mi backing store implementation -#include "mipointer.h" // mi software cursor -#include "micmap.h" // mi colormap code -#include "fb.h" // fb framebuffer code -#include "site.h" -#include "globals.h" -#include "xorgVersion.h" -#include "xf86Date.h" -#include "dix.h" - -#ifdef XINPUT -# include -# include -# include "exevents.h" -# include "extinit.h" -#endif - -#include -#include -#include -#include -#include -#include - -#define HAS_UTSNAME 1 -#include - -#define NO_CFPLUGIN -#include -#include -#include - -#include "darwin.h" -#include "darwinClut8.h" - -/* - * X server shared global variables - */ -int darwinScreensFound = 0; -int darwinScreenIndex = 0; -io_connect_t darwinParamConnect = 0; -int darwinEventReadFD = -1; -int darwinEventWriteFD = -1; -int darwinMouseAccelChange = 1; -int darwinFakeButtons = 0; - -// location of X11's (0,0) point in global screen coordinates -int darwinMainScreenX = 0; -int darwinMainScreenY = 0; - -// parameters read from the command line or user preferences -unsigned int darwinDesiredWidth = 0, darwinDesiredHeight = 0; -int darwinDesiredDepth = -1; -int darwinDesiredRefresh = -1; -char *darwinKeymapFile = "USA.keymapping"; -int darwinSyncKeymap = FALSE; -int darwinSwapAltMeta = FALSE; - -// modifier masks for faking mouse buttons -int darwinFakeMouse2Mask = NX_COMMANDMASK; -int darwinFakeMouse3Mask = NX_ALTERNATEMASK; - -// devices -DeviceIntPtr darwinPointer = NULL; -DeviceIntPtr darwinKeyboard = NULL; - -// Common pixmap formats -static PixmapFormatRec formats[] = { - { 1, 1, BITMAP_SCANLINE_PAD }, - { 4, 8, BITMAP_SCANLINE_PAD }, - { 8, 8, BITMAP_SCANLINE_PAD }, - { 15, 16, BITMAP_SCANLINE_PAD }, - { 16, 16, BITMAP_SCANLINE_PAD }, - { 24, 32, BITMAP_SCANLINE_PAD }, - { 32, 32, BITMAP_SCANLINE_PAD } -}; -const int NUMFORMATS = sizeof(formats)/sizeof(formats[0]); - -#ifndef OSNAME -#define OSNAME " Darwin" -#endif -#ifndef OSVENDOR -#define OSVENDOR "" -#endif -#ifndef PRE_RELEASE -#define PRE_RELEASE XORG_VERSION_SNAP -#endif - -void -DarwinPrintBanner() -{ -#if PRE_RELEASE - ErrorF("\n" - "This is a pre-release version of the " XVENDORNAME " X11.\n" - "Portions of this release are based on XFree86 4.4RC2 and selected\n" - "files from XFree86 4.4RC3. It is not supported in any way.\n" - "Bugs may be filed in the bugzilla at http://bugs.freedesktop.org/.\n" - "Select the \"xorg\" product for bugs you find in this release.\n" - "Before reporting bugs in pre-release versions please check the\n" - "latest version in the " XVENDORNAME " \"monolithic tree\" CVS\n" - "repository hosted at http://www.freedesktop.org/Software/xorg/"); -#endif -#if XORG_VERSION_SNAP > 0 - ErrorF(".%d", XORG_VERSION_SNAP); -#endif - -#if XORG_VERSION_SNAP >= 900 - ErrorF(" (%d.%d.0 RC %d)", XORG_VERSION_MAJOR, XORG_VERSION_MINOR + 1, - XORG_VERSION_SNAP - 900); -#endif - -#ifdef XORG_CUSTOM_VERSION - ErrorF(" (%s)", XF86_CUSTOM_VERSION); -#endif - ErrorF("\nRelease Date: %s\n", XF86_DATE); - ErrorF("X Protocol Version %d, Revision %d, %s\n", - X_PROTOCOL, X_PROTOCOL_REVISION, XORG_RELEASE ); - ErrorF("Build Operating System:%s%s\n", OSNAME, OSVENDOR); -#ifdef HAS_UTSNAME - { - struct utsname name; - - if (uname(&name) == 0) { - ErrorF("Current Operating System: %s %s %s %s %s\n", - name.sysname, name.nodename, name.release, name.version, name.machine); - } - } -#endif -#if defined(BUILD_DATE) && (BUILD_DATE > 19000000) - { - struct tm t; - char buf[100]; - - bzero(&t, sizeof(t)); - bzero(buf, sizeof(buf)); - t.tm_mday = BUILD_DATE % 100; - t.tm_mon = (BUILD_DATE / 100) % 100 - 1; - t.tm_year = BUILD_DATE / 10000 - 1900; - if (strftime(buf, sizeof(buf), "%d %B %Y", &t)) - ErrorF("Build Date: %s\n", buf); - } -#endif -#if defined(CLOG_DATE) && (CLOG_DATE > 19000000) - { - struct tm t; - char buf[100]; - - bzero(&t, sizeof(t)); - bzero(buf, sizeof(buf)); - t.tm_mday = CLOG_DATE % 100; - t.tm_mon = (CLOG_DATE / 100) % 100 - 1; - t.tm_year = CLOG_DATE / 10000 - 1900; - if (strftime(buf, sizeof(buf), "%d %B %Y", &t)) - ErrorF("Changelog Date: %s\n", buf); - } -#endif -#if defined(BUILDERSTRING) - ErrorF("%s \n",BUILDERSTRING); -#endif - ErrorF("\tBefore reporting problems, check "__VENDORDWEBSUPPORT__"\n" - "\tto make sure that you have the latest version.\n"); -} - - -/* - * DarwinSaveScreen - * X screensaver support. Not implemented. - */ -static Bool DarwinSaveScreen(ScreenPtr pScreen, int on) -{ - // FIXME - if (on == SCREEN_SAVER_FORCER) { - } else if (on == SCREEN_SAVER_ON) { - } else { - } - return TRUE; -} - - -/* - * DarwinAddScreen - * This is a callback from dix during AddScreen() from InitOutput(). - * Initialize the screen and communicate information about it back to dix. - */ -static Bool DarwinAddScreen( - int index, - ScreenPtr pScreen, - int argc, - char **argv ) -{ - int bitsPerRGB, i, dpi; - static int foundIndex = 0; - Bool ret; - VisualPtr visual; - ColormapPtr pmap; - DarwinFramebufferPtr dfb; - - // reset index of found screens for each server generation - if (index == 0) foundIndex = 0; - - // allocate space for private per screen storage - dfb = xalloc(sizeof(DarwinFramebufferRec)); - SCREEN_PRIV(pScreen) = dfb; - - // setup hardware/mode specific details - ret = DarwinModeAddScreen(foundIndex, pScreen); - foundIndex++; - if (! ret) - return FALSE; - - bitsPerRGB = dfb->bitsPerComponent; - - // reset the visual list - miClearVisualTypes(); - - // setup a single visual appropriate for our pixel type - if (dfb->colorType == TrueColor) { - if (!miSetVisualTypes( dfb->colorBitsPerPixel, TrueColorMask, - bitsPerRGB, TrueColor )) { - return FALSE; - } - } else if (dfb->colorType == PseudoColor) { - if (!miSetVisualTypes( dfb->colorBitsPerPixel, PseudoColorMask, - bitsPerRGB, PseudoColor )) { - return FALSE; - } - } else if (dfb->colorType == StaticColor) { - if (!miSetVisualTypes( dfb->colorBitsPerPixel, StaticColorMask, - bitsPerRGB, StaticColor )) { - return FALSE; - } - } else { - return FALSE; - } - - miSetPixmapDepths(); - - // machine independent screen init - // setup _Screen structure in pScreen - if (monitorResolution) - dpi = monitorResolution; - else - dpi = 75; - - // initialize fb - if (! fbScreenInit(pScreen, - dfb->framebuffer, // pointer to screen bitmap - dfb->width, dfb->height, // screen size in pixels - dpi, dpi, // dots per inch - dfb->pitch/(dfb->bitsPerPixel/8), // pixel width of framebuffer - dfb->bitsPerPixel)) // bits per pixel for screen - { - return FALSE; - } - - // set the RGB order correctly for TrueColor - if (dfb->bitsPerPixel > 8) { - for (i = 0, visual = pScreen->visuals; // someday we may have more than 1 - i < pScreen->numVisuals; i++, visual++) { - if (visual->class == TrueColor) { - visual->offsetRed = bitsPerRGB * 2; - visual->offsetGreen = bitsPerRGB; - visual->offsetBlue = 0; - visual->redMask = ((1<offsetRed; - visual->greenMask = ((1<offsetGreen; - visual->blueMask = ((1<offsetBlue; - } - } - } - -#ifdef RENDER - if (! fbPictureInit(pScreen, 0, 0)) { - return FALSE; - } -#endif - -#ifdef MITSHM - ShmRegisterFbFuncs(pScreen); -#endif - - // this must be initialized (why doesn't X have a default?) - pScreen->SaveScreen = DarwinSaveScreen; - - // finish mode dependent screen setup including cursor support - if (!DarwinModeSetupScreen(index, pScreen)) { - return FALSE; - } - - // create and install the default colormap and - // set pScreen->blackPixel / pScreen->white - if (!miCreateDefColormap( pScreen )) { - return FALSE; - } - - /* Set the colormap to the statically defined one if we're in 8 bit - * mode and we're using a fixed color map. Essentially this translates - * to Darwin/x86 in 8-bit mode. - */ - if( (dfb->colorBitsPerPixel == 8) && - (dfb->colorType == StaticColor) ) - { - pmap = miInstalledMaps[pScreen->myNum]; - visual = pmap->pVisual; - for( i = 0; i < visual->ColormapEntries; i++ ) { - pmap->red[i].co.local.red = darwinClut8[i].red; - pmap->red[i].co.local.green = darwinClut8[i].green; - pmap->red[i].co.local.blue = darwinClut8[i].blue; - } - } - - dixScreenOrigins[index].x = dfb->x; - dixScreenOrigins[index].y = dfb->y; - - ErrorF("Screen %d added: %dx%d @ (%d,%d)\n", - index, dfb->width, dfb->height, dfb->x, dfb->y); - - return TRUE; -} - -/* - ============================================================================= - - mouse and keyboard callbacks - - ============================================================================= -*/ - -/* - * DarwinChangePointerControl - * Set mouse acceleration and thresholding - * FIXME: We currently ignore the threshold in ctrl->threshold. - */ -static void DarwinChangePointerControl( - DeviceIntPtr device, - PtrCtrl *ctrl ) -{ - kern_return_t kr; - double acceleration; - - if (!darwinMouseAccelChange) - return; - - acceleration = ctrl->num / ctrl->den; - kr = IOHIDSetMouseAcceleration( darwinParamConnect, acceleration ); - if (kr != KERN_SUCCESS) - ErrorF( "Could not set mouse acceleration with kernel return = 0x%x.\n", kr ); -} - - -/* - * DarwinMouseProc - * Handle the initialization, etc. of a mouse - */ -static int DarwinMouseProc( - DeviceIntPtr pPointer, - int what ) -{ - char map[6]; - - switch (what) { - - case DEVICE_INIT: - pPointer->public.on = FALSE; - - // Set button map. - map[1] = 1; - map[2] = 2; - map[3] = 3; - map[4] = 4; - map[5] = 5; - InitPointerDeviceStruct( (DevicePtr)pPointer, - map, - 5, // numbuttons (4 & 5 are scroll wheel) - miPointerGetMotionEvents, - DarwinChangePointerControl, - 0 ); -#ifdef XINPUT - InitValuatorAxisStruct( pPointer, - 0, // X axis - 0, // min value - 16000, // max value (fixme screen size?) - 1, // resolution (fixme ?) - 1, // min resolution - 1 ); // max resolution - InitValuatorAxisStruct( pPointer, - 1, // X axis - 0, // min value - 16000, // max value (fixme screen size?) - 1, // resolution (fixme ?) - 1, // min resolution - 1 ); // max resolution -#endif - break; - - case DEVICE_ON: - pPointer->public.on = TRUE; - AddEnabledDevice( darwinEventReadFD ); - return Success; - - case DEVICE_CLOSE: - case DEVICE_OFF: - pPointer->public.on = FALSE; - RemoveEnabledDevice( darwinEventReadFD ); - return Success; - } - - return Success; -} - - -/* - * DarwinKeybdProc - * Callback from X - */ -static int DarwinKeybdProc( DeviceIntPtr pDev, int onoff ) -{ - switch ( onoff ) { - case DEVICE_INIT: - DarwinKeyboardInit( pDev ); - break; - case DEVICE_ON: - pDev->public.on = TRUE; - AddEnabledDevice( darwinEventReadFD ); - break; - case DEVICE_OFF: - pDev->public.on = FALSE; - RemoveEnabledDevice( darwinEventReadFD ); - break; - case DEVICE_CLOSE: - break; - } - - return Success; -} - -/* -=========================================================================== - - Utility routines - -=========================================================================== -*/ - -/* - * DarwinFindLibraryFile - * Search for a file in the standard Library paths, which are (in order): - * - * ~/Library/ user specific - * /Library/ host specific - * /Network/Library/ LAN specific - * /System/Library/ OS specific - * - * A sub-path can be specified to search in below the various Library - * directories. Returns a new character string (owned by the caller) - * containing the full path to the first file found. - */ -static char * DarwinFindLibraryFile( - const char *file, - const char *pathext ) -{ - // Library search paths - char *pathList[] = { - "", - "/Network", - "/System", - NULL - }; - char *home; - char *fullPath; - int i = 0; - - // Return the file name as is if it is already a fully qualified path. - if (!access(file, F_OK)) { - fullPath = xalloc(strlen(file)+1); - strcpy(fullPath, file); - return fullPath; - } - - fullPath = xalloc(PATH_MAX); - - home = getenv("HOME"); - if (home) { - snprintf(fullPath, PATH_MAX, "%s/Library/%s/%s", home, pathext, file); - if (!access(fullPath, F_OK)) - return fullPath; - } - - while (pathList[i]) { - snprintf(fullPath, PATH_MAX, "%s/Library/%s/%s", pathList[i++], - pathext, file); - if (!access(fullPath, F_OK)) - return fullPath; - } - - xfree(fullPath); - return NULL; -} - - -/* - * DarwinParseModifierList - * Parse a list of modifier names and return a corresponding modifier mask - */ -int DarwinParseModifierList( - const char *constmodifiers) // string containing list of modifier names -{ - int result = 0; - - if (constmodifiers) { - char *modifiers = strdup(constmodifiers); - char *modifier; - int nxkey; - char *p = modifiers; - - while (p) { - modifier = strsep(&p, " ,+&|/"); // allow lots of separators - nxkey = DarwinModifierStringToNXKey(modifier); - if (nxkey != -1) - result |= DarwinModifierNXKeyToNXMask(nxkey); - else - ErrorF("fakebuttons: Unknown modifier \"%s\"\n", modifier); - } - free(modifiers); - } - return result; -} - -/* -=========================================================================== - - Functions needed to link against device independent X - -=========================================================================== -*/ - -/* - * InitInput - * Register the keyboard and mouse devices - */ -void InitInput( int argc, char **argv ) -{ - darwinPointer = AddInputDevice(DarwinMouseProc, TRUE); - RegisterPointerDevice( darwinPointer ); - - darwinKeyboard = AddInputDevice(DarwinKeybdProc, TRUE); - RegisterKeyboardDevice( darwinKeyboard ); - - DarwinEQInit( (DevicePtr)darwinKeyboard, (DevicePtr)darwinPointer ); - - DarwinModeInitInput(argc, argv); -} - - -/* - * DarwinAdjustScreenOrigins - * Shift all screens so the X11 (0, 0) coordinate is at the top - * left of the global screen coordinates. - * - * Screens can be arranged so the top left isn't on any screen, so - * instead use the top left of the leftmost screen as (0,0). This - * may mean some screen space is in -y, but it's better that (0,0) - * be onscreen, or else default xterms disappear. It's better that - * -y be used than -x, because when popup menus are forced - * "onscreen" by dumb window managers like twm, they'll shift the - * menus down instead of left, which still looks funny but is an - * easier target to hit. - */ -void -DarwinAdjustScreenOrigins(ScreenInfo *pScreenInfo) -{ - int i, left, top; - - left = dixScreenOrigins[0].x; - top = dixScreenOrigins[0].y; - - /* Find leftmost screen. If there's a tie, take the topmost of the two. */ - for (i = 1; i < pScreenInfo->numScreens; i++) { - if (dixScreenOrigins[i].x < left || - (dixScreenOrigins[i].x == left && - dixScreenOrigins[i].y < top)) - { - left = dixScreenOrigins[i].x; - top = dixScreenOrigins[i].y; - } - } - - darwinMainScreenX = left; - darwinMainScreenY = top; - - /* Shift all screens so that there is a screen whose top left - is at X11 (0,0) and at global screen coordinate - (darwinMainScreenX, darwinMainScreenY). */ - - if (darwinMainScreenX != 0 || darwinMainScreenY != 0) { - for (i = 0; i < pScreenInfo->numScreens; i++) { - dixScreenOrigins[i].x -= darwinMainScreenX; - dixScreenOrigins[i].y -= darwinMainScreenY; - ErrorF("Screen %d placed at X11 coordinate (%d,%d).\n", - i, dixScreenOrigins[i].x, dixScreenOrigins[i].y); - } - } -} - - -/* - * InitOutput - * Initialize screenInfo for all actually accessible framebuffers. - * - * The display mode dependent code gets called three times. The mode - * specific InitOutput routines are expected to discover the number - * of potentially useful screens and cache routes to them internally. - * Inside DarwinAddScreen are two other mode specific calls. - * A mode specific AddScreen routine is called for each screen to - * actually initialize the screen with the ScreenPtr structure. - * After other screen setup has been done, a mode specific - * SetupScreen function can be called to finalize screen setup. - */ -void InitOutput( ScreenInfo *pScreenInfo, int argc, char **argv ) -{ - int i; - static unsigned long generation = 0; - - pScreenInfo->imageByteOrder = IMAGE_BYTE_ORDER; - pScreenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT; - pScreenInfo->bitmapScanlinePad = BITMAP_SCANLINE_PAD; - pScreenInfo->bitmapBitOrder = BITMAP_BIT_ORDER; - - // List how we want common pixmap formats to be padded - pScreenInfo->numPixmapFormats = NUMFORMATS; - for (i = 0; i < NUMFORMATS; i++) - pScreenInfo->formats[i] = formats[i]; - - // Allocate private storage for each screen's Darwin specific info - if (generation != serverGeneration) { - darwinScreenIndex = AllocateScreenPrivateIndex(); - generation = serverGeneration; - } - - // Discover screens and do mode specific initialization - DarwinModeInitOutput(argc, argv); - - // Add screens - for (i = 0; i < darwinScreensFound; i++) { - AddScreen( DarwinAddScreen, argc, argv ); - } - - DarwinAdjustScreenOrigins(pScreenInfo); -} - - -/* - * OsVendorFataError - */ -void OsVendorFatalError( void ) -{ - ErrorF( " OsVendorFatalError\n" ); -} - - -/* - * OsVendorInit - * Initialization of Darwin OS support. - */ -void OsVendorInit(void) -{ - if (serverGeneration == 1) { - DarwinPrintBanner(); - } - - // Find the full path to the keymapping file. - if ( darwinKeymapFile ) { - char *tempStr = DarwinFindLibraryFile(darwinKeymapFile, "Keyboards"); - if ( !tempStr ) { - ErrorF("Could not find keymapping file %s.\n", darwinKeymapFile); - } else { - ErrorF("Using keymapping provided in %s.\n", tempStr); - } - darwinKeymapFile = tempStr; - } - - if ( !darwinKeymapFile ) { - ErrorF("Reading keymap from the system.\n"); - } -} - - -/* - * ddxInitGlobals - * Called by InitGlobals() from os/util.c. - */ -void ddxInitGlobals(void) -{ -} - - -/* - * ddxProcessArgument - * Process device-dependent command line args. Returns 0 if argument is - * not device dependent, otherwise Count of number of elements of argv - * that are part of a device dependent commandline option. - */ -int ddxProcessArgument( int argc, char *argv[], int i ) -{ - int numDone; - - if ((numDone = DarwinModeProcessArgument( argc, argv, i ))) - return numDone; - - if ( !strcmp( argv[i], "-fakebuttons" ) ) { - darwinFakeButtons = TRUE; - ErrorF( "Faking a three button mouse\n" ); - return 1; - } - - if ( !strcmp( argv[i], "-nofakebuttons" ) ) { - darwinFakeButtons = FALSE; - ErrorF( "Not faking a three button mouse\n" ); - return 1; - } - - if (!strcmp( argv[i], "-fakemouse2" ) ) { - if ( i == argc-1 ) { - FatalError( "-fakemouse2 must be followed by a modifer list\n" ); - } - if (!strcasecmp(argv[i+1], "none") || !strcmp(argv[i+1], "")) - darwinFakeMouse2Mask = 0; - else - darwinFakeMouse2Mask = DarwinParseModifierList(argv[i+1]); - ErrorF("Modifier mask to fake mouse button 2 = 0x%x\n", - darwinFakeMouse2Mask); - return 2; - } - - if (!strcmp( argv[i], "-fakemouse3" ) ) { - if ( i == argc-1 ) { - FatalError( "-fakemouse3 must be followed by a modifer list\n" ); - } - if (!strcasecmp(argv[i+1], "none") || !strcmp(argv[i+1], "")) - darwinFakeMouse3Mask = 0; - else - darwinFakeMouse3Mask = DarwinParseModifierList(argv[i+1]); - ErrorF("Modifier mask to fake mouse button 3 = 0x%x\n", - darwinFakeMouse3Mask); - return 2; - } - - if ( !strcmp( argv[i], "-swapAltMeta" ) ) { - darwinSwapAltMeta = 1; - return 1; - } - - if ( !strcmp( argv[i], "-keymap" ) ) { - if ( i == argc-1 ) { - FatalError( "-keymap must be followed by a filename\n" ); - } - darwinKeymapFile = argv[i+1]; - return 2; - } - - if ( !strcmp( argv[i], "-nokeymap" ) ) { - darwinKeymapFile = NULL; - return 1; - } - - if ( !strcmp( argv[i], "+synckeymap" ) ) { - darwinSyncKeymap = TRUE; - return 1; - } - - if ( !strcmp( argv[i], "-synckeymap" ) ) { - darwinSyncKeymap = FALSE; - return 1; - } - - if ( !strcmp( argv[i], "-size" ) ) { - if ( i >= argc-2 ) { - FatalError( "-size must be followed by two numbers\n" ); - } -#ifdef OLD_POWERBOOK_G3 - ErrorF( "Ignoring unsupported -size option on old PowerBook G3\n" ); -#else - darwinDesiredWidth = atoi( argv[i+1] ); - darwinDesiredHeight = atoi( argv[i+2] ); - ErrorF( "Attempting to use width x height = %i x %i\n", - darwinDesiredWidth, darwinDesiredHeight ); -#endif - return 3; - } - - if ( !strcmp( argv[i], "-depth" ) ) { - int bitDepth; - - if ( i == argc-1 ) { - FatalError( "-depth must be followed by a number\n" ); - } -#ifdef OLD_POWERBOOK_G3 - ErrorF( "Ignoring unsupported -depth option on old PowerBook G3\n"); -#else - bitDepth = atoi( argv[i+1] ); - if (bitDepth == 8) - darwinDesiredDepth = 0; - else if (bitDepth == 15) - darwinDesiredDepth = 1; - else if (bitDepth == 24) - darwinDesiredDepth = 2; - else - FatalError( "Unsupported pixel depth. Use 8, 15, or 24 bits\n" ); - ErrorF( "Attempting to use pixel depth of %i\n", bitDepth ); -#endif - return 2; - } - - if ( !strcmp( argv[i], "-refresh" ) ) { - if ( i == argc-1 ) { - FatalError( "-refresh must be followed by a number\n" ); - } -#ifdef OLD_POWERBOOK_G3 - ErrorF( "Ignoring unsupported -refresh option on old PowerBook G3\n"); -#else - darwinDesiredRefresh = atoi( argv[i+1] ); - ErrorF( "Attempting to use refresh rate of %i\n", darwinDesiredRefresh ); -#endif - return 2; - } - - if (!strcmp( argv[i], "-showconfig" ) || !strcmp( argv[i], "-version" )) { - DarwinPrintBanner(); - exit(0); - } - - // XDarwinStartup uses this argument to indicate the IOKit X server - // should be started. Ignore it here. - if ( !strcmp( argv[i], "-iokit" ) ) { - return 1; - } - - return 0; -} - - -/* - * ddxUseMsg -- - * Print out correct use of device dependent commandline options. - * Maybe the user now knows what really to do ... - */ -void ddxUseMsg( void ) -{ - ErrorF("\n"); - ErrorF("\n"); - ErrorF("Device Dependent Usage:\n"); - ErrorF("\n"); - ErrorF("-fakebuttons : fake a three button mouse with Command and Option keys.\n"); - ErrorF("-nofakebuttons : don't fake a three button mouse.\n"); - ErrorF("-fakemouse2 : fake middle mouse button with modifier keys.\n"); - ErrorF("-fakemouse3 : fake right mouse button with modifier keys.\n"); - ErrorF(" ex: -fakemouse2 \"option,shift\" = option-shift-click is middle button.\n"); - ErrorF("-keymap : read the keymapping from a file instead of the kernel.\n"); - ErrorF("-version : show the server version.\n"); - ErrorF("\n"); -#ifdef DARWIN_WITH_QUARTZ - ErrorF("Quartz modes:\n"); - ErrorF("-fullscreen : run full screen in parallel with Mac OS X window server.\n"); - ErrorF("-rootless : run rootless inside Mac OS X window server.\n"); - ErrorF("-quartz : use default Mac OS X window server mode\n"); - ErrorF("\n"); - ErrorF("Options ignored in rootless mode:\n"); -#endif - ErrorF("-size : use a screen resolution of x .\n"); - ErrorF("-depth <8,15,24> : use this bit depth.\n"); - ErrorF("-refresh : use a monitor refresh rate of Hz.\n"); - ErrorF("\n"); -} - - -/* - * ddxGiveUp -- - * Device dependent cleanup. Called by dix before normal server death. - */ -void ddxGiveUp( void ) -{ - ErrorF( "Quitting XDarwin...\n" ); - - DarwinModeGiveUp(); -} - - -/* - * AbortDDX -- - * DDX - specific abort routine. Called by AbortServer(). The attempt is - * made to restore all original setting of the displays. Also all devices - * are closed. - */ -void AbortDDX( void ) -{ - ErrorF( " AbortDDX\n" ); - /* - * This is needed for a abnormal server exit, since the normal exit stuff - * MUST also be performed (i.e. the vt must be left in a defined state) - */ - ddxGiveUp(); -} - - -#ifdef DPMSExtension -/* - * DPMS extension stubs - */ -Bool DPMSSupported(void) -{ - return FALSE; -} - -void DPMSSet(int level) -{ -} - -int DPMSGet(int *level) -{ - return -1; -} -#endif - - -#include "mivalidate.h" // for union _Validate used by windowstr.h -#include "windowstr.h" // for struct _Window -#include "scrnintstr.h" // for struct _Screen - -// This is copied from Xserver/hw/xfree86/common/xf86Helper.c. -// Quartz mode uses this when switching in and out of Quartz. -// Quartz or IOKit can use this when waking from sleep. -// Copyright (c) 1997-1998 by The XFree86 Project, Inc. - -/* - * xf86SetRootClip -- - * Enable or disable rendering to the screen by - * setting the root clip list and revalidating - * all of the windows - */ - -void -xf86SetRootClip (ScreenPtr pScreen, BOOL enable) -{ - WindowPtr pWin = WindowTable[pScreen->myNum]; - WindowPtr pChild; - Bool WasViewable = (Bool)(pWin->viewable); - Bool anyMarked = TRUE; - RegionPtr pOldClip = NULL, bsExposed; -#ifdef DO_SAVE_UNDERS - Bool dosave = FALSE; -#endif - WindowPtr pLayerWin; - BoxRec box; - - if (WasViewable) - { - for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) - { - (void) (*pScreen->MarkOverlappedWindows)(pChild, - pChild, - &pLayerWin); - } - (*pScreen->MarkWindow) (pWin); - anyMarked = TRUE; - if (pWin->valdata) - { - if (HasBorder (pWin)) - { - RegionPtr borderVisible; - - borderVisible = REGION_CREATE(pScreen, NullBox, 1); - REGION_SUBTRACT(pScreen, borderVisible, - &pWin->borderClip, &pWin->winSize); - pWin->valdata->before.borderVisible = borderVisible; - } - pWin->valdata->before.resized = TRUE; - } - } - - /* - * Use REGION_BREAK to avoid optimizations in ValidateTree - * that assume the root borderClip can't change well, normally - * it doesn't...) - */ - if (enable) - { - box.x1 = 0; - box.y1 = 0; - box.x2 = pScreen->width; - box.y2 = pScreen->height; - REGION_RESET(pScreen, &pWin->borderClip, &box); - REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList); - } - else - { - REGION_EMPTY(pScreen, &pWin->borderClip); - REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList); - } - - ResizeChildrenWinSize (pWin, 0, 0, 0, 0); - - if (WasViewable) - { - if (pWin->backStorage) - { - pOldClip = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, pOldClip, &pWin->clipList); - } - - if (pWin->firstChild) - { - anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin->firstChild, - pWin->firstChild, - (WindowPtr *)NULL); - } - else - { - (*pScreen->MarkWindow) (pWin); - anyMarked = TRUE; - } - -#ifdef DO_SAVE_UNDERS - if (DO_SAVE_UNDERS(pWin)) - { - dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, pLayerWin); - } -#endif /* DO_SAVE_UNDERS */ - - if (anyMarked) - (*pScreen->ValidateTree)(pWin, NullWindow, VTOther); - } - - if (pWin->backStorage && - ((pWin->backingStore == Always) || WasViewable)) - { - if (!WasViewable) - pOldClip = &pWin->clipList; /* a convenient empty region */ - bsExposed = (*pScreen->TranslateBackingStore) - (pWin, 0, 0, pOldClip, - pWin->drawable.x, pWin->drawable.y); - if (WasViewable) - REGION_DESTROY(pScreen, pOldClip); - if (bsExposed) - { - RegionPtr valExposed = NullRegion; - - if (pWin->valdata) - valExposed = &pWin->valdata->after.exposed; - (*pScreen->WindowExposures) (pWin, valExposed, bsExposed); - if (valExposed) - REGION_EMPTY(pScreen, valExposed); - REGION_DESTROY(pScreen, bsExposed); - } - } - if (WasViewable) - { - if (anyMarked) - (*pScreen->HandleExposures)(pWin); -#ifdef DO_SAVE_UNDERS - if (dosave) - (*pScreen->PostChangeSaveUnder)(pLayerWin, pLayerWin); -#endif /* DO_SAVE_UNDERS */ - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pWin, NullWindow, VTOther); - } - if (pWin->realized) - WindowsRestructured (); - FlushAllOutput (); -} diff --git a/nx-X11/programs/Xserver/hw/darwin/darwin.h b/nx-X11/programs/Xserver/hw/darwin/darwin.h deleted file mode 100644 index 4f4e9b91f..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/darwin.h +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright (c) 2001-2004 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/darwin.h,v 1.20 2003/11/15 00:07:09 torrey Exp $ */ - -#ifndef _DARWIN_H -#define _DARWIN_H - -#include -#include "inputstr.h" -#include "scrnintstr.h" -#include - -typedef struct { - void *framebuffer; - int x; - int y; - int width; - int height; - int pitch; - int colorType; - int bitsPerPixel; - int colorBitsPerPixel; - int bitsPerComponent; -} DarwinFramebufferRec, *DarwinFramebufferPtr; - - -// From darwin.c -void DarwinPrintBanner(); -int DarwinParseModifierList(const char *constmodifiers); -void DarwinAdjustScreenOrigins(ScreenInfo *pScreenInfo); -void xf86SetRootClip (ScreenPtr pScreen, BOOL enable); - -// From darwinEvents.c -Bool DarwinEQInit(DevicePtr pKbd, DevicePtr pPtr); -void DarwinEQEnqueue(const xEvent *e); -void DarwinEQPointerPost(xEvent *e); -void DarwinEQSwitchScreen(ScreenPtr pScreen, Bool fromDIX); - -// From darwinKeyboard.c -int DarwinModifierNXKeyToNXKeycode(int key, int side); -void DarwinKeyboardInit(DeviceIntPtr pDev); -int DarwinModifierNXKeycodeToNXKey(unsigned char keycode, int *outSide); -int DarwinModifierNXKeyToNXMask(int key); -int DarwinModifierNXMaskToNXKey(int mask); -int DarwinModifierStringToNXKey(const char *string); - -// Mode specific functions -Bool DarwinModeAddScreen(int index, ScreenPtr pScreen); -Bool DarwinModeSetupScreen(int index, ScreenPtr pScreen); -void DarwinModeInitOutput(int argc,char **argv); -void DarwinModeInitInput(int argc, char **argv); -int DarwinModeProcessArgument(int argc, char *argv[], int i); -void DarwinModeProcessEvent(xEvent *xe); -void DarwinModeGiveUp(void); -void DarwinModeBell(int volume, DeviceIntPtr pDevice, pointer ctrl, int class); - - -#undef assert -#define assert(x) { if ((x) == 0) \ - FatalError("assert failed on line %d of %s!\n", __LINE__, __FILE__); } -#define kern_assert(x) { if ((x) != KERN_SUCCESS) \ - FatalError("assert failed on line %d of %s with kernel return 0x%x!\n", \ - __LINE__, __FILE__, x); } -#define SCREEN_PRIV(pScreen) \ - ((DarwinFramebufferPtr)pScreen->devPrivates[darwinScreenIndex].ptr) - - -#define MIN_KEYCODE XkbMinLegalKeyCode // unfortunately, this isn't 0... - - -/* - * Global variables from darwin.c - */ -extern int darwinScreenIndex; // index into pScreen.devPrivates -extern int darwinScreensFound; -extern io_connect_t darwinParamConnect; -extern int darwinEventReadFD; -extern int darwinEventWriteFD; -extern DeviceIntPtr darwinPointer; -extern DeviceIntPtr darwinKeyboard; - -// User preferences -extern int darwinMouseAccelChange; -extern int darwinFakeButtons; -extern int darwinFakeMouse2Mask; -extern int darwinFakeMouse3Mask; -extern int darwinSwapAltMeta; -extern char *darwinKeymapFile; -extern int darwinSyncKeymap; -extern unsigned int darwinDesiredWidth, darwinDesiredHeight; -extern int darwinDesiredDepth; -extern int darwinDesiredRefresh; - -// location of X11's (0,0) point in global screen coordinates -extern int darwinMainScreenX; -extern int darwinMainScreenY; - - -/* - * Special ddx events understood by the X server - */ -enum { - kXDarwinUpdateModifiers // update all modifier keys - = LASTEvent+1, // (from X.h list of event names) - kXDarwinUpdateButtons, // update state of mouse buttons 2 and up - kXDarwinScrollWheel, // scroll wheel event - - /* - * Quartz-specific events -- not used in IOKit mode - */ - kXDarwinActivate, // restore X drawing and cursor - kXDarwinDeactivate, // clip X drawing and switch to Aqua cursor - kXDarwinSetRootClip, // enable or disable drawing to the X screen - kXDarwinQuit, // kill the X server and release the display - kXDarwinReadPasteboard, // copy Mac OS X pasteboard into X cut buffer - kXDarwinWritePasteboard, // copy X cut buffer onto Mac OS X pasteboard - /* - * AppleWM events - */ - kXDarwinControllerNotify, // send an AppleWMControllerNotify event - kXDarwinPasteboardNotify, // notify the WM to copy or paste - /* - * Xplugin notification events - */ - kXDarwinDisplayChanged, // display configuration has changed - kXDarwinWindowState, // window visibility state has changed - kXDarwinWindowMoved // window has moved on screen -}; - -#endif /* _DARWIN_H */ diff --git a/nx-X11/programs/Xserver/hw/darwin/darwinClut8.h b/nx-X11/programs/Xserver/hw/darwin/darwinClut8.h deleted file mode 100644 index 06e7b71c5..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/darwinClut8.h +++ /dev/null @@ -1,532 +0,0 @@ -/* - * Darwin default 8-bit Colormap for StaticColor - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/darwinClut8.h,v 1.1.8.1 2003/03/04 01:31:43 torrey Exp $ */ - -#ifndef _DARWIN_CLUT8_ -#define _DARWIN_CLUT8_ - -#ifdef USE_NEW_CLUT - -static xColorItem darwinClut8[] = { - { 0, 0xffff, 0xffff, 0xffff, 0, 0 }, - { 1, 0xfefe, 0xfefe, 0xfefe, 0, 0 }, - { 2, 0xfdfd, 0xfdfd, 0xfdfd, 0, 0 }, - { 3, 0xb8b8, 0x2727, 0x2b2b, 0, 0 }, - { 4, 0xfcfc, 0xfcfc, 0xfcfc, 0, 0 }, - { 5, 0xffff, 0xffff, 0x0, 0, 0 }, - { 6, 0xfafa, 0xfafa, 0xfafa, 0, 0 }, - { 7, 0xf9f9, 0xf9f9, 0xf9f9, 0, 0 }, - { 8, 0xf8f8, 0xf8f8, 0xf8f8, 0, 0 }, - { 9, 0xf7f7, 0xf7f7, 0xf7f7, 0, 0 }, - { 10, 0xf6f6, 0xf6f6, 0xf6f6, 0, 0 }, - { 11, 0xf5f5, 0xf5f5, 0xf5f5, 0, 0 }, - { 12, 0xf4f4, 0xf4f4, 0xf4f4, 0, 0 }, - { 13, 0xf2f2, 0xf2f2, 0xf2f2, 0, 0 }, - { 14, 0xf1f1, 0xf1f1, 0xf1f1, 0, 0 }, - { 15, 0x0, 0x0, 0x0, 0, 0 }, - { 16, 0xefef, 0xefef, 0xefef, 0, 0 }, - { 17, 0xeeee, 0xeeee, 0xeeee, 0, 0 }, - { 18, 0xeded, 0xeded, 0xeded, 0, 0 }, - { 19, 0xebeb, 0xebeb, 0xebeb, 0, 0 }, - { 20, 0xe8e8, 0xe8e8, 0xe8e8, 0, 0 }, - { 21, 0xe7e7, 0xe7e7, 0xe7e7, 0, 0 }, - { 22, 0xc9c9, 0x3838, 0x3e3e, 0, 0 }, - { 23, 0xe5e5, 0xe5e5, 0xe5e5, 0, 0 }, - { 24, 0xffff, 0x0, 0xffff, 0, 0 }, - { 25, 0xfbfb, 0xfbfb, 0xfbfb, 0, 0 }, - { 26, 0xdede, 0x6c6c, 0x7272, 0, 0 }, - { 27, 0xe0e0, 0xe0e0, 0xe0e0, 0, 0 }, - { 28, 0xe8e8, 0x8686, 0x9090, 0, 0 }, - { 29, 0xdede, 0xdede, 0xdede, 0, 0 }, - { 30, 0xdddd, 0xdddd, 0xdddd, 0, 0 }, - { 31, 0xd3d3, 0x7e7e, 0x8d8d, 0, 0 }, - { 32, 0xd9d9, 0xd9d9, 0xd9d9, 0, 0 }, - { 33, 0xf3f3, 0x9696, 0xa6a6, 0, 0 }, - { 34, 0xb1b1, 0x1c1c, 0x3939, 0, 0 }, - { 35, 0xffff, 0x0, 0x0, 0, 0 }, - { 36, 0xbebe, 0x5e5e, 0x7272, 0, 0 }, - { 37, 0xd3d3, 0xd3d3, 0xd3d3, 0, 0 }, - { 38, 0xc6c6, 0x2e2e, 0x6767, 0, 0 }, - { 39, 0xd1d1, 0xd1d1, 0xd1d1, 0, 0 }, - { 40, 0xa3a3, 0x606, 0x4545, 0, 0 }, - { 41, 0xcece, 0xcece, 0xcece, 0, 0 }, - { 42, 0xcccc, 0xcccc, 0xffff, 0, 0 }, - { 43, 0xcccc, 0xcccc, 0xcccc, 0, 0 }, - { 44, 0xc6c6, 0x8f8f, 0xa7a7, 0, 0 }, - { 45, 0xe1e1, 0xd3d3, 0xd9d9, 0, 0 }, - { 46, 0xcece, 0x9e9e, 0xb4b4, 0, 0 }, - { 47, 0xcaca, 0xcaca, 0xcaca, 0, 0 }, - { 48, 0xbfbf, 0x3f3f, 0x7d7d, 0, 0 }, - { 49, 0xc9c9, 0xc9c9, 0xc9c9, 0, 0 }, - { 50, 0xf4f4, 0x8989, 0xbebe, 0, 0 }, - { 51, 0xc6c6, 0xc6c6, 0xc6c6, 0, 0 }, - { 52, 0xd6d6, 0x5151, 0x9797, 0, 0 }, - { 53, 0xc9c9, 0x2c2c, 0x8484, 0, 0 }, - { 54, 0x9696, 0x1a1a, 0x6a6a, 0, 0 }, - { 55, 0xc2c2, 0xc2c2, 0xc2c2, 0, 0 }, - { 56, 0xf3f3, 0x6f6f, 0xc6c6, 0, 0 }, - { 57, 0xe5e5, 0x4c4c, 0xbbbb, 0, 0 }, - { 58, 0xb7b7, 0x5a5a, 0x9c9c, 0, 0 }, - { 59, 0xbfbf, 0xbfbf, 0xbfbf, 0, 0 }, - { 60, 0xbebe, 0xbebe, 0xbebe, 0, 0 }, - { 61, 0xbdbd, 0xbdbd, 0xbdbd, 0, 0 }, - { 62, 0xb8b8, 0x2121, 0xa2a2, 0, 0 }, - { 63, 0xd3d3, 0x4444, 0xc0c0, 0, 0 }, - { 64, 0xc2c2, 0x6666, 0xb7b7, 0, 0 }, - { 65, 0xf4f4, 0x6666, 0xe6e6, 0, 0 }, - { 66, 0xfcfc, 0x7373, 0xfdfd, 0, 0 }, - { 67, 0xb9b9, 0xb9b9, 0xb9b9, 0, 0 }, - { 68, 0xeaea, 0xdfdf, 0xeaea, 0, 0 }, - { 69, 0xd4d4, 0x7171, 0xd5d5, 0, 0 }, - { 70, 0xf9f9, 0x8b8b, 0xffff, 0, 0 }, - { 71, 0xf5f5, 0xadad, 0xffff, 0, 0 }, - { 72, 0xbcbc, 0x9292, 0xc2c2, 0, 0 }, - { 73, 0xc7c7, 0x4f4f, 0xd9d9, 0, 0 }, - { 74, 0xa0a0, 0x4444, 0xafaf, 0, 0 }, - { 75, 0xc8c8, 0x8c8c, 0xd5d5, 0, 0 }, - { 76, 0xd7d7, 0x7474, 0xf7f7, 0, 0 }, - { 77, 0xb4b4, 0xb4b4, 0xb4b4, 0, 0 }, - { 78, 0xdada, 0x9595, 0xf9f9, 0, 0 }, - { 79, 0xeded, 0xcbcb, 0xffff, 0, 0 }, - { 80, 0xb2b2, 0xb2b2, 0xb2b2, 0, 0 }, - { 81, 0xa1a1, 0x6161, 0xd7d7, 0, 0 }, - { 82, 0xb2b2, 0x8585, 0xe2e2, 0, 0 }, - { 83, 0x5959, 0x2626, 0x9c9c, 0, 0 }, - { 84, 0x7c7c, 0x5151, 0xcccc, 0, 0 }, - { 85, 0xb0b0, 0xb0b0, 0xb0b0, 0, 0 }, - { 86, 0xb4b4, 0x8e8e, 0xfcfc, 0, 0 }, - { 87, 0xd5d5, 0xc0c0, 0xffff, 0, 0 }, - { 88, 0x5d5d, 0x3232, 0xcccc, 0, 0 }, - { 89, 0x7b7b, 0x5c5c, 0xe5e5, 0, 0 }, - { 90, 0xc0c0, 0xb0b0, 0xfdfd, 0, 0 }, - { 91, 0x6060, 0x5353, 0xadad, 0, 0 }, - { 92, 0x1212, 0xc0c, 0x7e7e, 0, 0 }, - { 93, 0x2e2e, 0x2929, 0x9999, 0, 0 }, - { 94, 0x7979, 0x7878, 0xe9e9, 0, 0 }, - { 95, 0x5b5b, 0x5c5c, 0xd0d0, 0, 0 }, - { 96, 0x6969, 0x6a6a, 0xcccc, 0, 0 }, - { 97, 0x9393, 0x9494, 0xf8f8, 0, 0 }, - { 98, 0x9292, 0x9292, 0xc3c3, 0, 0 }, - { 99, 0x4141, 0x4444, 0xbaba, 0, 0 }, - { 100, 0xa8a8, 0xabab, 0xffff, 0, 0 }, - { 101, 0xa3a3, 0xa3a3, 0xa3a3, 0, 0 }, - { 102, 0xdbdb, 0xdddd, 0xeaea, 0, 0 }, - { 103, 0x3131, 0x4949, 0xaaaa, 0, 0 }, - { 104, 0x7070, 0x8f8f, 0xf9f9, 0, 0 }, - { 105, 0x4848, 0x6666, 0xc1c1, 0, 0 }, - { 106, 0x5c5c, 0x7e7e, 0xe9e9, 0, 0 }, - { 107, 0xe2e2, 0xe5e5, 0xebeb, 0, 0 }, - { 108, 0xb0b0, 0xcdcd, 0xffff, 0, 0 }, - { 109, 0x6c6c, 0x8989, 0xb7b7, 0, 0 }, - { 110, 0x3434, 0x6565, 0xafaf, 0, 0 }, - { 111, 0x8c8c, 0xb9b9, 0xffff, 0, 0 }, - { 112, 0x3737, 0x7979, 0xd4d4, 0, 0 }, - { 113, 0x5a5a, 0x9999, 0xeaea, 0, 0 }, - { 114, 0xe0e, 0x4c4c, 0x9595, 0, 0 }, - { 115, 0x7979, 0xb9b9, 0xffff, 0, 0 }, - { 116, 0x8a8a, 0xa3a3, 0xbcbc, 0, 0 }, - { 117, 0x2020, 0x6161, 0x9d9d, 0, 0 }, - { 118, 0x8f8f, 0xaeae, 0xcaca, 0, 0 }, - { 119, 0xa0a, 0x6060, 0xa8a8, 0, 0 }, - { 120, 0x3f3f, 0x9494, 0xd9d9, 0, 0 }, - { 121, 0x6363, 0xb5b5, 0xf9f9, 0, 0 }, - { 122, 0xe2e2, 0xe8e8, 0xeded, 0, 0 }, - { 123, 0x2828, 0x6a6a, 0x9999, 0, 0 }, - { 124, 0x5555, 0xb2b2, 0xe7e7, 0, 0 }, - { 125, 0x3232, 0x8989, 0xa9a9, 0, 0 }, - { 126, 0xcfcf, 0xdada, 0xdede, 0, 0 }, - { 127, 0x2929, 0xa1a1, 0xc7c7, 0, 0 }, - { 128, 0x8686, 0xa9a9, 0xb4b4, 0, 0 }, - { 129, 0x0, 0x5f5f, 0x7979, 0, 0 }, - { 130, 0xc0c, 0x7777, 0x8e8e, 0, 0 }, - { 131, 0x1212, 0x8f8f, 0xabab, 0, 0 }, - { 132, 0x4141, 0xbaba, 0xd5d5, 0, 0 }, - { 133, 0x2424, 0x8282, 0x8383, 0, 0 }, - { 134, 0x2c2c, 0xc4c4, 0xc3c3, 0, 0 }, - { 135, 0x1a1a, 0xabab, 0xa6a6, 0, 0 }, - { 136, 0x4b4b, 0xa8a8, 0xa2a2, 0, 0 }, - { 137, 0xa0a, 0x9393, 0x8585, 0, 0 }, - { 138, 0xd0d, 0xa5a5, 0x9696, 0, 0 }, - { 139, 0x2626, 0xbcbc, 0xacac, 0, 0 }, - { 140, 0x404, 0x8181, 0x7272, 0, 0 }, - { 141, 0x1919, 0xb3b3, 0x8686, 0, 0 }, - { 142, 0x2929, 0xc1c1, 0x9494, 0, 0 }, - { 143, 0x2121, 0x9c9c, 0x7171, 0, 0 }, - { 144, 0x202, 0x8c8c, 0x5050, 0, 0 }, - { 145, 0x3535, 0xd0d0, 0x8989, 0, 0 }, - { 146, 0x4646, 0xa5a5, 0x7676, 0, 0 }, - { 147, 0x202, 0x7d7d, 0x3939, 0, 0 }, - { 148, 0x2929, 0xc9c9, 0x7171, 0, 0 }, - { 149, 0x5757, 0xd6d6, 0x8f8f, 0, 0 }, - { 150, 0xa2a2, 0xb5b5, 0xaaaa, 0, 0 }, - { 151, 0x101, 0x8888, 0x2a2a, 0, 0 }, - { 152, 0x7474, 0xbebe, 0x8a8a, 0, 0 }, - { 153, 0x1919, 0xb6b6, 0x4747, 0, 0 }, - { 154, 0x2d2d, 0xc6c6, 0x5151, 0, 0 }, - { 155, 0x3838, 0xdede, 0x5d5d, 0, 0 }, - { 156, 0x4c4c, 0xf4f4, 0x6f6f, 0, 0 }, - { 157, 0x9191, 0x9c9c, 0x9393, 0, 0 }, - { 158, 0x0, 0x8e8e, 0x1919, 0, 0 }, - { 159, 0x1010, 0xafaf, 0x2828, 0, 0 }, - { 160, 0xe3e3, 0xe3e3, 0xe3e3, 0, 0 }, - { 161, 0x808, 0xa1a1, 0x1a1a, 0, 0 }, - { 162, 0x5959, 0xc2c2, 0x6161, 0, 0 }, - { 163, 0xf0f0, 0xf0f0, 0xf0f0, 0, 0 }, - { 164, 0x8f8f, 0x9c9c, 0x9090, 0, 0 }, - { 165, 0x2323, 0xcece, 0x2a2a, 0, 0 }, - { 166, 0x1212, 0xbaba, 0x1717, 0, 0 }, - { 167, 0x101, 0x8a8a, 0x202, 0, 0 }, - { 168, 0x303, 0x9a9a, 0x202, 0, 0 }, - { 169, 0x4040, 0xe4e4, 0x4040, 0, 0 }, - { 170, 0x808, 0xb2b2, 0x505, 0, 0 }, - { 171, 0x1313, 0xcccc, 0xf0f, 0, 0 }, - { 172, 0x3636, 0xd7d7, 0x3232, 0, 0 }, - { 173, 0x2828, 0xe9e9, 0x1f1f, 0, 0 }, - { 174, 0x5353, 0xfbfb, 0x4c4c, 0, 0 }, - { 175, 0x6f6f, 0xafaf, 0x6a6a, 0, 0 }, - { 176, 0x7171, 0xe0e0, 0x6767, 0, 0 }, - { 177, 0x3232, 0xc0c0, 0x1212, 0, 0 }, - { 178, 0x2929, 0xa5a5, 0x808, 0, 0 }, - { 179, 0x5c5c, 0xdddd, 0x3535, 0, 0 }, - { 180, 0x0, 0xffff, 0xffff, 0, 0 }, - { 181, 0x6363, 0xc8c8, 0x4545, 0, 0 }, - { 182, 0x8686, 0xfdfd, 0x5b5b, 0, 0 }, - { 183, 0x7171, 0xf6f6, 0x3939, 0, 0 }, - { 184, 0x5555, 0xcccc, 0x1515, 0, 0 }, - { 185, 0x0, 0xffff, 0x0, 0, 0 }, - { 186, 0x9090, 0xcaca, 0x6e6e, 0, 0 }, - { 187, 0x4343, 0xa7a7, 0x101, 0, 0 }, - { 188, 0x8d8d, 0xe4e4, 0x3737, 0, 0 }, - { 189, 0xb3b3, 0xf0f0, 0x6464, 0, 0 }, - { 190, 0x8585, 0x8e8e, 0x7a7a, 0, 0 }, - { 191, 0xb0b0, 0xfafa, 0x4d4d, 0, 0 }, - { 192, 0xd6d6, 0xd6d6, 0xd6d6, 0, 0 }, - { 193, 0x8888, 0xd0d0, 0x1a1a, 0, 0 }, - { 194, 0x6a6a, 0xa7a7, 0x303, 0, 0 }, - { 195, 0x9898, 0xbfbf, 0x4141, 0, 0 }, - { 196, 0xcdcd, 0xf8f8, 0x5151, 0, 0 }, - { 197, 0x9494, 0xa4a4, 0x5555, 0, 0 }, - { 198, 0x9191, 0xb0b0, 0xa0a, 0, 0 }, - { 199, 0xdada, 0xf1f1, 0x3c3c, 0, 0 }, - { 200, 0xbaba, 0xcaca, 0x5353, 0, 0 }, - { 201, 0xb9b9, 0xc3c3, 0x2828, 0, 0 }, - { 202, 0xb1b1, 0xbaba, 0x1212, 0, 0 }, - { 203, 0xd2d2, 0xd9d9, 0x2626, 0, 0 }, - { 204, 0xe8e8, 0xecec, 0x2d2d, 0, 0 }, - { 205, 0x9898, 0x9696, 0x202, 0, 0 }, - { 206, 0xadad, 0xadad, 0x5c5c, 0, 0 }, - { 207, 0xe2e2, 0xd8d8, 0x3838, 0, 0 }, - { 208, 0xd9d9, 0xc4c4, 0x3838, 0, 0 }, - { 209, 0xa8a8, 0x9a9a, 0x5050, 0, 0 }, - { 210, 0x0, 0x0, 0xffff, 0, 0 }, - { 211, 0xbebe, 0xaeae, 0x5e5e, 0, 0 }, - { 212, 0x9a9a, 0x9898, 0x8e8e, 0, 0 }, - { 213, 0xacac, 0x8d8d, 0xd0d, 0, 0 }, - { 214, 0xc5c5, 0xa0a0, 0x2b2b, 0, 0 }, - { 215, 0xdbdb, 0xb5b5, 0x4848, 0, 0 }, - { 216, 0xdddd, 0x0, 0x0, 0, 0 }, - { 217, 0x9c9c, 0x6d6d, 0x303, 0, 0 }, - { 218, 0xd4d4, 0xa8a8, 0x4747, 0, 0 }, - { 219, 0xb7b7, 0x7171, 0x1717, 0, 0 }, - { 220, 0xdcdc, 0xa1a1, 0x5a5a, 0, 0 }, - { 221, 0xb9b9, 0x9c9c, 0x7c7c, 0, 0 }, - { 222, 0xb4b4, 0xabab, 0xa2a2, 0, 0 }, - { 223, 0x9e9e, 0x4b4b, 0x101, 0, 0 }, - { 224, 0xc8c8, 0x7878, 0x3535, 0, 0 }, - { 225, 0xd2d2, 0x8d8d, 0x5151, 0, 0 }, - { 226, 0xadad, 0x5252, 0xf0f, 0, 0 }, - { 227, 0x0, 0xbbbb, 0x0, 0, 0 }, - { 228, 0xb2b2, 0x6666, 0x3838, 0, 0 }, - { 229, 0xb1b1, 0xa6a6, 0x9f9f, 0, 0 }, - { 230, 0xb1b1, 0x8787, 0x6f6f, 0, 0 }, - { 231, 0xa4a4, 0x3434, 0x303, 0, 0 }, - { 232, 0xeeee, 0x9e9e, 0x8585, 0, 0 }, - { 233, 0xc9c9, 0x7373, 0x5a5a, 0, 0 }, - { 234, 0xe6e6, 0x9494, 0x7c7c, 0, 0 }, - { 235, 0xa9a9, 0x2222, 0x606, 0, 0 }, - { 236, 0xdbdb, 0x8787, 0x7474, 0, 0 }, - { 237, 0xb0b0, 0x2e2e, 0x1515, 0, 0 }, - { 238, 0xb7b7, 0x5a5a, 0x5050, 0, 0 }, - { 239, 0xb2b2, 0x4242, 0x3b3b, 0, 0 }, - { 240, 0xcdcd, 0x7373, 0x6e6e, 0, 0 }, - { 241, 0xd9d9, 0x5858, 0x5858, 0, 0 }, - { 242, 0xacac, 0xacac, 0xacac, 0, 0 }, - { 243, 0xa0a0, 0xa0a0, 0xa0a0, 0, 0 }, - { 244, 0x9a9a, 0x9a9a, 0x9a9a, 0, 0 }, - { 245, 0x9292, 0x9292, 0x9292, 0, 0 }, - { 246, 0x8e8e, 0x8e8e, 0x8e8e, 0, 0 }, - { 247, 0xbbbb, 0xbbbb, 0xbbbb, 0, 0 }, - { 248, 0x8181, 0x8181, 0x8181, 0, 0 }, - { 249, 0x8888, 0x8888, 0x8888, 0, 0 }, - { 250, 0x7777, 0x7777, 0x7777, 0, 0 }, - { 251, 0x5555, 0x5555, 0x5555, 0, 0 }, - { 252, 0x4444, 0x4444, 0x4444, 0, 0 }, - { 253, 0x2222, 0x2222, 0x2222, 0, 0 }, - { 254, 0x7b7b, 0x7b7b, 0x7b7b, 0, 0 }, - { 255, 0x0, 0x0, 0x0, 0, 0 }, -}; - -#else /* !USE_NEW_CLUT */ - -static xColorItem darwinClut8[] = { - { 0, 0x0000, 0x0000, 0x0000, 0, 0 }, - { 1, 0xffff, 0xffff, 0xcccc, 0, 0 }, - { 2, 0xffff, 0xffff, 0x9999, 0, 0 }, - { 3, 0xffff, 0xffff, 0x6666, 0, 0 }, - { 4, 0xffff, 0xffff, 0x3333, 0, 0 }, - { 5, 0xffff, 0xffff, 0x0000, 0, 0 }, - { 6, 0xffff, 0xcccc, 0xffff, 0, 0 }, - { 7, 0xffff, 0xcccc, 0xcccc, 0, 0 }, - { 8, 0xffff, 0xcccc, 0x9999, 0, 0 }, - { 9, 0xffff, 0xcccc, 0x6666, 0, 0 }, - { 10, 0xffff, 0xcccc, 0x3333, 0, 0 }, - { 11, 0xffff, 0xcccc, 0x0000, 0, 0 }, - { 12, 0xffff, 0x9999, 0xffff, 0, 0 }, - { 13, 0xffff, 0x9999, 0xcccc, 0, 0 }, - { 14, 0xffff, 0x9999, 0x9999, 0, 0 }, - { 15, 0xffff, 0x9999, 0x6666, 0, 0 }, - { 16, 0xffff, 0x9999, 0x3333, 0, 0 }, - { 17, 0xffff, 0x9999, 0x0000, 0, 0 }, - { 18, 0xffff, 0x6666, 0xffff, 0, 0 }, - { 19, 0xffff, 0x6666, 0xcccc, 0, 0 }, - { 20, 0xffff, 0x6666, 0x9999, 0, 0 }, - { 21, 0xffff, 0x6666, 0x6666, 0, 0 }, - { 22, 0xffff, 0x6666, 0x3333, 0, 0 }, - { 23, 0xffff, 0x6666, 0x0000, 0, 0 }, - { 24, 0xffff, 0x3333, 0xffff, 0, 0 }, - { 25, 0xffff, 0x3333, 0xcccc, 0, 0 }, - { 26, 0xffff, 0x3333, 0x9999, 0, 0 }, - { 27, 0xffff, 0x3333, 0x6666, 0, 0 }, - { 28, 0xffff, 0x3333, 0x3333, 0, 0 }, - { 29, 0xffff, 0x3333, 0x0000, 0, 0 }, - { 30, 0xffff, 0x0000, 0xffff, 0, 0 }, - { 31, 0xffff, 0x0000, 0xcccc, 0, 0 }, - { 32, 0xffff, 0x0000, 0x9999, 0, 0 }, - { 33, 0xffff, 0x0000, 0x6666, 0, 0 }, - { 34, 0xffff, 0x0000, 0x3333, 0, 0 }, - { 35, 0xffff, 0x0000, 0x0000, 0, 0 }, - { 36, 0xcccc, 0xffff, 0xffff, 0, 0 }, - { 37, 0xcccc, 0xffff, 0xcccc, 0, 0 }, - { 38, 0xcccc, 0xffff, 0x9999, 0, 0 }, - { 39, 0xcccc, 0xffff, 0x6666, 0, 0 }, - { 40, 0xcccc, 0xffff, 0x3333, 0, 0 }, - { 41, 0xcccc, 0xffff, 0x0000, 0, 0 }, - { 42, 0xcccc, 0xcccc, 0xffff, 0, 0 }, - { 43, 0xcccc, 0xcccc, 0xcccc, 0, 0 }, - { 44, 0xcccc, 0xcccc, 0x9999, 0, 0 }, - { 45, 0xcccc, 0xcccc, 0x6666, 0, 0 }, - { 46, 0xcccc, 0xcccc, 0x3333, 0, 0 }, - { 47, 0xcccc, 0xcccc, 0x0000, 0, 0 }, - { 48, 0xcccc, 0x9999, 0xffff, 0, 0 }, - { 49, 0xcccc, 0x9999, 0xcccc, 0, 0 }, - { 50, 0xcccc, 0x9999, 0x9999, 0, 0 }, - { 51, 0xcccc, 0x9999, 0x6666, 0, 0 }, - { 52, 0xcccc, 0x9999, 0x3333, 0, 0 }, - { 53, 0xcccc, 0x9999, 0x0000, 0, 0 }, - { 54, 0xcccc, 0x6666, 0xffff, 0, 0 }, - { 55, 0xcccc, 0x6666, 0xcccc, 0, 0 }, - { 56, 0xcccc, 0x6666, 0x9999, 0, 0 }, - { 57, 0xcccc, 0x6666, 0x6666, 0, 0 }, - { 58, 0xcccc, 0x6666, 0x3333, 0, 0 }, - { 59, 0xcccc, 0x6666, 0x0000, 0, 0 }, - { 60, 0xcccc, 0x3333, 0xffff, 0, 0 }, - { 61, 0xcccc, 0x3333, 0xcccc, 0, 0 }, - { 62, 0xcccc, 0x3333, 0x9999, 0, 0 }, - { 63, 0xcccc, 0x3333, 0x6666, 0, 0 }, - { 64, 0xcccc, 0x3333, 0x3333, 0, 0 }, - { 65, 0xcccc, 0x3333, 0x0000, 0, 0 }, - { 66, 0xcccc, 0x0000, 0xffff, 0, 0 }, - { 67, 0xcccc, 0x0000, 0xcccc, 0, 0 }, - { 68, 0xcccc, 0x0000, 0x9999, 0, 0 }, - { 69, 0xcccc, 0x0000, 0x6666, 0, 0 }, - { 70, 0xcccc, 0x0000, 0x3333, 0, 0 }, - { 71, 0xcccc, 0x0000, 0x0000, 0, 0 }, - { 72, 0x9999, 0xffff, 0xffff, 0, 0 }, - { 73, 0x9999, 0xffff, 0xcccc, 0, 0 }, - { 74, 0x9999, 0xffff, 0x9999, 0, 0 }, - { 75, 0x9999, 0xffff, 0x6666, 0, 0 }, - { 76, 0x9999, 0xffff, 0x3333, 0, 0 }, - { 77, 0x9999, 0xffff, 0x0000, 0, 0 }, - { 78, 0x9999, 0xcccc, 0xffff, 0, 0 }, - { 79, 0x9999, 0xcccc, 0xcccc, 0, 0 }, - { 80, 0x9999, 0xcccc, 0x9999, 0, 0 }, - { 81, 0x9999, 0xcccc, 0x6666, 0, 0 }, - { 82, 0x9999, 0xcccc, 0x3333, 0, 0 }, - { 83, 0x9999, 0xcccc, 0x0000, 0, 0 }, - { 84, 0x9999, 0x9999, 0xffff, 0, 0 }, - { 85, 0x9999, 0x9999, 0xcccc, 0, 0 }, - { 86, 0x9999, 0x9999, 0x9999, 0, 0 }, - { 87, 0x9999, 0x9999, 0x6666, 0, 0 }, - { 88, 0x9999, 0x9999, 0x3333, 0, 0 }, - { 89, 0x9999, 0x9999, 0x0000, 0, 0 }, - { 90, 0x9999, 0x6666, 0xffff, 0, 0 }, - { 91, 0x9999, 0x6666, 0xcccc, 0, 0 }, - { 92, 0x9999, 0x6666, 0x9999, 0, 0 }, - { 93, 0x9999, 0x6666, 0x6666, 0, 0 }, - { 94, 0x9999, 0x6666, 0x3333, 0, 0 }, - { 95, 0x9999, 0x6666, 0x0000, 0, 0 }, - { 96, 0x9999, 0x3333, 0xffff, 0, 0 }, - { 97, 0x9999, 0x3333, 0xcccc, 0, 0 }, - { 98, 0x9999, 0x3333, 0x9999, 0, 0 }, - { 99, 0x9999, 0x3333, 0x6666, 0, 0 }, - { 100, 0x9999, 0x3333, 0x3333, 0, 0 }, - { 101, 0x9999, 0x3333, 0x0000, 0, 0 }, - { 102, 0x9999, 0x0000, 0xffff, 0, 0 }, - { 103, 0x9999, 0x0000, 0xcccc, 0, 0 }, - { 104, 0x9999, 0x0000, 0x9999, 0, 0 }, - { 105, 0x9999, 0x0000, 0x6666, 0, 0 }, - { 106, 0x9999, 0x0000, 0x3333, 0, 0 }, - { 107, 0x9999, 0x0000, 0x0000, 0, 0 }, - { 108, 0x6666, 0xffff, 0xffff, 0, 0 }, - { 109, 0x6666, 0xffff, 0xcccc, 0, 0 }, - { 110, 0x6666, 0xffff, 0x9999, 0, 0 }, - { 111, 0x6666, 0xffff, 0x6666, 0, 0 }, - { 112, 0x6666, 0xffff, 0x3333, 0, 0 }, - { 113, 0x6666, 0xffff, 0x0000, 0, 0 }, - { 114, 0x6666, 0xcccc, 0xffff, 0, 0 }, - { 115, 0x6666, 0xcccc, 0xcccc, 0, 0 }, - { 116, 0x6666, 0xcccc, 0x9999, 0, 0 }, - { 117, 0x6666, 0xcccc, 0x6666, 0, 0 }, - { 118, 0x6666, 0xcccc, 0x3333, 0, 0 }, - { 119, 0x6666, 0xcccc, 0x0000, 0, 0 }, - { 120, 0x6666, 0x9999, 0xffff, 0, 0 }, - { 121, 0x6666, 0x9999, 0xcccc, 0, 0 }, - { 122, 0x6666, 0x9999, 0x9999, 0, 0 }, - { 123, 0x6666, 0x9999, 0x6666, 0, 0 }, - { 124, 0x6666, 0x9999, 0x3333, 0, 0 }, - { 125, 0x6666, 0x9999, 0x0000, 0, 0 }, - { 126, 0x6666, 0x6666, 0xffff, 0, 0 }, - { 127, 0x6666, 0x6666, 0xcccc, 0, 0 }, - { 128, 0x6666, 0x6666, 0x9999, 0, 0 }, - { 129, 0x6666, 0x6666, 0x6666, 0, 0 }, - { 130, 0x6666, 0x6666, 0x3333, 0, 0 }, - { 131, 0x6666, 0x6666, 0x0000, 0, 0 }, - { 132, 0x6666, 0x3333, 0xffff, 0, 0 }, - { 133, 0x6666, 0x3333, 0xcccc, 0, 0 }, - { 134, 0x6666, 0x3333, 0x9999, 0, 0 }, - { 135, 0x6666, 0x3333, 0x6666, 0, 0 }, - { 136, 0x6666, 0x3333, 0x3333, 0, 0 }, - { 137, 0x6666, 0x3333, 0x0000, 0, 0 }, - { 138, 0x6666, 0x0000, 0xffff, 0, 0 }, - { 139, 0x6666, 0x0000, 0xcccc, 0, 0 }, - { 140, 0x6666, 0x0000, 0x9999, 0, 0 }, - { 141, 0x6666, 0x0000, 0x6666, 0, 0 }, - { 142, 0x6666, 0x0000, 0x3333, 0, 0 }, - { 143, 0x6666, 0x0000, 0x0000, 0, 0 }, - { 144, 0x3333, 0xffff, 0xffff, 0, 0 }, - { 145, 0x3333, 0xffff, 0xcccc, 0, 0 }, - { 146, 0x3333, 0xffff, 0x9999, 0, 0 }, - { 147, 0x3333, 0xffff, 0x6666, 0, 0 }, - { 148, 0x3333, 0xffff, 0x3333, 0, 0 }, - { 149, 0x3333, 0xffff, 0x0000, 0, 0 }, - { 150, 0x3333, 0xcccc, 0xffff, 0, 0 }, - { 151, 0x3333, 0xcccc, 0xcccc, 0, 0 }, - { 152, 0x3333, 0xcccc, 0x9999, 0, 0 }, - { 153, 0x3333, 0xcccc, 0x6666, 0, 0 }, - { 154, 0x3333, 0xcccc, 0x3333, 0, 0 }, - { 155, 0x3333, 0xcccc, 0x0000, 0, 0 }, - { 156, 0x3333, 0x9999, 0xffff, 0, 0 }, - { 157, 0x3333, 0x9999, 0xcccc, 0, 0 }, - { 158, 0x3333, 0x9999, 0x9999, 0, 0 }, - { 159, 0x3333, 0x9999, 0x6666, 0, 0 }, - { 160, 0x3333, 0x9999, 0x3333, 0, 0 }, - { 161, 0x3333, 0x9999, 0x0000, 0, 0 }, - { 162, 0x3333, 0x6666, 0xffff, 0, 0 }, - { 163, 0x3333, 0x6666, 0xcccc, 0, 0 }, - { 164, 0x3333, 0x6666, 0x9999, 0, 0 }, - { 165, 0x3333, 0x6666, 0x6666, 0, 0 }, - { 166, 0x3333, 0x6666, 0x3333, 0, 0 }, - { 167, 0x3333, 0x6666, 0x0000, 0, 0 }, - { 168, 0x3333, 0x3333, 0xffff, 0, 0 }, - { 169, 0x3333, 0x3333, 0xcccc, 0, 0 }, - { 170, 0x3333, 0x3333, 0x9999, 0, 0 }, - { 171, 0x3333, 0x3333, 0x6666, 0, 0 }, - { 172, 0x3333, 0x3333, 0x3333, 0, 0 }, - { 173, 0x3333, 0x3333, 0x0000, 0, 0 }, - { 174, 0x3333, 0x0000, 0xffff, 0, 0 }, - { 175, 0x3333, 0x0000, 0xcccc, 0, 0 }, - { 176, 0x3333, 0x0000, 0x9999, 0, 0 }, - { 177, 0x3333, 0x0000, 0x6666, 0, 0 }, - { 178, 0x3333, 0x0000, 0x3333, 0, 0 }, - { 179, 0x3333, 0x0000, 0x0000, 0, 0 }, - { 180, 0x0000, 0xffff, 0xffff, 0, 0 }, - { 181, 0x0000, 0xffff, 0xcccc, 0, 0 }, - { 182, 0x0000, 0xffff, 0x9999, 0, 0 }, - { 183, 0x0000, 0xffff, 0x6666, 0, 0 }, - { 184, 0x0000, 0xffff, 0x3333, 0, 0 }, - { 185, 0x0000, 0xffff, 0x0000, 0, 0 }, - { 186, 0x0000, 0xcccc, 0xffff, 0, 0 }, - { 187, 0x0000, 0xcccc, 0xcccc, 0, 0 }, - { 188, 0x0000, 0xcccc, 0x9999, 0, 0 }, - { 189, 0x0000, 0xcccc, 0x6666, 0, 0 }, - { 190, 0x0000, 0xcccc, 0x3333, 0, 0 }, - { 191, 0x0000, 0xcccc, 0x0000, 0, 0 }, - { 192, 0x0000, 0x9999, 0xffff, 0, 0 }, - { 193, 0x0000, 0x9999, 0xcccc, 0, 0 }, - { 194, 0x0000, 0x9999, 0x9999, 0, 0 }, - { 195, 0x0000, 0x9999, 0x6666, 0, 0 }, - { 196, 0x0000, 0x9999, 0x3333, 0, 0 }, - { 197, 0x0000, 0x9999, 0x0000, 0, 0 }, - { 198, 0x0000, 0x6666, 0xffff, 0, 0 }, - { 199, 0x0000, 0x6666, 0xcccc, 0, 0 }, - { 200, 0x0000, 0x6666, 0x9999, 0, 0 }, - { 201, 0x0000, 0x6666, 0x6666, 0, 0 }, - { 202, 0x0000, 0x6666, 0x3333, 0, 0 }, - { 203, 0x0000, 0x6666, 0x0000, 0, 0 }, - { 204, 0x0000, 0x3333, 0xffff, 0, 0 }, - { 205, 0x0000, 0x3333, 0xcccc, 0, 0 }, - { 206, 0x0000, 0x3333, 0x9999, 0, 0 }, - { 207, 0x0000, 0x3333, 0x6666, 0, 0 }, - { 208, 0x0000, 0x3333, 0x3333, 0, 0 }, - { 209, 0x0000, 0x3333, 0x0000, 0, 0 }, - { 210, 0x0000, 0x0000, 0xffff, 0, 0 }, - { 211, 0x0000, 0x0000, 0xcccc, 0, 0 }, - { 212, 0x0000, 0x0000, 0x9999, 0, 0 }, - { 213, 0x0000, 0x0000, 0x6666, 0, 0 }, - { 214, 0x0000, 0x0000, 0x3333, 0, 0 }, - { 215, 0xeeee, 0x0000, 0x0000, 0, 0 }, - { 216, 0xdddd, 0x0000, 0x0000, 0, 0 }, - { 217, 0xbbbb, 0x0000, 0x0000, 0, 0 }, - { 218, 0xaaaa, 0x0000, 0x0000, 0, 0 }, - { 219, 0x8888, 0x0000, 0x0000, 0, 0 }, - { 220, 0x7777, 0x0000, 0x0000, 0, 0 }, - { 221, 0x5555, 0x0000, 0x0000, 0, 0 }, - { 222, 0x4444, 0x0000, 0x0000, 0, 0 }, - { 223, 0x2222, 0x0000, 0x0000, 0, 0 }, - { 224, 0x1111, 0x0000, 0x0000, 0, 0 }, - { 225, 0x0000, 0xeeee, 0x0000, 0, 0 }, - { 226, 0x0000, 0xdddd, 0x0000, 0, 0 }, - { 227, 0x0000, 0xbbbb, 0x0000, 0, 0 }, - { 228, 0x0000, 0xaaaa, 0x0000, 0, 0 }, - { 229, 0x0000, 0x8888, 0x0000, 0, 0 }, - { 230, 0x0000, 0x7777, 0x0000, 0, 0 }, - { 231, 0x0000, 0x5555, 0x0000, 0, 0 }, - { 232, 0x0000, 0x4444, 0x0000, 0, 0 }, - { 233, 0x0000, 0x2222, 0x0000, 0, 0 }, - { 234, 0x0000, 0x1111, 0x0000, 0, 0 }, - { 235, 0x0000, 0x0000, 0xeeee, 0, 0 }, - { 236, 0x0000, 0x0000, 0xdddd, 0, 0 }, - { 237, 0x0000, 0x0000, 0xbbbb, 0, 0 }, - { 238, 0x0000, 0x0000, 0xaaaa, 0, 0 }, - { 239, 0x0000, 0x0000, 0x8888, 0, 0 }, - { 240, 0x0000, 0x0000, 0x7777, 0, 0 }, - { 241, 0x0000, 0x0000, 0x5555, 0, 0 }, - { 242, 0x0000, 0x0000, 0x4444, 0, 0 }, - { 243, 0x0000, 0x0000, 0x2222, 0, 0 }, - { 244, 0x0000, 0x0000, 0x1111, 0, 0 }, - { 245, 0xeeee, 0xeeee, 0xeeee, 0, 0 }, - { 246, 0xdddd, 0xdddd, 0xdddd, 0, 0 }, - { 247, 0xbbbb, 0xbbbb, 0xbbbb, 0, 0 }, - { 248, 0xaaaa, 0xaaaa, 0xaaaa, 0, 0 }, - { 249, 0x8888, 0x8888, 0x8888, 0, 0 }, - { 250, 0x7777, 0x7777, 0x7777, 0, 0 }, - { 251, 0x5555, 0x5555, 0x5555, 0, 0 }, - { 252, 0x4444, 0x4444, 0x4444, 0, 0 }, - { 253, 0x2222, 0x2222, 0x2222, 0, 0 }, - { 254, 0x1111, 0x1111, 0x1111, 0, 0 }, - { 255, 0xffff, 0xffff, 0xffff, 0, 0 } -}; -#endif /* USE_NEW_CLUT */ - -#endif /* _DARWIN_CLUT8_ */ diff --git a/nx-X11/programs/Xserver/hw/darwin/darwinEvents.c b/nx-X11/programs/Xserver/hw/darwin/darwinEvents.c deleted file mode 100644 index 61100d9b3..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/darwinEvents.c +++ /dev/null @@ -1,481 +0,0 @@ -/* - * Darwin event queue and event handling - */ -/* -Copyright (c) 2002-2004 Torrey T. Lyons. All Rights Reserved. -Copyright 2004 Kaleb S. KEITHLEY. All Rights Reserved. - -This file is based on mieq.c by Keith Packard, -which contains the following copyright: -Copyright 1990, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/darwinEvents.c,v 1.6 2004/03/31 22:29:09 torrey Exp $ */ - -#define NEED_EVENTS -#include -#include -#include -#include "misc.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "inputstr.h" -#include "mi.h" -#include "scrnintstr.h" -#include "mipointer.h" - -#include "darwin.h" -#include "darwinKeyboard.h" - -#include -#include -#include -#include - -/* Fake button press/release for scroll wheel move. */ -#define SCROLLWHEELUPFAKE 4 -#define SCROLLWHEELDOWNFAKE 5 - -#define QUEUE_SIZE 256 - -typedef struct _Event { - xEvent event; - ScreenPtr pScreen; -} EventRec, *EventPtr; - -typedef struct _EventQueue { - HWEventQueueType head, tail; /* long for SetInputCheck */ - CARD32 lastEventTime; /* to avoid time running backwards */ - Bool lastMotion; - EventRec events[QUEUE_SIZE]; /* static allocation for signals */ - DevicePtr pKbd, pPtr; /* device pointer, to get funcs */ - ScreenPtr pEnqueueScreen; /* screen events are being delivered to */ - ScreenPtr pDequeueScreen; /* screen events are being dispatched to */ -} EventQueueRec, *EventQueuePtr; - -static EventQueueRec darwinEventQueue; - - -/* - * DarwinPressModifierMask - * Press or release the given modifier key, specified by its mask. - */ -static void DarwinPressModifierMask( - xEvent *xe, // must already have type, time and mouse location - int mask) // one of NX_*MASK constants -{ - int key = DarwinModifierNXMaskToNXKey(mask); - - if (key != -1) { - int keycode = DarwinModifierNXKeyToNXKeycode(key, 0); - if (keycode != 0) { - xe->u.u.detail = keycode + MIN_KEYCODE; - (*darwinEventQueue.pKbd->processInputProc)(xe, - (DeviceIntPtr)darwinEventQueue.pKbd, 1); - } - } -} - -#ifdef NX_DEVICELCTLKEYMASK -#define CONTROL_MASK(flags) (flags & (NX_DEVICELCTLKEYMASK|NX_DEVICERCTLKEYMASK)) -#else -#define CONTROL_MASK(flags) (NX_CONTROLMASK) -#endif /* NX_DEVICELCTLKEYMASK */ - -#ifdef NX_DEVICELSHIFTKEYMASK -#define SHIFT_MASK(flags) (flags & (NX_DEVICELSHIFTKEYMASK|NX_DEVICERSHIFTKEYMASK)) -#else -#define SHIFT_MASK(flags) (NX_SHIFTMASK) -#endif /* NX_DEVICELSHIFTKEYMASK */ - -#ifdef NX_DEVICELCMDKEYMASK -#define COMMAND_MASK(flags) (flags & (NX_DEVICELCMDKEYMASK|NX_DEVICERCMDKEYMASK)) -#else -#define COMMAND_MASK(flags) (NX_COMMANDMASK) -#endif /* NX_DEVICELCMDKEYMASK */ - -#ifdef NX_DEVICELALTKEYMASK -#define ALTERNATE_MASK(flags) (flags & (NX_DEVICELALTKEYMASK|NX_DEVICERALTKEYMASK)) -#else -#define ALTERNATE_MASK(flags) (NX_ALTERNATEMASK) -#endif /* NX_DEVICELALTKEYMASK */ - -/* - * DarwinUpdateModifiers - * Send events to update the modifier state. - */ -static void DarwinUpdateModifiers( - xEvent *xe, // event template with time and mouse position set - int pressed, // KeyPress or KeyRelease - int flags ) // modifier flags that have changed -{ - xe->u.u.type = pressed; - if (flags & NX_ALPHASHIFTMASK) { - DarwinPressModifierMask(xe, NX_ALPHASHIFTMASK); - } - if (flags & NX_COMMANDMASK) { - DarwinPressModifierMask(xe, COMMAND_MASK(flags)); - } - if (flags & NX_CONTROLMASK) { - DarwinPressModifierMask(xe, CONTROL_MASK(flags)); - } - if (flags & NX_ALTERNATEMASK) { - DarwinPressModifierMask(xe, ALTERNATE_MASK(flags)); - } - if (flags & NX_SHIFTMASK) { - DarwinPressModifierMask(xe, SHIFT_MASK(flags)); - } - if (flags & NX_SECONDARYFNMASK) { - DarwinPressModifierMask(xe, NX_SECONDARYFNMASK); - } -} - - -/* - * DarwinSimulateMouseClick - * Send a mouse click to X when multiple mouse buttons are simulated - * with modifier-clicks, such as command-click for button 2. The dix - * layer is told that the previously pressed modifier key(s) are - * released, the simulated click event is sent. After the mouse button - * is released, the modifier keys are reverted to their actual state, - * which may or may not be pressed at that point. This is usually - * closest to what the user wants. Ie. the user typically wants to - * simulate a button 2 press instead of Command-button 2. - */ -static void DarwinSimulateMouseClick( - xEvent *xe, // event template with time and - // mouse position filled in - int whichButton, // mouse button to be pressed - int modifierMask) // modifiers used for the fake click -{ - // first fool X into forgetting about the keys - DarwinUpdateModifiers(xe, KeyRelease, modifierMask); - - // push the mouse button - xe->u.u.type = ButtonPress; - xe->u.u.detail = whichButton; - (*darwinEventQueue.pPtr->processInputProc) - (xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1); -} - - -Bool -DarwinEQInit( - DevicePtr pKbd, - DevicePtr pPtr) -{ - darwinEventQueue.head = darwinEventQueue.tail = 0; - darwinEventQueue.lastEventTime = GetTimeInMillis (); - darwinEventQueue.pKbd = pKbd; - darwinEventQueue.pPtr = pPtr; - darwinEventQueue.pEnqueueScreen = screenInfo.screens[0]; - darwinEventQueue.pDequeueScreen = darwinEventQueue.pEnqueueScreen; - SetInputCheck (&darwinEventQueue.head, &darwinEventQueue.tail); - return TRUE; -} - - -/* - * DarwinEQEnqueue - * Must be thread safe with ProcessInputEvents. - * DarwinEQEnqueue - called from event gathering thread - * ProcessInputEvents - called from X server thread - * DarwinEQEnqueue should never be called from more than one thread. - */ -void -DarwinEQEnqueue( - const xEvent *e) -{ - HWEventQueueType oldtail, newtail; - char byte = 0; - - oldtail = darwinEventQueue.tail; - - // mieqEnqueue() collapses successive motion events into one event. - // This is difficult to do in a thread-safe way and rarely useful. - - newtail = oldtail + 1; - if (newtail == QUEUE_SIZE) - newtail = 0; - /* Toss events which come in late */ - if (newtail == darwinEventQueue.head) - return; - - darwinEventQueue.events[oldtail].event = *e; - /* - * Make sure that event times don't go backwards - this - * is "unnecessary", but very useful - */ - if (e->u.keyButtonPointer.time < darwinEventQueue.lastEventTime && - darwinEventQueue.lastEventTime - e->u.keyButtonPointer.time < 10000) - { - darwinEventQueue.events[oldtail].event.u.keyButtonPointer.time = - darwinEventQueue.lastEventTime; - } - darwinEventQueue.events[oldtail].pScreen = darwinEventQueue.pEnqueueScreen; - - // Update the tail after the event is prepared - darwinEventQueue.tail = newtail; - - // Signal there is an event ready to handle - write(darwinEventWriteFD, &byte, 1); -} - - -/* - * DarwinEQPointerPost - * Post a pointer event. Used by the mipointer.c routines. - */ -void -DarwinEQPointerPost( - xEvent *e) -{ - (*darwinEventQueue.pPtr->processInputProc) - (e, (DeviceIntPtr)darwinEventQueue.pPtr, 1); -} - - -void -DarwinEQSwitchScreen( - ScreenPtr pScreen, - Bool fromDIX) -{ - darwinEventQueue.pEnqueueScreen = pScreen; - if (fromDIX) - darwinEventQueue.pDequeueScreen = pScreen; -} - - -/* - * ProcessInputEvents - * Read and process events from the event queue until it is empty. - */ -void ProcessInputEvents(void) -{ - EventRec *e; - int x, y; - xEvent xe; - static int old_flags = 0; // last known modifier state - // button number and modifier mask of currently pressed fake button - static int darwinFakeMouseButtonDown = 0; - static int darwinFakeMouseButtonMask = 0; - - // Empty the signaling pipe - x = sizeof(xe); - while (x == sizeof(xe)) { - x = read(darwinEventReadFD, &xe, sizeof(xe)); - } - - while (darwinEventQueue.head != darwinEventQueue.tail) - { - if (screenIsSaved == SCREEN_SAVER_ON) - SaveScreens (SCREEN_SAVER_OFF, ScreenSaverReset); - - e = &darwinEventQueue.events[darwinEventQueue.head]; - xe = e->event; - - // Shift from global screen coordinates to coordinates relative to - // the origin of the current screen. - xe.u.keyButtonPointer.rootX -= darwinMainScreenX + - dixScreenOrigins[miPointerCurrentScreen()->myNum].x; - xe.u.keyButtonPointer.rootY -= darwinMainScreenY + - dixScreenOrigins[miPointerCurrentScreen()->myNum].y; - - /* - * Assumption - screen switching can only occur on motion events - */ - if (e->pScreen != darwinEventQueue.pDequeueScreen) - { - darwinEventQueue.pDequeueScreen = e->pScreen; - x = xe.u.keyButtonPointer.rootX; - y = xe.u.keyButtonPointer.rootY; - if (darwinEventQueue.head == QUEUE_SIZE - 1) - darwinEventQueue.head = 0; - else - ++darwinEventQueue.head; - NewCurrentScreen (darwinEventQueue.pDequeueScreen, x, y); - } - else - { - if (darwinEventQueue.head == QUEUE_SIZE - 1) - darwinEventQueue.head = 0; - else - ++darwinEventQueue.head; - switch (xe.u.u.type) - { - case KeyPress: - if (old_flags == 0 - && darwinSyncKeymap && darwinKeymapFile == NULL) - { - /* See if keymap has changed. */ - - static unsigned int last_seed; - unsigned int this_seed; - - this_seed = DarwinModeSystemKeymapSeed(); - if (this_seed != last_seed) - { - last_seed = this_seed; - DarwinKeyboardReload(darwinKeyboard); - } - } - /* fall through */ - - case KeyRelease: - xe.u.u.detail += MIN_KEYCODE; - (*darwinEventQueue.pKbd->processInputProc) - (&xe, (DeviceIntPtr)darwinEventQueue.pKbd, 1); - break; - - case ButtonPress: - miPointerAbsoluteCursor(xe.u.keyButtonPointer.rootX, - xe.u.keyButtonPointer.rootY, - xe.u.keyButtonPointer.time); - if (darwinFakeButtons && xe.u.u.detail == 1) { - // Mimic multi-button mouse with modifier-clicks - // If both sets of modifiers are pressed, - // button 2 is clicked. - if ((old_flags & darwinFakeMouse2Mask) == - darwinFakeMouse2Mask) - { - DarwinSimulateMouseClick(&xe, 2, darwinFakeMouse2Mask); - darwinFakeMouseButtonDown = 2; - darwinFakeMouseButtonMask = darwinFakeMouse2Mask; - break; - } - else if ((old_flags & darwinFakeMouse3Mask) == - darwinFakeMouse3Mask) - { - DarwinSimulateMouseClick(&xe, 3, darwinFakeMouse3Mask); - darwinFakeMouseButtonDown = 3; - darwinFakeMouseButtonMask = darwinFakeMouse3Mask; - break; - } - } - (*darwinEventQueue.pPtr->processInputProc) - (&xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1); - break; - - case ButtonRelease: - miPointerAbsoluteCursor(xe.u.keyButtonPointer.rootX, - xe.u.keyButtonPointer.rootY, - xe.u.keyButtonPointer.time); - if (darwinFakeButtons && xe.u.u.detail == 1 && - darwinFakeMouseButtonDown) - { - // If last mousedown was a fake click, don't check for - // mouse modifiers here. The user may have released the - // modifiers before the mouse button. - xe.u.u.detail = darwinFakeMouseButtonDown; - darwinFakeMouseButtonDown = 0; - (*darwinEventQueue.pPtr->processInputProc) - (&xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1); - - // Bring modifiers back up to date - DarwinUpdateModifiers(&xe, KeyPress, - darwinFakeMouseButtonMask & old_flags); - darwinFakeMouseButtonMask = 0; - } else { - (*darwinEventQueue.pPtr->processInputProc) - (&xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1); - } - break; - - case MotionNotify: - miPointerAbsoluteCursor(xe.u.keyButtonPointer.rootX, - xe.u.keyButtonPointer.rootY, - xe.u.keyButtonPointer.time); - break; - - case kXDarwinUpdateModifiers: - { - // Update modifier state. - // Any amount of modifiers may have changed. - int flags = xe.u.clientMessage.u.l.longs0; - DarwinUpdateModifiers(&xe, KeyRelease, - old_flags & ~flags); - DarwinUpdateModifiers(&xe, KeyPress, - ~old_flags & flags); - old_flags = flags; - break; - } - - case kXDarwinUpdateButtons: - { - long hwDelta = xe.u.clientMessage.u.l.longs0; - long hwButtons = xe.u.clientMessage.u.l.longs1; - int i; - - for (i = 1; i < 5; i++) { - if (hwDelta & (1 << i)) { - // IOKit and X have different numbering for the - // middle and right mouse buttons. - if (i == 1) { - xe.u.u.detail = 3; - } else if (i == 2) { - xe.u.u.detail = 2; - } else { - xe.u.u.detail = i + 1; - } - if (hwButtons & (1 << i)) { - xe.u.u.type = ButtonPress; - } else { - xe.u.u.type = ButtonRelease; - } - (*darwinEventQueue.pPtr->processInputProc) - (&xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1); - } - } - break; - } - - case kXDarwinScrollWheel: - { - short count = xe.u.clientMessage.u.s.shorts0; - - if (count > 0) { - xe.u.u.detail = SCROLLWHEELUPFAKE; - } else { - xe.u.u.detail = SCROLLWHEELDOWNFAKE; - count = -count; - } - - for (; count; --count) { - xe.u.u.type = ButtonPress; - (*darwinEventQueue.pPtr->processInputProc) - (&xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1); - xe.u.u.type = ButtonRelease; - (*darwinEventQueue.pPtr->processInputProc) - (&xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1); - } - break; - } - - default: - // Check for mode specific event - DarwinModeProcessEvent(&xe); - } - } - } - - miPointerUpdate(); -} diff --git a/nx-X11/programs/Xserver/hw/darwin/darwinKeyboard.c b/nx-X11/programs/Xserver/hw/darwin/darwinKeyboard.c deleted file mode 100644 index dbc449dc3..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/darwinKeyboard.c +++ /dev/null @@ -1,1027 +0,0 @@ -//============================================================================= -// -// Keyboard support for the Darwin X Server -// -// Copyright (c) 2001-2004 Torrey T. Lyons. All Rights Reserved. -// Copyright (c) 2003 Apple Computer, Inc. All Rights Reserved. -// Copyright 2004 Kaleb S. KEITHLEY. All Rights Reserved. -// -// The code to parse the Darwin keymap is derived from dumpkeymap.c -// by Eric Sunshine, which includes the following copyright: -// -// Copyright (C) 1999,2000 by Eric Sunshine -// All rights reserved. -// -//----------------------------------------------------------------------------- -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN -// NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -//============================================================================= - -/* $XFree86: xc/programs/Xserver/hw/darwin/darwinKeyboard.c,v 1.21 2004/04/01 00:05:22 torrey Exp $ */ - -/* -=========================================================================== - - An X keyCode must be in the range XkbMinLegalKeyCode (8) to - XkbMaxLegalKeyCode(255). - - The keyCodes we get from the kernel range from 0 to 127, so we need to - offset the range before passing the keyCode to X. - - An X KeySym is an extended ascii code that is device independent. - - The modifier map is accessed by the keyCode, but the normal map is - accessed by keyCode - MIN_KEYCODE. Sigh. - -=========================================================================== -*/ - -// Define this to get a diagnostic output to stderr which is helpful -// in determining how the X server is interpreting the Darwin keymap. -#undef DUMP_DARWIN_KEYMAP - -/* Define this to use Alt for Mode_switch. */ -#define ALT_IS_MODE_SWITCH 1 - -#include -#include -#include -#include -#include -#include -#include // For the NXSwap* -#include "darwin.h" -#include "darwinKeyboard.h" - -#define AltMask Mod1Mask -#define MetaMask Mod2Mask -#define FunctionMask Mod3Mask - -// FIXME: It would be nice to support some of the extra keys in XF86keysym.h, -// at least the volume controls that now ship on every Apple keyboard. - -#define UK(a) NoSymbol // unknown symbol - -static KeySym const next_to_x[256] = { - NoSymbol, NoSymbol, NoSymbol, XK_KP_Enter, - NoSymbol, NoSymbol, NoSymbol, NoSymbol, - XK_BackSpace, XK_Tab, XK_Linefeed, NoSymbol, - NoSymbol, XK_Return, NoSymbol, NoSymbol, - NoSymbol, NoSymbol, NoSymbol, NoSymbol, - NoSymbol, NoSymbol, NoSymbol, NoSymbol, - NoSymbol, NoSymbol, NoSymbol, XK_Escape, - NoSymbol, NoSymbol, NoSymbol, NoSymbol, - XK_space, XK_exclam, XK_quotedbl, XK_numbersign, - XK_dollar, XK_percent, XK_ampersand, XK_apostrophe, - XK_parenleft, XK_parenright, XK_asterisk, XK_plus, - XK_comma, XK_minus, XK_period, XK_slash, - XK_0, XK_1, XK_2, XK_3, - XK_4, XK_5, XK_6, XK_7, - XK_8, XK_9, XK_colon, XK_semicolon, - XK_less, XK_equal, XK_greater, XK_question, - XK_at, XK_A, XK_B, XK_C, - XK_D, XK_E, XK_F, XK_G, - XK_H, XK_I, XK_J, XK_K, - XK_L, XK_M, XK_N, XK_O, - XK_P, XK_Q, XK_R, XK_S, - XK_T, XK_U, XK_V, XK_W, - XK_X, XK_Y, XK_Z, XK_bracketleft, - XK_backslash, XK_bracketright,XK_asciicircum, XK_underscore, - XK_grave, XK_a, XK_b, XK_c, - XK_d, XK_e, XK_f, XK_g, - XK_h, XK_i, XK_j, XK_k, - XK_l, XK_m, XK_n, XK_o, - XK_p, XK_q, XK_r, XK_s, - XK_t, XK_u, XK_v, XK_w, - XK_x, XK_y, XK_z, XK_braceleft, - XK_bar, XK_braceright, XK_asciitilde, XK_BackSpace, -// 128 - NoSymbol, XK_Agrave, XK_Aacute, XK_Acircumflex, - XK_Atilde, XK_Adiaeresis, XK_Aring, XK_Ccedilla, - XK_Egrave, XK_Eacute, XK_Ecircumflex, XK_Ediaeresis, - XK_Igrave, XK_Iacute, XK_Icircumflex, XK_Idiaeresis, -// 144 - XK_ETH, XK_Ntilde, XK_Ograve, XK_Oacute, - XK_Ocircumflex, XK_Otilde, XK_Odiaeresis, XK_Ugrave, - XK_Uacute, XK_Ucircumflex, XK_Udiaeresis, XK_Yacute, - XK_THORN, XK_mu, XK_multiply, XK_division, -// 160 - XK_copyright, XK_exclamdown, XK_cent, XK_sterling, - UK(fraction), XK_yen, UK(fhook), XK_section, - XK_currency, XK_rightsinglequotemark, - XK_leftdoublequotemark, - XK_guillemotleft, - XK_leftanglebracket, - XK_rightanglebracket, - UK(filigature), UK(flligature), -// 176 - XK_registered, XK_endash, XK_dagger, XK_doubledagger, - XK_periodcentered,XK_brokenbar, XK_paragraph, UK(bullet), - XK_singlelowquotemark, - XK_doublelowquotemark, - XK_rightdoublequotemark, - XK_guillemotright, - XK_ellipsis, UK(permille), XK_notsign, XK_questiondown, -// 192 - XK_onesuperior, XK_dead_grave, XK_dead_acute, XK_dead_circumflex, - XK_dead_tilde, XK_dead_macron, XK_dead_breve, XK_dead_abovedot, - XK_dead_diaeresis, - XK_twosuperior, XK_dead_abovering, - XK_dead_cedilla, - XK_threesuperior, - XK_dead_doubleacute, - XK_dead_ogonek, XK_dead_caron, -// 208 - XK_emdash, XK_plusminus, XK_onequarter, XK_onehalf, - XK_threequarters, - XK_agrave, XK_aacute, XK_acircumflex, - XK_atilde, XK_adiaeresis, XK_aring, XK_ccedilla, - XK_egrave, XK_eacute, XK_ecircumflex, XK_ediaeresis, -// 224 - XK_igrave, XK_AE, XK_iacute, XK_ordfeminine, - XK_icircumflex, XK_idiaeresis, XK_eth, XK_ntilde, - XK_Lstroke, XK_Ooblique, XK_OE, XK_masculine, - XK_ograve, XK_oacute, XK_ocircumflex, XK_otilde, -// 240 - XK_odiaeresis, XK_ae, XK_ugrave, XK_uacute, - XK_ucircumflex, XK_idotless, XK_udiaeresis, XK_ygrave, - XK_lstroke, XK_ooblique, XK_oe, XK_ssharp, - XK_thorn, XK_ydiaeresis, NoSymbol, NoSymbol, - }; - -#define MIN_SYMBOL 0xAC -static KeySym const symbol_to_x[] = { - XK_Left, XK_Up, XK_Right, XK_Down - }; -int const NUM_SYMBOL = sizeof(symbol_to_x) / sizeof(symbol_to_x[0]); - -#define MIN_FUNCKEY 0x20 -static KeySym const funckey_to_x[] = { - XK_F1, XK_F2, XK_F3, XK_F4, - XK_F5, XK_F6, XK_F7, XK_F8, - XK_F9, XK_F10, XK_F11, XK_F12, - XK_Insert, XK_Delete, XK_Home, XK_End, - XK_Page_Up, XK_Page_Down, XK_F13, XK_F14, - XK_F15 - }; -int const NUM_FUNCKEY = sizeof(funckey_to_x) / sizeof(funckey_to_x[0]); - -typedef struct { - KeySym normalSym; - KeySym keypadSym; -} darwinKeyPad_t; - -static darwinKeyPad_t const normal_to_keypad[] = { - { XK_0, XK_KP_0 }, - { XK_1, XK_KP_1 }, - { XK_2, XK_KP_2 }, - { XK_3, XK_KP_3 }, - { XK_4, XK_KP_4 }, - { XK_5, XK_KP_5 }, - { XK_6, XK_KP_6 }, - { XK_7, XK_KP_7 }, - { XK_8, XK_KP_8 }, - { XK_9, XK_KP_9 }, - { XK_equal, XK_KP_Equal }, - { XK_asterisk, XK_KP_Multiply }, - { XK_plus, XK_KP_Add }, - { XK_comma, XK_KP_Separator }, - { XK_minus, XK_KP_Subtract }, - { XK_period, XK_KP_Decimal }, - { XK_slash, XK_KP_Divide } -}; -int const NUM_KEYPAD = sizeof(normal_to_keypad) / sizeof(normal_to_keypad[0]); - -static void DarwinChangeKeyboardControl( DeviceIntPtr device, KeybdCtrl *ctrl ) -{ - // keyclick, bell volume / pitch, autorepead, LED's -} - -static darwinKeyboardInfo keyInfo; -static FILE *fref = NULL; -static char *inBuffer = NULL; - -//----------------------------------------------------------------------------- -// Data Stream Object -// Can be configured to treat embedded "numbers" as being composed of -// either 1, 2, or 4 bytes, apiece. -//----------------------------------------------------------------------------- -typedef struct _DataStream -{ - unsigned char const *data; - unsigned char const *data_end; - short number_size; // Size in bytes of a "number" in the stream. -} DataStream; - -static DataStream* new_data_stream( unsigned char const* data, int size ) -{ - DataStream* s = (DataStream*)xalloc( sizeof(DataStream) ); - s->data = data; - s->data_end = data + size; - s->number_size = 1; // Default to byte-sized numbers. - return s; -} - -static void destroy_data_stream( DataStream* s ) -{ - xfree(s); -} - -static unsigned char get_byte( DataStream* s ) -{ - assert(s->data + 1 <= s->data_end); - return *s->data++; -} - -static short get_word( DataStream* s ) -{ - short hi, lo; - assert(s->data + 2 <= s->data_end); - hi = *s->data++; - lo = *s->data++; - return ((hi << 8) | lo); -} - -static int get_dword( DataStream* s ) -{ - int b1, b2, b3, b4; - assert(s->data + 4 <= s->data_end); - b4 = *s->data++; - b3 = *s->data++; - b2 = *s->data++; - b1 = *s->data++; - return ((b4 << 24) | (b3 << 16) | (b2 << 8) | b1); -} - -static int get_number( DataStream* s ) -{ - switch (s->number_size) { - case 4: return get_dword(s); - case 2: return get_word(s); - default: return get_byte(s); - } -} - -//----------------------------------------------------------------------------- -// Utility functions to help parse Darwin keymap -//----------------------------------------------------------------------------- - -/* - * bits_set - * Calculate number of bits set in the modifier mask. - */ -static short bits_set( short mask ) -{ - short n = 0; - - for ( ; mask != 0; mask >>= 1) - if ((mask & 0x01) != 0) - n++; - return n; -} - -/* - * parse_next_char_code - * Read the next character code from the Darwin keymapping - * and write it to the X keymap. - */ -static void parse_next_char_code( - DataStream *s, - KeySym *k ) -{ - const short charSet = get_number(s); - const short charCode = get_number(s); - - if (charSet == 0) { // ascii character - if (charCode >= 0 && charCode < 256) - *k = next_to_x[charCode]; - } else if (charSet == 0x01) { // symbol character - if (charCode >= MIN_SYMBOL && - charCode <= MIN_SYMBOL + NUM_SYMBOL) - *k = symbol_to_x[charCode - MIN_SYMBOL]; - } else if (charSet == 0xFE) { // function key - if (charCode >= MIN_FUNCKEY && - charCode <= MIN_FUNCKEY + NUM_FUNCKEY) - *k = funckey_to_x[charCode - MIN_FUNCKEY]; - } -} - - -/* - * DarwinReadKeymapFile - * Read the appropriate keymapping from a keymapping file. - */ -Bool DarwinReadKeymapFile( - NXKeyMapping *keyMap) -{ - struct stat st; - NXEventSystemDevice info[20]; - int interface = 0, handler_id = 0; - int map_interface, map_handler_id, map_size = 0; - unsigned int i, size; - int *bufferEnd; - union km_tag { - int *intP; - char *charP; - } km; - - fref = fopen( darwinKeymapFile, "rb" ); - if (fref == NULL) { - ErrorF("Unable to open keymapping file '%s' (errno %d).\n", - darwinKeymapFile, errno); - return FALSE; - } - if (fstat(fileno(fref), &st) == -1) { - ErrorF("Could not stat keymapping file '%s' (errno %d).\n", - darwinKeymapFile, errno); - return FALSE; - } - - // check to make sure we don't crash later - if (st.st_size <= 16*sizeof(int)) { - ErrorF("Keymapping file '%s' is invalid (too small).\n", - darwinKeymapFile); - return FALSE; - } - - inBuffer = (char*) xalloc( st.st_size ); - bufferEnd = (int *) (inBuffer + st.st_size); - if (fread(inBuffer, st.st_size, 1, fref) != 1) { - ErrorF("Could not read %qd bytes from keymapping file '%s' (errno %d).\n", - st.st_size, darwinKeymapFile, errno); - return FALSE; - } - - if (strncmp( inBuffer, "KYM1", 4 ) == 0) { - // Magic number OK. - } else if (strncmp( inBuffer, "KYMP", 4 ) == 0) { - ErrorF("Keymapping file '%s' is intended for use with the original NeXT keyboards and cannot be used by XDarwin.\n", darwinKeymapFile); - return FALSE; - } else { - ErrorF("Keymapping file '%s' has a bad magic number and cannot be used by XDarwin.\n", darwinKeymapFile); - return FALSE; - } - - // find the keyboard interface and handler id - size = sizeof( info ) / sizeof( int ); - if (!NXEventSystemInfo( darwinParamConnect, NX_EVS_DEVICE_INFO, - (NXEventSystemInfoType) info, &size )) { - ErrorF("Error reading event status driver info.\n"); - return FALSE; - } - - size = size * sizeof( int ) / sizeof( info[0] ); - for( i = 0; i < size; i++) { - if (info[i].dev_type == NX_EVS_DEVICE_TYPE_KEYBOARD) { - Bool hasInterface = FALSE; - Bool hasMatch = FALSE; - - interface = info[i].interface; - handler_id = info[i].id; - - // Find an appropriate keymapping: - // The first time we try to match both interface and handler_id. - // If we can't match both, we take the first match for interface. - - do { - km.charP = inBuffer; - km.intP++; - while (km.intP+3 < bufferEnd) { - map_interface = NXSwapBigIntToHost(*(km.intP++)); - map_handler_id = NXSwapBigIntToHost(*(km.intP++)); - map_size = NXSwapBigIntToHost(*(km.intP++)); - if (map_interface == interface) { - if (map_handler_id == handler_id || hasInterface) { - hasMatch = TRUE; - break; - } else { - hasInterface = TRUE; - } - } - km.charP += map_size; - } - } while (hasInterface && !hasMatch); - - if (hasMatch) { - // fill in NXKeyMapping structure - keyMap->size = map_size; - keyMap->mapping = (char*) xalloc(map_size); - memcpy(keyMap->mapping, km.charP, map_size); - return TRUE; - } - } // if dev_id == keyboard device - } // foreach info struct - - // The keymapping file didn't match any of the info structs - // returned by NXEventSystemInfo. - ErrorF("Keymapping file '%s' did not contain appropriate keyboard interface.\n", darwinKeymapFile); - return FALSE; -} - - -/* - * DarwinParseNXKeyMapping - */ -Bool DarwinParseNXKeyMapping( - darwinKeyboardInfo *info) -{ - KeySym *k; - int i; - short numMods, numKeys, numPadKeys = 0; - Bool haveKeymap = FALSE; - NXKeyMapping keyMap; - DataStream *keyMapStream; - unsigned char const *numPadStart = 0; - - if (darwinKeymapFile) { - haveKeymap = DarwinReadKeymapFile(&keyMap); - if (fref) - fclose(fref); - if (inBuffer) - xfree(inBuffer); - if (!haveKeymap) { - ErrorF("Reverting to kernel keymapping.\n"); - } - } - - if (!haveKeymap) { - // get the Darwin keyboard map - keyMap.size = NXKeyMappingLength( darwinParamConnect ); - keyMap.mapping = (char*) xalloc( keyMap.size ); - if (!NXGetKeyMapping( darwinParamConnect, &keyMap )) { - return FALSE; - } - } - - keyMapStream = new_data_stream( (unsigned char const*)keyMap.mapping, - keyMap.size ); - - // check the type of map - if (get_word(keyMapStream)) { - keyMapStream->number_size = 2; - ErrorF("Current 16-bit keymapping may not be interpreted correctly.\n"); - } - - // Insert X modifier KeySyms into the keyboard map. - numMods = get_number(keyMapStream); - while (numMods-- > 0) { - int left = 1; // first keycode is left - short const charCode = get_number(keyMapStream); - short numKeyCodes = get_number(keyMapStream); - - // This is just a marker, not a real modifier. - // Store numeric keypad keys for later. - if (charCode == NX_MODIFIERKEY_NUMERICPAD) { - numPadStart = keyMapStream->data; - numPadKeys = numKeyCodes; - } - - while (numKeyCodes-- > 0) { - const short keyCode = get_number(keyMapStream); - if (charCode != NX_MODIFIERKEY_NUMERICPAD) { - switch (charCode) { - case NX_MODIFIERKEY_ALPHALOCK: - info->keyMap[keyCode * GLYPHS_PER_KEY] = XK_Caps_Lock; - break; - case NX_MODIFIERKEY_SHIFT: - info->keyMap[keyCode * GLYPHS_PER_KEY] = - (left ? XK_Shift_L : XK_Shift_R); - break; - case NX_MODIFIERKEY_CONTROL: - info->keyMap[keyCode * GLYPHS_PER_KEY] = - (left ? XK_Control_L : XK_Control_R); - break; - case NX_MODIFIERKEY_ALTERNATE: - info->keyMap[keyCode * GLYPHS_PER_KEY] = - (left ? XK_Mode_switch : XK_Alt_R); - break; - case NX_MODIFIERKEY_COMMAND: - info->keyMap[keyCode * GLYPHS_PER_KEY] = - (left ? XK_Meta_L : XK_Meta_R); - break; - case NX_MODIFIERKEY_SECONDARYFN: - info->keyMap[keyCode * GLYPHS_PER_KEY] = - (left ? XK_Control_L : XK_Control_R); - break; - case NX_MODIFIERKEY_HELP: - // Help is not an X11 modifier; treat as normal key - info->keyMap[keyCode * GLYPHS_PER_KEY] = XK_Help; - break; - } - } - left = 0; - } - } - - // Convert the Darwin keyboard mapping to an X keyboard map. - // A key can have a different character code for each combination of - // modifiers. We currently ignore all modifier combinations except - // those with Shift, AlphaLock, and Alt. - numKeys = get_number(keyMapStream); - for (i = 0, k = info->keyMap; i < numKeys; i++, k += GLYPHS_PER_KEY) { - short const charGenMask = get_number(keyMapStream); - if (charGenMask != 0xFF) { // is key bound? - short numKeyCodes = 1 << bits_set(charGenMask); - - // Record unmodified case - parse_next_char_code( keyMapStream, k ); - numKeyCodes--; - - // If AlphaLock and Shift modifiers produce different codes, - // we record the Shift case since X handles AlphaLock. - if (charGenMask & 0x01) { // AlphaLock - parse_next_char_code( keyMapStream, k+1 ); - numKeyCodes--; - } - - if (charGenMask & 0x02) { // Shift - parse_next_char_code( keyMapStream, k+1 ); - numKeyCodes--; - - if (charGenMask & 0x01) { // Shift-AlphaLock - get_number(keyMapStream); get_number(keyMapStream); - numKeyCodes--; - } - } - - // Skip the Control cases - if (charGenMask & 0x04) { // Control - get_number(keyMapStream); get_number(keyMapStream); - numKeyCodes--; - - if (charGenMask & 0x01) { // Control-AlphaLock - get_number(keyMapStream); get_number(keyMapStream); - numKeyCodes--; - } - - if (charGenMask & 0x02) { // Control-Shift - get_number(keyMapStream); get_number(keyMapStream); - numKeyCodes--; - - if (charGenMask & 0x01) { // Shift-Control-AlphaLock - get_number(keyMapStream); get_number(keyMapStream); - numKeyCodes--; - } - } - } - - // Process Alt cases - if (charGenMask & 0x08) { // Alt - parse_next_char_code( keyMapStream, k+2 ); - numKeyCodes--; - - if (charGenMask & 0x01) { // Alt-AlphaLock - parse_next_char_code( keyMapStream, k+3 ); - numKeyCodes--; - } - - if (charGenMask & 0x02) { // Alt-Shift - parse_next_char_code( keyMapStream, k+3 ); - numKeyCodes--; - - if (charGenMask & 0x01) { // Alt-Shift-AlphaLock - get_number(keyMapStream); get_number(keyMapStream); - numKeyCodes--; - } - } - } - - while (numKeyCodes-- > 0) { - get_number(keyMapStream); get_number(keyMapStream); - } - - if (k[3] == k[2]) k[3] = NoSymbol; - if (k[2] == k[1]) k[2] = NoSymbol; - if (k[1] == k[0]) k[1] = NoSymbol; - if (k[0] == k[2] && k[1] == k[3]) k[2] = k[3] = NoSymbol; - } - } - - // Now we have to go back through the list of keycodes that are on the - // numeric keypad and update the X keymap. - keyMapStream->data = numPadStart; - while(numPadKeys-- > 0) { - const short keyCode = get_number(keyMapStream); - k = &info->keyMap[keyCode * GLYPHS_PER_KEY]; - for (i = 0; i < NUM_KEYPAD; i++) { - if (*k == normal_to_keypad[i].normalSym) { - k[0] = normal_to_keypad[i].keypadSym; - break; - } - } - } - - // free Darwin keyboard map - destroy_data_stream( keyMapStream ); - xfree( keyMap.mapping ); - - return TRUE; -} - - -/* - * DarwinBuildModifierMaps - * Use the keyMap field of keyboard info structure to populate - * the modMap and modifierKeycodes fields. - */ -static void -DarwinBuildModifierMaps( - darwinKeyboardInfo *info) -{ - int i; - KeySym *k; - - memset(info->modMap, NoSymbol, sizeof(info->modMap)); - memset(info->modifierKeycodes, 0, sizeof(info->modifierKeycodes)); - - for (i = 0; i < NUM_KEYCODES; i++) - { - k = info->keyMap + i * GLYPHS_PER_KEY; - - switch (k[0]) { - case XK_Shift_L: - info->modifierKeycodes[NX_MODIFIERKEY_SHIFT][0] = i; - info->modMap[MIN_KEYCODE + i] = ShiftMask; - break; - - case XK_Shift_R: -#ifdef NX_MODIFIERKEY_RSHIFT - info->modifierKeycodes[NX_MODIFIERKEY_RSHIFT][0] = i; -#else - info->modifierKeycodes[NX_MODIFIERKEY_SHIFT][0] = i; -#endif - info->modMap[MIN_KEYCODE + i] = ShiftMask; - break; - - case XK_Control_L: - info->modifierKeycodes[NX_MODIFIERKEY_CONTROL][0] = i; - info->modMap[MIN_KEYCODE + i] = ControlMask; - break; - - case XK_Control_R: -#ifdef NX_MODIFIERKEY_RCONTROL - info->modifierKeycodes[NX_MODIFIERKEY_RCONTROL][0] = i; -#else - info->modifierKeycodes[NX_MODIFIERKEY_CONTROL][0] = i; -#endif - info->modMap[MIN_KEYCODE + i] = ControlMask; - break; - - case XK_Caps_Lock: - info->modifierKeycodes[NX_MODIFIERKEY_ALPHALOCK][0] = i; - info->modMap[MIN_KEYCODE + i] = LockMask; - break; - - case XK_Alt_L: - info->modifierKeycodes[NX_MODIFIERKEY_ALTERNATE][0] = i; - info->modMap[MIN_KEYCODE + i] = Mod1Mask; - break; - - case XK_Alt_R: -#ifdef NX_MODIFIERKEY_RALTERNATE - info->modifierKeycodes[NX_MODIFIERKEY_RALTERNATE][0] = i; -#else - info->modifierKeycodes[NX_MODIFIERKEY_ALTERNATE][0] = i; -#endif - info->modMap[MIN_KEYCODE + i] = Mod1Mask; - break; - - case XK_Mode_switch: - info->modMap[MIN_KEYCODE + i] = Mod1Mask; - break; - - case XK_Meta_L: - info->modifierKeycodes[NX_MODIFIERKEY_COMMAND][0] = i; - info->modMap[MIN_KEYCODE + i] = Mod2Mask; - break; - - case XK_Meta_R: -#ifdef NX_MODIFIERKEY_RCOMMAND - info->modifierKeycodes[NX_MODIFIERKEY_RCOMMAND][0] = i; -#else - info->modifierKeycodes[NX_MODIFIERKEY_COMMAND][0] = i; -#endif - info->modMap[MIN_KEYCODE + i] = Mod2Mask; - break; - - case XK_Num_Lock: - info->modMap[MIN_KEYCODE + i] = Mod3Mask; - break; - } - - if (darwinSwapAltMeta) - { - switch (k[0]) - { - case XK_Alt_L: - k[0] = XK_Meta_L; - break; - case XK_Alt_R: - k[0] = XK_Meta_R; - break; - case XK_Meta_L: - k[0] = XK_Alt_L; - break; - case XK_Meta_R: - k[0] = XK_Alt_R; - break; - } - } - -#if ALT_IS_MODE_SWITCH - if (k[0] == XK_Alt_L) - k[0] = XK_Mode_switch; -#endif - } -} - - -/* - * DarwinLoadKeyboardMapping - * Load the keyboard map from a file or system and convert - * it to an equivalent X keyboard map and modifier map. - */ -static void -DarwinLoadKeyboardMapping(KeySymsRec *keySyms) -{ - memset(keyInfo.keyMap, 0, sizeof(keyInfo.keyMap)); - - if (!DarwinParseNXKeyMapping(&keyInfo)) { - if (!DarwinModeReadSystemKeymap(&keyInfo)) { - FatalError("Could not build a valid keymap."); - } - } - - DarwinBuildModifierMaps(&keyInfo); - -#ifdef DUMP_DARWIN_KEYMAP - ErrorF("Darwin -> X converted keyboard map\n"); - for (i = 0, k = info->keyMap; i < NX_NUMKEYCODES; - i++, k += GLYPHS_PER_KEY) - { - int j; - ErrorF("0x%02x:", i); - for (j = 0; j < GLYPHS_PER_KEY; j++) { - if (k[j] == NoSymbol) { - ErrorF("\tNoSym"); - } else { - ErrorF("\t0x%x", k[j]); - } - } - ErrorF("\n"); - } -#endif - - keySyms->map = keyInfo.keyMap; - keySyms->mapWidth = GLYPHS_PER_KEY; - keySyms->minKeyCode = MIN_KEYCODE; - keySyms->maxKeyCode = MAX_KEYCODE; -} - - -/* - * DarwinKeyboardInit - * Get the Darwin keyboard map and compute an equivalent - * X keyboard map and modifier map. Set the new keyboard - * device structure. - */ -void DarwinKeyboardInit( - DeviceIntPtr pDev ) -{ - KeySymsRec keySyms; - - // Open a shared connection to the HID System. - // Note that the Event Status Driver is really just a wrapper - // for a kIOHIDParamConnectType connection. - assert( darwinParamConnect = NXOpenEventStatus() ); - - DarwinLoadKeyboardMapping(&keySyms); - - /* Initialize the seed, so we don't reload the keymap unnecessarily - (and possibly overwrite xinitrc changes) */ - DarwinModeSystemKeymapSeed(); - - assert( InitKeyboardDeviceStruct( (DevicePtr)pDev, &keySyms, - keyInfo.modMap, DarwinModeBell, - DarwinChangeKeyboardControl )); -} - - -/* Borrowed from dix/devices.c */ -static Bool -InitModMap(register KeyClassPtr keyc) -{ - int i, j; - CARD8 keysPerModifier[8]; - CARD8 mask; - - if (keyc->modifierKeyMap != NULL) - xfree (keyc->modifierKeyMap); - - keyc->maxKeysPerModifier = 0; - for (i = 0; i < 8; i++) - keysPerModifier[i] = 0; - for (i = 8; i < MAP_LENGTH; i++) - { - for (j = 0, mask = 1; j < 8; j++, mask <<= 1) - { - if (mask & keyc->modifierMap[i]) - { - if (++keysPerModifier[j] > keyc->maxKeysPerModifier) - keyc->maxKeysPerModifier = keysPerModifier[j]; - } - } - } - keyc->modifierKeyMap = (KeyCode *)xalloc(8*keyc->maxKeysPerModifier); - if (!keyc->modifierKeyMap && keyc->maxKeysPerModifier) - return (FALSE); - bzero((char *)keyc->modifierKeyMap, 8*(int)keyc->maxKeysPerModifier); - for (i = 0; i < 8; i++) - keysPerModifier[i] = 0; - for (i = 8; i < MAP_LENGTH; i++) - { - for (j = 0, mask = 1; j < 8; j++, mask <<= 1) - { - if (mask & keyc->modifierMap[i]) - { - keyc->modifierKeyMap[(j*keyc->maxKeysPerModifier) + - keysPerModifier[j]] = i; - keysPerModifier[j]++; - } - } - } - return TRUE; -} - - -void -DarwinKeyboardReload(DeviceIntPtr pDev) -{ - KeySymsRec keySyms; - - DarwinLoadKeyboardMapping(&keySyms); - - if (SetKeySymsMap(&pDev->key->curKeySyms, &keySyms)) { - /* now try to update modifiers. */ - - memmove(pDev->key->modifierMap, keyInfo.modMap, MAP_LENGTH); - InitModMap(pDev->key); - } - - SendMappingNotify(MappingKeyboard, MIN_KEYCODE, NUM_KEYCODES, 0); - SendMappingNotify(MappingModifier, 0, 0, 0); -} - - -//----------------------------------------------------------------------------- -// Modifier translation functions -// -// There are three different ways to specify a Mac modifier key: -// keycode - specifies hardware key, read from keymapping -// key - NX_MODIFIERKEY_*, really an index -// mask - NX_*MASK, mask for modifier flags in event record -// Left and right side have different keycodes but the same key and mask. -//----------------------------------------------------------------------------- - -/* - * DarwinModifierNXKeyToNXKeycode - * Return the keycode for an NX_MODIFIERKEY_* modifier. - * side = 0 for left or 1 for right. - * Returns 0 if key+side is not a known modifier. - */ -int DarwinModifierNXKeyToNXKeycode(int key, int side) -{ - return keyInfo.modifierKeycodes[key][side]; -} - -/* - * DarwinModifierNXKeycodeToNXKey - * Returns -1 if keycode+side is not a modifier key - * outSide may be NULL, else it gets 0 for left and 1 for right. - */ -int DarwinModifierNXKeycodeToNXKey(unsigned char keycode, int *outSide) -{ - int key, side; - - keycode += MIN_KEYCODE; - // search modifierKeycodes for this keycode+side - for (key = 0; key < NX_NUMMODIFIERS; key++) { - for (side = 0; side <= 1; side++) { - if (keyInfo.modifierKeycodes[key][side] == keycode) break; - } - } - if (key == NX_NUMMODIFIERS) return -1; - if (outSide) *outSide = side; - return key; -} - -/* - * DarwinModifierNXMaskToNXKey - * Returns -1 if mask is not a known modifier mask. - */ -int DarwinModifierNXMaskToNXKey(int mask) -{ - switch (mask) { - case NX_ALPHASHIFTMASK: return NX_MODIFIERKEY_ALPHALOCK; - case NX_SHIFTMASK: return NX_MODIFIERKEY_SHIFT; -#ifdef NX_DEVICELSHIFTKEYMASK - case NX_DEVICELSHIFTKEYMASK: return NX_MODIFIERKEY_SHIFT; - case NX_DEVICERSHIFTKEYMASK: return NX_MODIFIERKEY_RSHIFT; -#endif - case NX_CONTROLMASK: return NX_MODIFIERKEY_CONTROL; -#ifdef NX_DEVICELCTLKEYMASK - case NX_DEVICELCTLKEYMASK: return NX_MODIFIERKEY_CONTROL; - case NX_DEVICERCTLKEYMASK: return NX_MODIFIERKEY_RCONTROL; -#endif - case NX_ALTERNATEMASK: return NX_MODIFIERKEY_ALTERNATE; -#ifdef NX_DEVICELALTKEYMASK - case NX_DEVICELALTKEYMASK: return NX_MODIFIERKEY_ALTERNATE; - case NX_DEVICERALTKEYMASK: return NX_MODIFIERKEY_RALTERNATE; -#endif - case NX_COMMANDMASK: return NX_MODIFIERKEY_COMMAND; -#ifdef NX_DEVICELCMDKEYMASK - case NX_DEVICELCMDKEYMASK: return NX_MODIFIERKEY_COMMAND; - case NX_DEVICERCMDKEYMASK: return NX_MODIFIERKEY_RCOMMAND; -#endif - case NX_NUMERICPADMASK: return NX_MODIFIERKEY_NUMERICPAD; - case NX_HELPMASK: return NX_MODIFIERKEY_HELP; - case NX_SECONDARYFNMASK: return NX_MODIFIERKEY_SECONDARYFN; - } - return -1; -} - -/* - * DarwinModifierNXKeyToNXMask - * Returns 0 if key is not a known modifier key. - */ -int DarwinModifierNXKeyToNXMask(int key) -{ - switch (key) { - case NX_MODIFIERKEY_ALPHALOCK: return NX_ALPHASHIFTMASK; - case NX_MODIFIERKEY_SHIFT: return NX_SHIFTMASK; -#ifdef NX_MODIFIERKEY_RSHIFT - case NX_MODIFIERKEY_RSHIFT: return NX_SHIFTMASK; -#endif - case NX_MODIFIERKEY_CONTROL: return NX_CONTROLMASK; -#ifdef NX_MODIFIERKEY_RCONTROL - case NX_MODIFIERKEY_RCONTROL: return NX_CONTROLMASK; -#endif - case NX_MODIFIERKEY_ALTERNATE: return NX_ALTERNATEMASK; -#ifdef NX_MODIFIERKEY_RALTERNATE - case NX_MODIFIERKEY_RALTERNATE: return NX_ALTERNATEMASK; -#endif - case NX_MODIFIERKEY_COMMAND: return NX_COMMANDMASK; -#ifdef NX_MODIFIERKEY_RCOMMAND - case NX_MODIFIERKEY_RCOMMAND: return NX_COMMANDMASK; -#endif - case NX_MODIFIERKEY_NUMERICPAD: return NX_NUMERICPADMASK; - case NX_MODIFIERKEY_HELP: return NX_HELPMASK; - case NX_MODIFIERKEY_SECONDARYFN: return NX_SECONDARYFNMASK; - } - return 0; -} - -/* - * DarwinModifierStringToNXKey - * Returns -1 if string is not a known modifier. - */ -int DarwinModifierStringToNXKey(const char *str) -{ - if (!strcasecmp(str, "shift")) return NX_MODIFIERKEY_SHIFT; - else if (!strcasecmp(str, "control")) return NX_MODIFIERKEY_CONTROL; - else if (!strcasecmp(str, "option")) return NX_MODIFIERKEY_ALTERNATE; - else if (!strcasecmp(str, "command")) return NX_MODIFIERKEY_COMMAND; - else if (!strcasecmp(str, "fn")) return NX_MODIFIERKEY_SECONDARYFN; - else return -1; -} - -/* - * LegalModifier - * This allows the ddx layer to prevent some keys from being remapped - * as modifier keys. - */ -Bool LegalModifier(unsigned int key, DevicePtr pDev) -{ - return 1; -} diff --git a/nx-X11/programs/Xserver/hw/darwin/darwinKeyboard.h b/nx-X11/programs/Xserver/hw/darwin/darwinKeyboard.h deleted file mode 100644 index 0ea9c1d60..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/darwinKeyboard.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2003-2004 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/darwinKeyboard.c,v 1.18 2003/05/14 05:27:55 torrey Exp $ */ - -#ifndef DARWIN_KEYBOARD_H -#define DARWIN_KEYBOARD_H 1 - -#define XK_TECHNICAL // needed to get XK_Escape -#define XK_PUBLISHING -#include "keysym.h" -#include "inputstr.h" - -// Each key can generate 4 glyphs. They are, in order: -// unshifted, shifted, modeswitch unshifted, modeswitch shifted -#define GLYPHS_PER_KEY 4 -#define NUM_KEYCODES 248 // NX_NUMKEYCODES might be better -#define MAX_KEYCODE NUM_KEYCODES + MIN_KEYCODE - 1 - -typedef struct darwinKeyboardInfo_struct { - CARD8 modMap[MAP_LENGTH]; - KeySym keyMap[MAP_LENGTH * GLYPHS_PER_KEY]; - unsigned char modifierKeycodes[32][2]; -} darwinKeyboardInfo; - -void DarwinKeyboardReload(DeviceIntPtr pDev); -unsigned int DarwinModeSystemKeymapSeed(void); -Bool DarwinModeReadSystemKeymap(darwinKeyboardInfo *info); - -#endif /* DARWIN_KEYBOARD_H */ diff --git a/nx-X11/programs/Xserver/hw/darwin/darwinXinput.c b/nx-X11/programs/Xserver/hw/darwin/darwinXinput.c deleted file mode 100644 index d3716a1d4..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/darwinXinput.c +++ /dev/null @@ -1,310 +0,0 @@ -/* $Xorg: stubs.c,v 1.4 2001/02/09 02:04:35 xorgcvs Exp $ */ - -/* - * X server support of the XINPUT extension for Darwin - * - * This is currently a copy of mi/stubs.c, but eventually this - * should include more complete XINPUT support. - */ - -/************************************************************ - -Copyright 1989, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Hewlett-Packard not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -********************************************************/ -/* $XFree86: xc/programs/Xserver/hw/darwin/darwinXinput.c,v 1.1 2004/05/28 07:44:00 torrey Exp $ */ - -#define NEED_EVENTS -#include -#include -#include "inputstr.h" -#include -#include -#include "XIstubs.h" - -/*********************************************************************** - * - * Caller: ProcXChangeKeyboardDevice - * - * This procedure does the implementation-dependent portion of the work - * needed to change the keyboard device. - * - * The X keyboard device has a FocusRec. If the device that has been - * made into the new X keyboard did not have a FocusRec, - * ProcXChangeKeyboardDevice will allocate one for it. - * - * If you do not want clients to be able to focus the old X keyboard - * device, call DeleteFocusClassDeviceStruct to free the FocusRec. - * - * If you support input devices with keys that you do not want to be - * used as the X keyboard, you need to check for them here and return - * a BadDevice error. - * - * The default implementation is to do nothing (assume you do want - * clients to be able to focus the old X keyboard). The commented-out - * sample code shows what you might do if you don't want the default. - * - */ - -int -ChangeKeyboardDevice (old_dev, new_dev) - DeviceIntPtr old_dev; - DeviceIntPtr new_dev; - { - /*********************************************************************** - DeleteFocusClassDeviceStruct(old_dev); * defined in xchgptr.c * - **********************************************************************/ - return BadMatch; - } - - -/*********************************************************************** - * - * Caller: ProcXChangePointerDevice - * - * This procedure does the implementation-dependent portion of the work - * needed to change the pointer device. - * - * The X pointer device does not have a FocusRec. If the device that - * has been made into the new X pointer had a FocusRec, - * ProcXChangePointerDevice will free it. - * - * If you want clients to be able to focus the old pointer device that - * has now become accessible through the input extension, you need to - * add a FocusRec to it here. - * - * The XChangePointerDevice protocol request also allows the client - * to choose which axes of the new pointer device are used to move - * the X cursor in the X- and Y- directions. If the axes are different - * than the default ones, you need to keep track of that here. - * - * If you support input devices with valuators that you do not want to be - * used as the X pointer, you need to check for them here and return a - * BadDevice error. - * - * The default implementation is to do nothing (assume you don't want - * clients to be able to focus the old X pointer). The commented-out - * sample code shows what you might do if you don't want the default. - * - */ - -int -ChangePointerDevice ( - DeviceIntPtr old_dev, - DeviceIntPtr new_dev, - unsigned char x, - unsigned char y) - { - /*********************************************************************** - InitFocusClassDeviceStruct(old_dev); * allow focusing old ptr* - - x_axis = x; * keep track of new x-axis* - y_axis = y; * keep track of new y-axis* - if (x_axis != 0 || y_axis != 1) - axes_changed = TRUE; * remember axes have changed* - else - axes_changed = FALSE; - *************************************************************************/ - return BadMatch; - } - -/*********************************************************************** - * - * Caller: ProcXCloseDevice - * - * Take care of implementation-dependent details of closing a device. - * Some implementations may actually close the device, others may just - * remove this clients interest in that device. - * - * The default implementation is to do nothing (assume all input devices - * are initialized during X server initialization and kept open). - * - */ - -void -CloseInputDevice (d, client) - DeviceIntPtr d; - ClientPtr client; - { - } - -/*********************************************************************** - * - * Caller: ProcXListInputDevices - * - * This is the implementation-dependent routine to initialize an input - * device to the point that information about it can be listed. - * Some implementations open all input devices when the server is first - * initialized, and never close them. Other implementations open only - * the X pointer and keyboard devices during server initialization, - * and only open other input devices when some client makes an - * XOpenDevice request. If some other process has the device open, the - * server may not be able to get information about the device to list it. - * - * This procedure should be used by implementations that do not initialize - * all input devices at server startup. It should do device-dependent - * initialization for any devices not previously initialized, and call - * AddInputDevice for each of those devices so that a DeviceIntRec will be - * created for them. - * - * The default implementation is to do nothing (assume all input devices - * are initialized during X server initialization and kept open). - * The commented-out sample code shows what you might do if you don't want - * the default. - * - */ - -void -AddOtherInputDevices () - { - /********************************************************************** - for each uninitialized device, do something like: - - DeviceIntPtr dev; - DeviceProc deviceProc; - pointer private; - - dev = (DeviceIntPtr) AddInputDevice(deviceProc, TRUE); - dev->public.devicePrivate = private; - RegisterOtherDevice(dev); - dev->inited = ((*dev->deviceProc)(dev, DEVICE_INIT) == Success); - ************************************************************************/ - - } - -/*********************************************************************** - * - * Caller: ProcXOpenDevice - * - * This is the implementation-dependent routine to open an input device. - * Some implementations open all input devices when the server is first - * initialized, and never close them. Other implementations open only - * the X pointer and keyboard devices during server initialization, - * and only open other input devices when some client makes an - * XOpenDevice request. This entry point is for the latter type of - * implementation. - * - * If the physical device is not already open, do it here. In this case, - * you need to keep track of the fact that one or more clients has the - * device open, and physically close it when the last client that has - * it open does an XCloseDevice. - * - * The default implementation is to do nothing (assume all input devices - * are opened during X server initialization and kept open). - * - */ - -void -OpenInputDevice (dev, client, status) - DeviceIntPtr dev; - ClientPtr client; - int *status; - { - } - -/**************************************************************************** - * - * Caller: ProcXSetDeviceMode - * - * Change the mode of an extension device. - * This function is used to change the mode of a device from reporting - * relative motion to reporting absolute positional information, and - * vice versa. - * The default implementation below is that no such devices are supported. - * - */ - -int -SetDeviceMode (client, dev, mode) - register ClientPtr client; - DeviceIntPtr dev; - int mode; - { - return BadMatch; - } - -/**************************************************************************** - * - * Caller: ProcXSetDeviceValuators - * - * Set the value of valuators on an extension input device. - * This function is used to set the initial value of valuators on - * those input devices that are capable of reporting either relative - * motion or an absolute position, and allow an initial position to be set. - * The default implementation below is that no such devices are supported. - * - */ - -int -SetDeviceValuators (client, dev, valuators, first_valuator, num_valuators) - register ClientPtr client; - DeviceIntPtr dev; - int *valuators; - int first_valuator; - int num_valuators; - { - return BadMatch; - } - -/**************************************************************************** - * - * Caller: ProcXChangeDeviceControl - * - * Change the specified device controls on an extension input device. - * - */ - -int -ChangeDeviceControl (client, dev, control) - register ClientPtr client; - DeviceIntPtr dev; - xDeviceCtl *control; - { - switch (control->control) - { - case DEVICE_RESOLUTION: - return (BadMatch); - default: - return (BadMatch); - } - } diff --git a/nx-X11/programs/Xserver/hw/darwin/iokit/Imakefile b/nx-X11/programs/Xserver/hw/darwin/iokit/Imakefile deleted file mode 100644 index 061874e75..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/iokit/Imakefile +++ /dev/null @@ -1,25 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/darwin/Imakefile,v 1.18 2003/03/15 18:02:08 torrey Exp $ - -#include - -SRCS = xfIOKit.c \ - xfIOKitCursor.c \ - xfIOKitStartup.c - -OBJS = xfIOKit.o \ - xfIOKitCursor.o \ - xfIOKitStartup.o - -INCLUDES = -I. -I$(SERVERSRC)/mi -I$(SERVERSRC)/fb -I$(EXTINCSRC) \ - -I$(SERVERSRC)/render -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ - -I$(SERVERSRC)/os -I$(INCLUDESRC) -I$(FONTINCSRC) \ - -I$(SERVERSRC)/miext/shadow -I.. - -#if DarwinQuartzSupport -DEFINES = -DDARWIN_WITH_QUARTZ -#endif - -NormalLibraryObjectRule() -NormalLibraryTarget(iokit,$(OBJS)) - -DependTarget() diff --git a/nx-X11/programs/Xserver/hw/darwin/iokit/xfIOKit.c b/nx-X11/programs/Xserver/hw/darwin/iokit/xfIOKit.c deleted file mode 100644 index 2f0fc11a3..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/iokit/xfIOKit.c +++ /dev/null @@ -1,772 +0,0 @@ -/************************************************************** - * - * IOKit support for the Darwin X Server - * - * HISTORY: - * Original port to Mac OS X Server by John Carmack - * Port to Darwin 1.0 by Dave Zarzycki - * Significantly rewritten for XFree86 4.0.1 by Torrey Lyons - * - **************************************************************/ -/* - * Copyright (c) 2001-2004 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XdotOrg: xc/programs/Xserver/hw/darwin/iokit/xfIOKit.c,v 1.6 2005/07/03 08:53:39 daniels Exp $ */ -/* $XFree86: xc/programs/Xserver/hw/darwin/iokit/xfIOKit.c,v 1.2 2003/10/16 23:50:09 torrey Exp $ */ - -#include -#include -#include "os.h" -#include "servermd.h" -#include "inputstr.h" -#include "scrnintstr.h" -#include "mi.h" -#include "mibstore.h" -#include "mipointer.h" -#include "micmap.h" -#include "shadow.h" - -#include -#include -#include -#include -#include - -#include - -#define NO_CFPLUGIN -#include -#include -#include -#include - -// Define this to work around bugs in the display drivers for -// older PowerBook G3's. If the X server starts without this -// #define, you don't need it. -#undef OLD_POWERBOOK_G3 - -#include "darwin.h" -#include "xfIOKit.h" - -// Globals -int xfIOKitScreenIndex = 0; -io_connect_t xfIOKitInputConnect = 0; - -static pthread_t inputThread; -static EvGlobals * evg; -static mach_port_t masterPort; -static mach_port_t notificationPort; -static IONotificationPortRef NotificationPortRef; -static mach_port_t pmNotificationPort; -static io_iterator_t fbIter; - - -/* - * XFIOKitStoreColors - * This is a callback from X to change the hardware colormap - * when using PsuedoColor. - */ -static void XFIOKitStoreColors( - ColormapPtr pmap, - int numEntries, - xColorItem *pdefs) -{ - kern_return_t kr; - int i; - IOColorEntry *newColors; - ScreenPtr pScreen = pmap->pScreen; - XFIOKitScreenPtr iokitScreen = XFIOKIT_SCREEN_PRIV(pScreen); - - assert( newColors = (IOColorEntry *) - xalloc( numEntries*sizeof(IOColorEntry) )); - - // Convert xColorItem values to IOColorEntry - // assume the colormap is PsuedoColor - // as we do not support DirectColor - for (i = 0; i < numEntries; i++) { - newColors[i].index = pdefs[i].pixel; - newColors[i].red = pdefs[i].red; - newColors[i].green = pdefs[i].green; - newColors[i].blue = pdefs[i].blue; - } - - kr = IOFBSetCLUT( iokitScreen->fbService, 0, numEntries, - kSetCLUTByValue, newColors ); - kern_assert( kr ); - - xfree( newColors ); -} - - -/* - * DarwinModeBell - * FIXME - */ -void DarwinModeBell( - int loud, - DeviceIntPtr pDevice, - pointer ctrl, - int fbclass) -{ -} - - -/* - * DarwinModeGiveUp - * Closes the connections to IOKit services - */ -void DarwinModeGiveUp( void ) -{ - int i; - - // we must close the HID System first - // because it is a client of the framebuffer - NXCloseEventStatus( darwinParamConnect ); - IOServiceClose( xfIOKitInputConnect ); - for (i = 0; i < screenInfo.numScreens; i++) { - XFIOKitScreenPtr iokitScreen = - XFIOKIT_SCREEN_PRIV(screenInfo.screens[i]); - IOServiceClose( iokitScreen->fbService ); - } -} - - -/* - * ClearEvent - * Clear an event from the HID System event queue - */ -static void ClearEvent(NXEvent * ep) -{ - static NXEvent nullEvent = {NX_NULLEVENT, {0, 0 }, 0, -1, 0 }; - - *ep = nullEvent; - ep->data.compound.subType = ep->data.compound.misc.L[0] = - ep->data.compound.misc.L[1] = 0; -} - - -/* - * XFIOKitHIDThread - * Read the HID System event queue, translate it to an X event, - * and queue it for processing. - */ -static void *XFIOKitHIDThread(void *unused) -{ - for (;;) { - NXEQElement *oldHead; - mach_msg_return_t kr; - mach_msg_empty_rcv_t msg; - - kr = mach_msg((mach_msg_header_t*) &msg, MACH_RCV_MSG, 0, - sizeof(msg), notificationPort, 0, MACH_PORT_NULL); - kern_assert(kr); - - while (evg->LLEHead != evg->LLETail) { - NXEvent ev; - xEvent xe; - - // Extract the next event from the kernel queue - oldHead = (NXEQElement*)&evg->lleq[evg->LLEHead]; - ev_lock(&oldHead->sema); - ev = oldHead->event; - ClearEvent(&oldHead->event); - evg->LLEHead = oldHead->next; - ev_unlock(&oldHead->sema); - - memset(&xe, 0, sizeof(xe)); - - // These fields should be filled in for every event - xe.u.keyButtonPointer.rootX = ev.location.x; - xe.u.keyButtonPointer.rootY = ev.location.y; - xe.u.keyButtonPointer.time = GetTimeInMillis(); - - switch( ev.type ) { - case NX_MOUSEMOVED: - xe.u.u.type = MotionNotify; - break; - - case NX_LMOUSEDOWN: - xe.u.u.type = ButtonPress; - xe.u.u.detail = 1; - break; - - case NX_LMOUSEUP: - xe.u.u.type = ButtonRelease; - xe.u.u.detail = 1; - break; - - // A newer kernel generates multi-button events with - // NX_SYSDEFINED. Button 2 isn't handled correctly by - // older kernels anyway. Just let NX_SYSDEFINED events - // handle these. -#if 0 - case NX_RMOUSEDOWN: - xe.u.u.type = ButtonPress; - xe.u.u.detail = 2; - break; - - case NX_RMOUSEUP: - xe.u.u.type = ButtonRelease; - xe.u.u.detail = 2; - break; -#endif - - case NX_KEYDOWN: - xe.u.u.type = KeyPress; - xe.u.u.detail = ev.data.key.keyCode; - break; - - case NX_KEYUP: - xe.u.u.type = KeyRelease; - xe.u.u.detail = ev.data.key.keyCode; - break; - - case NX_FLAGSCHANGED: - xe.u.u.type = kXDarwinUpdateModifiers; - xe.u.clientMessage.u.l.longs0 = ev.flags; - break; - - case NX_SYSDEFINED: - if (ev.data.compound.subType == 7) { - xe.u.u.type = kXDarwinUpdateButtons; - xe.u.clientMessage.u.l.longs0 = - ev.data.compound.misc.L[0]; - xe.u.clientMessage.u.l.longs1 = - ev.data.compound.misc.L[1]; - } else { - continue; - } - break; - - case NX_SCROLLWHEELMOVED: - xe.u.u.type = kXDarwinScrollWheel; - xe.u.clientMessage.u.s.shorts0 = - ev.data.scrollWheel.deltaAxis1; - break; - - default: - continue; - } - - DarwinEQEnqueue(&xe); - } - } - - return NULL; -} - - -/* - * XFIOKitPMThread - * Handle power state notifications - */ -static void *XFIOKitPMThread(void *arg) -{ - ScreenPtr pScreen = (ScreenPtr)arg; - XFIOKitScreenPtr iokitScreen = XFIOKIT_SCREEN_PRIV(pScreen); - - for (;;) { - mach_msg_return_t kr; - mach_msg_empty_rcv_t msg; - - kr = mach_msg((mach_msg_header_t*) &msg, MACH_RCV_MSG, 0, - sizeof(msg), pmNotificationPort, 0, MACH_PORT_NULL); - kern_assert(kr); - - // display is powering down - if (msg.header.msgh_id == 0) { - IOFBAcknowledgePM( iokitScreen->fbService ); - xf86SetRootClip(pScreen, FALSE); - } - // display just woke up - else if (msg.header.msgh_id == 1) { - xf86SetRootClip(pScreen, TRUE); - } - } - return NULL; -} - - -/* - * SetupFBandHID - * Setup an IOFramebuffer service and connect the HID system to it. - */ -static Bool SetupFBandHID( - int index, - DarwinFramebufferPtr dfb, - XFIOKitScreenPtr iokitScreen) -{ - kern_return_t kr; - io_service_t service; - io_connect_t fbService; - vm_address_t vram; - vm_size_t shmemSize; - int i; - UInt32 numModes; - IODisplayModeInformation modeInfo; - IODisplayModeID displayMode, *allModes; - IOIndex displayDepth; - IOFramebufferInformation fbInfo; - IOPixelInformation pixelInfo; - StdFBShmem_t *cshmem; - - // find and open the IOFrameBuffer service - service = IOIteratorNext(fbIter); - if (service == 0) - return FALSE; - - kr = IOServiceOpen( service, mach_task_self(), - kIOFBServerConnectType, &iokitScreen->fbService ); - IOObjectRelease( service ); - if (kr != KERN_SUCCESS) { - ErrorF("Failed to connect as window server to screen %i.\n", index); - return FALSE; - } - fbService = iokitScreen->fbService; - - // create the slice of shared memory containing cursor state data - kr = IOFBCreateSharedCursor( fbService, - kIOFBCurrentShmemVersion, - 32, 32 ); - if (kr != KERN_SUCCESS) - return FALSE; - - // Register for power management events for the framebuffer's device - kr = IOCreateReceivePort(kOSNotificationMessageID, &pmNotificationPort); - kern_assert(kr); - kr = IOConnectSetNotificationPort( fbService, 0, - pmNotificationPort, 0 ); - if (kr != KERN_SUCCESS) { - ErrorF("Power management registration failed.\n"); - } - - // SET THE SCREEN PARAMETERS - // get the current screen resolution, refresh rate and depth - kr = IOFBGetCurrentDisplayModeAndDepth( fbService, - &displayMode, - &displayDepth ); - if (kr != KERN_SUCCESS) - return FALSE; - - // use the current screen resolution if the user - // only wants to change the refresh rate - if (darwinDesiredRefresh != -1 && darwinDesiredWidth == 0) { - kr = IOFBGetDisplayModeInformation( fbService, - displayMode, - &modeInfo ); - if (kr != KERN_SUCCESS) - return FALSE; - darwinDesiredWidth = modeInfo.nominalWidth; - darwinDesiredHeight = modeInfo.nominalHeight; - } - - // use the current resolution and refresh rate - // if the user doesn't have a preference - if (darwinDesiredWidth == 0) { - - // change the pixel depth if desired - if (darwinDesiredDepth != -1) { - kr = IOFBGetDisplayModeInformation( fbService, - displayMode, - &modeInfo ); - if (kr != KERN_SUCCESS) - return FALSE; - if (modeInfo.maxDepthIndex < darwinDesiredDepth) { - ErrorF("Discarding screen %i:\n", index); - ErrorF("Current screen resolution does not support desired pixel depth.\n"); - return FALSE; - } - - displayDepth = darwinDesiredDepth; - kr = IOFBSetDisplayModeAndDepth( fbService, displayMode, - displayDepth ); - if (kr != KERN_SUCCESS) - return FALSE; - } - - // look for display mode with correct resolution and refresh rate - } else { - - // get an array of all supported display modes - kr = IOFBGetDisplayModeCount( fbService, &numModes ); - if (kr != KERN_SUCCESS) - return FALSE; - assert(allModes = (IODisplayModeID *) - xalloc( numModes * sizeof(IODisplayModeID) )); - kr = IOFBGetDisplayModes( fbService, numModes, allModes ); - if (kr != KERN_SUCCESS) - return FALSE; - - for (i = 0; i < numModes; i++) { - kr = IOFBGetDisplayModeInformation( fbService, allModes[i], - &modeInfo ); - if (kr != KERN_SUCCESS) - return FALSE; - - if (modeInfo.flags & kDisplayModeValidFlag && - modeInfo.nominalWidth == darwinDesiredWidth && - modeInfo.nominalHeight == darwinDesiredHeight) { - - if (darwinDesiredDepth == -1) - darwinDesiredDepth = modeInfo.maxDepthIndex; - if (modeInfo.maxDepthIndex < darwinDesiredDepth) { - ErrorF("Discarding screen %i:\n", index); - ErrorF("Desired screen resolution does not support desired pixel depth.\n"); - return FALSE; - } - - if ((darwinDesiredRefresh == -1 || - (darwinDesiredRefresh << 16) == modeInfo.refreshRate)) { - displayMode = allModes[i]; - displayDepth = darwinDesiredDepth; - kr = IOFBSetDisplayModeAndDepth(fbService, - displayMode, - displayDepth); - if (kr != KERN_SUCCESS) - return FALSE; - break; - } - } - } - - xfree( allModes ); - if (i >= numModes) { - ErrorF("Discarding screen %i:\n", index); - ErrorF("Desired screen resolution or refresh rate is not supported.\n"); - return FALSE; - } - } - - kr = IOFBGetPixelInformation( fbService, displayMode, displayDepth, - kIOFBSystemAperture, &pixelInfo ); - if (kr != KERN_SUCCESS) - return FALSE; - -#ifdef __i386__ - /* x86 in 8bit mode currently needs fixed color map... */ - if (pixelInfo.bitsPerComponent == 8 && - pixelInfo.componentCount == 1) - { - pixelInfo.pixelType = kIOFixedCLUTPixels; - } -#endif - -#ifdef OLD_POWERBOOK_G3 - if (pixelInfo.pixelType == kIOCLUTPixels) - pixelInfo.pixelType = kIOFixedCLUTPixels; -#endif - - kr = IOFBGetFramebufferInformationForAperture( fbService, - kIOFBSystemAperture, - &fbInfo ); - if (kr != KERN_SUCCESS) - return FALSE; - - // FIXME: 1x1 IOFramebuffers are sometimes used to indicate video - // outputs without a monitor connected to them. Since IOKit Xinerama - // does not really work, this often causes problems on PowerBooks. - // For now we explicitly check and ignore these screens. - if (fbInfo.activeWidth <= 1 || fbInfo.activeHeight <= 1) { - ErrorF("Discarding screen %i:\n", index); - ErrorF("Invalid width or height.\n"); - return FALSE; - } - - kr = IOConnectMapMemory( fbService, kIOFBCursorMemory, - mach_task_self(), (vm_address_t *) &cshmem, - &shmemSize, kIOMapAnywhere ); - if (kr != KERN_SUCCESS) - return FALSE; - iokitScreen->cursorShmem = cshmem; - - kr = IOConnectMapMemory( fbService, kIOFBSystemAperture, - mach_task_self(), &vram, &shmemSize, - kIOMapAnywhere ); - if (kr != KERN_SUCCESS) - return FALSE; - - iokitScreen->framebuffer = (void*)vram; - dfb->x = cshmem->screenBounds.minx; - dfb->y = cshmem->screenBounds.miny; - dfb->width = fbInfo.activeWidth; - dfb->height = fbInfo.activeHeight; - dfb->pitch = fbInfo.bytesPerRow; - dfb->bitsPerPixel = fbInfo.bitsPerPixel; - dfb->colorBitsPerPixel = pixelInfo.componentCount * - pixelInfo.bitsPerComponent; - dfb->bitsPerComponent = pixelInfo.bitsPerComponent; - - // allocate shadow framebuffer - iokitScreen->shadowPtr = xalloc(dfb->pitch * dfb->height); - dfb->framebuffer = iokitScreen->shadowPtr; - - // Note: Darwin kIORGBDirectPixels = X TrueColor, not DirectColor - if (pixelInfo.pixelType == kIORGBDirectPixels) { - dfb->colorType = TrueColor; - } else if (pixelInfo.pixelType == kIOCLUTPixels) { - dfb->colorType = PseudoColor; - } else if (pixelInfo.pixelType == kIOFixedCLUTPixels) { - dfb->colorType = StaticColor; - } - - // Inform the HID system that the framebuffer is also connected to it. - kr = IOConnectAddClient( xfIOKitInputConnect, fbService ); - kern_assert( kr ); - - // We have to have added at least one screen - // before we can enable the cursor. - kr = IOHIDSetCursorEnable(xfIOKitInputConnect, TRUE); - kern_assert( kr ); - - return TRUE; -} - - -/* - * DarwinModeAddScreen - * IOKit specific initialization for each screen. - */ -Bool DarwinModeAddScreen( - int index, - ScreenPtr pScreen) -{ - DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen); - XFIOKitScreenPtr iokitScreen; - - // allocate space for private per screen storage - iokitScreen = xalloc(sizeof(XFIOKitScreenRec)); - XFIOKIT_SCREEN_PRIV(pScreen) = iokitScreen; - - // setup hardware framebuffer - iokitScreen->fbService = 0; - if (! SetupFBandHID(index, dfb, iokitScreen)) { - if (iokitScreen->fbService) { - IOServiceClose(iokitScreen->fbService); - } - return FALSE; - } - - return TRUE; -} - - -/* - * XFIOKitShadowUpdate - * Update the damaged regions of the shadow framebuffer on the screen. - */ -static void XFIOKitShadowUpdate(ScreenPtr pScreen, - shadowBufPtr pBuf) -{ - DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen); - XFIOKitScreenPtr iokitScreen = XFIOKIT_SCREEN_PRIV(pScreen); - RegionPtr damage = &pBuf->damage; - int numBox = REGION_NUM_RECTS(damage); - BoxPtr pBox = REGION_RECTS(damage); - int pitch = dfb->pitch; - int bpp = dfb->bitsPerPixel/8; - - // Loop through all the damaged boxes - while (numBox--) { - int width, height, offset; - unsigned char *src, *dst; - - width = (pBox->x2 - pBox->x1) * bpp; - height = pBox->y2 - pBox->y1; - offset = (pBox->y1 * pitch) + (pBox->x1 * bpp); - src = iokitScreen->shadowPtr + offset; - dst = iokitScreen->framebuffer + offset; - - while (height--) { - memcpy(dst, src, width); - dst += pitch; - src += pitch; - } - - // Get the next box - pBox++; - } -} - - -/* - * DarwinModeSetupScreen - * Finalize IOKit specific initialization of each screen. - */ -Bool DarwinModeSetupScreen( - int index, - ScreenPtr pScreen) -{ - DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen); - pthread_t pmThread; - - // initalize cursor support - if (! XFIOKitInitCursor(pScreen)) { - return FALSE; - } - - // initialize shadow framebuffer support - if (! shadowInit(pScreen, XFIOKitShadowUpdate, NULL)) { - ErrorF("Failed to initalize shadow framebuffer for screen %i.\n", - index); - return FALSE; - } - - // initialize colormap handling as needed - if (dfb->colorType == PseudoColor) { - pScreen->StoreColors = XFIOKitStoreColors; - } - - // initialize power manager handling - pthread_create( &pmThread, NULL, XFIOKitPMThread, - (void *) pScreen ); - - return TRUE; -} - - -/* - * DarwinModeInitOutput - * One-time initialization of IOKit output support. - */ -void DarwinModeInitOutput( - int argc, - char **argv) -{ - static unsigned long generation = 0; - kern_return_t kr; - io_iterator_t iter; - io_service_t service; - vm_address_t shmem; - vm_size_t shmemSize; - - ErrorF("Display mode: IOKit\n"); - - // Allocate private storage for each screen's IOKit specific info - if (generation != serverGeneration) { - xfIOKitScreenIndex = AllocateScreenPrivateIndex(); - generation = serverGeneration; - } - - kr = IOMasterPort(bootstrap_port, &masterPort); - kern_assert( kr ); - - // Find and open the HID System Service - // Do this now to be sure the Mac OS X window server is not running. - kr = IOServiceGetMatchingServices( masterPort, - IOServiceMatching( kIOHIDSystemClass ), - &iter ); - kern_assert( kr ); - - assert( service = IOIteratorNext( iter ) ); - - kr = IOServiceOpen( service, mach_task_self(), kIOHIDServerConnectType, - &xfIOKitInputConnect ); - if (kr != KERN_SUCCESS) { - ErrorF("Failed to connect to the HID System as the window server!\n"); -#ifdef DARWIN_WITH_QUARTZ - FatalError("Quit the Mac OS X window server or use the -quartz option.\n"); -#else - FatalError("Make sure you have quit the Mac OS X window server.\n"); -#endif - } - - IOObjectRelease( service ); - IOObjectRelease( iter ); - - // Setup the event queue in memory shared by the kernel and X server - kr = IOHIDCreateSharedMemory( xfIOKitInputConnect, - kIOHIDCurrentShmemVersion ); - kern_assert( kr ); - - kr = IOConnectMapMemory( xfIOKitInputConnect, kIOHIDGlobalMemory, - mach_task_self(), &shmem, &shmemSize, - kIOMapAnywhere ); - kern_assert( kr ); - - evg = (EvGlobals *)(shmem + ((EvOffsets *)shmem)->evGlobalsOffset); - - assert(sizeof(EvGlobals) == evg->structSize); - - NotificationPortRef = IONotificationPortCreate( masterPort ); - - notificationPort = IONotificationPortGetMachPort(NotificationPortRef); - - kr = IOConnectSetNotificationPort( xfIOKitInputConnect, - kIOHIDEventNotification, - notificationPort, 0 ); - kern_assert( kr ); - - evg->movedMask |= NX_MOUSEMOVEDMASK; - - // find number of framebuffers - kr = IOServiceGetMatchingServices( masterPort, - IOServiceMatching( IOFRAMEBUFFER_CONFORMSTO ), - &fbIter ); - kern_assert( kr ); - - darwinScreensFound = 0; - while ((service = IOIteratorNext(fbIter))) { - IOObjectRelease( service ); - darwinScreensFound++; - } - IOIteratorReset(fbIter); -} - - -/* - * DarwinModeInitInput - * One-time initialization of IOKit input support. - */ -void DarwinModeInitInput( - int argc, - char **argv) -{ - kern_return_t kr; - int fd[2]; - - kr = IOHIDSetEventsEnable(xfIOKitInputConnect, TRUE); - kern_assert( kr ); - - // Start event passing thread - assert( pipe(fd) == 0 ); - darwinEventReadFD = fd[0]; - darwinEventWriteFD = fd[1]; - fcntl(darwinEventReadFD, F_SETFL, O_NONBLOCK); - pthread_create(&inputThread, NULL, - XFIOKitHIDThread, NULL); - -} - - -/* - * DarwinModeProcessEvent - * Process IOKit specific events. - */ -void DarwinModeProcessEvent( - xEvent *xe) -{ - // No mode specific events - ErrorF("Unknown X event caught: %d\n", xe->u.u.type); -} diff --git a/nx-X11/programs/Xserver/hw/darwin/iokit/xfIOKit.h b/nx-X11/programs/Xserver/hw/darwin/iokit/xfIOKit.h deleted file mode 100644 index 288063da1..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/iokit/xfIOKit.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - xfIOKit.h - - IOKit specific functions and definitions -*/ -/* - * Copyright (c) 2001-2002 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/xfIOKit.h,v 1.10 2003/03/15 18:02:08 torrey Exp $ */ - -#ifndef _XFIOKIT_H -#define _XFIOKIT_H - -#include -#include -#include -#include "screenint.h" -#include "darwin.h" - -typedef struct { - io_connect_t fbService; - StdFBShmem_t *cursorShmem; - unsigned char *framebuffer; - unsigned char *shadowPtr; -} XFIOKitScreenRec, *XFIOKitScreenPtr; - -#define XFIOKIT_SCREEN_PRIV(pScreen) \ - ((XFIOKitScreenPtr)pScreen->devPrivates[xfIOKitScreenIndex].ptr) - -extern int xfIOKitScreenIndex; // index into pScreen.devPrivates -extern io_connect_t xfIOKitInputConnect; - -Bool XFIOKitInitCursor(ScreenPtr pScreen); - -#endif /* _XFIOKIT_H */ diff --git a/nx-X11/programs/Xserver/hw/darwin/iokit/xfIOKitCursor.c b/nx-X11/programs/Xserver/hw/darwin/iokit/xfIOKitCursor.c deleted file mode 100644 index 69eb41d2f..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/iokit/xfIOKitCursor.c +++ /dev/null @@ -1,735 +0,0 @@ -/************************************************************** - * - * Cursor support for Darwin X Server - * - * Three different cursor modes are possible: - * X (0) - tracking via Darwin kernel, - * display via X machine independent - * Kernel (1) - tracking and display via Darwin kernel - * (not currently supported) - * Hardware (2) - tracking and display via hardware - * - * The X software cursor uses the Darwin software cursor - * routines in IOFramebuffer.cpp to track the cursor, but - * displays the cursor image using the X machine - * independent display cursor routines in midispcur.c. - * - * The kernel cursor uses IOFramebuffer.cpp routines to - * track and display the cursor. This gives better - * performance as the display calls don't have to cross - * the kernel boundary. Unfortunately, this mode has - * synchronization issues with the user land X server - * and isn't currently used. - * - * Hardware cursor support lets the hardware handle these - * details. - * - * Kernel and hardware cursor mode only work for cursors - * up to a certain size, currently 16x16 pixels. If a - * bigger cursor is set, we fallback to X cursor mode. - * - * HISTORY: - * 1.0 by Torrey T. Lyons, October 30, 2000 - * - **************************************************************/ -/* - * Copyright (c) 2001-2002 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/xfIOKitCursor.c,v 1.6 2002/12/10 00:00:39 torrey Exp $ */ - -#include "scrnintstr.h" -#include "cursorstr.h" -#include "mipointrst.h" -#include "micmap.h" -#define NO_CFPLUGIN -#include -#include -#include "darwin.h" -#include "xfIOKit.h" - -#define DUMP_DARWIN_CURSOR FALSE - -#define CURSOR_PRIV(pScreen) \ - ((XFIOKitCursorScreenPtr)pScreen->devPrivates[darwinCursorScreenIndex].ptr) - -// The cursors format are documented in IOFramebufferShared.h. -#define RGBto34WithGamma(red, green, blue) \ - ( 0x000F \ - | (((red) & 0xF) << 12) \ - | (((green) & 0xF) << 8) \ - | (((blue) & 0xF) << 4) ) -#define RGBto38WithGamma(red, green, blue) \ - ( 0xFF << 24 \ - | (((red) & 0xFF) << 16) \ - | (((green) & 0xFF) << 8) \ - | (((blue) & 0xFF)) ) -#define HighBitOf32 0x80000000 - -typedef struct { - Bool canHWCursor; - short cursorMode; - RecolorCursorProcPtr RecolorCursor; - InstallColormapProcPtr InstallColormap; - QueryBestSizeProcPtr QueryBestSize; - miPointerSpriteFuncPtr spriteFuncs; - ColormapPtr pInstalledMap; -} XFIOKitCursorScreenRec, *XFIOKitCursorScreenPtr; - -static int darwinCursorScreenIndex = -1; -static unsigned long darwinCursorGeneration = 0; - -/* -=========================================================================== - - Pointer sprite functions - -=========================================================================== -*/ - -/* - Realizing the Darwin hardware cursor (ie. converting from the - X representation to the IOKit representation) is complicated - by the fact that we have three different potential cursor - formats to go to, one for each bit depth (8, 15, or 24). - The IOKit formats are documented in IOFramebufferShared.h. - X cursors are represented as two pieces, a source and a mask. - The mask is a bitmap indicating which parts of the cursor are - transparent and which parts are drawn. The source is a bitmap - indicating which parts of the non-transparent portion of the the - cursor should be painted in the foreground color and which should - be painted in the background color. The bitmaps are given in - 32-bit format with least significant byte and bit first. - (This is opposite PowerPC Darwin.) -*/ - -typedef struct { - unsigned char image[CURSORWIDTH*CURSORHEIGHT]; - unsigned char mask[CURSORWIDTH*CURSORHEIGHT]; -} cursorPrivRec, *cursorPrivPtr; - -/* - * XFIOKitRealizeCursor8 - * Convert the X cursor representation to an 8-bit depth - * format for Darwin. This function assumes the maximum cursor - * width is a multiple of 8. - */ -static Bool -XFIOKitRealizeCursor8( - ScreenPtr pScreen, - CursorPtr pCursor) -{ - cursorPrivPtr newCursor; - unsigned char *newSourceP, *newMaskP; - CARD32 *oldSourceP, *oldMaskP; - xColorItem fgColor, bgColor; - int index, x, y, rowPad; - int cursorWidth, cursorHeight; - ColormapPtr pmap; - - // check cursor size just to be sure - cursorWidth = pCursor->bits->width; - cursorHeight = pCursor->bits->height; - if (cursorHeight > CURSORHEIGHT || cursorWidth > CURSORWIDTH) - return FALSE; - - // get cursor colors in colormap - index = pScreen->myNum; - pmap = miInstalledMaps[index]; - if (!pmap) return FALSE; - - fgColor.red = pCursor->foreRed; - fgColor.green = pCursor->foreGreen; - fgColor.blue = pCursor->foreBlue; - FakeAllocColor(pmap, &fgColor); - bgColor.red = pCursor->backRed; - bgColor.green = pCursor->backGreen; - bgColor.blue = pCursor->backBlue; - FakeAllocColor(pmap, &bgColor); - FakeFreeColor(pmap, fgColor.pixel); - FakeFreeColor(pmap, bgColor.pixel); - - // allocate memory for new cursor image - newCursor = xalloc( sizeof(cursorPrivRec) ); - if (!newCursor) - return FALSE; - memset( newCursor->image, pScreen->blackPixel, CURSORWIDTH*CURSORHEIGHT ); - memset( newCursor->mask, 0, CURSORWIDTH*CURSORHEIGHT ); - - // convert to 8-bit Darwin cursor format - oldSourceP = (CARD32 *) pCursor->bits->source; - oldMaskP = (CARD32 *) pCursor->bits->mask; - newSourceP = newCursor->image; - newMaskP = newCursor->mask; - rowPad = CURSORWIDTH - cursorWidth; - - for (y = 0; y < cursorHeight; y++) { - for (x = 0; x < cursorWidth; x++) { - if (*oldSourceP & (HighBitOf32 >> x)) - *newSourceP = fgColor.pixel; - else - *newSourceP = bgColor.pixel; - if (*oldMaskP & (HighBitOf32 >> x)) - *newMaskP = 255; - else - *newSourceP = pScreen->blackPixel; - newSourceP++; newMaskP++; - } - oldSourceP++; oldMaskP++; - newSourceP += rowPad; newMaskP += rowPad; - } - - // save the result - pCursor->devPriv[pScreen->myNum] = (pointer) newCursor; - return TRUE; -} - - -/* - * XFIOKitRealizeCursor15 - * Convert the X cursor representation to an 15-bit depth - * format for Darwin. - */ -static Bool -XFIOKitRealizeCursor15( - ScreenPtr pScreen, - CursorPtr pCursor) -{ - unsigned short *newCursor; - unsigned short fgPixel, bgPixel; - unsigned short *newSourceP; - CARD32 *oldSourceP, *oldMaskP; - int x, y, rowPad; - int cursorWidth, cursorHeight; - - // check cursor size just to be sure - cursorWidth = pCursor->bits->width; - cursorHeight = pCursor->bits->height; - if (cursorHeight > CURSORHEIGHT || cursorWidth > CURSORWIDTH) - return FALSE; - - // allocate memory for new cursor image - newCursor = xalloc( CURSORWIDTH*CURSORHEIGHT*sizeof(short) ); - if (!newCursor) - return FALSE; - memset( newCursor, 0, CURSORWIDTH*CURSORHEIGHT*sizeof(short) ); - - // calculate pixel values - fgPixel = RGBto34WithGamma( pCursor->foreRed, pCursor->foreGreen, - pCursor->foreBlue ); - bgPixel = RGBto34WithGamma( pCursor->backRed, pCursor->backGreen, - pCursor->backBlue ); - - // convert to 15-bit Darwin cursor format - oldSourceP = (CARD32 *) pCursor->bits->source; - oldMaskP = (CARD32 *) pCursor->bits->mask; - newSourceP = newCursor; - rowPad = CURSORWIDTH - cursorWidth; - - for (y = 0; y < cursorHeight; y++) { - for (x = 0; x < cursorWidth; x++) { - if (*oldMaskP & (HighBitOf32 >> x)) { - if (*oldSourceP & (HighBitOf32 >> x)) - *newSourceP = fgPixel; - else - *newSourceP = bgPixel; - } else { - *newSourceP = 0; - } - newSourceP++; - } - oldSourceP++; oldMaskP++; - newSourceP += rowPad; - } - -#if DUMP_DARWIN_CURSOR - // Write out the cursor - ErrorF("Cursor: 0x%x\n", pCursor); - ErrorF("Width = %i, Height = %i, RowPad = %i\n", cursorWidth, - cursorHeight, rowPad); - for (y = 0; y < cursorHeight; y++) { - newSourceP = newCursor + y*CURSORWIDTH; - for (x = 0; x < cursorWidth; x++) { - if (*newSourceP == fgPixel) - ErrorF("x"); - else if (*newSourceP == bgPixel) - ErrorF("o"); - else - ErrorF(" "); - newSourceP++; - } - ErrorF("\n"); - } -#endif - - // save the result - pCursor->devPriv[pScreen->myNum] = (pointer) newCursor; - return TRUE; -} - - -/* - * XFIOKitRealizeCursor24 - * Convert the X cursor representation to an 24-bit depth - * format for Darwin. This function assumes the maximum cursor - * width is a multiple of 8. - */ -static Bool -XFIOKitRealizeCursor24( - ScreenPtr pScreen, - CursorPtr pCursor) -{ - unsigned int *newCursor; - unsigned int fgPixel, bgPixel; - unsigned int *newSourceP; - CARD32 *oldSourceP, *oldMaskP; - int x, y, rowPad; - int cursorWidth, cursorHeight; - - // check cursor size just to be sure - cursorWidth = pCursor->bits->width; - cursorHeight = pCursor->bits->height; - if (cursorHeight > CURSORHEIGHT || cursorWidth > CURSORWIDTH) - return FALSE; - - // allocate memory for new cursor image - newCursor = xalloc( CURSORWIDTH*CURSORHEIGHT*sizeof(int) ); - if (!newCursor) - return FALSE; - memset( newCursor, 0, CURSORWIDTH*CURSORHEIGHT*sizeof(int) ); - - // calculate pixel values - fgPixel = RGBto38WithGamma( pCursor->foreRed, pCursor->foreGreen, - pCursor->foreBlue ); - bgPixel = RGBto38WithGamma( pCursor->backRed, pCursor->backGreen, - pCursor->backBlue ); - - // convert to 24-bit Darwin cursor format - oldSourceP = (CARD32 *) pCursor->bits->source; - oldMaskP = (CARD32 *) pCursor->bits->mask; - newSourceP = newCursor; - rowPad = CURSORWIDTH - cursorWidth; - - for (y = 0; y < cursorHeight; y++) { - for (x = 0; x < cursorWidth; x++) { - if (*oldMaskP & (HighBitOf32 >> x)) { - if (*oldSourceP & (HighBitOf32 >> x)) - *newSourceP = fgPixel; - else - *newSourceP = bgPixel; - } else { - *newSourceP = 0; - } - newSourceP++; - } - oldSourceP++; oldMaskP++; - newSourceP += rowPad; - } - -#if DUMP_DARWIN_CURSOR - // Write out the cursor - ErrorF("Cursor: 0x%x\n", pCursor); - ErrorF("Width = %i, Height = %i, RowPad = %i\n", cursorWidth, - cursorHeight, rowPad); - for (y = 0; y < cursorHeight; y++) { - newSourceP = newCursor + y*CURSORWIDTH; - for (x = 0; x < cursorWidth; x++) { - if (*newSourceP == fgPixel) - ErrorF("x"); - else if (*newSourceP == bgPixel) - ErrorF("o"); - else - ErrorF(" "); - newSourceP++; - } - ErrorF("\n"); - } -#endif - - // save the result - pCursor->devPriv[pScreen->myNum] = (pointer) newCursor; - return TRUE; -} - - -/* - * XFIOKitRealizeCursor - * - */ -static Bool -XFIOKitRealizeCursor( - ScreenPtr pScreen, - CursorPtr pCursor) -{ - Bool result; - XFIOKitCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); - DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen); - - if ((pCursor->bits->height > CURSORHEIGHT) || - (pCursor->bits->width > CURSORWIDTH) || - // FIXME: this condition is not needed after kernel cursor works - !ScreenPriv->canHWCursor) { - result = (*ScreenPriv->spriteFuncs->RealizeCursor)(pScreen, pCursor); - } else if (dfb->bitsPerPixel == 8) { - result = XFIOKitRealizeCursor8(pScreen, pCursor); - } else if (dfb->bitsPerPixel == 16) { - result = XFIOKitRealizeCursor15(pScreen, pCursor); - } else { - result = XFIOKitRealizeCursor24(pScreen, pCursor); - } - - return result; -} - - -/* - * XFIOKitUnrealizeCursor - * - */ -static Bool -XFIOKitUnrealizeCursor( - ScreenPtr pScreen, - CursorPtr pCursor) -{ - Bool result; - XFIOKitCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); - - if ((pCursor->bits->height > CURSORHEIGHT) || - (pCursor->bits->width > CURSORWIDTH) || - // FIXME: this condition is not needed after kernel cursor works - !ScreenPriv->canHWCursor) { - result = (*ScreenPriv->spriteFuncs->UnrealizeCursor)(pScreen, pCursor); - } else { - xfree( pCursor->devPriv[pScreen->myNum] ); - result = TRUE; - } - - return result; -} - - -/* - * XFIOKitSetCursor - * Set the cursor sprite and position - * Use hardware cursor if possible - */ -static void -XFIOKitSetCursor( - ScreenPtr pScreen, - CursorPtr pCursor, - int x, - int y) -{ - kern_return_t kr; - DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen); - XFIOKitScreenPtr iokitScreen = XFIOKIT_SCREEN_PRIV(pScreen); - StdFBShmem_t *cshmem = iokitScreen->cursorShmem; - XFIOKitCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); - - // are we supposed to remove the cursor? - if (!pCursor) { - if (ScreenPriv->cursorMode == 0) - (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, 0, x, y); - else { - if (!cshmem->cursorShow) { - cshmem->cursorShow++; - if (cshmem->hardwareCursorActive) { - kr = IOFBSetCursorVisible(iokitScreen->fbService, FALSE); - kern_assert( kr ); - } - } - } - return; - } - - // can we use the kernel or hardware cursor? - if ((pCursor->bits->height <= CURSORHEIGHT) && - (pCursor->bits->width <= CURSORWIDTH) && - // FIXME: condition not needed when kernel cursor works - ScreenPriv->canHWCursor) { - - if (ScreenPriv->cursorMode == 0) // remove the X cursor - (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, 0, x, y); - ScreenPriv->cursorMode = 1; // kernel cursor - - // change the cursor image in shared memory - if (dfb->bitsPerPixel == 8) { - cursorPrivPtr newCursor = - (cursorPrivPtr) pCursor->devPriv[pScreen->myNum]; - memcpy(cshmem->cursor.bw8.image[0], newCursor->image, - CURSORWIDTH*CURSORHEIGHT); - memcpy(cshmem->cursor.bw8.mask[0], newCursor->mask, - CURSORWIDTH*CURSORHEIGHT); - } else if (dfb->bitsPerPixel == 16) { - unsigned short *newCursor = - (unsigned short *) pCursor->devPriv[pScreen->myNum]; - memcpy(cshmem->cursor.rgb.image[0], newCursor, - 2*CURSORWIDTH*CURSORHEIGHT); - } else { - unsigned int *newCursor = - (unsigned int *) pCursor->devPriv[pScreen->myNum]; - memcpy(cshmem->cursor.rgb24.image[0], newCursor, - 4*CURSORWIDTH*CURSORHEIGHT); - } - - // FIXME: We always use a full size cursor, even if the image - // is smaller because I couldn't get the padding to come out - // right otherwise. - cshmem->cursorSize[0].width = CURSORWIDTH; - cshmem->cursorSize[0].height = CURSORHEIGHT; - cshmem->hotSpot[0].x = pCursor->bits->xhot; - cshmem->hotSpot[0].y = pCursor->bits->yhot; - - // try to use a hardware cursor - if (ScreenPriv->canHWCursor) { - kr = IOFBSetNewCursor(iokitScreen->fbService, 0, 0, 0); - // FIXME: this is a fatal error without the kernel cursor - kern_assert( kr ); -#if 0 - if (kr != KERN_SUCCESS) { - ErrorF("Could not set new cursor with kernel return 0x%x.\n", kr); - ScreenPriv->canHWCursor = FALSE; - } -#endif - } - - // make the new cursor visible - if (cshmem->cursorShow) - cshmem->cursorShow--; - - if (!cshmem->cursorShow && ScreenPriv->canHWCursor) { - kr = IOFBSetCursorVisible(iokitScreen->fbService, TRUE); - // FIXME: this is a fatal error without the kernel cursor - kern_assert( kr ); -#if 0 - if (kr != KERN_SUCCESS) { - ErrorF("Couldn't set hardware cursor visible with kernel return 0x%x.\n", kr); - ScreenPriv->canHWCursor = FALSE; - } else -#endif - ScreenPriv->cursorMode = 2; // hardware cursor - } - - return; - } - - // otherwise we use a software cursor - if (ScreenPriv->cursorMode) { - /* remove the kernel or hardware cursor */ - XFIOKitSetCursor(pScreen, 0, x, y); - } - - ScreenPriv->cursorMode = 0; - (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, pCursor, x, y); -} - - -/* - * XFIOKitMoveCursor - * Move the cursor. This is a noop for a kernel or hardware cursor. - */ -static void -XFIOKitMoveCursor( - ScreenPtr pScreen, - int x, - int y) -{ - XFIOKitCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); - - // only the X cursor needs to be explicitly moved - if (!ScreenPriv->cursorMode) - (*ScreenPriv->spriteFuncs->MoveCursor)(pScreen, x, y); -} - -static miPointerSpriteFuncRec darwinSpriteFuncsRec = { - XFIOKitRealizeCursor, - XFIOKitUnrealizeCursor, - XFIOKitSetCursor, - XFIOKitMoveCursor -}; - - -/* -=========================================================================== - - Pointer screen functions - -=========================================================================== -*/ - -/* - * XFIOKitCursorOffScreen - */ -static Bool XFIOKitCursorOffScreen(ScreenPtr *pScreen, int *x, int *y) -{ return FALSE; -} - - -/* - * XFIOKitCrossScreen - */ -static void XFIOKitCrossScreen(ScreenPtr pScreen, Bool entering) -{ return; -} - - -/* - * XFIOKitWarpCursor - * Change the cursor position without generating an event or motion history - */ -static void -XFIOKitWarpCursor( - ScreenPtr pScreen, - int x, - int y) -{ - kern_return_t kr; - - kr = IOHIDSetMouseLocation( xfIOKitInputConnect, x, y ); - if (kr != KERN_SUCCESS) { - ErrorF("Could not set cursor position with kernel return 0x%x.\n", kr); - } - miPointerWarpCursor(pScreen, x, y); -} - -static miPointerScreenFuncRec darwinScreenFuncsRec = { - XFIOKitCursorOffScreen, - XFIOKitCrossScreen, - XFIOKitWarpCursor, - DarwinEQPointerPost, - DarwinEQSwitchScreen -}; - - -/* -=========================================================================== - - Other screen functions - -=========================================================================== -*/ - -/* - * XFIOKitCursorQueryBestSize - * Handle queries for best cursor size - */ -static void -XFIOKitCursorQueryBestSize( - int class, - unsigned short *width, - unsigned short *height, - ScreenPtr pScreen) -{ - XFIOKitCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); - - if (class == CursorShape) { - *width = CURSORWIDTH; - *height = CURSORHEIGHT; - } else - (*ScreenPriv->QueryBestSize)(class, width, height, pScreen); -} - - -/* - * XFIOKitInitCursor - * Initialize cursor support - */ -Bool -XFIOKitInitCursor( - ScreenPtr pScreen) -{ - XFIOKitScreenPtr iokitScreen = XFIOKIT_SCREEN_PRIV(pScreen); - XFIOKitCursorScreenPtr ScreenPriv; - miPointerScreenPtr PointPriv; - kern_return_t kr; - - // start with no cursor displayed - if (!iokitScreen->cursorShmem->cursorShow++) { - if (iokitScreen->cursorShmem->hardwareCursorActive) { - kr = IOFBSetCursorVisible(iokitScreen->fbService, FALSE); - kern_assert( kr ); - } - } - - // initialize software cursor handling (always needed as backup) - if (!miDCInitialize(pScreen, &darwinScreenFuncsRec)) { - return FALSE; - } - - // allocate private storage for this screen's hardware cursor info - if (darwinCursorGeneration != serverGeneration) { - if ((darwinCursorScreenIndex = AllocateScreenPrivateIndex()) < 0) - return FALSE; - darwinCursorGeneration = serverGeneration; - } - - ScreenPriv = xcalloc( 1, sizeof(XFIOKitCursorScreenRec) ); - if (!ScreenPriv) return FALSE; - - pScreen->devPrivates[darwinCursorScreenIndex].ptr = (pointer) ScreenPriv; - - // check if a hardware cursor is supported - if (!iokitScreen->cursorShmem->hardwareCursorCapable) { - ScreenPriv->canHWCursor = FALSE; - ErrorF("Hardware cursor not supported.\n"); - } else { - // we need to make sure that the hardware cursor really works - ScreenPriv->canHWCursor = TRUE; - kr = IOFBSetNewCursor(iokitScreen->fbService, 0, 0, 0); - if (kr != KERN_SUCCESS) { - ErrorF("Could not set hardware cursor with kernel return 0x%x.\n", kr); - ScreenPriv->canHWCursor = FALSE; - } - kr = IOFBSetCursorVisible(iokitScreen->fbService, TRUE); - if (kr != KERN_SUCCESS) { - ErrorF("Couldn't set hardware cursor visible with kernel return 0x%x.\n", kr); - ScreenPriv->canHWCursor = FALSE; - } - IOFBSetCursorVisible(iokitScreen->fbService, FALSE); - } - - ScreenPriv->cursorMode = 0; - ScreenPriv->pInstalledMap = NULL; - - // override some screen procedures - ScreenPriv->QueryBestSize = pScreen->QueryBestSize; - pScreen->QueryBestSize = XFIOKitCursorQueryBestSize; -// ScreenPriv->ConstrainCursor = pScreen->ConstrainCursor; -// pScreen->ConstrainCursor = XFIOKitConstrainCursor; - - // initialize hardware cursor handling - PointPriv = (miPointerScreenPtr) - pScreen->devPrivates[miPointerScreenIndex].ptr; - - ScreenPriv->spriteFuncs = PointPriv->spriteFuncs; - PointPriv->spriteFuncs = &darwinSpriteFuncsRec; - - /* Other routines that might be overridden */ -/* - CursorLimitsProcPtr CursorLimits; - RecolorCursorProcPtr RecolorCursor; -*/ - - return TRUE; -} diff --git a/nx-X11/programs/Xserver/hw/darwin/iokit/xfIOKitStartup.c b/nx-X11/programs/Xserver/hw/darwin/iokit/xfIOKitStartup.c deleted file mode 100644 index 09c5daa1c..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/iokit/xfIOKitStartup.c +++ /dev/null @@ -1,126 +0,0 @@ -/************************************************************** - * - * Startup code for the IOKit Darwin X Server - * - **************************************************************/ -/* - * Copyright (c) 2001-2004 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/iokit/xfIOKitStartup.c,v 1.1 2003/05/14 05:27:56 torrey Exp $ */ - -#include "darwin.h" -#include "darwinKeyboard.h" -#include "micmap.h" - -void GlxExtensionInit(void); -void GlxWrapInitVisuals(miInitVisualsProcPtr *procPtr); - - -/* - * DarwinHandleGUI - * This function is called first from main(). - * It does nothing for the IOKit X server. - */ -void DarwinHandleGUI( - int argc, - char *argv[], - char *envp[] ) -{ -} - - -/* - * DarwinGlxExtensionInit - * Initialize the GLX extension. - * Mesa is linked into the IOKit mode X server so we just call directly. - */ -void DarwinGlxExtensionInit(void) -{ - GlxExtensionInit(); -} - - -/* - * DarwinGlxWrapInitVisuals - */ -void DarwinGlxWrapInitVisuals( - miInitVisualsProcPtr *procPtr) -{ - GlxWrapInitVisuals(procPtr); -} - - -/* - * DarwinModeProcessArgument - * Process IOKit specific command line arguments. - */ -int DarwinModeProcessArgument( - int argc, - char *argv[], - int i) -{ -#ifdef DARWIN_WITH_QUARTZ - // XDarwinStartup uses these arguments to indicate which X server - // should be started. Ignore them here. - if (!strcmp( argv[i], "-fullscreen" ) || - !strcmp( argv[i], "-rootless" ) || - !strcmp( argv[i], "-quartz" )) - { - return 1; - } -#else - if (!strcmp( argv[i], "-fullscreen" ) || - !strcmp( argv[i], "-rootless" ) || - !strcmp( argv[i], "-quartz" )) - { - FatalError("Command line option %s is not available without Quartz " - "support.\n", argv[i]); - } -#endif - - return 0; -} - - -/* - * DarwinModeSystemKeymapSeed - * Changes to NXKeyMapping are not tracked. - */ -unsigned int -DarwinModeSystemKeymapSeed(void) -{ - return 0; -} - - -/* - * DarwinModeReadSystemKeymap - * IOKit has no alternative to NXKeyMapping API. - */ -Bool DarwinModeReadSystemKeymap( - darwinKeyboardInfo *info) -{ - return FALSE; -} diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/Imakefile b/nx-X11/programs/Xserver/hw/darwin/quartz/Imakefile deleted file mode 100644 index d12b04f6b..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/Imakefile +++ /dev/null @@ -1,113 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/darwin/quartz/Imakefile,v 1.12 2003/11/11 01:29:47 torrey Exp $ - -#include -#define IHaveSubdirs - -SRCS = Preferences.m \ - XApplication.m \ - XServer.m \ - applewm.c \ - keysym2ucs.c \ - quartz.c \ - quartzAudio.c \ - quartzCocoa.m \ - quartzPasteboard.c \ - quartzKeyboard.c \ - quartzStartup.c \ - pseudoramiX.c - -OBJS = Preferences.o \ - XApplication.o \ - XServer.o \ - applewm.o \ - keysym2ucs.o \ - quartz.o \ - quartzAudio.o \ - quartzCocoa.o \ - quartzPasteboard.o \ - quartzKeyboard.o \ - quartzStartup.o \ - pseudoramiX.o - -INCLUDES = -I. -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi -I$(SERVERSRC)/include \ - -I$(XINCLUDESRC) -I$(FONTINCSRC) -I$(SERVERSRC)/render \ - -I$(SERVERSRC)/miext/shadow -I$(EXTINCSRC) -I$(SERVERSRC)/Xext \ - -I.. -I$(APPLEWMLIBSRC) - -#if defined(XorgCustomVersion) || defined(XFree86CustomVersion) -# if defined(XorgCustomVersion) -CUSTOMVERSION = XorgCustomVersion -# else -CUSTOMVERSION = XFree86CustomVersion -# endif /* XorgCustomVersion */ -CUSTOMVERDEF = -DXORG_CUSTOM_VERSION='$(CUSTOMVERSION)' -#endif /* XorgCustomVersion || XFree86CustomVersion */ - -#if XFree86Devel -BUILDSTYLE = -buildstyle Development -DEBUGDEFINES = -DROOTLESSDEBUG -#else -BUILDSTYLE = -buildstyle Deployment -#endif - -#if OSMajorVersion >= 7 -PROJ_TARGET = -project XDarwin.pbproj -target XDarwin -#else -PROJ_TARGET = -target XDarwin -#endif - -#if (OSMajorVersion == 1 && OSMinorVersion >= 4) || OSMajorVersion >= 5 -QUARTZDEFINES = -DHAS_CG_MACH_PORT -#endif - -#if HasXplugin -XPRDEFINES = -DBUILD_XPR -#endif - -#if OSMajorVersion >= 6 -KLDEFINES = -DHAS_KL_API -#endif - -DEFINES = $(CUSTOMVERDEF) -DXBINDIR=$(BINDIR) -DXINITDIR=$(XINITDIR) \ - $(QUARTZDEFINES) $(DEBUGDEFINES) $(XPRDEFINES) $(KLDEFINES) -EXTRAMANDEFS = -D__XBinDir__=$(BINDIR) -#if NothingOutsideProjectRoot -XDARWINROOT = $(BINDIR) -#else -XDARWINROOT = /Applications -#endif - -#if HasXplugin -SUBDIRS = cr fullscreen xpr -#else -SUBDIRS = cr fullscreen -#endif - -NormalLibraryObjectRule() -NormalLibraryTarget(XQuartz,$(OBJS)) - -AllTarget(XDarwinStartup) -NormalProgramTarget(XDarwinStartup,XDarwinStartup.o, \ - NullParameter,NullParameter, \ - -framework CoreFoundation -framework ApplicationServices) -InstallProgram(XDarwinStartup,$(BINDIR)) -install:: - -(cd $(DESTDIR)$(BINDIR); $(RM) X; $(LN) XDarwinStartup X) - -AllTarget(XDarwin) -XDarwin: - $(PROJ_BUILD) $(PROJ_TARGET) $(BUILDSTYLE) - -install:: - $(PROJ_BUILD) install $(PROJ_TARGET) $(BUILDSTYLE) \ - DSTROOT=$(DESTDIR)$(XDARWINROOT) - -InstallManPage(XDarwinStartup,$(MANDIR)) - -clean:: - $(PROJ_BUILD) "clean" $(PROJ_TARGET) $(BUILDSTYLE) - -DependTarget() - -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/Preferences.h b/nx-X11/programs/Xserver/hw/darwin/quartz/Preferences.h deleted file mode 100644 index d8c3c2ea2..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/Preferences.h +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the - * sale, use or other dealings in this Software without prior written - * authorization. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/Preferences.h,v 1.2 2003/01/15 02:34:05 torrey Exp $ */ - -#import - -@interface Preferences : NSObject -{ - IBOutlet NSPanel *window; - IBOutlet id displayField; - IBOutlet id dockSwitchButton; - IBOutlet id fakeButton; - IBOutlet id button2ModifiersMatrix; - IBOutlet id button3ModifiersMatrix; - IBOutlet id switchKeyButton; - IBOutlet id keymapFileField; - IBOutlet id modeMatrix; - IBOutlet id modeWindowButton; - IBOutlet id startupHelpButton; - IBOutlet id systemBeepButton; - IBOutlet id mouseAccelChangeButton; - IBOutlet id useXineramaButton; - IBOutlet id addToPathButton; - IBOutlet id addToPathField; - IBOutlet id useDefaultShellMatrix; - IBOutlet id useOtherShellField; - IBOutlet id depthButton; - - BOOL isGettingKeyCode; - int keyCode; - int modifiers; - NSMutableString *switchString; -} - -- (IBAction)close:(id)sender; -- (IBAction)pickFile:(id)sender; -- (IBAction)saveChanges:(id)sender; -- (IBAction)setKey:(id)sender; - -- (BOOL)sendEvent:(NSEvent *)anEvent; - -- (void)awakeFromNib; -- (void)windowWillClose:(NSNotification *)aNotification; - -+ (void)setUseKeymapFile:(BOOL)newUseKeymapFile; -+ (void)setKeymapFile:(NSString *)newFile; -+ (void)setSwitchString:(NSString *)newString; -+ (void)setKeyCode:(int)newKeyCode; -+ (void)setModifiers:(int)newModifiers; -+ (void)setDisplay:(int)newDisplay; -+ (void)setDockSwitch:(BOOL)newDockSwitch; -+ (void)setFakeButtons:(BOOL)newFakeButtons; -+ (void)setButton2Mask:(int)newFakeMask; -+ (void)setButton3Mask:(int)newFakeMask; -+ (void)setMouseAccelChange:(BOOL)newMouseAccelChange; -+ (void)setUseQDCursor:(int)newUseQDCursor; -+ (void)setRootless:(BOOL)newRootless; -+ (void)setUseAGL:(BOOL)newUseAGL; -+ (void)setModeWindow:(BOOL)newModeWindow; -+ (void)setStartupHelp:(BOOL)newStartupHelp; -+ (void)setSystemBeep:(BOOL)newSystemBeep; -+ (void)setEnableKeyEquivalents:(BOOL)newKeyEquivs; -+ (void)setXinerama:(BOOL)newXinerama; -+ (void)setAddToPath:(BOOL)newAddToPath; -+ (void)setAddToPathString:(NSString *)newAddToPathString; -+ (void)setUseDefaultShell:(BOOL)newUseDefaultShell; -+ (void)setShellString:(NSString *)newShellString; -+ (void)setDepth:(int)newDepth; -+ (void)setDisplayModeBundles:(NSArray *)newBundles; -+ (void)saveToDisk; - -+ (BOOL)useKeymapFile; -+ (NSString *)keymapFile; -+ (NSString *)switchString; -+ (unsigned int)keyCode; -+ (unsigned int)modifiers; -+ (int)display; -+ (BOOL)dockSwitch; -+ (BOOL)fakeButtons; -+ (int)button2Mask; -+ (int)button3Mask; -+ (BOOL)mouseAccelChange; -+ (int)useQDCursor; -+ (BOOL)rootless; -+ (BOOL)useAGL; -+ (BOOL)modeWindow; -+ (BOOL)startupHelp; -+ (BOOL)systemBeep; -+ (BOOL)enableKeyEquivalents; -+ (BOOL)xinerama; -+ (BOOL)addToPath; -+ (NSString *)addToPathString; -+ (BOOL)useDefaultShell; -+ (NSString *)shellString; -+ (int)depth; -+ (NSArray *)displayModeBundles; - -@end - -// Possible settings for useQDCursor -enum { - qdCursor_Never, // never use QuickDraw cursor - qdCursor_Not8Bit, // don't try to use QuickDraw with 8-bit depth - qdCursor_Always // always try to use QuickDraw cursor -}; - -// Possible settings for depth -enum { - depth_Current, - depth_8Bit, - depth_15Bit, - depth_24Bit -}; diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/Preferences.m b/nx-X11/programs/Xserver/hw/darwin/quartz/Preferences.m deleted file mode 100644 index 6c14f4982..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/Preferences.m +++ /dev/null @@ -1,597 +0,0 @@ -// -// Preferences.m -// -// This class keeps track of the user preferences. -// -/* - * Copyright (c) 2002-2004 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the - * sale, use or other dealings in this Software without prior written - * authorization. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/Preferences.m,v 1.5 2004/06/08 22:58:10 torrey Exp $ */ - -#import "quartzCommon.h" - -#define BOOL xBOOL -#include "darwin.h" -#undef BOOL - -#import "Preferences.h" - -#include // for modifier masks - -// Macros to build the path name -#ifndef XBINDIR -#define XBINDIR /usr/X11R6/bin -#endif -#define STR(s) #s -#define XSTRPATH(s) STR(s) - -// Keys for user defaults dictionary -static NSString *X11EnableKeyEquivalentsKey = @"EnableKeyEquivalents"; - - -@implementation Preferences - -+ (void)initialize -{ - // Provide user defaults if needed - NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithInt:0], @"Display", - @"YES", @"FakeButtons", - [NSNumber numberWithInt:NX_COMMANDMASK], @"Button2Mask", - [NSNumber numberWithInt:NX_ALTERNATEMASK], @"Button3Mask", - NSLocalizedString(@"USA.keymapping",@""), @"KeymappingFile", - @"YES", @"UseKeymappingFile", - NSLocalizedString(@"Cmd-Opt-a",@""), @"SwitchString", - @"YES", @"UseRootlessMode", - @"YES", @"UseAGLforGLX", - @"YES", @"ShowModePickWindow", - @"YES", @"ShowStartupHelp", - [NSNumber numberWithInt:0], @"SwitchKeyCode", - [NSNumber numberWithInt:(NSCommandKeyMask | NSAlternateKeyMask)], - @"SwitchModifiers", @"NO", @"UseSystemBeep", - @"YES", X11EnableKeyEquivalentsKey, - @"YES", @"DockSwitch", - @"NO", @"AllowMouseAccelChange", - [NSNumber numberWithInt:qdCursor_Not8Bit], @"UseQDCursor", - @"YES", @"Xinerama", - @"YES", @"AddToPath", - [NSString stringWithCString:XSTRPATH(XBINDIR)], @"AddToPathString", - @"YES", @"UseDefaultShell", - @"/bin/tcsh", @"Shell", - [NSNumber numberWithInt:depth_Current], @"Depth", -#ifdef BUILD_XPR - [NSArray arrayWithObjects:@"xpr.bundle", @"cr.bundle", nil], -#else - [NSArray arrayWithObjects:@"cr.bundle", nil], -#endif - @"DisplayModeBundles", nil]; - - [super initialize]; - [[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults]; -} - -// Initialize internal state info of switch key button -- (void)initSwitchKey -{ - keyCode = [Preferences keyCode]; - modifiers = [Preferences modifiers]; - [switchString setString:[Preferences switchString]]; -} - -- (id)init -{ - self = [super init]; - - isGettingKeyCode=NO; - switchString=[[NSMutableString alloc] init]; - [self initSwitchKey]; - - return self; -} - -// Set a modifiers checkbox matrix to match a modifier mask -- (void)resetMatrix:(NSMatrix *)aMatrix withMask:(int)aMask -{ - [aMatrix setState:(aMask & NX_SHIFTMASK) atRow:0 column:0]; - [aMatrix setState:(aMask & NX_CONTROLMASK) atRow:1 column:0]; - [aMatrix setState:(aMask & NX_COMMANDMASK) atRow:2 column:0]; - [aMatrix setState:(aMask & NX_ALTERNATEMASK) atRow:3 column:0]; - [aMatrix setState:(aMask & NX_SECONDARYFNMASK) atRow:4 column:0]; -} - -// Generate a modifiers mask from a modifiers checkbox matrix -- (int)getMaskFromMatrix:(NSMatrix *)aMatrix -{ - int theMask = 0; - - if ([[aMatrix cellAtRow:0 column:0] state]) - theMask |= NX_SHIFTMASK; - if ([[aMatrix cellAtRow:1 column:0] state]) - theMask |= NX_CONTROLMASK; - if ([[aMatrix cellAtRow:2 column:0] state]) - theMask |= NX_COMMANDMASK; - if ([[aMatrix cellAtRow:3 column:0] state]) - theMask |= NX_ALTERNATEMASK; - if ([[aMatrix cellAtRow:4 column:0] state]) - theMask |= NX_SECONDARYFNMASK; - - return theMask; -} - -// Set the window controls to the state in user defaults -- (void)resetWindow -{ - if ([Preferences keymapFile] == nil) - [keymapFileField setStringValue:@" "]; - else - [keymapFileField setStringValue:[Preferences keymapFile]]; - - if ([Preferences switchString] == nil) - [switchKeyButton setTitle:@"--"]; - else - [switchKeyButton setTitle:[Preferences switchString]]; - - [displayField setIntValue:[Preferences display]]; - [dockSwitchButton setIntValue:[Preferences dockSwitch]]; - [fakeButton setIntValue:[Preferences fakeButtons]]; - [self resetMatrix:button2ModifiersMatrix - withMask:[Preferences button2Mask]]; - [self resetMatrix:button3ModifiersMatrix - withMask:[Preferences button3Mask]]; - [modeMatrix setState:[Preferences rootless] atRow:0 column:1]; - [startupHelpButton setIntValue:[Preferences startupHelp]]; - [modeWindowButton setIntValue:[Preferences modeWindow]]; - [systemBeepButton setIntValue:[Preferences systemBeep]]; - [mouseAccelChangeButton setIntValue:[Preferences mouseAccelChange]]; - [useXineramaButton setIntValue:[Preferences xinerama]]; - [addToPathButton setIntValue:[Preferences addToPath]]; - [addToPathField setStringValue:[Preferences addToPathString]]; - [useDefaultShellMatrix setState:![Preferences useDefaultShell] - atRow:1 column:0]; - [useOtherShellField setStringValue:[Preferences shellString]]; - [depthButton selectItemAtIndex:[Preferences depth]]; -} - -- (void)awakeFromNib -{ - [self resetWindow]; -} - -// Preference window delegate -- (void)windowWillClose:(NSNotification *)aNotification -{ - [self resetWindow]; - [self initSwitchKey]; -} - -// User cancelled the changes -- (IBAction)close:(id)sender -{ - [window orderOut:nil]; - [self resetWindow]; // reset window controls - [self initSwitchKey]; // reset switch key state -} - -// Pick keymapping file -- (IBAction)pickFile:(id)sender -{ - int result; - NSArray *fileTypes = [NSArray arrayWithObject:@"keymapping"]; - NSOpenPanel *oPanel = [NSOpenPanel openPanel]; - - [oPanel setAllowsMultipleSelection:NO]; - result = [oPanel runModalForDirectory:@"/System/Library/Keyboards" - file:nil types:fileTypes]; - if (result == NSOKButton) { - [keymapFileField setStringValue:[oPanel filename]]; - } -} - -// User saved changes -- (IBAction)saveChanges:(id)sender -{ - [Preferences setKeyCode:keyCode]; - [Preferences setModifiers:modifiers]; - [Preferences setSwitchString:switchString]; - [Preferences setKeymapFile:[keymapFileField stringValue]]; - [Preferences setUseKeymapFile:YES]; - [Preferences setDisplay:[displayField intValue]]; - [Preferences setDockSwitch:[dockSwitchButton intValue]]; - [Preferences setFakeButtons:[fakeButton intValue]]; - [Preferences setButton2Mask: - [self getMaskFromMatrix:button2ModifiersMatrix]]; - [Preferences setButton3Mask: - [self getMaskFromMatrix:button3ModifiersMatrix]]; - [Preferences setRootless:[[modeMatrix cellAtRow:0 column:1] state]]; - [Preferences setModeWindow:[modeWindowButton intValue]]; - [Preferences setStartupHelp:[startupHelpButton intValue]]; - [Preferences setSystemBeep:[systemBeepButton intValue]]; - [Preferences setMouseAccelChange:[mouseAccelChangeButton intValue]]; - [Preferences setXinerama:[useXineramaButton intValue]]; - [Preferences setAddToPath:[addToPathButton intValue]]; - [Preferences setAddToPathString:[addToPathField stringValue]]; - [Preferences setUseDefaultShell: - [[useDefaultShellMatrix cellAtRow:0 column:0] state]]; - [Preferences setShellString:[useOtherShellField stringValue]]; - [Preferences setDepth:[depthButton indexOfSelectedItem]]; - [Preferences saveToDisk]; - - [window orderOut:nil]; -} - -- (IBAction)setKey:(id)sender -{ - [switchKeyButton setTitle:NSLocalizedString(@"Press key",@"")]; - isGettingKeyCode=YES; - [switchString setString:@""]; -} - -- (BOOL)sendEvent:(NSEvent *)anEvent -{ - if(isGettingKeyCode) { - if([anEvent type]==NSKeyDown) // wait for keyup - return YES; - if([anEvent type]!=NSKeyUp) - return NO; - - if([anEvent modifierFlags] & NSCommandKeyMask) - [switchString appendString:@"Cmd-"]; - if([anEvent modifierFlags] & NSControlKeyMask) - [switchString appendString:@"Ctrl-"]; - if([anEvent modifierFlags] & NSAlternateKeyMask) - [switchString appendString:@"Opt-"]; - if([anEvent modifierFlags] & NSNumericPadKeyMask) // doesn't work - [switchString appendString:@"Num-"]; - if([anEvent modifierFlags] & NSHelpKeyMask) - [switchString appendString:@"Help-"]; - if([anEvent modifierFlags] & NSFunctionKeyMask) // powerbooks only - [switchString appendString:@"Fn-"]; - - [switchString appendString:[anEvent charactersIgnoringModifiers]]; - [switchKeyButton setTitle:switchString]; - - keyCode = [anEvent keyCode]; - modifiers = [anEvent modifierFlags]; - isGettingKeyCode=NO; - - return YES; - } - return NO; -} - -+ (void)setKeymapFile:(NSString *)newFile -{ - [[NSUserDefaults standardUserDefaults] setObject:newFile - forKey:@"KeymappingFile"]; -} - -+ (void)setUseKeymapFile:(BOOL)newUseKeymapFile -{ - [[NSUserDefaults standardUserDefaults] setBool:newUseKeymapFile - forKey:@"UseKeymappingFile"]; -} - -+ (void)setSwitchString:(NSString *)newString -{ - [[NSUserDefaults standardUserDefaults] setObject:newString - forKey:@"SwitchString"]; -} - -+ (void)setKeyCode:(int)newKeyCode -{ - [[NSUserDefaults standardUserDefaults] setInteger:newKeyCode - forKey:@"SwitchKeyCode"]; -} - -+ (void)setModifiers:(int)newModifiers -{ - [[NSUserDefaults standardUserDefaults] setInteger:newModifiers - forKey:@"SwitchModifiers"]; -} - -+ (void)setDisplay:(int)newDisplay -{ - [[NSUserDefaults standardUserDefaults] setInteger:newDisplay - forKey:@"Display"]; -} - -+ (void)setDockSwitch:(BOOL)newDockSwitch -{ - [[NSUserDefaults standardUserDefaults] setBool:newDockSwitch - forKey:@"DockSwitch"]; -} - -+ (void)setFakeButtons:(BOOL)newFakeButtons -{ - [[NSUserDefaults standardUserDefaults] setBool:newFakeButtons - forKey:@"FakeButtons"]; - // Update the setting used by the X server thread - darwinFakeButtons = newFakeButtons; -} - -+ (void)setButton2Mask:(int)newFakeMask -{ - [[NSUserDefaults standardUserDefaults] setInteger:newFakeMask - forKey:@"Button2Mask"]; - // Update the setting used by the X server thread - darwinFakeMouse2Mask = newFakeMask; -} - -+ (void)setButton3Mask:(int)newFakeMask -{ - [[NSUserDefaults standardUserDefaults] setInteger:newFakeMask - forKey:@"Button3Mask"]; - // Update the setting used by the X server thread - darwinFakeMouse3Mask = newFakeMask; -} - -+ (void)setMouseAccelChange:(BOOL)newMouseAccelChange -{ - [[NSUserDefaults standardUserDefaults] setBool:newMouseAccelChange - forKey:@"AllowMouseAccelChange"]; - // Update the setting used by the X server thread - darwinMouseAccelChange = newMouseAccelChange; -} - -+ (void)setUseQDCursor:(int)newUseQDCursor -{ - [[NSUserDefaults standardUserDefaults] setInteger:newUseQDCursor - forKey:@"UseQDCursor"]; -} - -+ (void)setModeWindow:(BOOL)newModeWindow -{ - [[NSUserDefaults standardUserDefaults] setBool:newModeWindow - forKey:@"ShowModePickWindow"]; -} - -+ (void)setRootless:(BOOL)newRootless -{ - [[NSUserDefaults standardUserDefaults] setBool:newRootless - forKey:@"UseRootlessMode"]; -} - -+ (void)setUseAGL:(BOOL)newUseAGL -{ - [[NSUserDefaults standardUserDefaults] setBool:newUseAGL - forKey:@"UseAGLforGLX"]; -} - -+ (void)setStartupHelp:(BOOL)newStartupHelp -{ - [[NSUserDefaults standardUserDefaults] setBool:newStartupHelp - forKey:@"ShowStartupHelp"]; -} - -+ (void)setSystemBeep:(BOOL)newSystemBeep -{ - [[NSUserDefaults standardUserDefaults] setBool:newSystemBeep - forKey:@"UseSystemBeep"]; - // Update the setting used by the X server thread - quartzUseSysBeep = newSystemBeep; -} - -+ (void)setEnableKeyEquivalents:(BOOL)newKeyEquivs -{ - [[NSUserDefaults standardUserDefaults] setBool:newKeyEquivs - forKey:X11EnableKeyEquivalentsKey]; - // Update the setting used by the X server thread - quartzEnableKeyEquivalents = newKeyEquivs; -} - -+ (void)setXinerama:(BOOL)newXinerama -{ - [[NSUserDefaults standardUserDefaults] setBool:newXinerama - forKey:@"Xinerama"]; -} - -+ (void)setAddToPath:(BOOL)newAddToPath -{ - [[NSUserDefaults standardUserDefaults] setBool:newAddToPath - forKey:@"AddToPath"]; -} - -+ (void)setAddToPathString:(NSString *)newAddToPathString -{ - [[NSUserDefaults standardUserDefaults] setObject:newAddToPathString - forKey:@"AddToPathString"]; -} - -+ (void)setUseDefaultShell:(BOOL)newUseDefaultShell -{ - [[NSUserDefaults standardUserDefaults] setBool:newUseDefaultShell - forKey:@"UseDefaultShell"]; -} - -+ (void)setShellString:(NSString *)newShellString -{ - [[NSUserDefaults standardUserDefaults] setObject:newShellString - forKey:@"Shell"]; -} - -+ (void)setDepth:(int)newDepth -{ - [[NSUserDefaults standardUserDefaults] setInteger:newDepth - forKey:@"Depth"]; -} - -+ (void)setDisplayModeBundles:(NSArray *)newBundles -{ - [[NSUserDefaults standardUserDefaults] setObject:newBundles - forKey:@"DisplayModeBundles"]; -} - -+ (void)saveToDisk -{ - [[NSUserDefaults standardUserDefaults] synchronize]; -} - -+ (BOOL)useKeymapFile -{ - return [[NSUserDefaults standardUserDefaults] - boolForKey:@"UseKeymappingFile"]; -} - -+ (NSString *)keymapFile -{ - return [[NSUserDefaults standardUserDefaults] - stringForKey:@"KeymappingFile"]; -} - -+ (NSString *)switchString -{ - return [[NSUserDefaults standardUserDefaults] - stringForKey:@"SwitchString"]; -} - -+ (unsigned int)keyCode -{ - return [[NSUserDefaults standardUserDefaults] - integerForKey:@"SwitchKeyCode"]; -} - -+ (unsigned int)modifiers -{ - return [[NSUserDefaults standardUserDefaults] - integerForKey:@"SwitchModifiers"]; -} - -+ (int)display -{ - return [[NSUserDefaults standardUserDefaults] - integerForKey:@"Display"]; -} - -+ (BOOL)dockSwitch -{ - return [[NSUserDefaults standardUserDefaults] boolForKey:@"DockSwitch"]; -} - -+ (BOOL)fakeButtons -{ - return [[NSUserDefaults standardUserDefaults] boolForKey:@"FakeButtons"]; -} - -+ (int)button2Mask -{ - return [[NSUserDefaults standardUserDefaults] - integerForKey:@"Button2Mask"]; -} - -+ (int)button3Mask -{ - return [[NSUserDefaults standardUserDefaults] - integerForKey:@"Button3Mask"]; -} - -+ (BOOL)mouseAccelChange -{ - return [[NSUserDefaults standardUserDefaults] - boolForKey:@"AllowMouseAccelChange"]; -} - -+ (int)useQDCursor -{ - return [[NSUserDefaults standardUserDefaults] - integerForKey:@"UseQDCursor"]; -} - -+ (BOOL)rootless -{ - return [[NSUserDefaults standardUserDefaults] - boolForKey:@"UseRootlessMode"]; -} - -+ (BOOL)useAGL -{ - return [[NSUserDefaults standardUserDefaults] - boolForKey:@"UseAGLforGLX"]; -} - -+ (BOOL)modeWindow -{ - return [[NSUserDefaults standardUserDefaults] - boolForKey:@"ShowModePickWindow"]; -} - -+ (BOOL)startupHelp -{ - return [[NSUserDefaults standardUserDefaults] - boolForKey:@"ShowStartupHelp"]; -} - -+ (BOOL)systemBeep -{ - return [[NSUserDefaults standardUserDefaults] boolForKey:@"UseSystemBeep"]; -} - -+ (BOOL)enableKeyEquivalents -{ - return [[NSUserDefaults standardUserDefaults] boolForKey:X11EnableKeyEquivalentsKey]; -} - -+ (BOOL)xinerama -{ - return [[NSUserDefaults standardUserDefaults] boolForKey:@"Xinerama"]; -} - -+ (BOOL)addToPath -{ - return [[NSUserDefaults standardUserDefaults] boolForKey:@"AddToPath"]; -} - -+ (NSString *)addToPathString -{ - return [[NSUserDefaults standardUserDefaults] - stringForKey:@"AddToPathString"]; -} - -+ (BOOL)useDefaultShell -{ - return [[NSUserDefaults standardUserDefaults] - boolForKey:@"UseDefaultShell"]; -} - -+ (NSString *)shellString -{ - return [[NSUserDefaults standardUserDefaults] - stringForKey:@"Shell"]; -} - -+ (int)depth -{ - return [[NSUserDefaults standardUserDefaults] - integerForKey:@"Depth"]; -} - -+ (NSArray *)displayModeBundles -{ - return [[NSUserDefaults standardUserDefaults] - objectForKey:@"DisplayModeBundles"]; -} - -@end diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/XApplication.h b/nx-X11/programs/Xserver/hw/darwin/quartz/XApplication.h deleted file mode 100644 index a2622e060..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/XApplication.h +++ /dev/null @@ -1,47 +0,0 @@ -// -// XApplication.h -// -// Created by Andreas Monitzer on January 6, 2001. -// -/* - * Copyright (c) 2001 Andreas Monitzer. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the - * sale, use or other dealings in this Software without prior written - * authorization. - */ -/* $XFree86: $ */ - -#import - -#import "XServer.h" -#import "Preferences.h" - -@interface XApplication : NSApplication { - IBOutlet XServer *xserver; - IBOutlet Preferences *preferences; -} - -- (void)sendEvent:(NSEvent *)anEvent; - -@end diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/XApplication.m b/nx-X11/programs/Xserver/hw/darwin/quartz/XApplication.m deleted file mode 100644 index e0ee8d9c6..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/XApplication.m +++ /dev/null @@ -1,47 +0,0 @@ -// -// XApplication.m -// -// Created by Andreas Monitzer on January 6, 2001. -// -/* - * Copyright (c) 2001 Andreas Monitzer. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the - * sale, use or other dealings in this Software without prior written - * authorization. - */ -/* $XFree86: $ */ - -#import "XApplication.h" - - -@implementation XApplication - -- (void)sendEvent:(NSEvent *)anEvent { - if (![xserver translateEvent:anEvent]) { - if (![preferences sendEvent:anEvent]) - [super sendEvent:anEvent]; - } -} - -@end diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/XDarwin.pbproj/project.pbxproj b/nx-X11/programs/Xserver/hw/darwin/quartz/XDarwin.pbproj/project.pbxproj deleted file mode 100644 index 90002db56..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/XDarwin.pbproj/project.pbxproj +++ /dev/null @@ -1,2519 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 39; - objects = { - 01279092000747AA0A000002 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.objc; - path = XServer.m; - refType = 4; - sourceTree = ""; - }; - 0127909600074AF60A000002 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.objc; - path = XApplication.m; - refType = 4; - sourceTree = ""; - }; - 0127909800074B1A0A000002 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = XApplication.h; - refType = 4; - sourceTree = ""; - }; - 015698ED003DF345CE6F79C2 = { - isa = PBXFileReference; - lastKnownFileType = image.icns; - path = XDarwin.icns; - refType = 4; - sourceTree = ""; - }; - 0157A37D002CF6D7CE6F79C2 = { - children = ( - F533214601A4B45401000001, - 0157A37E002CF6D7CE6F79C2, - F58D65DF018F79B101000001, - F533213D0193CBE001000001, - 43B962E200617B93416877C2, - F5ACD263C5BE031F01000001, - F51BF62E02026E3501000001, - F5ACD25CC5B5E96601000001, - F587E16401924C6901000001, - ); - isa = PBXVariantGroup; - name = Credits.rtf; - path = ""; - refType = 4; - sourceTree = ""; - }; - 0157A37E002CF6D7CE6F79C2 = { - isa = PBXFileReference; - lastKnownFileType = text.rtf; - name = English; - path = English.lproj/Credits.rtf; - refType = 4; - sourceTree = ""; - }; - 015EDCEA004203A8CE6F79C2 = { - isa = PBXFileReference; - lastKnownFileType = wrapper.framework; - name = IOKit.framework; - path = /System/Library/Frameworks/IOKit.framework; - refType = 0; - sourceTree = ""; - }; - 018F40F2003E1902CE6F79C2 = { - children = ( - 018F40F3003E1916CE6F79C2, - 021D6BA9003E1BACCE6F79C2, - 3E74E03600863F047F000001, - F5A94EF10314BAC70100011B, - 018F40F6003E1974CE6F79C2, - 6E5F5F0005537A1A008FEAD7, - ); - isa = PBXGroup; - name = "X Server"; - path = ..; - refType = 4; - sourceTree = ""; - }; - 018F40F3003E1916CE6F79C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = darwin.c; - refType = 4; - sourceTree = ""; - }; - 018F40F6003E1974CE6F79C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = darwinKeyboard.c; - refType = 4; - sourceTree = ""; - }; - 018F40F8003E1979CE6F79C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = quartz.c; - refType = 4; - sourceTree = ""; - }; - 018F40FA003E197ECE6F79C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = quartz.h; - refType = 4; - sourceTree = ""; - }; - 018F40FC003E1983CE6F79C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = xfIOKit.c; - refType = 4; - sourceTree = ""; - }; - 018F40FE003E1988CE6F79C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = xfIOKit.h; - refType = 4; - sourceTree = ""; - }; - 018F4100003E19E4CE6F79C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = xfIOKitCursor.c; - refType = 4; - sourceTree = ""; - }; -//010 -//011 -//012 -//013 -//014 -//020 -//021 -//022 -//023 -//024 - 021D6BA9003E1BACCE6F79C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = darwin.h; - refType = 4; - sourceTree = ""; - }; - 02A1FEA6006D34BE416877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = xfIOKitStartup.c; - refType = 4; - sourceTree = ""; - }; - 02A1FEA8006D38F0416877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = quartzStartup.c; - refType = 4; - sourceTree = ""; - }; - 02E03CA000348209CE6F79C2 = { - children = ( - F533214701A4B48301000001, - 02E03CA100348209CE6F79C2, - F58D65E0018F79C001000001, - F533213E0193CBF401000001, - 43B962E300617B93416877C2, - F5ACD268C5BE046401000001, - F51BF62F02026E5C01000001, - F5ACD261C5B5EA2001000001, - F587E16501924C7401000001, - ); - isa = PBXVariantGroup; - name = XDarwinHelp.html; - path = ""; - refType = 4; - sourceTree = ""; - }; - 02E03CA100348209CE6F79C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = text.html; - name = English; - path = English.lproj/XDarwinHelp.html; - refType = 4; - sourceTree = ""; - }; -//020 -//021 -//022 -//023 -//024 -//030 -//031 -//032 -//033 -//034 - 0338412F0083BFE57F000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = quartzCursor.h; - refType = 4; - sourceTree = ""; - }; -//030 -//031 -//032 -//033 -//034 -//040 -//041 -//042 -//043 -//044 - 04329610000763920A000002 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.objc; - path = Preferences.m; - refType = 4; - sourceTree = ""; - }; - 04329611000763920A000002 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = Preferences.h; - refType = 4; - sourceTree = ""; - }; -//040 -//041 -//042 -//043 -//044 -//080 -//081 -//082 -//083 -//084 - 080E96DDFE201D6D7F000001 = { - children = ( - 04329610000763920A000002, - 04329611000763920A000002, - 0127909600074AF60A000002, - 0127909800074B1A0A000002, - 01279092000747AA0A000002, - 1C4A3109004D8F24CE6F79C2, - ); - isa = PBXGroup; - name = Classes; - refType = 4; - sourceTree = ""; - }; - 089C165CFE840E0CC02AAC07 = { - children = ( - F533214301A4B3F001000001, - 089C165DFE840E0CC02AAC07, - F58D65DD018F798F01000001, - F533213A0193CBA201000001, - 43B962E100617B49416877C2, - F5ACD269C5BE049301000001, - F51BF62B02026DDA01000001, - F5ACD262C5B5EA4D01000001, - F587E16101924C2F01000001, - ); - isa = PBXVariantGroup; - name = InfoPlist.strings; - refType = 4; - sourceTree = ""; - }; - 089C165DFE840E0CC02AAC07 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = text.plist.strings; - name = English; - path = English.lproj/InfoPlist.strings; - refType = 4; - sourceTree = ""; - }; -//080 -//081 -//082 -//083 -//084 -//0A0 -//0A1 -//0A2 -//0A3 -//0A4 - 0A79E19E004499A1CE6F79C2 = { - explicitFileType = wrapper.application; - isa = PBXFileReference; - path = XDarwin.app; - refType = 3; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 0A79E19F004499A1CE6F79C2 = { - buildPhases = ( - 0A79E1A0004499A1CE6F79C2, - 0A79E1A1004499A1CE6F79C2, - 0A79E1A2004499A1CE6F79C2, - 0A79E1A3004499A1CE6F79C2, - 0A79E1A4004499A1CE6F79C2, - ); - buildSettings = { - INSTALL_PATH = /; - OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ""; - OTHER_REZFLAGS = ""; - PRODUCT_NAME = XDarwin; - SECTORDER_FLAGS = ""; - WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas"; - WRAPPER_EXTENSION = app; - }; - dependencies = ( - 6EF065C903D4F0CA006877C2, - 6EF065C703D4EE19006877C2, - 6E11A986048BDFFB006877C2, - 6E7904110500F33B00EEC080, - ); - isa = PBXApplicationTarget; - name = XDarwin; - productInstallPath = /; - productName = XDarwin; - productReference = 0A79E19E004499A1CE6F79C2; - productSettingsXML = " - - - - CFBundleDevelopmentRegion - English - CFBundleDocumentTypes - - - CFBundleTypeExtensions - - x11app - - CFBundleTypeName - X11 Application - CFBundleTypeOSTypes - - **** - - CFBundleTypeRole - Viewer - - - CFBundleTypeExtensions - - tool - * - - CFBundleTypeName - UNIX Application - CFBundleTypeOSTypes - - **** - - CFBundleTypeRole - Viewer - - - CFBundleExecutable - XDarwin - CFBundleGetInfoString - XDarwin 1.4.0, X.Org Foundation - CFBundleIconFile - XDarwin.icns - CFBundleIdentifier - org.xfree86.XDarwin - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - XDarwin - CFBundlePackageType - APPL - CFBundleShortVersionString - XDarwin 1.4.0 - CFBundleSignature - ???? - CFBundleVersion - - NSHelpFile - XDarwinHelp.html - NSMainNibFile - MainMenu - NSPrincipalClass - XApplication - - -"; - }; - 0A79E1A0004499A1CE6F79C2 = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXHeadersBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 0A79E1A1004499A1CE6F79C2 = { - buildActionMask = 2147483647; - files = ( - 0A79E1A600449EB2CE6F79C2, - 0A79E1A700449EB2CE6F79C2, - 0A79E1A800449EB2CE6F79C2, - 0A79E1A900449EB2CE6F79C2, - 0A79E1AA00449EB2CE6F79C2, - 1220774500712D2D416877C2, - F54BF6ED017D506E01000001, - ); - isa = PBXResourcesBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 0A79E1A2004499A1CE6F79C2 = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXSourcesBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 0A79E1A3004499A1CE6F79C2 = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXFrameworksBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 0A79E1A4004499A1CE6F79C2 = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXRezBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 0A79E1A600449EB2CE6F79C2 = { - fileRef = 29B97318FDCFA39411CA2CEA; - isa = PBXBuildFile; - settings = { - }; - }; - 0A79E1A700449EB2CE6F79C2 = { - fileRef = 089C165CFE840E0CC02AAC07; - isa = PBXBuildFile; - settings = { - }; - }; - 0A79E1A800449EB2CE6F79C2 = { - fileRef = 0157A37D002CF6D7CE6F79C2; - isa = PBXBuildFile; - settings = { - }; - }; - 0A79E1A900449EB2CE6F79C2 = { - fileRef = 02E03CA000348209CE6F79C2; - isa = PBXBuildFile; - settings = { - }; - }; - 0A79E1AA00449EB2CE6F79C2 = { - fileRef = 015698ED003DF345CE6F79C2; - isa = PBXBuildFile; - settings = { - }; - }; -//0A0 -//0A1 -//0A2 -//0A3 -//0A4 -//100 -//101 -//102 -//103 -//104 - 1058C7A0FEA54F0111CA2CBB = { - children = ( - F53321400193CCF001000001, - 1BE4F84D0006C9890A000002, - 1058C7A1FEA54F0111CA2CBB, - F53321410193CCF001000001, - 015EDCEA004203A8CE6F79C2, - ); - isa = PBXGroup; - name = "Linked Frameworks"; - refType = 4; - sourceTree = ""; - }; - 1058C7A1FEA54F0111CA2CBB = { - isa = PBXFileReference; - lastKnownFileType = wrapper.framework; - name = Cocoa.framework; - path = /System/Library/Frameworks/Cocoa.framework; - refType = 0; - sourceTree = ""; - }; - 1058C7A2FEA54F0111CA2CBB = { - children = ( - 29B97325FDCFA39411CA2CEA, - 29B97324FDCFA39411CA2CEA, - ); - isa = PBXGroup; - name = "Other Frameworks"; - refType = 4; - sourceTree = ""; - }; -//100 -//101 -//102 -//103 -//104 -//120 -//121 -//122 -//123 -//124 - 1220774300712D2D416877C2 = { - children = ( - F533214501A4B42501000001, - 1220774400712D2D416877C2, - F58D65DE018F79A001000001, - F533213C0193CBC901000001, - 1220774600712D75416877C2, - F5ACD266C5BE03C501000001, - F51BF62D02026E1C01000001, - F5ACD25FC5B5E9AA01000001, - F587E16301924C5E01000001, - ); - isa = PBXVariantGroup; - name = Localizable.strings; - path = ""; - refType = 4; - sourceTree = ""; - }; - 1220774400712D2D416877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = text.plist.strings; - name = English; - path = English.lproj/Localizable.strings; - refType = 4; - sourceTree = ""; - }; - 1220774500712D2D416877C2 = { - fileRef = 1220774300712D2D416877C2; - isa = PBXBuildFile; - settings = { - }; - }; - 1220774600712D75416877C2 = { - fileEncoding = 10; - isa = PBXFileReference; - lastKnownFileType = text.plist.strings; - name = Japanese; - path = Japanese.lproj/Localizable.strings; - refType = 4; - sourceTree = ""; - }; -//120 -//121 -//122 -//123 -//124 -//170 -//171 -//172 -//173 -//174 - 170DFAFF00729A35416877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = XDarwinStartup.c; - refType = 4; - sourceTree = ""; - }; - 170DFB0000729C86416877C2 = { - children = ( - 018F40FC003E1983CE6F79C2, - 018F40FE003E1988CE6F79C2, - 018F4100003E19E4CE6F79C2, - 02A1FEA6006D34BE416877C2, - ); - isa = PBXGroup; - name = IOKit; - path = ../iokit; - refType = 4; - sourceTree = ""; - }; -//170 -//171 -//172 -//173 -//174 -//190 -//191 -//192 -//193 -//194 - 19C28FACFE9D520D11CA2CBB = { - children = ( - 0A79E19E004499A1CE6F79C2, - 6EF7C58703D3BC6D00000104, - 6EF065C603D4EE19006877C2, - 6E11A985048BDFEE006877C2, - 6E7904100500F05600EEC080, - ); - isa = PBXGroup; - name = Products; - refType = 4; - sourceTree = ""; - }; -//190 -//191 -//192 -//193 -//194 -//1B0 -//1B1 -//1B2 -//1B3 -//1B4 - 1BD8DE4200B8A3567F000001 = { - children = ( - F533214401A4B40F01000001, - 1BD8DE4300B8A3567F000001, - F58D65DC018F794D01000001, - F533213B0193CBB401000001, - 1BD8DE4700B8A3C77F000001, - F5ACD264C5BE035B01000001, - F51BF62C02026E0601000001, - F5ACD25DC5B5E97701000001, - F587E16201924C5301000001, - ); - isa = PBXVariantGroup; - name = InfoPlist.strings.cpp; - path = ""; - refType = 4; - sourceTree = ""; - }; - 1BD8DE4300B8A3567F000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.cpp.cpp; - name = English; - path = English.lproj/InfoPlist.strings.cpp; - refType = 4; - sourceTree = ""; - }; - 1BD8DE4400B8A38E7F000001 = { - children = ( - F533214801A4B4D701000001, - 1BD8DE4500B8A38E7F000001, - F58D65E1018F79E001000001, - F533213F0193CC2501000001, - 1BD8DE4800B8A4167F000001, - F5ACD267C5BE03FC01000001, - F51BF63002026E8D01000001, - F5ACD260C5B5E9DF01000001, - F587E16601924C9D01000001, - ); - isa = PBXVariantGroup; - name = XDarwinHelp.html.cpp; - path = ""; - refType = 4; - sourceTree = ""; - }; - 1BD8DE4500B8A38E7F000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.cpp.cpp; - name = English; - path = English.lproj/XDarwinHelp.html.cpp; - refType = 4; - sourceTree = ""; - }; - 1BD8DE4700B8A3C77F000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.cpp.cpp; - name = Japanese; - path = Japanese.lproj/InfoPlist.strings.cpp; - refType = 4; - sourceTree = ""; - }; - 1BD8DE4800B8A4167F000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.cpp.cpp; - name = Japanese; - path = Japanese.lproj/XDarwinHelp.html.cpp; - refType = 4; - sourceTree = ""; - }; - 1BE4F84D0006C9890A000002 = { - isa = PBXFileReference; - lastKnownFileType = wrapper.framework; - name = Carbon.framework; - path = /System/Library/Frameworks/Carbon.framework; - refType = 0; - sourceTree = ""; - }; -//1B0 -//1B1 -//1B2 -//1B3 -//1B4 -//1C0 -//1C1 -//1C2 -//1C3 -//1C4 - 1C4A3109004D8F24CE6F79C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = XServer.h; - refType = 4; - sourceTree = ""; - }; -//1C0 -//1C1 -//1C2 -//1C3 -//1C4 -//230 -//231 -//232 -//233 -//234 - 237A34C10076E37E7F000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = quartzAudio.c; - refType = 4; - sourceTree = ""; - }; - 237A34C20076E37E7F000001 = { - buildSettings = { - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_GENERATE_DEBUGGING_SYMBOLS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - OPTIMIZATION_CFLAGS = "-O0"; - ZERO_LINK = YES; - }; - isa = PBXBuildStyle; - name = Development; - }; - 237A34C30076E37E7F000001 = { - buildSettings = { - COPY_PHASE_STRIP = YES; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - ZERO_LINK = NO; - }; - isa = PBXBuildStyle; - name = Deployment; - }; - 237A34C40076F4F07F000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = quartzAudio.h; - refType = 4; - sourceTree = ""; - }; -//230 -//231 -//232 -//233 -//234 -//290 -//291 -//292 -//293 -//294 - 29B97313FDCFA39411CA2CEA = { - buildSettings = { - }; - buildStyles = ( - 237A34C20076E37E7F000001, - 237A34C30076E37E7F000001, - ); - hasScannedForEncodings = 1; - isa = PBXProject; - knownRegions = ( - English, - Japanese, - French, - German, - Swedish, - Dutch, - Spanish, - ko, - Portuguese, - ); - mainGroup = 29B97314FDCFA39411CA2CEA; - projectDirPath = ""; - targets = ( - 0A79E19F004499A1CE6F79C2, - 6EF7C58603D3BC6D00000104, - 6E11A984048BDFEE006877C2, - 6EF065C503D4EE19006877C2, - 6E79040F0500F05600EEC080, - ); - }; - 29B97314FDCFA39411CA2CEA = { - children = ( - 080E96DDFE201D6D7F000001, - 018F40F2003E1902CE6F79C2, - 170DFB0000729C86416877C2, - 43B962CE00617089416877C2, - F5614B3D025112D901000114, - 6EC4A64C042A9597006877C2, - 32FEE13C00E07C3E7F000001, - 6EE1214104968658006877C2, - 6EC4A66D042A97FC006877C2, - 29B97315FDCFA39411CA2CEA, - 29B97317FDCFA39411CA2CEA, - 29B97323FDCFA39411CA2CEA, - 19C28FACFE9D520D11CA2CBB, - ); - isa = PBXGroup; - name = "Xmaster-Cocoa"; - path = ""; - refType = 4; - sourceTree = ""; - }; - 29B97315FDCFA39411CA2CEA = { - children = ( - 170DFAFF00729A35416877C2, - ); - isa = PBXGroup; - name = "Other Sources"; - path = ""; - refType = 2; - sourceTree = SOURCE_ROOT; - }; - 29B97317FDCFA39411CA2CEA = { - children = ( - 29B97318FDCFA39411CA2CEA, - 089C165CFE840E0CC02AAC07, - 1BD8DE4200B8A3567F000001, - 1220774300712D2D416877C2, - 0157A37D002CF6D7CE6F79C2, - 02E03CA000348209CE6F79C2, - 1BD8DE4400B8A38E7F000001, - 015698ED003DF345CE6F79C2, - F54BF6EA017D500901000001, - F54BF6EC017D506E01000001, - ); - isa = PBXGroup; - name = Resources; - path = ../bundle; - refType = 4; - sourceTree = ""; - }; - 29B97318FDCFA39411CA2CEA = { - children = ( - F533214201A4B3CE01000001, - 29B97319FDCFA39411CA2CEA, - F58D65DB018F793801000001, - F53321390193CB6A01000001, - 43B962E000617B49416877C2, - F5ACD265C5BE038601000001, - F51BF62A02026DAF01000001, - F5ACD25EC5B5E98D01000001, - F587E16001924C1D01000001, - ); - isa = PBXVariantGroup; - name = MainMenu.nib; - path = ""; - refType = 4; - sourceTree = ""; - }; - 29B97319FDCFA39411CA2CEA = { - isa = PBXFileReference; - lastKnownFileType = wrapper.nib; - name = English; - path = English.lproj/MainMenu.nib; - refType = 4; - sourceTree = ""; - }; - 29B97323FDCFA39411CA2CEA = { - children = ( - 1058C7A0FEA54F0111CA2CBB, - 1058C7A2FEA54F0111CA2CBB, - ); - isa = PBXGroup; - name = Frameworks; - path = ""; - refType = 4; - sourceTree = ""; - }; - 29B97324FDCFA39411CA2CEA = { - isa = PBXFileReference; - lastKnownFileType = wrapper.framework; - name = AppKit.framework; - path = /System/Library/Frameworks/AppKit.framework; - refType = 0; - sourceTree = ""; - }; - 29B97325FDCFA39411CA2CEA = { - isa = PBXFileReference; - lastKnownFileType = wrapper.framework; - name = Foundation.framework; - path = /System/Library/Frameworks/Foundation.framework; - refType = 0; - sourceTree = ""; - }; -//290 -//291 -//292 -//293 -//294 -//320 -//321 -//322 -//323 -//324 - 32FEE13C00E07C3E7F000001 = { - children = ( - F5269C2D01D5BC3501000001, - F5269C2E01D5BC3501000001, - ); - isa = PBXGroup; - name = "Old Cocoa Imp"; - path = ""; - refType = 4; - sourceTree = ""; - }; -//320 -//321 -//322 -//323 -//324 -//350 -//351 -//352 -//353 -//354 - 3576829A0077B8F17F000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = quartzCursor.c; - refType = 4; - sourceTree = ""; - }; -//350 -//351 -//352 -//353 -//354 -//3E0 -//3E1 -//3E2 -//3E3 -//3E4 - 3E74E03600863F047F000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = darwinClut8.h; - refType = 4; - sourceTree = ""; - }; -//3E0 -//3E1 -//3E2 -//3E3 -//3E4 -//430 -//431 -//432 -//433 -//434 - 43B962CE00617089416877C2 = { - children = ( - 6EE9B21604E859C200CA7FEA, - 6E97A0F505079F9100B8294C, - 6E5F5F030553815A008FEAD7, - 6E5F5F040553815A008FEAD7, - 018F40F8003E1979CE6F79C2, - 018F40FA003E197ECE6F79C2, - 237A34C10076E37E7F000001, - 237A34C40076F4F07F000001, - 43B962CF00617089416877C2, - F5582948015DAD3B01000001, - 6E5F5F0105537A5F008FEAD7, - 43B962D000617089416877C2, - 43B962D100617089416877C2, - 02A1FEA8006D38F0416877C2, - ); - isa = PBXGroup; - name = Quartz; - path = ""; - refType = 4; - sourceTree = ""; - }; - 43B962CF00617089416877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.objc; - path = quartzCocoa.m; - refType = 4; - sourceTree = ""; - }; - 43B962D000617089416877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = quartzPasteboard.c; - refType = 4; - sourceTree = ""; - }; - 43B962D100617089416877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = quartzPasteboard.h; - refType = 4; - sourceTree = ""; - }; - 43B962E000617B49416877C2 = { - isa = PBXFileReference; - lastKnownFileType = wrapper.nib; - name = Japanese; - path = Japanese.lproj/MainMenu.nib; - refType = 4; - sourceTree = ""; - }; - 43B962E100617B49416877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = text.plist.strings; - name = Japanese; - path = Japanese.lproj/InfoPlist.strings; - refType = 4; - sourceTree = ""; - }; - 43B962E200617B93416877C2 = { - isa = PBXFileReference; - lastKnownFileType = text.rtf; - name = Japanese; - path = Japanese.lproj/Credits.rtf; - refType = 4; - sourceTree = ""; - }; - 43B962E300617B93416877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = text.html; - name = Japanese; - path = Japanese.lproj/XDarwinHelp.html; - refType = 4; - sourceTree = ""; - }; -//430 -//431 -//432 -//433 -//434 -//6E0 -//6E1 -//6E2 -//6E3 -//6E4 - 6E11A97F048BDFEE006877C2 = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXHeadersBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 6E11A980048BDFEE006877C2 = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXResourcesBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 6E11A981048BDFEE006877C2 = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXSourcesBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 6E11A982048BDFEE006877C2 = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXFrameworksBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 6E11A983048BDFEE006877C2 = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXRezBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 6E11A984048BDFEE006877C2 = { - buildPhases = ( - 6E11A97F048BDFEE006877C2, - 6E11A980048BDFEE006877C2, - 6E11A981048BDFEE006877C2, - 6E11A982048BDFEE006877C2, - 6E11A983048BDFEE006877C2, - ); - buildSettings = { - OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ""; - OTHER_REZFLAGS = ""; - PRODUCT_NAME = glxCGL; - SECTORDER_FLAGS = ""; - WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas"; - WRAPPER_EXTENSION = bundle; - }; - dependencies = ( - ); - isa = PBXBundleTarget; - name = glxCGL; - productInstallPath = "$(USER_LIBRARY_DIR)/Bundles"; - productName = glxCGL; - productReference = 6E11A985048BDFEE006877C2; - productSettingsXML = " - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - glxCGL - CFBundleGetInfoString - - CFBundleIconFile - - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - GLX bundle using Apple's OpenGL - CFBundlePackageType - BNDL - CFBundleShortVersionString - 0.1 - CFBundleSignature - ???? - CFBundleVersion - 0.1 - - -"; - }; - 6E11A985048BDFEE006877C2 = { - explicitFileType = wrapper.cfbundle; - isa = PBXFileReference; - path = glxCGL.bundle; - refType = 3; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 6E11A986048BDFFB006877C2 = { - isa = PBXTargetDependency; - target = 6E11A984048BDFEE006877C2; - targetProxy = 6E4CAF650702464F001A7398; - }; - 6E4CAF630702464F001A7398 = { - containerPortal = 29B97313FDCFA39411CA2CEA; - isa = PBXContainerItemProxy; - proxyType = 1; - remoteGlobalIDString = 6EF7C58603D3BC6D00000104; - remoteInfo = glxAGL; - }; - 6E4CAF640702464F001A7398 = { - containerPortal = 29B97313FDCFA39411CA2CEA; - isa = PBXContainerItemProxy; - proxyType = 1; - remoteGlobalIDString = 6E79040F0500F05600EEC080; - remoteInfo = xpr; - }; - 6E4CAF650702464F001A7398 = { - containerPortal = 29B97313FDCFA39411CA2CEA; - isa = PBXContainerItemProxy; - proxyType = 1; - remoteGlobalIDString = 6E11A984048BDFEE006877C2; - remoteInfo = glxCGL; - }; - 6E4CAF660702464F001A7398 = { - containerPortal = 29B97313FDCFA39411CA2CEA; - isa = PBXContainerItemProxy; - proxyType = 1; - remoteGlobalIDString = 6EF065C503D4EE19006877C2; - remoteInfo = glxMesa; - }; - 6E5F5F0005537A1A008FEAD7 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = darwinKeyboard.h; - refType = 4; - sourceTree = ""; - }; - 6E5F5F0105537A5F008FEAD7 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = quartzKeyboard.c; - refType = 4; - sourceTree = ""; - }; - 6E5F5F030553815A008FEAD7 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = keysym2ucs.c; - refType = 4; - sourceTree = ""; - }; - 6E5F5F040553815A008FEAD7 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = keysym2ucs.h; - refType = 4; - sourceTree = ""; - }; - 6E6656EC048832CF006877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = "x-hook.c"; - refType = 4; - sourceTree = ""; - }; - 6E6656ED048832CF006877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = "x-hook.h"; - refType = 4; - sourceTree = ""; - }; - 6E6656F0048832EC006877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = dri.c; - refType = 4; - sourceTree = ""; - }; - 6E6656F1048832EC006877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = dri.h; - refType = 4; - sourceTree = ""; - }; - 6E6656F2048832EC006877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = dristruct.h; - refType = 4; - sourceTree = ""; - }; - 6E6656F3048832F9006877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = appledri.c; - refType = 4; - sourceTree = ""; - }; - 6E79040104FD5ED900EEC080 = { - children = ( - 6E79040204FD5EDA00EEC080, - 6E79040304FD5EDA00EEC080, - 6E79040404FD5EDA00EEC080, - ); - isa = PBXGroup; - name = "Safe Alpha"; - path = safeAlpha; - refType = 4; - sourceTree = ""; - }; - 6E79040204FD5EDA00EEC080 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = safeAlpha.h; - refType = 4; - sourceTree = ""; - }; - 6E79040304FD5EDA00EEC080 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = safeAlphaPicture.c; - refType = 4; - sourceTree = ""; - }; - 6E79040404FD5EDA00EEC080 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = safeAlphaWindow.c; - refType = 4; - sourceTree = ""; - }; - 6E79040A0500F05600EEC080 = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXHeadersBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 6E79040B0500F05600EEC080 = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXResourcesBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 6E79040C0500F05600EEC080 = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXSourcesBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 6E79040D0500F05600EEC080 = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXFrameworksBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 6E79040E0500F05600EEC080 = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXRezBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 6E79040F0500F05600EEC080 = { - buildPhases = ( - 6E79040A0500F05600EEC080, - 6E79040B0500F05600EEC080, - 6E79040C0500F05600EEC080, - 6E79040D0500F05600EEC080, - 6E79040E0500F05600EEC080, - ); - buildSettings = { - OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ""; - OTHER_REZFLAGS = ""; - PRODUCT_NAME = xpr; - SECTORDER_FLAGS = ""; - WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas"; - WRAPPER_EXTENSION = bundle; - }; - dependencies = ( - ); - isa = PBXBundleTarget; - name = xpr; - productInstallPath = "$(USER_LIBRARY_DIR)/Bundles"; - productName = xpr; - productReference = 6E7904100500F05600EEC080; - productSettingsXML = " - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - xpr - CFBundleGetInfoString - - CFBundleIconFile - - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - Xplugin rootless implementation - CFBundlePackageType - BNDL - CFBundleShortVersionString - 0.1 - CFBundleSignature - ???? - CFBundleVersion - 0.1 - - -"; - }; - 6E7904100500F05600EEC080 = { - explicitFileType = wrapper.cfbundle; - isa = PBXFileReference; - path = xpr.bundle; - refType = 3; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 6E7904110500F33B00EEC080 = { - isa = PBXTargetDependency; - target = 6E79040F0500F05600EEC080; - targetProxy = 6E4CAF640702464F001A7398; - }; - 6E97A0F2050798B100B8294C = { - fileEncoding = 4; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = xprAppleWM.c; - refType = 4; - sourceTree = ""; - }; - 6E97A0F305079B6500B8294C = { - fileEncoding = 4; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.objc; - path = crAppleWM.m; - refType = 4; - sourceTree = ""; - }; - 6E97A0F505079F9100B8294C = { - fileEncoding = 4; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = applewmExt.h; - refType = 4; - sourceTree = ""; - }; - 6EA0B3AF0544A9CC006877C2 = { - children = ( - 6EA0B3B00544A9CC006877C2, - 6EA0B3B10544A9CC006877C2, - 6EA0B3B20544A9CC006877C2, - 6EA0B3B30544A9CC006877C2, - 6EA0B3B40544A9CC006877C2, - 6EA0B3B50544A9CC006877C2, - 6EA0B3B60544A9CC006877C2, - 6EA0B3B70544A9CC006877C2, - ); - isa = PBXGroup; - name = Acceleration; - path = accel; - refType = 4; - sourceTree = ""; - }; - 6EA0B3B00544A9CC006877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = rlAccel.h; - refType = 4; - sourceTree = ""; - }; - 6EA0B3B10544A9CC006877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = rlBlt.c; - refType = 4; - sourceTree = ""; - }; - 6EA0B3B20544A9CC006877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = rlCopy.c; - refType = 4; - sourceTree = ""; - }; - 6EA0B3B30544A9CC006877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = rlFill.c; - refType = 4; - sourceTree = ""; - }; - 6EA0B3B40544A9CC006877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = rlFillRect.c; - refType = 4; - sourceTree = ""; - }; - 6EA0B3B50544A9CC006877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = rlFillSpans.c; - refType = 4; - sourceTree = ""; - }; - 6EA0B3B60544A9CC006877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = rlGlyph.c; - refType = 4; - sourceTree = ""; - }; - 6EA0B3B70544A9CC006877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = rlSolid.c; - refType = 4; - sourceTree = ""; - }; - 6EA8EEC80445E25C006877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = rootlessConfig.h; - refType = 4; - sourceTree = ""; - }; - 6EC4A64C042A9597006877C2 = { - children = ( - 6EC4A65D042A9654006877C2, - 6EC4A65E042A9654006877C2, - 6EC4A65F042A9654006877C2, - 6EA8EEC80445E25C006877C2, - 6EC4A661042A9654006877C2, - 6EC4A662042A9654006877C2, - 6EC4A660042A9654006877C2, - 6EC4A663042A9654006877C2, - 6EC4A664042A9654006877C2, - 6EA0B3AF0544A9CC006877C2, - 6E79040104FD5ED900EEC080, - ); - isa = PBXGroup; - name = Rootless; - path = ../../../miext/rootless; - refType = 2; - sourceTree = SOURCE_ROOT; - }; - 6EC4A65D042A9654006877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = rootless.h; - refType = 4; - sourceTree = ""; - }; - 6EC4A65E042A9654006877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = rootlessCommon.c; - refType = 4; - sourceTree = ""; - }; - 6EC4A65F042A9654006877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = rootlessCommon.h; - refType = 4; - sourceTree = ""; - }; - 6EC4A660042A9654006877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = rootlessWindow.h; - refType = 4; - sourceTree = ""; - }; - 6EC4A661042A9654006877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = rootlessScreen.c; - refType = 4; - sourceTree = ""; - }; - 6EC4A662042A9654006877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = rootlessWindow.c; - refType = 4; - sourceTree = ""; - }; - 6EC4A663042A9654006877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = rootlessGC.c; - refType = 4; - sourceTree = ""; - }; - 6EC4A664042A9654006877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = rootlessValTree.c; - refType = 4; - sourceTree = ""; - }; - 6EC4A66D042A97FC006877C2 = { - children = ( - 6EF471A004478DE0006877C2, - 6E6656F3048832F9006877C2, - 6E6656F0048832EC006877C2, - 6E6656F1048832EC006877C2, - 6E6656F2048832EC006877C2, - 6ECF218404589E4D006877C2, - 6E97A0F2050798B100B8294C, - 6ECF218604589F40006877C2, - 6EF4719E04478B08006877C2, - 6EDDB2DF04508B2C006877C2, - 6EF471A204479263006877C2, - 6EF471A404479263006877C2, - 6E6656EC048832CF006877C2, - 6E6656ED048832CF006877C2, - 6EF471A504479263006877C2, - 6EF471A304479263006877C2, - ); - isa = PBXGroup; - path = xpr; - refType = 4; - sourceTree = ""; - }; - 6ECF218404589E4D006877C2 = { - fileEncoding = 4; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = xpr.h; - refType = 4; - sourceTree = ""; - }; - 6ECF218604589F40006877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = xprCursor.c; - refType = 4; - sourceTree = ""; - }; - 6EDDB2DF04508B2C006877C2 = { - fileEncoding = 4; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = xprScreen.c; - refType = 4; - sourceTree = ""; - }; - 6EE1214104968658006877C2 = { - children = ( - 6EE1214304968692006877C2, - 6EE1214404968692006877C2, - 6EE1214204968692006877C2, - 6E97A0F305079B6500B8294C, - 6EE1214504968692006877C2, - 6EE1214604968692006877C2, - ); - isa = PBXGroup; - path = cr; - refType = 4; - sourceTree = ""; - }; - 6EE1214204968692006877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = cr.h; - refType = 4; - sourceTree = ""; - }; - 6EE1214304968692006877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.objc; - path = XView.m; - refType = 4; - sourceTree = ""; - }; - 6EE1214404968692006877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = XView.h; - refType = 4; - sourceTree = ""; - }; - 6EE1214504968692006877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.objc; - path = crFrame.m; - refType = 4; - sourceTree = ""; - }; - 6EE1214604968692006877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.objc; - path = crScreen.m; - refType = 4; - sourceTree = ""; - }; - 6EE9B21604E859C200CA7FEA = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = applewm.c; - refType = 4; - sourceTree = ""; - }; - 6EF065C003D4EE19006877C2 = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXHeadersBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 6EF065C103D4EE19006877C2 = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXResourcesBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 6EF065C203D4EE19006877C2 = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXSourcesBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 6EF065C303D4EE19006877C2 = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXFrameworksBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 6EF065C403D4EE19006877C2 = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXRezBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 6EF065C503D4EE19006877C2 = { - buildPhases = ( - 6EF065C003D4EE19006877C2, - 6EF065C103D4EE19006877C2, - 6EF065C203D4EE19006877C2, - 6EF065C303D4EE19006877C2, - 6EF065C403D4EE19006877C2, - ); - buildSettings = { - OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ""; - OTHER_REZFLAGS = ""; - PRODUCT_NAME = glxMesa; - SECTORDER_FLAGS = ""; - WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas"; - WRAPPER_EXTENSION = bundle; - }; - dependencies = ( - ); - isa = PBXBundleTarget; - name = glxMesa; - productInstallPath = "$(USER_LIBRARY_DIR)/Bundles"; - productName = glxMesa; - productReference = 6EF065C603D4EE19006877C2; - productSettingsXML = " - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - glxMesa - CFBundleGetInfoString - - CFBundleIconFile - - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - GLX bundle with Mesa - CFBundlePackageType - BNDL - CFBundleShortVersionString - 0.1 - CFBundleSignature - ???? - CFBundleVersion - 0.1 - - -"; - }; - 6EF065C603D4EE19006877C2 = { - explicitFileType = wrapper.cfbundle; - isa = PBXFileReference; - path = glxMesa.bundle; - refType = 3; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 6EF065C703D4EE19006877C2 = { - isa = PBXTargetDependency; - target = 6EF065C503D4EE19006877C2; - targetProxy = 6E4CAF660702464F001A7398; - }; - 6EF065C903D4F0CA006877C2 = { - isa = PBXTargetDependency; - target = 6EF7C58603D3BC6D00000104; - targetProxy = 6E4CAF630702464F001A7398; - }; - 6EF4719E04478B08006877C2 = { - fileEncoding = 4; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = xprFrame.c; - refType = 4; - sourceTree = ""; - }; - 6EF471A004478DE0006877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = Xplugin.h; - refType = 4; - sourceTree = ""; - }; - 6EF471A204479263006877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = "x-hash.c"; - refType = 4; - sourceTree = ""; - }; - 6EF471A304479263006877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = "x-list.h"; - refType = 4; - sourceTree = ""; - }; - 6EF471A404479263006877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = "x-hash.h"; - refType = 4; - sourceTree = ""; - }; - 6EF471A504479263006877C2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = "x-list.c"; - refType = 4; - sourceTree = ""; - }; - 6EF7C58103D3BC6D00000104 = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXHeadersBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 6EF7C58203D3BC6D00000104 = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXResourcesBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 6EF7C58303D3BC6D00000104 = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXSourcesBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 6EF7C58403D3BC6D00000104 = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXFrameworksBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 6EF7C58503D3BC6D00000104 = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXRezBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 6EF7C58603D3BC6D00000104 = { - buildPhases = ( - 6EF7C58103D3BC6D00000104, - 6EF7C58203D3BC6D00000104, - 6EF7C58303D3BC6D00000104, - 6EF7C58403D3BC6D00000104, - 6EF7C58503D3BC6D00000104, - ); - buildSettings = { - OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ""; - OTHER_REZFLAGS = ""; - PRODUCT_NAME = glxAGL; - SECTORDER_FLAGS = ""; - WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas"; - WRAPPER_EXTENSION = bundle; - }; - dependencies = ( - ); - isa = PBXBundleTarget; - name = glxAGL; - productName = glxAGL; - productReference = 6EF7C58703D3BC6D00000104; - productSettingsXML = " - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - glxAGL - CFBundleGetInfoString - - CFBundleIconFile - - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - GLX bundle using AGL framework - CFBundlePackageType - BNDL - CFBundleShortVersionString - 0.1 - CFBundleSignature - ???? - CFBundleVersion - 0.1 - - -"; - }; - 6EF7C58703D3BC6D00000104 = { - explicitFileType = wrapper.cfbundle; - isa = PBXFileReference; - path = glxAGL.bundle; - refType = 3; - sourceTree = BUILT_PRODUCTS_DIR; - }; -//6E0 -//6E1 -//6E2 -//6E3 -//6E4 -//F50 -//F51 -//F52 -//F53 -//F54 - F51BF62A02026DAF01000001 = { - isa = PBXFileReference; - lastKnownFileType = wrapper.nib; - name = Portuguese; - path = Portuguese.lproj/MainMenu.nib; - refType = 4; - sourceTree = ""; - }; - F51BF62B02026DDA01000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = text.plist.strings; - name = Portuguese; - path = Portuguese.lproj/InfoPlist.strings; - refType = 4; - sourceTree = ""; - }; - F51BF62C02026E0601000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.cpp.cpp; - name = Portuguese; - path = Portuguese.lproj/InfoPlist.strings.cpp; - refType = 4; - sourceTree = ""; - }; - F51BF62D02026E1C01000001 = { - fileEncoding = 10; - isa = PBXFileReference; - lastKnownFileType = text.plist.strings; - name = Portuguese; - path = Portuguese.lproj/Localizable.strings; - refType = 4; - sourceTree = ""; - }; - F51BF62E02026E3501000001 = { - isa = PBXFileReference; - lastKnownFileType = text.rtf; - name = Portuguese; - path = Portuguese.lproj/Credits.rtf; - refType = 4; - sourceTree = ""; - }; - F51BF62F02026E5C01000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = text.html; - name = Portuguese; - path = Portuguese.lproj/XDarwinHelp.html; - refType = 4; - sourceTree = ""; - }; - F51BF63002026E8D01000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.cpp.cpp; - name = Portuguese; - path = Portuguese.lproj/XDarwinHelp.html.cpp; - refType = 4; - sourceTree = ""; - }; - F5269C2D01D5BC3501000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = pseudoramiX.c; - refType = 4; - sourceTree = ""; - }; - F5269C2E01D5BC3501000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = pseudoramiX.h; - refType = 4; - sourceTree = ""; - }; - F53321390193CB6A01000001 = { - isa = PBXFileReference; - lastKnownFileType = wrapper.nib; - name = German; - path = German.lproj/MainMenu.nib; - refType = 4; - sourceTree = ""; - }; - F533213A0193CBA201000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = text.plist.strings; - name = German; - path = German.lproj/InfoPlist.strings; - refType = 4; - sourceTree = ""; - }; - F533213B0193CBB401000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.cpp.cpp; - name = German; - path = German.lproj/InfoPlist.strings.cpp; - refType = 4; - sourceTree = ""; - }; - F533213C0193CBC901000001 = { - fileEncoding = 10; - isa = PBXFileReference; - lastKnownFileType = text.plist.strings; - name = German; - path = German.lproj/Localizable.strings; - refType = 4; - sourceTree = ""; - }; - F533213D0193CBE001000001 = { - isa = PBXFileReference; - lastKnownFileType = text.rtf; - name = German; - path = German.lproj/Credits.rtf; - refType = 4; - sourceTree = ""; - }; - F533213E0193CBF401000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = text.html; - name = German; - path = German.lproj/XDarwinHelp.html; - refType = 4; - sourceTree = ""; - }; - F533213F0193CC2501000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.cpp.cpp; - name = German; - path = German.lproj/XDarwinHelp.html.cpp; - refType = 4; - sourceTree = ""; - }; - F53321400193CCF001000001 = { - isa = PBXFileReference; - lastKnownFileType = wrapper.framework; - name = ApplicationServices.framework; - path = /System/Library/Frameworks/ApplicationServices.framework; - refType = 0; - sourceTree = ""; - }; - F53321410193CCF001000001 = { - isa = PBXFileReference; - lastKnownFileType = wrapper.framework; - name = CoreAudio.framework; - path = /System/Library/Frameworks/CoreAudio.framework; - refType = 0; - sourceTree = ""; - }; - F533214201A4B3CE01000001 = { - isa = PBXFileReference; - lastKnownFileType = wrapper.nib; - name = Dutch; - path = Dutch.lproj/MainMenu.nib; - refType = 4; - sourceTree = ""; - }; - F533214301A4B3F001000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = text.plist.strings; - name = Dutch; - path = Dutch.lproj/InfoPlist.strings; - refType = 4; - sourceTree = ""; - }; - F533214401A4B40F01000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.cpp.cpp; - name = Dutch; - path = Dutch.lproj/InfoPlist.strings.cpp; - refType = 4; - sourceTree = ""; - }; - F533214501A4B42501000001 = { - fileEncoding = 10; - isa = PBXFileReference; - lastKnownFileType = text.plist.strings; - name = Dutch; - path = Dutch.lproj/Localizable.strings; - refType = 4; - sourceTree = ""; - }; - F533214601A4B45401000001 = { - isa = PBXFileReference; - lastKnownFileType = text.rtf; - name = Dutch; - path = Dutch.lproj/Credits.rtf; - refType = 4; - sourceTree = ""; - }; - F533214701A4B48301000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = text.html; - name = Dutch; - path = Dutch.lproj/XDarwinHelp.html; - refType = 4; - sourceTree = ""; - }; - F533214801A4B4D701000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.cpp.cpp; - name = Dutch; - path = Dutch.lproj/XDarwinHelp.html.cpp; - refType = 4; - sourceTree = ""; - }; - F54BF6EA017D500901000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.cpp.cpp; - path = startXClients.cpp; - refType = 4; - sourceTree = ""; - }; - F54BF6EC017D506E01000001 = { - isa = PBXFileReference; - lastKnownFileType = text.script.sh; - path = startXClients; - refType = 4; - sourceTree = ""; - }; - F54BF6ED017D506E01000001 = { - fileRef = F54BF6EC017D506E01000001; - isa = PBXBuildFile; - settings = { - }; - }; - F5582948015DAD3B01000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = quartzCommon.h; - refType = 4; - sourceTree = ""; - }; - F5614B3B0251124C01000114 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = fullscreen.c; - refType = 4; - sourceTree = ""; - }; - F5614B3D025112D901000114 = { - children = ( - F5614B3B0251124C01000114, - 3576829A0077B8F17F000001, - 0338412F0083BFE57F000001, - ); - isa = PBXGroup; - path = fullscreen; - refType = 4; - sourceTree = ""; - }; - F587E16001924C1D01000001 = { - isa = PBXFileReference; - lastKnownFileType = wrapper.nib; - name = Swedish; - path = Swedish.lproj/MainMenu.nib; - refType = 4; - sourceTree = ""; - }; - F587E16101924C2F01000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = text.plist.strings; - name = Swedish; - path = Swedish.lproj/InfoPlist.strings; - refType = 4; - sourceTree = ""; - }; - F587E16201924C5301000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.cpp.cpp; - name = Swedish; - path = Swedish.lproj/InfoPlist.strings.cpp; - refType = 4; - sourceTree = ""; - }; - F587E16301924C5E01000001 = { - fileEncoding = 10; - isa = PBXFileReference; - lastKnownFileType = text.plist.strings; - name = Swedish; - path = Swedish.lproj/Localizable.strings; - refType = 4; - sourceTree = ""; - }; - F587E16401924C6901000001 = { - isa = PBXFileReference; - lastKnownFileType = text.rtf; - name = Swedish; - path = Swedish.lproj/Credits.rtf; - refType = 4; - sourceTree = ""; - }; - F587E16501924C7401000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = text.html; - name = Swedish; - path = Swedish.lproj/XDarwinHelp.html; - refType = 4; - sourceTree = ""; - }; - F587E16601924C9D01000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.cpp.cpp; - name = Swedish; - path = Swedish.lproj/XDarwinHelp.html.cpp; - refType = 4; - sourceTree = ""; - }; - F58D65DB018F793801000001 = { - isa = PBXFileReference; - lastKnownFileType = wrapper.nib; - name = French; - path = French.lproj/MainMenu.nib; - refType = 4; - sourceTree = ""; - }; - F58D65DC018F794D01000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.cpp.cpp; - name = French; - path = French.lproj/InfoPlist.strings.cpp; - refType = 4; - sourceTree = ""; - }; - F58D65DD018F798F01000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = text.plist.strings; - name = French; - path = French.lproj/InfoPlist.strings; - refType = 4; - sourceTree = ""; - }; - F58D65DE018F79A001000001 = { - fileEncoding = 10; - isa = PBXFileReference; - lastKnownFileType = text.plist.strings; - name = French; - path = French.lproj/Localizable.strings; - refType = 4; - sourceTree = ""; - }; - F58D65DF018F79B101000001 = { - isa = PBXFileReference; - lastKnownFileType = text.rtf; - name = French; - path = French.lproj/Credits.rtf; - refType = 4; - sourceTree = ""; - }; - F58D65E0018F79C001000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = text.html; - name = French; - path = French.lproj/XDarwinHelp.html; - refType = 4; - sourceTree = ""; - }; - F58D65E1018F79E001000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.cpp.cpp; - name = French; - path = French.lproj/XDarwinHelp.html.cpp; - refType = 4; - sourceTree = ""; - }; - F5A94EF10314BAC70100011B = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = darwinEvents.c; - refType = 4; - sourceTree = ""; - }; - F5ACD25CC5B5E96601000001 = { - isa = PBXFileReference; - lastKnownFileType = text.rtf; - name = Spanish; - path = Spanish.lproj/Credits.rtf; - refType = 4; - sourceTree = ""; - }; - F5ACD25DC5B5E97701000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.cpp.cpp; - name = Spanish; - path = Spanish.lproj/InfoPlist.strings.cpp; - refType = 4; - sourceTree = ""; - }; - F5ACD25EC5B5E98D01000001 = { - isa = PBXFileReference; - lastKnownFileType = wrapper.nib; - name = Spanish; - path = Spanish.lproj/MainMenu.nib; - refType = 4; - sourceTree = ""; - }; - F5ACD25FC5B5E9AA01000001 = { - fileEncoding = 10; - isa = PBXFileReference; - lastKnownFileType = text.plist.strings; - name = Spanish; - path = Spanish.lproj/Localizable.strings; - refType = 4; - sourceTree = ""; - }; - F5ACD260C5B5E9DF01000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.cpp.cpp; - name = Spanish; - path = Spanish.lproj/XDarwinHelp.html.cpp; - refType = 4; - sourceTree = ""; - }; - F5ACD261C5B5EA2001000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = text.html; - name = Spanish; - path = Spanish.lproj/XDarwinHelp.html; - refType = 4; - sourceTree = ""; - }; - F5ACD262C5B5EA4D01000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = text.plist.strings; - name = Spanish; - path = Spanish.lproj/InfoPlist.strings; - refType = 4; - sourceTree = ""; - }; - F5ACD263C5BE031F01000001 = { - isa = PBXFileReference; - lastKnownFileType = text.rtf; - name = ko; - path = ko.lproj/Credits.rtf; - refType = 4; - sourceTree = ""; - }; - F5ACD264C5BE035B01000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.cpp.cpp; - name = ko; - path = ko.lproj/InfoPlist.strings.cpp; - refType = 4; - sourceTree = ""; - }; - F5ACD265C5BE038601000001 = { - isa = PBXFileReference; - lastKnownFileType = wrapper.nib; - name = ko; - path = ko.lproj/MainMenu.nib; - refType = 4; - sourceTree = ""; - }; - F5ACD266C5BE03C501000001 = { - fileEncoding = 10; - isa = PBXFileReference; - lastKnownFileType = text.plist.strings; - name = ko; - path = ko.lproj/Localizable.strings; - refType = 4; - sourceTree = ""; - }; - F5ACD267C5BE03FC01000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.cpp.cpp; - name = ko; - path = ko.lproj/XDarwinHelp.html.cpp; - refType = 4; - sourceTree = ""; - }; - F5ACD268C5BE046401000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = text.html; - name = ko; - path = ko.lproj/XDarwinHelp.html; - refType = 4; - sourceTree = ""; - }; - F5ACD269C5BE049301000001 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = text.plist.strings; - name = ko; - path = ko.lproj/InfoPlist.strings; - refType = 4; - sourceTree = ""; - }; - }; - rootObject = 29B97313FDCFA39411CA2CEA; -} diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/XDarwinStartup.c b/nx-X11/programs/Xserver/hw/darwin/quartz/XDarwinStartup.c deleted file mode 100644 index 0adb4c212..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/XDarwinStartup.c +++ /dev/null @@ -1,164 +0,0 @@ -/************************************************************** - * - * Startup program for Darwin X servers - * - * This program selects the appropriate X server to launch: - * XDarwin IOKit X server (default) - * XDarwinQuartz A soft link to the Quartz X server - * executable (-quartz etc. option) - * - * If told to idle, the program will simply pause and not - * launch any X server. This is to support startx being - * run by XDarwin.app. - * - **************************************************************/ -/* - * Copyright (c) 2001-2002 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * TORREY T. LYONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF - * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * Except as contained in this notice, the name of Torrey T. Lyons shall not - * be used in advertising or otherwise to promote the sale, use or other - * dealings in this Software without prior written authorization from - * Torrey T. Lyons. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XDarwinStartup.c,v 1.1 2002/03/28 02:21:18 torrey Exp $ */ - -#include -#include -#include -#include -#include -#include - -// Macros to build the path name -#ifndef XBINDIR -#define XBINDIR /usr/X11R6/bin -#endif -#define STR(s) #s -#define XSTRPATH(s) STR(s) "/" -#define XPATH(file) XSTRPATH(XBINDIR) STR(file) - -int main( - int argc, - char *argv[] ) -{ - int i, j, quartzMode = -1; - char **newargv; - - // Check if we are going to run in Quartz mode or idle - // to support startx from the Quartz server. The last - // parameter in the list is the one used. - for (i = argc-1; i; i--) { - if (!strcmp(argv[i], "-idle")) { - pause(); - return 0; - - } else if (!strcmp(argv[i], "-quartz") || - !strcmp(argv[i], "-rootless") || - !strcmp(argv[i], "-fullscreen")) - { - quartzMode = 1; - break; - - } else if (!strcmp(argv[i], "-iokit")) { - quartzMode = 0; - break; - } - } - - if (quartzMode == -1) { -#ifdef HAS_CG_MACH_PORT - // Check if the CoreGraphics window server is running. - // Mike Paquette says this is the fastest way to determine if it is running. - CFMachPortRef cgMachPortRef = CGWindowServerCFMachPort(); - if (cgMachPortRef == NULL) - quartzMode = 0; - else - quartzMode = 1; -#else - // On older systems we assume IOKit mode. - quartzMode = 0; -#endif - } - - if (quartzMode) { - // Launch the X server for the quartz modes - - char quartzPath[PATH_MAX+1]; - int pathLength; - OSStatus theStatus; - CFURLRef appURL; - CFStringRef appPath; - Boolean success; - - // Build the new argument list - newargv = (char **) malloc((argc+2) * sizeof(char *)); - for (j = argc; j; j--) - newargv[j] = argv[j]; - newargv[argc] = "-nostartx"; - newargv[argc+1] = NULL; - - // Use the XDarwinQuartz soft link if it is valid - pathLength = readlink(XPATH(XDarwinQuartz), quartzPath, PATH_MAX); - if (pathLength != -1) { - quartzPath[pathLength] = '\0'; - newargv[0] = quartzPath; - execv(newargv[0], newargv); - } - - // Otherwise query LaunchServices for the location of the XDarwin application - theStatus = LSFindApplicationForInfo(kLSUnknownCreator, - CFSTR("org.xfree86.XDarwin"), - NULL, NULL, &appURL); - if (theStatus) { - fprintf(stderr, "Could not find the XDarwin application. (Error = 0x%lx)\n", theStatus); - fprintf(stderr, "Launch XDarwin once from the Finder.\n"); - return theStatus; - } - - appPath = CFURLCopyFileSystemPath (appURL, kCFURLPOSIXPathStyle); - success = CFStringGetCString(appPath, quartzPath, PATH_MAX, CFStringGetSystemEncoding()); - if (! success) { - fprintf(stderr, "Could not find path to XDarwin application.\n"); - return success; - } - - // Launch the XDarwin application - strncat(quartzPath, "/Contents/MacOS/XDarwin", PATH_MAX); - newargv[0] = quartzPath; - execv(newargv[0], newargv); - fprintf(stderr, "Could not start XDarwin application at %s.\n", newargv[0]); - return errno; - - } else { - - // Build the new argument list - newargv = (char **) malloc((argc+1) * sizeof(char *)); - for (j = argc; j; j--) - newargv[j] = argv[j]; - newargv[0] = "XDarwin"; - newargv[argc] = NULL; - - // Launch the IOKit X server - execvp(newargv[0], newargv); - fprintf(stderr, "Could not start XDarwin IOKit X server.\n"); - return errno; - } -} diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/XDarwinStartup.man b/nx-X11/programs/Xserver/hw/darwin/quartz/XDarwinStartup.man deleted file mode 100644 index 28efd1edf..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/XDarwinStartup.man +++ /dev/null @@ -1,75 +0,0 @@ -.\" $XFree86: xc/programs/Xserver/hw/darwin/bundle/XDarwinStartup.man,v 1.1 2002/02/05 19:16:14 torrey Exp $ -.TH XDarwinStartup 1 -.SH NAME -XDarwinStartup - Startup program for the XDarwin X window server -.SH SYNOPSIS -.B XDarwinStartup -[\fI-iokit\fP] -[\fI-fullscreen\fP] -[\fI-rootless\fP] -[\fI-quartz\fP] -[\fI-idle\fP] -[\fIoptions\fP] -.SH DESCRIPTION -The \fIXDarwin(1)\fP X window server can be run in a variety of different -modes and is actually two different executables. The IOKit X server, -XDarwin, is used when running from the console. It is most commonly -located in __XBinDir__. The Quartz X server, for running in parallel with -Aqua, is a full-fledged Mac OS X application that can be started from -the Finder. Its application bundle is XDarwin.app, which is typically -located in /Applications. -.I XDarwinStartup -allows easy switching between these X servers and auto-detection of the -appropriate one to use when launching from the command line. -When run without any arguments, -.I XDarwinStartup -will start the Quartz X server if the Core Graphics window server -is currently running. Otherwise it will start the IOKit X server. -.PP -To locate the Quartz X server, -.I XDarwinStartup -will try to read the soft link at __XBinDir__/XDarwinQuartz. -This is typically a soft link to the executable of the XDarwin.app -application. If this fails, -.I XDarwinStartup -will call Launch Services to locate XDarwin.app. -.PP -To start the IOKit X server, -.I XDarwinStartup -will run the XDarwin execuatable, which should be present in the -user's path. -.SH OPTIONS -.I XDarwinStartup -accepts and passes on all options to the X server it -launches. In addition the following options have specific effects: -.TP 8 -.B \-iokit -Launch the IOKit X server. -.TP 8 -.B \-fullscreen -Launch the Quartz X server to run in full screen mode. -.TP 8 -.B \-rootless -Launch the Quartz X server to run in rootless mode. -.TP 8 -.B \-quartz -Launch the Quartz X server. -.TP 8 -.B \-idle -Pause and do nothing. This option is used by XDarwin.app when it is -started from the Finder. -.SH FILES -.TP 30 -__XBinDir__/XDarwin -IOKit mode X server -.TP 30 -/Applications/XDarwin.app -Quartz mode X server -.TP 30 -__XBinDir__/XDarwinQuartz -Soft link to Quartz mode X server executable -.SH SEE ALSO -XDarwin(1) -.SH BUGS -The path to XDarwinQuartz should not be hard coded. - diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/XServer.h b/nx-X11/programs/Xserver/hw/darwin/quartz/XServer.h deleted file mode 100644 index 8b45ffc55..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/XServer.h +++ /dev/null @@ -1,138 +0,0 @@ -// -// XServer.h -// -/* - * Copyright (c) 2001 Andreas Monitzer. All Rights Reserved. - * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the - * sale, use or other dealings in this Software without prior written - * authorization. - */ -/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/XServer.h,v 1.5 2005/07/01 22:43:07 daniels Exp $ */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XServer.h,v 1.16 2003/11/23 06:04:01 torrey Exp $ */ - -#define BOOL xBOOL -#include -#undef BOOL - -#import - -@interface XServer : NSObject { - // Server state - int serverState; - NSRecursiveLock *serverLock; - NSMutableArray *pendingClients; - BOOL serverVisible; - BOOL rootlessMenuBarVisible; - BOOL queueShowServer; - BOOL quitWithoutQuery; - BOOL pendingAppQuitReply; - UInt32 mouseState; - unsigned short swallowedKey; - BOOL sendServerEvents; - BOOL x11Active; - - // Aqua interface - IBOutlet NSWindow *modeWindow; - IBOutlet NSButton *startupModeButton; - IBOutlet NSButton *startFullScreenButton; - IBOutlet NSButton *startRootlessButton; - IBOutlet NSWindow *helpWindow; - IBOutlet NSButton *startupHelpButton; - IBOutlet NSPanel *switchWindow; - - // Menu elements setable by Apple-WM extension - IBOutlet NSMenu *windowMenu; - IBOutlet NSMenuItem *windowSeparator; - IBOutlet NSMenu *dockMenu; - int checkedWindowItem; -} - -- (id)init; - -- (BOOL)translateEvent:(NSEvent *)anEvent; -- (BOOL)getMousePosition:(xEvent *)xe fromEvent:(NSEvent *)anEvent; - -- (NSString *)makeSafePath:(NSString *)path; - -- (BOOL)loadDisplayBundle; -- (void)startX; -- (void)finishStartX; -- (BOOL)startXClients; -- (void)runClient:(NSString *)filename; -- (void)run; -- (void)toggle; -- (void)showServer:(BOOL)show; -- (void)forceShowServer:(BOOL)show; -- (void)setRootClip:(BOOL)enable; -- (void)readPasteboard; -- (void)writePasteboard; -- (void)quitServer; -- (void)sendXEvent:(xEvent *)xe; -- (void)sendShowHide:(BOOL)show; -- (void)clientProcessDone:(int)clientStatus; -- (void)activateX11:(BOOL)state; -- (void)windowBecameKey:(NSNotification *)notification; -- (void)setX11WindowList:(NSArray *)list; -- (void)setX11WindowCheck:(NSNumber *)nn; - -// Aqua interface actions -- (IBAction)startFullScreen:(id)sender; -- (IBAction)startRootless:(id)sender; -- (IBAction)closeHelpAndShow:(id)sender; -- (IBAction)showSwitchPanel:(id)sender; -- (IBAction)showAction:(id)sender; -- (IBAction)itemSelected:(id)sender; -- (IBAction)nextWindow:(id)sender; -- (IBAction)previousWindow:(id)sender; -- (IBAction)performClose:(id)sender; -- (IBAction)performMiniaturize:(id)sender; -- (IBAction)performZoom:(id)sender; -- (IBAction)bringAllToFront:(id)sender; -- (IBAction)copy:(id)sender; - -// NSApplication delegate -- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender; -- (void)applicationWillTerminate:(NSNotification *)aNotification; -- (void)applicationDidFinishLaunching:(NSNotification *)aNotification; -- (void)applicationDidHide:(NSNotification *)aNotification; -- (void)applicationDidUnhide:(NSNotification *)aNotification; -- (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication hasVisibleWindows:(BOOL)flag; -- (void)applicationWillResignActive:(NSNotification *)aNotification; -- (void)applicationWillBecomeActive:(NSNotification *)aNotification; -- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename; - -// NSPort delegate -- (void)handlePortMessage:(NSPortMessage *)portMessage; - -@end - -// X server states -enum { - server_NotStarted, - server_Starting, - server_Running, - server_Quitting, - server_Done -}; diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/XServer.m b/nx-X11/programs/Xserver/hw/darwin/quartz/XServer.m deleted file mode 100644 index 613c9c830..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/XServer.m +++ /dev/null @@ -1,1539 +0,0 @@ -// -// XServer.m -// -// This class handles the interaction between the Cocoa front-end -// and the Darwin X server thread. -// -// Created by Andreas Monitzer on January 6, 2001. -// -/* - * Copyright (c) 2001 Andreas Monitzer. All Rights Reserved. - * Copyright (c) 2002-2005 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the - * sale, use or other dealings in this Software without prior written - * authorization. - */ -/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/XServer.m,v 1.4 2005/04/02 02:29:24 torrey Exp $ */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XServer.m,v 1.19 2003/11/24 05:39:01 torrey Exp $ */ - -#include "quartzCommon.h" - -#define BOOL xBOOL -#include "X.h" -#include "Xproto.h" -#include "os.h" -#include "opaque.h" -#include "darwin.h" -#include "quartz.h" -#define _APPLEWM_SERVER_ -#include "applewm.h" -#include "applewmExt.h" -#undef BOOL - -#import "XServer.h" -#import "Preferences.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -// For power management notifications -#import -#import -#import -#import -#import - -// Types of shells -enum { - shell_Unknown, - shell_Bourne, - shell_C -}; - -typedef struct { - char *name; - int type; -} shellList_t; - -static shellList_t const shellList[] = { - { "csh", shell_C }, // standard C shell - { "tcsh", shell_C }, // ... needs no introduction - { "sh", shell_Bourne }, // standard Bourne shell - { "zsh", shell_Bourne }, // Z shell - { "bash", shell_Bourne }, // GNU Bourne again shell - { NULL, shell_Unknown } -}; - -extern int argcGlobal; -extern char **argvGlobal; -extern char **envpGlobal; -extern int main(int argc, char *argv[], char *envp[]); -extern void HideMenuBar(void); -extern void ShowMenuBar(void); -static void childDone(int sig); -static void powerDidChange(void *x, io_service_t y, natural_t messageType, - void *messageArgument); - -static NSPort *signalPort; -static NSPort *returnPort; -static NSPortMessage *signalMessage; -static pid_t clientPID; -static XServer *oneXServer; -static NSRect aquaMenuBarBox; -static io_connect_t root_port; - - -@implementation XServer - -- (id)init -{ - self = [super init]; - oneXServer = self; - - serverState = server_NotStarted; - serverLock = [[NSRecursiveLock alloc] init]; - pendingClients = nil; - clientPID = 0; - sendServerEvents = NO; - x11Active = YES; - serverVisible = NO; - rootlessMenuBarVisible = YES; - queueShowServer = YES; - quartzServerQuitting = NO; - pendingAppQuitReply = NO; - mouseState = 0; - - // set up a port to safely send messages to main thread from server thread - signalPort = [[NSPort port] retain]; - returnPort = [[NSPort port] retain]; - signalMessage = [[NSPortMessage alloc] initWithSendPort:signalPort - receivePort:returnPort components:nil]; - - // set up receiving end - [signalPort setDelegate:self]; - [[NSRunLoop currentRunLoop] addPort:signalPort - forMode:NSDefaultRunLoopMode]; - [[NSRunLoop currentRunLoop] addPort:signalPort - forMode:NSModalPanelRunLoopMode]; - - return self; -} - -- (NSApplicationTerminateReply) - applicationShouldTerminate:(NSApplication *)sender -{ - // Quit if the X server is not running - if ([serverLock tryLock]) { - quartzServerQuitting = YES; - serverState = server_Done; - if (clientPID != 0) - kill(clientPID, SIGINT); - return NSTerminateNow; - } - - // Hide the X server and stop sending it events - [self showServer:NO]; - sendServerEvents = NO; - - if (!quitWithoutQuery && (clientPID != 0 || !quartzStartClients)) { - int but; - - but = NSRunAlertPanel(NSLocalizedString(@"Quit X server?",@""), - NSLocalizedString(@"Quitting the X server will terminate any running X Window System programs.",@""), - NSLocalizedString(@"Quit",@""), - NSLocalizedString(@"Cancel",@""), - nil); - - switch (but) { - case NSAlertDefaultReturn: // quit - break; - case NSAlertAlternateReturn: // cancel - if (serverState == server_Running) - sendServerEvents = YES; - return NSTerminateCancel; - } - } - - quartzServerQuitting = YES; - if (clientPID != 0) - kill(clientPID, SIGINT); - - // At this point the X server is either running or starting. - if (serverState == server_Starting) { - // Quit will be queued later when server is running - pendingAppQuitReply = YES; - return NSTerminateLater; - } else if (serverState == server_Running) { - [self quitServer]; - } - - return NSTerminateNow; -} - -// Ensure that everything has quit cleanly -- (void)applicationWillTerminate:(NSNotification *)aNotification -{ - // Make sure the client process has finished - if (clientPID != 0) { - NSLog(@"Waiting on client process..."); - sleep(2); - - // If the client process hasn't finished yet, kill it off - if (clientPID != 0) { - int clientStatus; - NSLog(@"Killing client process..."); - killpg(clientPID, SIGKILL); - waitpid(clientPID, &clientStatus, 0); - } - } - - // Wait until the X server thread quits - [serverLock lock]; -} - -// returns YES when event was handled -- (BOOL)translateEvent:(NSEvent *)anEvent -{ - xEvent xe; - static BOOL mouse1Pressed = NO; - NSEventType type; - unsigned int flags; - - if (!sendServerEvents) { - return NO; - } - - type = [anEvent type]; - flags = [anEvent modifierFlags]; - - if (!quartzRootless) { - // Check for switch keypress - if ((type == NSKeyDown) && (![anEvent isARepeat]) && - ([anEvent keyCode] == [Preferences keyCode])) - { - unsigned int switchFlags = [Preferences modifiers]; - - // Switch if all the switch modifiers are pressed, while none are - // pressed that should not be, except for caps lock. - if (((flags & switchFlags) == switchFlags) && - ((flags & ~(switchFlags | NSAlphaShiftKeyMask)) == 0)) - { - [self toggle]; - return YES; - } - } - - if (!serverVisible) - return NO; - } - - memset(&xe, 0, sizeof(xe)); - - switch (type) { - case NSLeftMouseUp: - if (quartzRootless && !mouse1Pressed) { - // MouseUp after MouseDown in menu - ignore - return NO; - } - mouse1Pressed = NO; - [self getMousePosition:&xe fromEvent:anEvent]; - xe.u.u.type = ButtonRelease; - xe.u.u.detail = 1; - break; - - case NSLeftMouseDown: - if (quartzRootless) { - // Check that event is in X11 window - if (!quartzProcs->IsX11Window([anEvent window], - [anEvent windowNumber])) - { - if (x11Active) - [self activateX11:NO]; - return NO; - } else { - if (!x11Active) - [self activateX11:YES]; - } - } - mouse1Pressed = YES; - [self getMousePosition:&xe fromEvent:anEvent]; - xe.u.u.type = ButtonPress; - xe.u.u.detail = 1; - break; - - case NSRightMouseUp: - [self getMousePosition:&xe fromEvent:anEvent]; - xe.u.u.type = ButtonRelease; - xe.u.u.detail = 3; - break; - - case NSRightMouseDown: - [self getMousePosition:&xe fromEvent:anEvent]; - xe.u.u.type = ButtonPress; - xe.u.u.detail = 3; - break; - - case NSOtherMouseUp: - { - int hwButton = [anEvent buttonNumber]; - - [self getMousePosition:&xe fromEvent:anEvent]; - xe.u.u.type = ButtonRelease; - xe.u.u.detail = (hwButton == 2) ? hwButton : hwButton + 1; - break; - } - - case NSOtherMouseDown: - { - int hwButton = [anEvent buttonNumber]; - - [self getMousePosition:&xe fromEvent:anEvent]; - xe.u.u.type = ButtonPress; - xe.u.u.detail = (hwButton == 2) ? hwButton : hwButton + 1; - break; - } - - case NSMouseMoved: - case NSLeftMouseDragged: - case NSRightMouseDragged: - case NSOtherMouseDragged: - [self getMousePosition:&xe fromEvent:anEvent]; - xe.u.u.type = MotionNotify; - break; - - case NSScrollWheel: - [self getMousePosition:&xe fromEvent:anEvent]; - xe.u.u.type = kXDarwinScrollWheel; - xe.u.clientMessage.u.s.shorts0 = [anEvent deltaX] + - [anEvent deltaY]; - break; - - case NSKeyDown: - case NSKeyUp: - if (!x11Active) { - swallowedKey = 0; - return NO; - } - - if (type == NSKeyDown) { - // If the mouse is not on the valid X display area, - // don't send the X server key events. - if (![self getMousePosition:&xe fromEvent:nil]) { - swallowedKey = [anEvent keyCode]; - return NO; - } - - // See if there are any global shortcuts for this key combo. - if (quartzEnableKeyEquivalents - && [[NSApp mainMenu] performKeyEquivalent:anEvent]) - { - swallowedKey = [anEvent keyCode]; - return YES; - } - } else { - // If the down key event was a valid key combo, - // don't pass the up event to X11. - if (swallowedKey != 0 && [anEvent keyCode] == swallowedKey) { - swallowedKey = 0; - return NO; - } - } - - xe.u.u.type = (type == NSKeyDown) ? KeyPress : KeyRelease; - xe.u.u.detail = [anEvent keyCode]; - break; - - case NSFlagsChanged: - if (!x11Active) - return NO; - xe.u.u.type = kXDarwinUpdateModifiers; - xe.u.clientMessage.u.l.longs0 = flags; - break; - - default: - return NO; - } - - [self sendXEvent:&xe]; - - // Rootless: Send first NSLeftMouseDown to Cocoa windows and views so - // window ordering can be suppressed. - // Don't pass further events - they (incorrectly?) bring the window - // forward no matter what. - if (quartzRootless && - (type == NSLeftMouseDown || type == NSLeftMouseUp) && - [anEvent clickCount] == 1 && [anEvent window]) - { - return NO; - } - - return YES; -} - -// Return mouse coordinates, inverting y coordinate. -// The coordinates are extracted from an event or the current mouse position. -// For rootless mode, the menu bar is treated as not part of the usable -// X display area and the cursor position is adjusted accordingly. -// Returns YES if the cursor is not in the menu bar. -- (BOOL)getMousePosition:(xEvent *)xe fromEvent:(NSEvent *)anEvent -{ - NSPoint pt; - - if (anEvent) { - NSWindow *eventWindow = [anEvent window]; - - if (eventWindow) { - pt = [anEvent locationInWindow]; - pt.x += [eventWindow frame].origin.x; - pt.y += [eventWindow frame].origin.y; - } else { - pt = [NSEvent mouseLocation]; - } - } else { - pt = [NSEvent mouseLocation]; - } - - xe->u.keyButtonPointer.rootX = (int)(pt.x); - - if (quartzRootless && NSMouseInRect(pt, aquaMenuBarBox, NO)) { - // mouse in menu bar - tell X11 that it's just below instead - xe->u.keyButtonPointer.rootY = aquaMenuBarHeight; - return NO; - } else { - xe->u.keyButtonPointer.rootY = - NSHeight([[NSScreen mainScreen] frame]) - (int)(pt.y); - return YES; - } -} - - -// Make a safe path -// -// Return the path in single quotes in case there are problematic characters in it. -// We still have to worry about there being single quotes in the path. So, replace -// all instances of the ' character in the path with '\''. -- (NSString *)makeSafePath:(NSString *)path -{ - NSMutableString *safePath = [NSMutableString stringWithString:path]; - NSRange aRange = NSMakeRange(0, [safePath length]); - - while (aRange.length) { - aRange = [safePath rangeOfString:@"'" options:0 range:aRange]; - if (!aRange.length) - break; - [safePath replaceCharactersInRange:aRange - withString:@"\'\\'\'"]; - aRange.location += 4; - aRange.length = [safePath length] - aRange.location; - } - - safePath = [NSMutableString stringWithFormat:@"'%@'", safePath]; - - return safePath; -} - - -- (void)applicationDidFinishLaunching:(NSNotification *)aNotification -{ - // Block SIGPIPE - // SIGPIPE repeatably killed the (rootless) server when closing a - // dozen xterms in rapid succession. Those SIGPIPEs should have been - // sent to the X server thread, which ignores them, but somehow they - // ended up in this thread instead. - { - sigset_t set; - sigemptyset(&set); - sigaddset(&set, SIGPIPE); - // pthread_sigmask not implemented yet - // pthread_sigmask(SIG_BLOCK, &set, NULL); - sigprocmask(SIG_BLOCK, &set, NULL); - } - - if (quartzRootless == -1) { - // The display mode was not set from the command line. - // Show mode pick panel? - if ([Preferences modeWindow]) { - if ([Preferences rootless]) - [startRootlessButton setKeyEquivalent:@"\r"]; - else - [startFullScreenButton setKeyEquivalent:@"\r"]; - [modeWindow makeKeyAndOrderFront:nil]; - } else { - // Otherwise use default mode - quartzRootless = [Preferences rootless]; - [self startX]; - } - } else { - [self startX]; - } -} - - -// Load the appropriate display mode bundle -- (BOOL)loadDisplayBundle -{ - if (quartzRootless) { - NSEnumerator *enumerator = [[Preferences displayModeBundles] - objectEnumerator]; - NSString *bundleName; - - while ((bundleName = [enumerator nextObject])) { - if (QuartzLoadDisplayBundle([bundleName cString])) - return YES; - } - - return NO; - } else { - return QuartzLoadDisplayBundle("fullscreen.bundle"); - } -} - - -// Start the X server thread and the client process -- (void)startX -{ - NSDictionary *appDictionary; - NSString *appVersion; - - [modeWindow close]; - - // Calculate the height of the menu bar so rootless mode can avoid it - if (quartzRootless) { - aquaMenuBarHeight = NSHeight([[NSScreen mainScreen] frame]) - - NSMaxY([[NSScreen mainScreen] visibleFrame]) - 1; - aquaMenuBarBox = - NSMakeRect(0, NSMaxY([[NSScreen mainScreen] visibleFrame]) + 1, - NSWidth([[NSScreen mainScreen] frame]), - aquaMenuBarHeight); - } - - // Write the XDarwin version to the console log - appDictionary = [[NSBundle mainBundle] infoDictionary]; - appVersion = [appDictionary objectForKey:@"CFBundleShortVersionString"]; - if (appVersion) - NSLog(@"\n%@", appVersion); - else - NSLog(@"No version"); - - if (![self loadDisplayBundle]) - [NSApp terminate:nil]; - - if (quartzRootless) { - // We need to track whether the key window is an X11 window - [[NSNotificationCenter defaultCenter] - addObserver:self - selector:@selector(windowBecameKey:) - name:NSWindowDidBecomeKeyNotification - object:nil]; - - // Request notification of screen layout changes even when this - // is not the active application - [[NSDistributedNotificationCenter defaultCenter] - addObserver:self - selector:@selector(applicationDidChangeScreenParameters:) - name:NSApplicationDidChangeScreenParametersNotification - object:nil]; - } - - // Start the X server thread - serverState = server_Starting; - [NSThread detachNewThreadSelector:@selector(run) toTarget:self - withObject:nil]; - - // Start the X clients if started from GUI - if (quartzStartClients) { - [self startXClients]; - } - - if (quartzRootless) { - // There is no help window for rootless; just start - [helpWindow close]; - helpWindow = nil; - } else { - IONotificationPortRef notify; - io_object_t anIterator; - - // Register for system power notifications - root_port = IORegisterForSystemPower(0, ¬ify, powerDidChange, - &anIterator); - if (root_port) { - CFRunLoopAddSource([[NSRunLoop currentRunLoop] getCFRunLoop], - IONotificationPortGetRunLoopSource(notify), - kCFRunLoopDefaultMode); - } else { - NSLog(@"Failed to register for system power notifications."); - } - - // Show the X switch window if not using dock icon switching - if (![Preferences dockSwitch]) - [switchWindow orderFront:nil]; - - if ([Preferences startupHelp]) { - // display the full screen mode help - [helpWindow makeKeyAndOrderFront:nil]; - queueShowServer = NO; - } else { - // start running full screen and make sure X is visible - ShowMenuBar(); - [self closeHelpAndShow:nil]; - } - } -} - -// Finish starting the X server thread -// This includes anything that must be done after the X server is -// ready to process events after the first or subsequent generations. -- (void)finishStartX -{ - sendServerEvents = YES; - serverState = server_Running; - - if (quartzRootless) { - [self forceShowServer:[NSApp isActive]]; - } else { - [self forceShowServer:queueShowServer]; - } - - if (quartzServerQuitting) { - [self quitServer]; - if (pendingAppQuitReply) - [NSApp replyToApplicationShouldTerminate:YES]; - return; - } - - if (pendingClients) { - NSEnumerator *enumerator = [pendingClients objectEnumerator]; - NSString *filename; - - while ((filename = [enumerator nextObject])) { - [self runClient:filename]; - } - - [pendingClients release]; - pendingClients = nil; - } -} - -// Start the first X clients in a separate process -- (BOOL)startXClients -{ - struct passwd *passwdUser; - NSString *shellPath, *dashShellName, *commandStr, *startXPath; - NSString *safeStartXPath; - NSBundle *thisBundle; - const char *shellPathStr, *newargv[3], *shellNameStr; - int fd[2], outFD, length, shellType, i; - - // Register to catch the signal when the client processs finishes - signal(SIGCHLD, childDone); - - // Get user's password database entry - passwdUser = getpwuid(getuid()); - - // Find the shell to use - if ([Preferences useDefaultShell]) - shellPath = [NSString stringWithCString:passwdUser->pw_shell]; - else - shellPath = [Preferences shellString]; - - dashShellName = [NSString stringWithFormat:@"-%@", - [shellPath lastPathComponent]]; - shellPathStr = [shellPath cString]; - shellNameStr = [[shellPath lastPathComponent] cString]; - - if (access(shellPathStr, X_OK)) { - NSLog(@"Shell %s is not valid!", shellPathStr); - return NO; - } - - // Find the type of shell - for (i = 0; shellList[i].name; i++) { - if (!strcmp(shellNameStr, shellList[i].name)) - break; - } - shellType = shellList[i].type; - - newargv[0] = [dashShellName cString]; - if (shellType == shell_Bourne) { - // Bourne shells need to be told they are interactive to make - // sure they read all their initialization files. - newargv[1] = "-i"; - newargv[2] = NULL; - } else { - newargv[1] = NULL; - } - - // Create a pipe to communicate with the X client process - NSAssert(pipe(fd) == 0, @"Could not create new pipe."); - - // Open a file descriptor for writing to stdout and stderr - outFD = open("/dev/console", O_WRONLY, 0); - if (outFD == -1) { - outFD = open("/dev/null", O_WRONLY, 0); - NSAssert(outFD != -1, @"Could not open shell output."); - } - - // Fork process to start X clients in user's default shell - // Sadly we can't use NSTask because we need to start a login shell. - // Login shells are started by passing "-" as the first character of - // argument 0. NSTask forces argument 0 to be the shell's name. - clientPID = vfork(); - if (clientPID == 0) { - - // Inside the new process: - if (fd[0] != STDIN_FILENO) { - dup2(fd[0], STDIN_FILENO); // Take stdin from pipe - close(fd[0]); - } - close(fd[1]); // Close write end of pipe - if (outFD == STDOUT_FILENO) { // Setup stdout and stderr - dup2(outFD, STDERR_FILENO); - } else if (outFD == STDERR_FILENO) { - dup2(outFD, STDOUT_FILENO); - } else { - dup2(outFD, STDERR_FILENO); - dup2(outFD, STDOUT_FILENO); - close(outFD); - } - - // Setup environment - setenv("HOME", passwdUser->pw_dir, 1); - setenv("SHELL", shellPathStr, 1); - setenv("LOGNAME", passwdUser->pw_name, 1); - setenv("USER", passwdUser->pw_name, 1); - setenv("TERM", "unknown", 1); - if (chdir(passwdUser->pw_dir)) // Change to user's home dir - NSLog(@"Could not change to user's home directory."); - - execv(shellPathStr, (char * const *)newargv); // Start user's shell - - NSLog(@"Could not start X client process with errno = %i.", errno); - _exit(127); - } - - // In parent process: - close(fd[0]); // Close read end of pipe - close(outFD); // Close output file descriptor - - thisBundle = [NSBundle bundleForClass:[self class]]; - startXPath = [thisBundle pathForResource:@"startXClients" ofType:nil]; - if (!startXPath) { - NSLog(@"Could not find startXClients in application bundle!"); - return NO; - } - - safeStartXPath = [self makeSafePath:startXPath]; - - if ([Preferences addToPath]) { - commandStr = [NSString stringWithFormat:@"%@ :%d %@\n", - safeStartXPath, [Preferences display], - [Preferences addToPathString]]; - } else { - commandStr = [NSString stringWithFormat:@"%@ :%d\n", - safeStartXPath, [Preferences display]]; - } - - length = [commandStr cStringLength]; - if (write(fd[1], [commandStr cString], length) != length) { - NSLog(@"Write to X client process failed."); - return NO; - } - - // Close the pipe so that shell will terminate when xinit quits - close(fd[1]); - - return YES; -} - -// Start the specified client in its own task -// FIXME: This should be unified with startXClients -- (void)runClient:(NSString *)filename -{ - const char *command = [[self makeSafePath:filename] UTF8String]; - const char *shell; - const char *argv[5]; - int child1, child2 = 0; - int status; - - shell = getenv("SHELL"); - if (shell == NULL) - shell = "/bin/bash"; - - /* At least [ba]sh, [t]csh and zsh all work with this syntax. We - need to use an interactive shell to force it to load the user's - environment. */ - - argv[0] = shell; - argv[1] = "-i"; - argv[2] = "-c"; - argv[3] = command; - argv[4] = NULL; - - /* Do the fork-twice trick to avoid having to reap zombies */ - - child1 = fork(); - - switch (child1) { - case -1: /* error */ - break; - - case 0: /* child1 */ - child2 = fork(); - - switch (child2) { - int max_files, i; - char buf[1024], *tem; - - case -1: /* error */ - _exit(1); - - case 0: /* child2 */ - /* close all open files except for standard streams */ - max_files = sysconf(_SC_OPEN_MAX); - for (i = 3; i < max_files; i++) - close(i); - - /* ensure stdin is on /dev/null */ - close(0); - open("/dev/null", O_RDONLY); - - /* cd $HOME */ - tem = getenv("HOME"); - if (tem != NULL) - chdir(tem); - - /* Setup environment */ - snprintf(buf, sizeof(buf), ":%s", display); - setenv("DISPLAY", buf, TRUE); - tem = getenv("PATH"); - if (tem != NULL && tem[0] != NULL) - snprintf(buf, sizeof(buf), "%s:/usr/X11R6/bin", tem); - else - snprintf(buf, sizeof(buf), "/bin:/usr/bin:/usr/X11R6/bin"); - setenv("PATH", buf, TRUE); - - execvp(argv[0], (char **const) argv); - - _exit(2); - - default: /* parent (child1) */ - _exit(0); - } - break; - - default: /* parent */ - waitpid(child1, &status, 0); - } -} - -// Run the X server thread -- (void)run -{ - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - [serverLock lock]; - main(argcGlobal, argvGlobal, envpGlobal); - serverVisible = NO; - [pool release]; - [serverLock unlock]; - QuartzMessageMainThread(kQuartzServerDied, nil, 0); -} - -// Full screen mode was picked in the mode pick panel -- (IBAction)startFullScreen:(id)sender -{ - [Preferences setModeWindow:[startupModeButton intValue]]; - [Preferences saveToDisk]; - quartzRootless = FALSE; - [self startX]; -} - -// Rootless mode was picked in the mode pick panel -- (IBAction)startRootless:(id)sender -{ - [Preferences setModeWindow:[startupModeButton intValue]]; - [Preferences saveToDisk]; - quartzRootless = TRUE; - [self startX]; -} - -// Close the help splash screen and show the X server -- (IBAction)closeHelpAndShow:(id)sender -{ - if (sender) { - int helpVal = [startupHelpButton intValue]; - [Preferences setStartupHelp:helpVal]; - [Preferences saveToDisk]; - } - [helpWindow close]; - helpWindow = nil; - - [self forceShowServer:YES]; - [NSApp activateIgnoringOtherApps:YES]; -} - -// Show the Aqua-X11 switch panel useful for fullscreen mode -- (IBAction)showSwitchPanel:(id)sender -{ - [switchWindow orderFront:nil]; -} - -// Show the X server when sent message from GUI -- (IBAction)showAction:(id)sender -{ - [self forceShowServer:YES]; -} - -// Show or hide the X server or menu bar in rootless mode -- (void)toggle -{ - if (quartzRootless) { -#if 0 - // FIXME: Remove or add option to not dodge menubar - if (rootlessMenuBarVisible) - HideMenuBar(); - else - ShowMenuBar(); - rootlessMenuBarVisible = !rootlessMenuBarVisible; -#endif - } else { - [self showServer:!serverVisible]; - } -} - -// Show or hide the X server on screen -- (void)showServer:(BOOL)show -{ - // Do not show or hide multiple times in a row - if (serverVisible == show) - return; - - if (sendServerEvents) { - [self sendShowHide:show]; - } else if (serverState == server_Starting) { - queueShowServer = show; - } -} - -// Show or hide the X server irregardless of the current state -- (void)forceShowServer:(BOOL)show -{ - serverVisible = !show; - [self showServer:show]; -} - -// Tell the X server to show or hide itself. -// This ignores the current X server visible state. -// -// In full screen mode, the order we do things is important and must be -// preserved between the threads. X drawing operations have to be performed -// in the X server thread. It appears that we have the additional -// constraint that we must hide and show the menu bar in the main thread. -// -// To show the X server: -// 1. Capture the displays. (Main thread) -// 2. Hide the menu bar. (Must be in main thread) -// 3. Send event to X server thread to redraw X screen. -// 4. Redraw the X screen. (Must be in X server thread) -// -// To hide the X server: -// 1. Send event to X server thread to stop drawing. -// 2. Stop drawing to the X screen. (Must be in X server thread) -// 3. Message main thread that drawing is stopped. -// 4. If main thread still wants X server hidden: -// a. Release the displays. (Main thread) -// b. Unhide the menu bar. (Must be in main thread) -// Otherwise we have already queued an event to start drawing again. -// -- (void)sendShowHide:(BOOL)show -{ - xEvent xe; - - [self getMousePosition:&xe fromEvent:nil]; - - if (show) { - if (!quartzRootless) { - quartzProcs->CaptureScreens(); - HideMenuBar(); - } - [self activateX11:YES]; - - // the mouse location will have moved; track it - xe.u.u.type = MotionNotify; - [self sendXEvent:&xe]; - - // inform the X server of the current modifier state - xe.u.u.type = kXDarwinUpdateModifiers; - xe.u.clientMessage.u.l.longs0 = [[NSApp currentEvent] modifierFlags]; - [self sendXEvent:&xe]; - - // If there is no AppleWM-aware cut and paste manager, do what we can. - if ((AppleWMSelectedEvents() & AppleWMPasteboardNotifyMask) == 0) { - // put the pasteboard into the X cut buffer - [self readPasteboard]; - } - } else { - // If there is no AppleWM-aware cut and paste manager, do what we can. - if ((AppleWMSelectedEvents() & AppleWMPasteboardNotifyMask) == 0) { - // put the X cut buffer on the pasteboard - [self writePasteboard]; - } - - [self activateX11:NO]; - } - - serverVisible = show; -} - -// Enable or disable rendering to the X screen -- (void)setRootClip:(BOOL)enable -{ - xEvent xe; - - xe.u.u.type = kXDarwinSetRootClip; - xe.u.clientMessage.u.l.longs0 = enable; - [self sendXEvent:&xe]; -} - -// Tell the X server to read from the pasteboard into the X cut buffer -- (void)readPasteboard -{ - xEvent xe; - - xe.u.u.type = kXDarwinReadPasteboard; - [self sendXEvent:&xe]; -} - -// Tell the X server to write the X cut buffer into the pasteboard -- (void)writePasteboard -{ - xEvent xe; - - xe.u.u.type = kXDarwinWritePasteboard; - [self sendXEvent:&xe]; -} - -- (void)quitServer -{ - xEvent xe; - - xe.u.u.type = kXDarwinQuit; - [self sendXEvent:&xe]; - - // Revert to the Mac OS X arrow cursor. The main thread sets the cursor - // and it won't be responding to future requests to change it. - [[NSCursor arrowCursor] set]; - - serverState = server_Quitting; -} - -- (void)sendXEvent:(xEvent *)xe -{ - // This field should be filled in for every event - xe->u.keyButtonPointer.time = GetTimeInMillis(); - - DarwinEQEnqueue(xe); -} - -// Handle messages from the X server thread -- (void)handlePortMessage:(NSPortMessage *)portMessage -{ - unsigned msg = [portMessage msgid]; - - switch (msg) { - case kQuartzServerHidden: - // Make sure the X server wasn't queued to be shown again while - // the hide was pending. - if (!quartzRootless && !serverVisible) { - quartzProcs->ReleaseScreens(); - ShowMenuBar(); - } - break; - - case kQuartzServerStarted: - [self finishStartX]; - break; - - case kQuartzServerDied: - sendServerEvents = NO; - serverState = server_Done; - if (!quartzServerQuitting) { - [NSApp terminate:nil]; // quit if we aren't already - } - break; - - case kQuartzCursorUpdate: - if (quartzProcs->CursorUpdate) - quartzProcs->CursorUpdate(); - break; - - case kQuartzPostEvent: - { - const xEvent *xe = [[[portMessage components] lastObject] bytes]; - DarwinEQEnqueue(xe); - break; - } - - case kQuartzSetWindowMenu: - { - NSArray *list; - [[[portMessage components] lastObject] getBytes:&list]; - [self setX11WindowList:list]; - [list release]; - break; - } - - case kQuartzSetWindowMenuCheck: - { - int n; - [[[portMessage components] lastObject] getBytes:&n]; - [self setX11WindowCheck:[NSNumber numberWithInt:n]]; - break; - } - - case kQuartzSetFrontProcess: - [NSApp activateIgnoringOtherApps:YES]; - break; - - case kQuartzSetCanQuit: - { - int n; - [[[portMessage components] lastObject] getBytes:&n]; - quitWithoutQuery = (BOOL) n; - break; - } - - default: - NSLog(@"Unknown message from server thread."); - } -} - -// Quit the X server when the X client process finishes -- (void)clientProcessDone:(int)clientStatus -{ - if (WIFEXITED(clientStatus)) { - int exitStatus = WEXITSTATUS(clientStatus); - if (exitStatus != 0) - NSLog(@"X client process terminated with status %i.", exitStatus); - } else { - NSLog(@"X client process terminated abnormally."); - } - - if (!quartzServerQuitting) { - [NSApp terminate:nil]; // quit if we aren't already - } -} - -// User selected an X11 window from a menu -- (IBAction)itemSelected:(id)sender -{ - xEvent xe; - - [NSApp activateIgnoringOtherApps:YES]; - - // Notify the client of the change through the X server thread - xe.u.u.type = kXDarwinControllerNotify; - xe.u.clientMessage.u.l.longs0 = AppleWMWindowMenuItem; - xe.u.clientMessage.u.l.longs1 = [sender tag]; - [self sendXEvent:&xe]; -} - -// User selected Next from window menu -- (IBAction)nextWindow:(id)sender -{ - QuartzMessageServerThread(kXDarwinControllerNotify, 1, - AppleWMNextWindow); -} - -// User selected Previous from window menu -- (IBAction)previousWindow:(id)sender -{ - QuartzMessageServerThread(kXDarwinControllerNotify, 1, - AppleWMPreviousWindow); -} - -/* - * The XPR implementation handles close, minimize, and zoom actions for X11 - * windows here, while CR handles these in the NSWindow class. - */ - -// Handle Close from window menu for X11 window in XPR implementation -- (IBAction)performClose:(id)sender -{ - QuartzMessageServerThread(kXDarwinControllerNotify, 1, - AppleWMCloseWindow); -} - -// Handle Minimize from window menu for X11 window in XPR implementation -- (IBAction)performMiniaturize:(id)sender -{ - QuartzMessageServerThread(kXDarwinControllerNotify, 1, - AppleWMMinimizeWindow); -} - -// Handle Zoom from window menu for X11 window in XPR implementation -- (IBAction)performZoom:(id)sender -{ - QuartzMessageServerThread(kXDarwinControllerNotify, 1, - AppleWMZoomWindow); -} - -// Handle "Bring All to Front" from window menu -- (IBAction)bringAllToFront:(id)sender -{ - if ((AppleWMSelectedEvents() & AppleWMControllerNotifyMask) != 0) { - QuartzMessageServerThread(kXDarwinControllerNotify, 1, - AppleWMBringAllToFront); - } else { - [NSApp arrangeInFront:nil]; - } -} - -// This ends up at the end of the responder chain. -- (IBAction)copy:(id)sender -{ - QuartzMessageServerThread(kXDarwinPasteboardNotify, 1, - AppleWMCopyToPasteboard); -} - -// Set whether or not X11 is active and should receive all key events -- (void)activateX11:(BOOL)state -{ - if (state) { - QuartzMessageServerThread(kXDarwinActivate, 0); - } - else { - QuartzMessageServerThread(kXDarwinDeactivate, 0); - } - - x11Active = state; -} - -// Some NSWindow became the key window -- (void)windowBecameKey:(NSNotification *)notification -{ - NSWindow *window = [notification object]; - - if (quartzProcs->IsX11Window(window, [window windowNumber])) { - if (!x11Active) - [self activateX11:YES]; - } else { - if (x11Active) - [self activateX11:NO]; - } -} - -// Set the Apple-WM specifiable part of the window menu -- (void)setX11WindowList:(NSArray *)list -{ - NSMenuItem *item; - int first, count, i; - xEvent xe; - - /* Work backwards so we don't mess up the indices */ - first = [windowMenu indexOfItem:windowSeparator] + 1; - if (first > 0) { - count = [windowMenu numberOfItems]; - for (i = count - 1; i >= first; i--) - [windowMenu removeItemAtIndex:i]; - } else { - windowSeparator = (NSMenuItem *)[windowMenu addItemWithTitle:@"" - action:nil - keyEquivalent:@""]; - } - - count = [dockMenu numberOfItems]; - for (i = 0; i < count; i++) - [dockMenu removeItemAtIndex:0]; - - count = [list count]; - - for (i = 0; i < count; i++) - { - NSString *name, *shortcut; - - name = [[list objectAtIndex:i] objectAtIndex:0]; - shortcut = [[list objectAtIndex:i] objectAtIndex:1]; - - item = (NSMenuItem *)[windowMenu addItemWithTitle:name - action:@selector(itemSelected:) - keyEquivalent:shortcut]; - [item setTarget:self]; - [item setTag:i]; - [item setEnabled:YES]; - - item = (NSMenuItem *)[dockMenu insertItemWithTitle:name - action:@selector(itemSelected:) - keyEquivalent:shortcut atIndex:i]; - [item setTarget:self]; - [item setTag:i]; - [item setEnabled:YES]; - } - - if (checkedWindowItem >= 0 && checkedWindowItem < count) - { - item = (NSMenuItem *)[windowMenu itemAtIndex:first + checkedWindowItem]; - [item setState:NSOnState]; - item = (NSMenuItem *)[dockMenu itemAtIndex:checkedWindowItem]; - [item setState:NSOnState]; - } - - // Notify the client of the change through the X server thread - xe.u.u.type = kXDarwinControllerNotify; - xe.u.clientMessage.u.l.longs0 = AppleWMWindowMenuNotify; - [self sendXEvent:&xe]; -} - -// Set the checked item on the Apple-WM specifiable window menu -- (void)setX11WindowCheck:(NSNumber *)nn -{ - NSMenuItem *item; - int first, count; - int n = [nn intValue]; - - first = [windowMenu indexOfItem:windowSeparator] + 1; - count = [windowMenu numberOfItems] - first; - - if (checkedWindowItem >= 0 && checkedWindowItem < count) - { - item = (NSMenuItem *)[windowMenu itemAtIndex:first + checkedWindowItem]; - [item setState:NSOffState]; - item = (NSMenuItem *)[dockMenu itemAtIndex:checkedWindowItem]; - [item setState:NSOffState]; - } - if (n >= 0 && n < count) - { - item = (NSMenuItem *)[windowMenu itemAtIndex:first + n]; - [item setState:NSOnState]; - item = (NSMenuItem *)[dockMenu itemAtIndex:n]; - [item setState:NSOnState]; - } - checkedWindowItem = n; -} - -// Return whether or not a menu item should be enabled -- (BOOL)validateMenuItem:(NSMenuItem *)item -{ - NSMenu *menu = [item menu]; - - if (menu == windowMenu && [item tag] == 30) { - // Mode switch panel is for fullscreen only - return !quartzRootless; - } - else if ((menu == windowMenu && [item tag] != 40) || menu == dockMenu) { - // The special window and dock menu items should not be active unless - // there is an AppleWM-aware window manager running. - return (AppleWMSelectedEvents() & AppleWMControllerNotifyMask) != 0; - } - else { - return TRUE; - } -} - -/* - * Application Delegate Methods - */ - -- (void)applicationDidChangeScreenParameters:(NSNotification *)aNotification -{ - if (quartzProcs->ScreenChanged) - quartzProcs->ScreenChanged(); -} - -- (void)applicationDidHide:(NSNotification *)aNotification -{ - if ((AppleWMSelectedEvents() & AppleWMControllerNotifyMask) != 0) { - QuartzMessageServerThread(kXDarwinControllerNotify, 1, - AppleWMHideAll); - } else { - if (quartzProcs->HideWindows) - quartzProcs->HideWindows(YES); - } -} - -- (void)applicationDidUnhide:(NSNotification *)aNotification -{ - if ((AppleWMSelectedEvents() & AppleWMControllerNotifyMask) != 0) { - QuartzMessageServerThread(kXDarwinControllerNotify, 1, - AppleWMShowAll); - } else { - if (quartzProcs->HideWindows) - quartzProcs->HideWindows(NO); - } -} - -// Called when the user clicks the application icon, -// but not when Cmd-Tab is used. -// Rootless: Don't switch until applicationWillBecomeActive. -- (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication - hasVisibleWindows:(BOOL)flag -{ - if ([Preferences dockSwitch] && !quartzRootless) { - [self showServer:YES]; - } - return NO; -} - -- (void)applicationWillResignActive:(NSNotification *)aNotification -{ - [self showServer:NO]; -} - -- (void)applicationWillBecomeActive:(NSNotification *)aNotification -{ - if (quartzRootless) { - [self showServer:YES]; - - // If there is no AppleWM-aware window manager, we can't allow - // interleaving of Aqua and X11 windows. - if ((AppleWMSelectedEvents() & AppleWMControllerNotifyMask) == 0) { - [NSApp arrangeInFront:nil]; - } - } -} - -// Called when the user opens a document type that we claim (ie. an X11 executable). -- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename -{ - if (serverState == server_Running) { - [self runClient:filename]; - return YES; - } - else if (serverState == server_NotStarted || serverState == server_Starting) { - if ([filename UTF8String][0] != ':') { // Ignore display names - if (!pendingClients) { - pendingClients = [[NSMutableArray alloc] initWithCapacity:1]; - } - [pendingClients addObject:filename]; - return YES; // Assume it will launch successfully - } - return NO; - } - - // If the server is quitting or done, - // its too late to launch new clients this time. - return NO; -} - -@end - - -// Send a message to the main thread, which calls handlePortMessage in -// response. Must only be called from the X server thread because -// NSPort is not thread safe. -void QuartzMessageMainThread(unsigned msg, void *data, unsigned length) -{ - if (length > 0) { - NSData *eventData = [NSData dataWithBytes:data length:length]; - NSArray *eventArray = [NSArray arrayWithObject:eventData]; - NSPortMessage *newMessage = - [[NSPortMessage alloc] - initWithSendPort:signalPort - receivePort:returnPort components:eventArray]; - [newMessage setMsgid:msg]; - [newMessage sendBeforeDate:[NSDate distantPast]]; - [newMessage release]; - } else { - [signalMessage setMsgid:msg]; - [signalMessage sendBeforeDate:[NSDate distantPast]]; - } -} - -void -QuartzSetWindowMenu(int nitems, const char **items, - const char *shortcuts) -{ - NSMutableArray *array; - int i; - - array = [[NSMutableArray alloc] initWithCapacity:nitems]; - - for (i = 0; i < nitems; i++) { - NSMutableArray *subarray = [NSMutableArray arrayWithCapacity:2]; - NSString *string = [NSString stringWithUTF8String:items[i]]; - - [subarray addObject:string]; - - if (shortcuts[i] != 0) { - NSString *number = [NSString stringWithFormat:@"%d", - shortcuts[i]]; - [subarray addObject:number]; - } else - [subarray addObject:@""]; - - [array addObject:subarray]; - } - - /* Send the array of strings over to the main thread. */ - /* Will be released in main thread. */ - QuartzMessageMainThread(kQuartzSetWindowMenu, &array, sizeof(NSArray *)); -} - -// Handle SIGCHLD signals -static void childDone(int sig) -{ - int clientStatus; - - if (clientPID == 0) - return; - - // Make sure it was the client task that finished - if (waitpid(clientPID, &clientStatus, WNOHANG) == clientPID) { - if (WIFSTOPPED(clientStatus)) - return; - clientPID = 0; - [oneXServer clientProcessDone:clientStatus]; - } -} - -static void powerDidChange( - void *x, - io_service_t y, - natural_t messageType, - void *messageArgument) -{ - switch (messageType) { - case kIOMessageSystemWillSleep: - if (!quartzRootless) { - [oneXServer setRootClip:FALSE]; - } - IOAllowPowerChange(root_port, (long)messageArgument); - break; - case kIOMessageCanSystemSleep: - IOAllowPowerChange(root_port, (long)messageArgument); - break; - case kIOMessageSystemHasPoweredOn: - if (!quartzRootless) { - [oneXServer setRootClip:TRUE]; - } - break; - } - -} diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/applewm.c b/nx-X11/programs/Xserver/hw/darwin/quartz/applewm.c deleted file mode 100644 index d79df4cee..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/applewm.c +++ /dev/null @@ -1,722 +0,0 @@ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/applewm.c,v 1.2 2003/09/16 00:36:13 torrey Exp $ */ -/************************************************************************** - -Copyright (c) 2002 Apple Computer, Inc. All Rights Reserved. -Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sub license, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice (including the -next paragraph) shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -**************************************************************************/ - -#include "quartzCommon.h" - -#define NEED_REPLIES -#define NEED_EVENTS -#include "misc.h" -#include "dixstruct.h" -#include "globals.h" -#include "extnsionst.h" -#include "colormapst.h" -#include "cursorstr.h" -#include "scrnintstr.h" -#include "windowstr.h" -#include "servermd.h" -#include "swaprep.h" -#include "propertyst.h" -#include -#include "darwin.h" -#define _APPLEWM_SERVER_ -#include "applewmstr.h" -#include "applewmExt.h" - -#define DEFINE_ATOM_HELPER(func,atom_name) \ -static Atom func (void) { \ - static int generation; \ - static Atom atom; \ - if (generation != serverGeneration) { \ - generation = serverGeneration; \ - atom = MakeAtom (atom_name, strlen (atom_name), TRUE); \ - } \ - return atom; \ -} - -DEFINE_ATOM_HELPER(xa_native_screen_origin, "_NATIVE_SCREEN_ORIGIN") -DEFINE_ATOM_HELPER (xa_apple_no_order_in, "_APPLE_NO_ORDER_IN") - -static AppleWMProcsPtr appleWMProcs; - -static int WMErrorBase; - -static DISPATCH_PROC(ProcAppleWMDispatch); -static DISPATCH_PROC(SProcAppleWMDispatch); - -static void AppleWMResetProc(ExtensionEntry* extEntry); - -static unsigned char WMReqCode = 0; -static int WMEventBase = 0; - -static RESTYPE ClientType, EventType; /* resource types for event masks */ -static XID eventResource; - -/* Currently selected events */ -static unsigned int eventMask = 0; - -static int WMFreeClient (pointer data, XID id); -static int WMFreeEvents (pointer data, XID id); -static void SNotifyEvent(xAppleWMNotifyEvent *from, xAppleWMNotifyEvent *to); - -typedef struct _WMEvent *WMEventPtr; -typedef struct _WMEvent { - WMEventPtr next; - ClientPtr client; - XID clientResource; - unsigned int mask; -} WMEventRec; - -static inline BoxRec -make_box (int x, int y, int w, int h) -{ - BoxRec r; - r.x1 = x; - r.y1 = y; - r.x2 = x + w; - r.y2 = y + h; - return r; -} - -void -AppleWMExtensionInit( - AppleWMProcsPtr procsPtr) -{ - ExtensionEntry* extEntry; - - ClientType = CreateNewResourceType(WMFreeClient); - EventType = CreateNewResourceType(WMFreeEvents); - eventResource = FakeClientID(0); - - if (ClientType && EventType && - (extEntry = AddExtension(APPLEWMNAME, - AppleWMNumberEvents, - AppleWMNumberErrors, - ProcAppleWMDispatch, - SProcAppleWMDispatch, - AppleWMResetProc, - StandardMinorOpcode))) - { - WMReqCode = (unsigned char)extEntry->base; - WMErrorBase = extEntry->errorBase; - WMEventBase = extEntry->eventBase; - EventSwapVector[WMEventBase] = (EventSwapPtr) SNotifyEvent; - appleWMProcs = procsPtr; - } -} - -/*ARGSUSED*/ -static void -AppleWMResetProc ( - ExtensionEntry* extEntry -) -{ -} - -/* Updates the _NATIVE_SCREEN_ORIGIN property on the given root window. */ -void -AppleWMSetScreenOrigin( - WindowPtr pWin -) -{ - long data[2]; - - data[0] = (dixScreenOrigins[pWin->drawable.pScreen->myNum].x - + darwinMainScreenX); - data[1] = (dixScreenOrigins[pWin->drawable.pScreen->myNum].y - + darwinMainScreenY); - - ChangeWindowProperty(pWin, xa_native_screen_origin(), XA_INTEGER, - 32, PropModeReplace, 2, data, TRUE); -} - -/* Window managers can set the _APPLE_NO_ORDER_IN property on windows - that are being genie-restored from the Dock. We want them to - be mapped but remain ordered-out until the animation - completes (when the Dock will order them in). */ -Bool -AppleWMDoReorderWindow( - WindowPtr pWin -) -{ - Atom atom; - PropertyPtr prop; - - atom = xa_apple_no_order_in(); - for (prop = wUserProps(pWin); prop != NULL; prop = prop->next) - { - if (prop->propertyName == atom && prop->type == atom) - return FALSE; - } - - return TRUE; -} - - -static int -ProcAppleWMQueryVersion( - register ClientPtr client -) -{ - xAppleWMQueryVersionReply rep; - register int n; - - REQUEST_SIZE_MATCH(xAppleWMQueryVersionReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.majorVersion = APPLE_WM_MAJOR_VERSION; - rep.minorVersion = APPLE_WM_MINOR_VERSION; - rep.patchVersion = APPLE_WM_PATCH_VERSION; - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - } - WriteToClient(client, sizeof(xAppleWMQueryVersionReply), (char *)&rep); - return (client->noClientException); -} - - -/* events */ - -static inline void -updateEventMask (WMEventPtr *pHead) -{ - WMEventPtr pCur; - - eventMask = 0; - for (pCur = *pHead; pCur != NULL; pCur = pCur->next) - eventMask |= pCur->mask; -} - -/*ARGSUSED*/ -static int -WMFreeClient (data, id) - pointer data; - XID id; -{ - WMEventPtr pEvent; - WMEventPtr *pHead, pCur, pPrev; - - pEvent = (WMEventPtr) data; - pHead = (WMEventPtr *) LookupIDByType(eventResource, EventType); - if (pHead) { - pPrev = 0; - for (pCur = *pHead; pCur && pCur != pEvent; pCur=pCur->next) - pPrev = pCur; - if (pCur) { - if (pPrev) - pPrev->next = pEvent->next; - else - *pHead = pEvent->next; - } - updateEventMask (pHead); - } - xfree ((pointer) pEvent); - return 1; -} - -/*ARGSUSED*/ -static int -WMFreeEvents (data, id) - pointer data; - XID id; -{ - WMEventPtr *pHead, pCur, pNext; - - pHead = (WMEventPtr *) data; - for (pCur = *pHead; pCur; pCur = pNext) { - pNext = pCur->next; - FreeResource (pCur->clientResource, ClientType); - xfree ((pointer) pCur); - } - xfree ((pointer) pHead); - eventMask = 0; - return 1; -} - -static int -ProcAppleWMSelectInput (client) - register ClientPtr client; -{ - REQUEST(xAppleWMSelectInputReq); - WMEventPtr pEvent, pNewEvent, *pHead; - XID clientResource; - - REQUEST_SIZE_MATCH (xAppleWMSelectInputReq); - pHead = (WMEventPtr *)SecurityLookupIDByType(client, - eventResource, EventType, SecurityWriteAccess); - if (stuff->mask != 0) { - if (pHead) { - /* check for existing entry. */ - for (pEvent = *pHead; pEvent; pEvent = pEvent->next) - { - if (pEvent->client == client) - { - pEvent->mask = stuff->mask; - updateEventMask (pHead); - return Success; - } - } - } - - /* build the entry */ - pNewEvent = (WMEventPtr) xalloc (sizeof (WMEventRec)); - if (!pNewEvent) - return BadAlloc; - pNewEvent->next = 0; - pNewEvent->client = client; - pNewEvent->mask = stuff->mask; - /* - * add a resource that will be deleted when - * the client goes away - */ - clientResource = FakeClientID (client->index); - pNewEvent->clientResource = clientResource; - if (!AddResource (clientResource, ClientType, (pointer)pNewEvent)) - return BadAlloc; - /* - * create a resource to contain a pointer to the list - * of clients selecting input. This must be indirect as - * the list may be arbitrarily rearranged which cannot be - * done through the resource database. - */ - if (!pHead) - { - pHead = (WMEventPtr *) xalloc (sizeof (WMEventPtr)); - if (!pHead || - !AddResource (eventResource, EventType, (pointer)pHead)) - { - FreeResource (clientResource, RT_NONE); - return BadAlloc; - } - *pHead = 0; - } - pNewEvent->next = *pHead; - *pHead = pNewEvent; - updateEventMask (pHead); - } else if (stuff->mask == 0) { - /* delete the interest */ - if (pHead) { - pNewEvent = 0; - for (pEvent = *pHead; pEvent; pEvent = pEvent->next) { - if (pEvent->client == client) - break; - pNewEvent = pEvent; - } - if (pEvent) { - FreeResource (pEvent->clientResource, ClientType); - if (pNewEvent) - pNewEvent->next = pEvent->next; - else - *pHead = pEvent->next; - xfree (pEvent); - updateEventMask (pHead); - } - } - } else { - client->errorValue = stuff->mask; - return BadValue; - } - return Success; -} - -/* - * deliver the event - */ - -void -AppleWMSendEvent (type, mask, which, arg) - int type, which, arg; - unsigned int mask; -{ - WMEventPtr *pHead, pEvent; - ClientPtr client; - xAppleWMNotifyEvent se; - - pHead = (WMEventPtr *) LookupIDByType(eventResource, EventType); - if (!pHead) - return; - for (pEvent = *pHead; pEvent; pEvent = pEvent->next) { - client = pEvent->client; - if ((pEvent->mask & mask) == 0 - || client == serverClient || client->clientGone) - { - continue; - } - se.type = type + WMEventBase; - se.kind = which; - se.arg = arg; - se.sequenceNumber = client->sequence; - se.time = currentTime.milliseconds; - WriteEventsToClient (client, 1, (xEvent *) &se); - } -} - -/* Safe to call from any thread. */ -unsigned int -AppleWMSelectedEvents (void) -{ - return eventMask; -} - - -/* general utility functions */ - -static int -ProcAppleWMDisableUpdate( - register ClientPtr client -) -{ - REQUEST_SIZE_MATCH(xAppleWMDisableUpdateReq); - - appleWMProcs->DisableUpdate(); - - return (client->noClientException); -} - -static int -ProcAppleWMReenableUpdate( - register ClientPtr client -) -{ - REQUEST_SIZE_MATCH(xAppleWMReenableUpdateReq); - - appleWMProcs->EnableUpdate(); - - return (client->noClientException); -} - - -/* window functions */ - -static int -ProcAppleWMSetWindowMenu( - register ClientPtr client -) -{ - const char *bytes, **items; - char *shortcuts; - int max_len, nitems, i, j; - REQUEST(xAppleWMSetWindowMenuReq); - - REQUEST_AT_LEAST_SIZE(xAppleWMSetWindowMenuReq); - - nitems = stuff->nitems; - items = xalloc (sizeof (char *) * nitems); - shortcuts = xalloc (sizeof (char) * nitems); - - max_len = (stuff->length << 2) - sizeof(xAppleWMSetWindowMenuReq); - bytes = (char *) &stuff[1]; - - for (i = j = 0; i < max_len && j < nitems;) - { - shortcuts[j] = bytes[i++]; - items[j++] = bytes + i; - - while (i < max_len) - { - if (bytes[i++] == 0) - break; - } - } - - QuartzSetWindowMenu (nitems, items, shortcuts); - - free(items); - free(shortcuts); - - return (client->noClientException); -} - -static int -ProcAppleWMSetWindowMenuCheck( - register ClientPtr client -) -{ - REQUEST(xAppleWMSetWindowMenuCheckReq); - - REQUEST_SIZE_MATCH(xAppleWMSetWindowMenuCheckReq); - - QuartzMessageMainThread(kQuartzSetWindowMenuCheck, &stuff->index, - sizeof(stuff->index)); - - return (client->noClientException); -} - -static int -ProcAppleWMSetFrontProcess( - register ClientPtr client -) -{ - REQUEST_SIZE_MATCH(xAppleWMSetFrontProcessReq); - - QuartzMessageMainThread(kQuartzSetFrontProcess, NULL, 0); - - return (client->noClientException); -} - -static int -ProcAppleWMSetWindowLevel( - register ClientPtr client -) -{ - REQUEST(xAppleWMSetWindowLevelReq); - WindowPtr pWin; - int errno; - - REQUEST_SIZE_MATCH(xAppleWMSetWindowLevelReq); - - if (!(pWin = SecurityLookupWindow((Drawable)stuff->window, - client, SecurityReadAccess))) - { - return BadValue; - } - - if (stuff->level < 0 || stuff->level >= AppleWMNumWindowLevels) { - return BadValue; - } - - errno = appleWMProcs->SetWindowLevel(pWin, stuff->level); - if (errno != Success) { - return errno; - } - - return (client->noClientException); -} - -static int -ProcAppleWMSetCanQuit( - register ClientPtr client -) -{ - REQUEST(xAppleWMSetCanQuitReq); - - REQUEST_SIZE_MATCH(xAppleWMSetCanQuitReq); - - QuartzMessageMainThread(kQuartzSetCanQuit, &stuff->state, - sizeof(stuff->state)); - - return (client->noClientException); -} - - -/* frame functions */ - -static int -ProcAppleWMFrameGetRect( - register ClientPtr client -) -{ - xAppleWMFrameGetRectReply rep; - BoxRec ir, or, rr; - REQUEST(xAppleWMFrameGetRectReq); - - REQUEST_SIZE_MATCH(xAppleWMFrameGetRectReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - - ir = make_box (stuff->ix, stuff->iy, stuff->iw, stuff->ih); - or = make_box (stuff->ox, stuff->oy, stuff->ow, stuff->oh); - - if (appleWMProcs->FrameGetRect(stuff->frame_rect, - stuff->frame_class, - &or, &ir, &rr) != Success) - { - return BadValue; - } - - rep.x = rr.x1; - rep.y = rr.y1; - rep.w = rr.x2 - rr.x1; - rep.h = rr.y2 - rr.y1; - - WriteToClient(client, sizeof(xAppleWMFrameGetRectReply), (char *)&rep); - return (client->noClientException); -} - -static int -ProcAppleWMFrameHitTest( - register ClientPtr client -) -{ - xAppleWMFrameHitTestReply rep; - BoxRec ir, or; - int ret; - REQUEST(xAppleWMFrameHitTestReq); - - REQUEST_SIZE_MATCH(xAppleWMFrameHitTestReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - - ir = make_box (stuff->ix, stuff->iy, stuff->iw, stuff->ih); - or = make_box (stuff->ox, stuff->oy, stuff->ow, stuff->oh); - - if (appleWMProcs->FrameHitTest(stuff->frame_class, stuff->px, - stuff->py, &or, &ir, &ret) != Success) - { - return BadValue; - } - - rep.ret = ret; - - WriteToClient(client, sizeof(xAppleWMFrameHitTestReply), (char *)&rep); - return (client->noClientException); -} - -static int -ProcAppleWMFrameDraw( - register ClientPtr client -) -{ - BoxRec ir, or; - unsigned int title_length, title_max; - unsigned char *title_bytes; - REQUEST(xAppleWMFrameDrawReq); - WindowPtr pWin; - - REQUEST_AT_LEAST_SIZE(xAppleWMFrameDrawReq); - - if (!(pWin = SecurityLookupWindow((Drawable)stuff->window, - client, SecurityReadAccess))) - { - return BadValue; - } - - ir = make_box (stuff->ix, stuff->iy, stuff->iw, stuff->ih); - or = make_box (stuff->ox, stuff->oy, stuff->ow, stuff->oh); - - title_length = stuff->title_length; - title_max = (stuff->length << 2) - sizeof(xAppleWMFrameDrawReq); - - if (title_max < title_length) - return BadValue; - - title_bytes = (unsigned char *) &stuff[1]; - - errno = appleWMProcs->FrameDraw(pWin, stuff->frame_class, - stuff->frame_attr, &or, &ir, - title_length, title_bytes); - if (errno != Success) { - return errno; - } - - return (client->noClientException); -} - - -/* dispatch */ - -static int -ProcAppleWMDispatch ( - register ClientPtr client -) -{ - REQUEST(xReq); - - switch (stuff->data) - { - case X_AppleWMQueryVersion: - return ProcAppleWMQueryVersion(client); - } - - if (!LocalClient(client)) - return WMErrorBase + AppleWMClientNotLocal; - - switch (stuff->data) - { - case X_AppleWMSelectInput: - return ProcAppleWMSelectInput(client); - case X_AppleWMDisableUpdate: - return ProcAppleWMDisableUpdate(client); - case X_AppleWMReenableUpdate: - return ProcAppleWMReenableUpdate(client); - case X_AppleWMSetWindowMenu: - return ProcAppleWMSetWindowMenu(client); - case X_AppleWMSetWindowMenuCheck: - return ProcAppleWMSetWindowMenuCheck(client); - case X_AppleWMSetFrontProcess: - return ProcAppleWMSetFrontProcess(client); - case X_AppleWMSetWindowLevel: - return ProcAppleWMSetWindowLevel(client); - case X_AppleWMSetCanQuit: - return ProcAppleWMSetCanQuit(client); - case X_AppleWMFrameGetRect: - return ProcAppleWMFrameGetRect(client); - case X_AppleWMFrameHitTest: - return ProcAppleWMFrameHitTest(client); - case X_AppleWMFrameDraw: - return ProcAppleWMFrameDraw(client); - default: - return BadRequest; - } -} - -static void -SNotifyEvent(from, to) - xAppleWMNotifyEvent *from, *to; -{ - to->type = from->type; - to->kind = from->kind; - cpswaps (from->sequenceNumber, to->sequenceNumber); - cpswapl (from->time, to->time); - cpswapl (from->arg, to->arg); -} - -static int -SProcAppleWMQueryVersion( - register ClientPtr client -) -{ - register int n; - REQUEST(xAppleWMQueryVersionReq); - swaps(&stuff->length, n); - return ProcAppleWMQueryVersion(client); -} - -static int -SProcAppleWMDispatch ( - register ClientPtr client -) -{ - REQUEST(xReq); - - /* It is bound to be non-local when there is byte swapping */ - if (!LocalClient(client)) - return WMErrorBase + AppleWMClientNotLocal; - - /* only local clients are allowed WM access */ - switch (stuff->data) - { - case X_AppleWMQueryVersion: - return SProcAppleWMQueryVersion(client); - default: - return BadRequest; - } -} diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/applewmExt.h b/nx-X11/programs/Xserver/hw/darwin/quartz/applewmExt.h deleted file mode 100644 index b27083ac7..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/applewmExt.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * External interface for the server's AppleWM support - */ -/************************************************************************** - -Copyright (c) 2002 Apple Computer, Inc. All Rights Reserved. -Copyright (c) 2003-2004 Torrey T. Lyons. All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sub license, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice (including the -next paragraph) shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -**************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/applewmExt.h,v 1.2 2003/11/11 23:48:41 torrey Exp $ */ - -#ifndef _APPLEWMEXT_H_ -#define _APPLEWMEXT_H_ - -#include "window.h" - -typedef int (*DisableUpdateProc)(void); -typedef int (*EnableUpdateProc)(void); -typedef int (*SetWindowLevelProc)(WindowPtr pWin, int level); -typedef int (*FrameGetRectProc)(int type, int class, const BoxRec *outer, - const BoxRec *inner, BoxRec *ret); -typedef int (*FrameHitTestProc)(int class, int x, int y, - const BoxRec *outer, - const BoxRec *inner, int *ret); -typedef int (*FrameDrawProc)(WindowPtr pWin, int class, unsigned int attr, - const BoxRec *outer, const BoxRec *inner, - unsigned int title_len, - const unsigned char *title_bytes); - -/* - * AppleWM implementation function list - */ -typedef struct _AppleWMProcs { - DisableUpdateProc DisableUpdate; - EnableUpdateProc EnableUpdate; - SetWindowLevelProc SetWindowLevel; - FrameGetRectProc FrameGetRect; - FrameHitTestProc FrameHitTest; - FrameDrawProc FrameDraw; -} AppleWMProcsRec, *AppleWMProcsPtr; - -void AppleWMExtensionInit( - AppleWMProcsPtr procsPtr -); - -void AppleWMSetScreenOrigin( - WindowPtr pWin -); - -Bool AppleWMDoReorderWindow( - WindowPtr pWin -); - -void AppleWMSendEvent( - int /* type */, - unsigned int /* mask */, - int /* which */, - int /* arg */ -); - -unsigned int AppleWMSelectedEvents( - void -); - -#endif /* _APPLEWMEXT_H_ */ diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/cr/Imakefile b/nx-X11/programs/Xserver/hw/darwin/quartz/cr/Imakefile deleted file mode 100644 index 8746063a8..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/cr/Imakefile +++ /dev/null @@ -1,35 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/Imakefile,v 1.3 2004/03/19 02:05:29 torrey Exp $ - -#include - -LinkSourceFile(quartzCursor.c,../fullscreen) -LinkSourceFile(quartzCursor.h,../fullscreen) - -SRCS = crAppleWM.m \ - crFrame.m \ - crScreen.m \ - quartzCursor.c \ - XView.m - -OBJS = crAppleWM.o \ - crFrame.o \ - crScreen.o \ - quartzCursor.o \ - XView.o - -INCLUDES = -I. -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi -I$(SERVERSRC)/include \ - -I$(XINCLUDESRC) -I$(FONTINCSRC) -I$(SERVERSRC)/render \ - -I$(SERVERSRC)/miext/rootless -I$(SERVERSRC)/miext/damage \ - -I$(EXTINCSRC) -I.. -I../.. \ - -I$(SERVERSRC)/miext/rootless/safeAlpha -I$(SERVERSRC)/Xext \ - -I$(APPLEWMLIBSRC) - -#if OSMajorVersion < 6 -DEFINES = -DDEFER_NSWINDOW -#endif - -NormalLibraryObjectRule() -NormalLibraryTarget(cr,$(OBJS)) - -DependTarget() - diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/cr/XView.h b/nx-X11/programs/Xserver/hw/darwin/quartz/cr/XView.h deleted file mode 100644 index 01f5b04b4..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/cr/XView.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * NSView subclass for Mac OS X rootless X server - * - * Copyright (c) 2001 Greg Parker. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XView.h,v 1.2 2002/07/15 19:58:31 torrey Exp $ */ - -#import - -@interface XView : NSQuickDrawView - -- (BOOL)isFlipped; -- (BOOL)isOpaque; -- (BOOL)acceptsFirstResponder; -- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent; -- (BOOL)shouldDelayWindowOrderingForEvent:(NSEvent *)theEvent; - -- (void)mouseDown:(NSEvent *)anEvent; - -@end diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/cr/XView.m b/nx-X11/programs/Xserver/hw/darwin/quartz/cr/XView.m deleted file mode 100644 index 5feac6b42..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/cr/XView.m +++ /dev/null @@ -1,74 +0,0 @@ -/* - * NSView subclass for Mac OS X rootless X server - * - * Each rootless window contains an instance of this class. - * This class handles events while drawing is handled by Carbon - * code in the rootless Aqua implementation. - * - * Copyright (c) 2001 Greg Parker. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/XView.m,v 1.1 2003/06/07 05:49:07 torrey Exp $ */ - -#import "XView.h" - - -@implementation XView - -- (BOOL)isFlipped -{ - return NO; -} - -- (BOOL)isOpaque -{ - return YES; -} - -- (BOOL)acceptsFirstResponder -{ - return YES; -} - -- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent -{ - return YES; -} - -- (BOOL)shouldDelayWindowOrderingForEvent:(NSEvent *)theEvent -{ - return YES; -} - -- (void)mouseDown:(NSEvent *)anEvent -{ - // Only X is allowed to restack windows. - [NSApp preventWindowOrdering]; - if (! [NSApp isActive]) { - [NSApp activateIgnoringOtherApps:YES]; - } - [[self nextResponder] mouseDown:anEvent]; -} - -@end diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/cr/cr.h b/nx-X11/programs/Xserver/hw/darwin/quartz/cr/cr.h deleted file mode 100644 index 94133e4af..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/cr/cr.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Internal definitions of the Cocoa rootless implementation - */ -/* - * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XFree86$ */ - -#ifndef _CR_H -#define _CR_H - -#ifdef __OBJC__ -#import -#import "XView.h" -#else -typedef struct OpaqueNSWindow NSWindow; -typedef struct OpaqueXView XView; -#endif - -#undef BOOL -#define BOOL xBOOL -#include "screenint.h" -#include "window.h" -#undef BOOL - -// Predefined style for the window which is about to be framed -extern WindowPtr nextWindowToFrame; -extern unsigned int nextWindowStyle; - -typedef struct { - NSWindow *window; - XView *view; - GrafPtr port; - CGContextRef context; -} CRWindowRec, *CRWindowPtr; - -Bool CRInit(ScreenPtr pScreen); -void CRAppleWMInit(void); - -#endif /* _CR_H */ diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/cr/crAppleWM.m b/nx-X11/programs/Xserver/hw/darwin/quartz/cr/crAppleWM.m deleted file mode 100644 index a2e97ff81..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/cr/crAppleWM.m +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Cocoa rootless implementation functions for AppleWM extension - */ -/* - * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/xprFrame.c,v 1.2 2003/06/30 01:45:13 torrey Exp $ */ - -#include "quartzCommon.h" -#include "cr.h" - -#undef BOOL -#define BOOL xBOOL -#include "rootless.h" -#include "X.h" -#define _APPLEWM_SERVER_ -#include "applewm.h" -#include "applewmExt.h" -#undef BOOL - -#define StdDocumentStyleMask (NSTitledWindowMask | \ - NSClosableWindowMask | \ - NSMiniaturizableWindowMask | \ - NSResizableWindowMask) - -static int -CRDisableUpdate(void) -{ - return Success; -} - - -static int -CREnableUpdate(void) -{ - return Success; -} - - -static int CRSetWindowLevel( - WindowPtr pWin, - int level) -{ - CRWindowPtr crWinPtr; - - crWinPtr = (CRWindowPtr) RootlessFrameForWindow(pWin, TRUE); - if (crWinPtr == 0) - return BadWindow; - - RootlessStopDrawing(pWin, FALSE); - - [crWinPtr->window setLevel:level]; - - return Success; -} - - -static int CRFrameGetRect( - int type, - int class, - const BoxRec *outer, - const BoxRec *inner, - BoxRec *ret) -{ - return Success; -} - - -static int CRFrameHitTest( - int class, - int x, - int y, - const BoxRec *outer, - const BoxRec *inner, - int *ret) -{ - return 0; -} - - -static int CRFrameDraw( - WindowPtr pWin, - int class, - unsigned int attr, - const BoxRec *outer, - const BoxRec *inner, - unsigned int title_len, - const unsigned char *title_bytes) -{ - CRWindowPtr crWinPtr; - NSWindow *window; - Bool hasResizeIndicator; - - /* We assume the window has not yet been framed so - RootlessFrameForWindow() will cause it to be. Record the window - style so that the appropriate one will be used when it is framed. - If the window is already framed, we can't change the window - style and the following will have no effect. */ - - nextWindowToFrame = pWin; - if (class == AppleWMFrameClassDocument) - nextWindowStyle = StdDocumentStyleMask; - else - nextWindowStyle = NSBorderlessWindowMask; - - crWinPtr = (CRWindowPtr) RootlessFrameForWindow(pWin, TRUE); - if (crWinPtr == 0) - return BadWindow; - - window = crWinPtr->window; - - [window setTitle:[NSString stringWithCString:title_bytes - length:title_len]]; - - hasResizeIndicator = (attr & AppleWMFrameGrowBox) ? YES : NO; - [window setShowsResizeIndicator:hasResizeIndicator]; - - return Success; -} - - -static AppleWMProcsRec crAppleWMProcs = { - CRDisableUpdate, - CREnableUpdate, - CRSetWindowLevel, - CRFrameGetRect, - CRFrameHitTest, - CRFrameDraw -}; - - -void CRAppleWMInit(void) -{ - AppleWMExtensionInit(&crAppleWMProcs); -} diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/cr/crFrame.m b/nx-X11/programs/Xserver/hw/darwin/quartz/cr/crFrame.m deleted file mode 100644 index 9427b2e1d..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/cr/crFrame.m +++ /dev/null @@ -1,439 +0,0 @@ -/* - * Cocoa rootless implementation frame functions - */ -/* - * Copyright (c) 2001 Greg Parker. All Rights Reserved. - * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/cr/crFrame.m,v 1.3 2004/10/08 00:35:05 torrey Exp $ */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/crFrame.m,v 1.9 2004/03/19 02:05:29 torrey Exp $ */ - -#include "quartzCommon.h" -#include "cr.h" - -#undef BOOL -#define BOOL xBOOL -#include "rootless.h" -#include "applewmExt.h" -#include "windowstr.h" -#undef BOOL - -WindowPtr nextWindowToFrame = NULL; -unsigned int nextWindowStyle = 0; - -static void CRReshapeFrame(RootlessFrameID wid, RegionPtr pShape); - - -/* - * CRCreateFrame - * Create a new physical window. - * Rootless windows must not autodisplay! Autodisplay can cause a deadlock. - * Event thread - autodisplay: locks view hierarchy, then window - * X Server thread - window resize: locks window, then view hierarchy - * Deadlock occurs if each thread gets one lock and waits for the other. - */ -static Bool -CRCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen, - int newX, int newY, RegionPtr pShape) -{ - CRWindowPtr crWinPtr; - NSRect bounds; - NSWindow *theWindow; - XView *theView; - unsigned int theStyleMask = NSBorderlessWindowMask; - - crWinPtr = (CRWindowPtr) xalloc(sizeof(CRWindowRec)); - - bounds = NSMakeRect(newX, - NSHeight([[NSScreen mainScreen] frame]) - - newY - pFrame->height, - pFrame->width, pFrame->height); - - // Check if AppleWM has specified a style for this window - if (pFrame->win == nextWindowToFrame) { - theStyleMask = nextWindowStyle; - } - nextWindowToFrame = NULL; - - // Create an NSWindow for the new X11 window - theWindow = [[NSWindow alloc] initWithContentRect:bounds - styleMask:theStyleMask - backing:NSBackingStoreBuffered -#ifdef DEFER_NSWINDOW - defer:YES]; -#else - defer:NO]; -#endif - - if (!theWindow) return FALSE; - - [theWindow setBackgroundColor:[NSColor clearColor]]; // erase transparent - [theWindow setAlphaValue:1.0]; // draw opaque - [theWindow setOpaque:YES]; // changed when window is shaped - - [theWindow useOptimizedDrawing:YES]; // Has no overlapping sub-views - [theWindow setAutodisplay:NO]; // See comment above - [theWindow disableFlushWindow]; // We do all the flushing manually - [theWindow setHasShadow:YES]; // All windows have shadows - [theWindow setReleasedWhenClosed:YES]; // Default, but we want to be sure - - theView = [[XView alloc] initWithFrame:bounds]; - [theWindow setContentView:theView]; - [theWindow setInitialFirstResponder:theView]; - -#ifdef DEFER_NSWINDOW - // We need the NSWindow to actually be created now. - // If we had to defer creating it, we have to order it - // onto the screen to force it to be created. - - if (pFrame->win->prevSib) { - CRWindowPtr crWinPtr = (CRWindowPtr) RootlessFrameForWindow( - pFrame->win->prevSib, FALSE); - int upperNum = [crWinPtr->window windowNumber]; - [theWindow orderWindow:NSWindowBelow relativeTo:upperNum]; - } else { - [theWindow orderFront:nil]; - } -#endif - - [theWindow setAcceptsMouseMovedEvents:YES]; - - crWinPtr->window = theWindow; - crWinPtr->view = theView; - - [theView lockFocus]; - // Fill the window with white to make sure alpha channel is set - NSEraseRect(bounds); - crWinPtr->port = [theView qdPort]; - crWinPtr->context = [[NSGraphicsContext currentContext] graphicsPort]; - // CreateCGContextForPort(crWinPtr->port, &crWinPtr->context); - [theView unlockFocus]; - - // Store the implementation private frame ID - pFrame->wid = (RootlessFrameID) crWinPtr; - - // Reshape the frame if it was created shaped. - if (pShape != NULL) - CRReshapeFrame(pFrame->wid, pShape); - - return TRUE; -} - - -/* - * CRDestroyFrame - * Destroy a frame. - */ -static void -CRDestroyFrame(RootlessFrameID wid) -{ - CRWindowPtr crWinPtr = (CRWindowPtr) wid; - - [crWinPtr->window orderOut:nil]; - [crWinPtr->window close]; - [crWinPtr->view release]; - free(crWinPtr); -} - - -/* - * CRMoveFrame - * Move a frame on screen. - */ -static void -CRMoveFrame(RootlessFrameID wid, ScreenPtr pScreen, int newX, int newY) -{ - CRWindowPtr crWinPtr = (CRWindowPtr) wid; - NSPoint topLeft; - - topLeft = NSMakePoint(newX, - NSHeight([[NSScreen mainScreen] frame]) - newY); - - [crWinPtr->window setFrameTopLeftPoint:topLeft]; -} - - -/* - * CRResizeFrame - * Move and resize a frame. - */ -static void -CRResizeFrame(RootlessFrameID wid, ScreenPtr pScreen, - int newX, int newY, unsigned int newW, unsigned int newH, - unsigned int gravity) -{ - CRWindowPtr crWinPtr = (CRWindowPtr) wid; - NSRect bounds = NSMakeRect(newX, NSHeight([[NSScreen mainScreen] frame]) - - newY - newH, newW, newH); - - [crWinPtr->window setFrame:bounds display:NO]; -} - - -/* - * CRRestackFrame - * Change the frame order. Put the frame behind nextWid or on top if - * it is NULL. Unmapped frames are mapped by restacking them. - */ -static void -CRRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid) -{ - CRWindowPtr crWinPtr = (CRWindowPtr) wid; - CRWindowPtr crNextWinPtr = (CRWindowPtr) nextWid; - - if (crNextWinPtr) { - int upperNum = [crNextWinPtr->window windowNumber]; - - [crWinPtr->window orderWindow:NSWindowBelow relativeTo:upperNum]; - } else { - [crWinPtr->window makeKeyAndOrderFront:nil]; - } -} - - -/* - * CRReshapeFrame - * Set the shape of a frame. - */ -static void -CRReshapeFrame(RootlessFrameID wid, RegionPtr pShape) -{ - CRWindowPtr crWinPtr = (CRWindowPtr) wid; - NSRect bounds = [crWinPtr->view frame]; - int winHeight = NSHeight(bounds); - BoxRec localBox = {0, 0, NSWidth(bounds), winHeight}; - - [crWinPtr->view lockFocus]; - - if (pShape != NULL) { - // Calculate the region outside the new shape. - miInverse(pShape, pShape, &localBox); - } - - // If window is currently shaped we need to undo the previous shape. - if (![crWinPtr->window isOpaque]) { - [[NSColor whiteColor] set]; - NSRectFillUsingOperation(bounds, NSCompositeDestinationAtop); - } - - if (pShape != NULL) { - int count = REGION_NUM_RECTS(pShape); - BoxRec *extRects = REGION_RECTS(pShape); - BoxRec *rects, *end; - - // Make transparent if window is now shaped. - [crWinPtr->window setOpaque:NO]; - - // Clear the areas outside the window shape - [[NSColor clearColor] set]; - for (rects = extRects, end = extRects+count; rects < end; rects++) { - int rectHeight = rects->y2 - rects->y1; - NSRectFill( NSMakeRect(rects->x1, - winHeight - rects->y1 - rectHeight, - rects->x2 - rects->x1, rectHeight) ); - } - [[NSGraphicsContext currentContext] flushGraphics]; - - // force update of window shadow - [crWinPtr->window setHasShadow:NO]; - [crWinPtr->window setHasShadow:YES]; - - } else { - [crWinPtr->window setOpaque:YES]; - [[NSGraphicsContext currentContext] flushGraphics]; - } - - [crWinPtr->view unlockFocus]; -} - - -/* - * CRUnmapFrame - * Unmap a frame. - */ -static void -CRUnmapFrame(RootlessFrameID wid) -{ - CRWindowPtr crWinPtr = (CRWindowPtr) wid; - - [crWinPtr->window orderOut:nil]; -} - - -/* - * CRStartDrawing - * When a window's buffer is not being drawn to, the CoreGraphics - * window server may compress or move it. Call this routine - * to lock down the buffer during direct drawing. It returns - * a pointer to the backing buffer. - */ -static void -CRStartDrawing(RootlessFrameID wid, char **pixelData, int *bytesPerRow) -{ - CRWindowPtr crWinPtr = (CRWindowPtr) wid; - PixMapHandle pix; - - [crWinPtr->view lockFocus]; - crWinPtr->port = [crWinPtr->view qdPort]; - LockPortBits(crWinPtr->port); - [crWinPtr->view unlockFocus]; - pix = GetPortPixMap(crWinPtr->port); - - *pixelData = GetPixBaseAddr(pix); - *bytesPerRow = GetPixRowBytes(pix) & 0x3fff; // fixme is mask needed? -} - - -/* - * CRStopDrawing - * When direct access to a window's buffer is no longer needed, this - * routine should be called to allow CoreGraphics to compress or - * move it. - */ -static void -CRStopDrawing(RootlessFrameID wid, Bool flush) -{ - CRWindowPtr crWinPtr = (CRWindowPtr) wid; - - UnlockPortBits(crWinPtr->port); - - if (flush) { - QDFlushPortBuffer(crWinPtr->port, NULL); - } -} - - -/* - * CRUpdateRegion - * Flush a region from a window's backing buffer to the screen. - */ -static void -CRUpdateRegion(RootlessFrameID wid, RegionPtr pDamage) -{ - CRWindowPtr crWinPtr = (CRWindowPtr) wid; - -#ifdef ROOTLESS_TRACK_DAMAGE - int count = REGION_NUM_RECTS(pDamage); - BoxRec *rects = REGION_RECTS(pDamage); - BoxRec *end; - - static RgnHandle rgn = NULL; - static RgnHandle box = NULL; - - if (!rgn) rgn = NewRgn(); - if (!box) box = NewRgn(); - - for (end = rects+count; rects < end; rects++) { - Rect qdRect; - qdRect.left = rects->x1; - qdRect.top = rects->y1; - qdRect.right = rects->x2; - qdRect.bottom = rects->y2; - - RectRgn(box, &qdRect); - UnionRgn(rgn, box, rgn); - } - - QDFlushPortBuffer(crWinPtr->port, rgn); - - SetEmptyRgn(rgn); - SetEmptyRgn(box); - -#else /* !ROOTLESS_TRACK_DAMAGE */ - QDFlushPortBuffer(crWinPtr->port, NULL); -#endif -} - - -/* - * CRDamageRects - * Mark damaged rectangles as requiring redisplay to screen. - */ -static void -CRDamageRects(RootlessFrameID wid, int count, const BoxRec *rects, - int shift_x, int shift_y) -{ - CRWindowPtr crWinPtr = (CRWindowPtr) wid; - const BoxRec *end; - - for (end = rects + count; rects < end; rects++) { - Rect qdRect; - qdRect.left = rects->x1 + shift_x; - qdRect.top = rects->y1 + shift_y; - qdRect.right = rects->x2 + shift_x; - qdRect.bottom = rects->y2 + shift_y; - - QDAddRectToDirtyRegion(crWinPtr->port, &qdRect); - } -} - - -/* - * Called to check if the frame should be reordered when it is restacked. - */ -Bool CRDoReorderWindow(RootlessWindowPtr pFrame) -{ - WindowPtr pWin = pFrame->win; - - return AppleWMDoReorderWindow(pWin); -} - - -static RootlessFrameProcsRec CRRootlessProcs = { - CRCreateFrame, - CRDestroyFrame, - CRMoveFrame, - CRResizeFrame, - CRRestackFrame, - CRReshapeFrame, - CRUnmapFrame, - CRStartDrawing, - CRStopDrawing, - CRUpdateRegion, - CRDamageRects, - NULL, - CRDoReorderWindow, - NULL, - NULL, - NULL, - NULL -}; - - -/* - * Initialize CR implementation - */ -Bool -CRInit(ScreenPtr pScreen) -{ - RootlessInit(pScreen, &CRRootlessProcs); - - rootless_CopyBytes_threshold = 0; - rootless_FillBytes_threshold = 0; - rootless_CompositePixels_threshold = 0; - rootless_CopyWindow_threshold = 0; - - return TRUE; -} diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/cr/crScreen.m b/nx-X11/programs/Xserver/hw/darwin/quartz/cr/crScreen.m deleted file mode 100644 index caf26f123..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/cr/crScreen.m +++ /dev/null @@ -1,381 +0,0 @@ -/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/cr/crScreen.m,v 1.5 2004/09/18 00:38:30 torrey Exp $ */ -/* - * Cocoa rootless implementation initialization - */ -/* - * Copyright (c) 2001 Greg Parker. All Rights Reserved. - * Copyright (c) 2002-2004 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/crScreen.m,v 1.5 2003/11/12 20:21:52 torrey Exp $ */ - -#include "quartzCommon.h" -#include "cr.h" - -#undef BOOL -#define BOOL xBOOL -#include "darwin.h" -#include "quartz.h" -#include "quartzCursor.h" -#include "rootless.h" -#include "safeAlpha.h" -#include "pseudoramiX.h" -#include "applewmExt.h" - -#include "regionstr.h" -#include "scrnintstr.h" -#include "picturestr.h" -#include "globals.h" -#ifdef DAMAGE -# include "damage.h" -#endif -#undef BOOL - -// Name of GLX bundle using AGL framework -static const char *crOpenGLBundle = "glxAGL.bundle"; - -static Class classXView = nil; - - -/* - * CRDisplayInit - * Find all screens. - * - * Multihead note: When rootless mode uses PseudoramiX, the - * X server only sees one screen; only PseudoramiX itself knows - * about all of the screens. - */ -static void -CRDisplayInit(void) -{ - ErrorF("Display mode: Rootless Quartz -- Cocoa implementation\n"); - - if (noPseudoramiXExtension) { - darwinScreensFound = [[NSScreen screens] count]; - } else { - darwinScreensFound = 1; // only PseudoramiX knows about the rest - } - - CRAppleWMInit(); -} - - -/* - * CRAddPseudoramiXScreens - * Add a single virtual screen encompassing all the physical screens - * with PseudoramiX. - */ -static void -CRAddPseudoramiXScreens(int *x, int *y, int *width, int *height) -{ - int i; - NSRect unionRect = NSMakeRect(0, 0, 0, 0); - NSArray *screens = [NSScreen screens]; - - // Get the union of all screens (minus the menu bar on main screen) - for (i = 0; i < [screens count]; i++) { - NSScreen *screen = [screens objectAtIndex:i]; - NSRect frame = [screen frame]; - frame.origin.y = [[NSScreen mainScreen] frame].size.height - - frame.size.height - frame.origin.y; - if (NSEqualRects([screen frame], [[NSScreen mainScreen] frame])) { - frame.origin.y += aquaMenuBarHeight; - frame.size.height -= aquaMenuBarHeight; - } - unionRect = NSUnionRect(unionRect, frame); - } - - // Use unionRect as the screen size for the X server. - *x = unionRect.origin.x; - *y = unionRect.origin.y; - *width = unionRect.size.width; - *height = unionRect.size.height; - - // Tell PseudoramiX about the real screens. - // InitOutput() will move the big screen to (0,0), - // so compensate for that here. - for (i = 0; i < [screens count]; i++) { - NSScreen *screen = [screens objectAtIndex:i]; - NSRect frame = [screen frame]; - int j; - - // Skip this screen if it's a mirrored copy of an earlier screen. - for (j = 0; j < i; j++) { - if (NSEqualRects(frame, [[screens objectAtIndex:j] frame])) { - ErrorF("PseudoramiX screen %d is a mirror of screen %d.\n", - i, j); - break; - } - } - if (j < i) continue; // this screen is a mirrored copy - - frame.origin.y = [[NSScreen mainScreen] frame].size.height - - frame.size.height - frame.origin.y; - - if (NSEqualRects([screen frame], [[NSScreen mainScreen] frame])) { - frame.origin.y += aquaMenuBarHeight; - frame.size.height -= aquaMenuBarHeight; - } - - ErrorF("PseudoramiX screen %d added: %dx%d @ (%d,%d).\n", i, - (int)frame.size.width, (int)frame.size.height, - (int)frame.origin.x, (int)frame.origin.y); - - frame.origin.x -= unionRect.origin.x; - frame.origin.y -= unionRect.origin.y; - - ErrorF("PseudoramiX screen %d placed at X11 coordinate (%d,%d).\n", - i, (int)frame.origin.x, (int)frame.origin.y); - - PseudoramiXAddScreen(frame.origin.x, frame.origin.y, - frame.size.width, frame.size.height); - } -} - - -/* - * CRScreenParams - * Set the basic screen parameters. - */ -static void -CRScreenParams(int index, DarwinFramebufferPtr dfb) -{ - dfb->bitsPerComponent = CGDisplayBitsPerSample(kCGDirectMainDisplay); - dfb->bitsPerPixel = CGDisplayBitsPerPixel(kCGDirectMainDisplay); - dfb->colorBitsPerPixel = 3 * dfb->bitsPerComponent; - - if (noPseudoramiXExtension) { - NSScreen *screen = [[NSScreen screens] objectAtIndex:index]; - NSRect frame = [screen frame]; - - // set x, y so (0,0) is top left of main screen - dfb->x = NSMinX(frame); - dfb->y = NSHeight([[NSScreen mainScreen] frame]) - - NSHeight(frame) - NSMinY(frame); - - dfb->width = NSWidth(frame); - dfb->height = NSHeight(frame); - - // Shift the usable part of main screen down to avoid the menu bar. - if (NSEqualRects(frame, [[NSScreen mainScreen] frame])) { - dfb->y += aquaMenuBarHeight; - dfb->height -= aquaMenuBarHeight; - } - - } else { - CRAddPseudoramiXScreens(&dfb->x, &dfb->y, &dfb->width, &dfb->height); - } -} - - -/* - * CRAddScreen - * Init the framebuffer and record pixmap parameters for the screen. - */ -static Bool -CRAddScreen(int index, ScreenPtr pScreen) -{ - DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen); - QuartzScreenPtr displayInfo = QUARTZ_PRIV(pScreen); - CGRect cgRect; - CGDisplayCount numDisplays; - CGDisplayCount allocatedDisplays = 0; - CGDirectDisplayID *displays = NULL; - CGDisplayErr cgErr; - - CRScreenParams(index, dfb); - - dfb->colorType = TrueColor; - - /* Passing zero width (pitch) makes miCreateScreenResources set the - screen pixmap to the framebuffer pointer, i.e. NULL. The generic - rootless code takes care of making this work. */ - dfb->pitch = 0; - dfb->framebuffer = NULL; - - // Get all CoreGraphics displays covered by this X11 display. - cgRect = CGRectMake(dfb->x, dfb->y, dfb->width, dfb->height); - do { - cgErr = CGGetDisplaysWithRect(cgRect, 0, NULL, &numDisplays); - if (cgErr) break; - allocatedDisplays = numDisplays; - displays = xrealloc(displays, - numDisplays * sizeof(CGDirectDisplayID)); - cgErr = CGGetDisplaysWithRect(cgRect, allocatedDisplays, displays, - &numDisplays); - if (cgErr != CGDisplayNoErr) break; - } while (numDisplays > allocatedDisplays); - - if (cgErr != CGDisplayNoErr || numDisplays == 0) { - ErrorF("Could not find CGDirectDisplayID(s) for X11 screen %d: %dx%d @ %d,%d.\n", - index, dfb->width, dfb->height, dfb->x, dfb->y); - return FALSE; - } - - // This X11 screen covers all CoreGraphics displays we just found. - // If there's more than one CG display, then video mirroring is on - // or PseudoramiX is on. - displayInfo->displayCount = allocatedDisplays; - displayInfo->displayIDs = displays; - - return TRUE; -} - - -/* - * CRSetupScreen - * Setup the screen for rootless access. - */ -static Bool -CRSetupScreen(int index, ScreenPtr pScreen) -{ - // Add alpha protecting replacements for fb screen functions - pScreen->PaintWindowBackground = SafeAlphaPaintWindow; - pScreen->PaintWindowBorder = SafeAlphaPaintWindow; - -#ifdef RENDER - { - PictureScreenPtr ps = GetPictureScreen(pScreen); - ps->Composite = SafeAlphaComposite; - } -#endif /* RENDER */ - - // Initialize accelerated rootless drawing - // Note that this must be done before DamageSetup(). - RootlessAccelInit(pScreen); - -#ifdef DAMAGE - // The Damage extension needs to wrap underneath the - // generic rootless layer, so do it now. - if (!DamageSetup(pScreen)) - return FALSE; -#endif - - // Initialize generic rootless code - return CRInit(pScreen); -} - - -/* - * CRScreenChanged - * Configuration of displays has changed. - */ -static void -CRScreenChanged(void) -{ - QuartzMessageServerThread(kXDarwinDisplayChanged, 0); -} - - -/* - * CRUpdateScreen - * Update screen after configuation change. - */ -static void -CRUpdateScreen(ScreenPtr pScreen) -{ - rootlessGlobalOffsetX = darwinMainScreenX; - rootlessGlobalOffsetY = darwinMainScreenY; - - AppleWMSetScreenOrigin(WindowTable[pScreen->myNum]); - - RootlessRepositionWindows(pScreen); - RootlessUpdateScreenPixmap(pScreen); -} - - -/* - * CRInitInput - * Finalize CR specific setup. - */ -static void -CRInitInput(int argc, char **argv) -{ - int i; - - rootlessGlobalOffsetX = darwinMainScreenX; - rootlessGlobalOffsetY = darwinMainScreenY; - - for (i = 0; i < screenInfo.numScreens; i++) - AppleWMSetScreenOrigin(WindowTable[i]); -} - - -/* - * CRIsX11Window - * Returns TRUE if cr is displaying this window. - */ -static Bool -CRIsX11Window(void *nsWindow, int windowNumber) -{ - NSWindow *theWindow = nsWindow; - - if (!theWindow) - return FALSE; - - if ([[theWindow contentView] isKindOfClass:classXView]) - return TRUE; - else - return FALSE; -} - - -/* - * Quartz display mode function list. - */ -static QuartzModeProcsRec crModeProcs = { - CRDisplayInit, - CRAddScreen, - CRSetupScreen, - CRInitInput, - QuartzInitCursor, - QuartzReallySetCursor, - QuartzSuspendXCursor, - QuartzResumeXCursor, - NULL, // No capture or release in rootless mode - NULL, - CRScreenChanged, - CRAddPseudoramiXScreens, - CRUpdateScreen, - CRIsX11Window, - NULL, // Cocoa NSWindows hide themselves - RootlessFrameForWindow, - TopLevelParent, - NULL, // No support for DRI surfaces - NULL -}; - - -/* - * QuartzModeBundleInit - * Initialize the display mode bundle after loading. - */ -Bool -QuartzModeBundleInit(void) -{ - quartzProcs = &crModeProcs; - quartzOpenGLBundle = crOpenGLBundle; - classXView = [XView class]; - return TRUE; -} diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/fullscreen/Imakefile b/nx-X11/programs/Xserver/hw/darwin/quartz/fullscreen/Imakefile deleted file mode 100644 index 59c295050..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/fullscreen/Imakefile +++ /dev/null @@ -1,19 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/Imakefile,v 1.1 2003/06/07 05:49:07 torrey Exp $ - -#include - -SRCS = fullscreen.c \ - quartzCursor.c - -OBJS = fullscreen.o \ - quartzCursor.o - -INCLUDES = -I. -I$(SERVERSRC)/mi -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ - -I$(FONTINCSRC) -I$(SERVERSRC)/render -I$(SERVERSRC)/miext/shadow \ - -I$(EXTINCSRC) -I.. -I../.. - -NormalLibraryObjectRule() -NormalLibraryTarget(fullscreen,$(OBJS)) - -DependTarget() - diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/fullscreen/fullscreen.c b/nx-X11/programs/Xserver/hw/darwin/quartz/fullscreen/fullscreen.c deleted file mode 100644 index fc0744ca5..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/fullscreen/fullscreen.c +++ /dev/null @@ -1,569 +0,0 @@ -/* - * Screen routines for full screen Quartz mode - * - * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * TORREY T. LYONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF - * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/fullscreen/fullscreen.c,v 1.4 2005/07/01 22:43:08 daniels Exp $ */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/fullscreen/fullscreen.c,v 1.3 2003/11/27 01:59:53 torrey Exp $ */ - -#include "quartzCommon.h" -#include "darwin.h" -#include "quartz.h" -#include "quartzCursor.h" -#include "colormapst.h" -#include "scrnintstr.h" -#include "micmap.h" -#include "shadow.h" - -// Full screen specific per screen storage structure -typedef struct { - CGDirectDisplayID displayID; - CFDictionaryRef xDisplayMode; - CFDictionaryRef aquaDisplayMode; - CGDirectPaletteRef xPalette; - CGDirectPaletteRef aquaPalette; - unsigned char *framebuffer; - unsigned char *shadowPtr; -} FSScreenRec, *FSScreenPtr; - -#define FULLSCREEN_PRIV(pScreen) \ - ((FSScreenPtr)pScreen->devPrivates[fsScreenIndex].ptr) - -static int fsScreenIndex; -static CGDirectDisplayID *quartzDisplayList = NULL; -static int quartzNumScreens = 0; -static FSScreenPtr quartzScreens[MAXSCREENS]; - -static int darwinCmapPrivateIndex = -1; -static unsigned long darwinCmapGeneration = 0; - -#define CMAP_PRIV(pCmap) \ - ((CGDirectPaletteRef) (pCmap)->devPrivates[darwinCmapPrivateIndex].ptr) - -/* - ============================================================================= - - Colormap handling - - ============================================================================= -*/ - -/* - * FSInitCmapPrivates - * Colormap privates may be allocated after the default colormap has - * already been created for some screens. This initialization procedure - * is called for each default colormap that is found. - */ -static Bool -FSInitCmapPrivates( - ColormapPtr pCmap) -{ - return TRUE; -} - - -/* - * FSCreateColormap - * This is a callback from X after a new colormap is created. - * We allocate a new CoreGraphics pallete for each colormap. - */ -static Bool -FSCreateColormap( - ColormapPtr pCmap) -{ - CGDirectPaletteRef pallete; - - // Allocate private storage for the hardware dependent colormap info. - if (darwinCmapGeneration != serverGeneration) { - if ((darwinCmapPrivateIndex = - AllocateColormapPrivateIndex(FSInitCmapPrivates)) < 0) - { - return FALSE; - } - darwinCmapGeneration = serverGeneration; - } - - pallete = CGPaletteCreateDefaultColorPalette(); - if (!pallete) return FALSE; - - CMAP_PRIV(pCmap) = pallete; - return TRUE; -} - - -/* - * FSDestroyColormap - * This is called by DIX FreeColormap after it has uninstalled a colormap - * and notified all interested parties. We deallocated the corresponding - * CoreGraphics pallete. - */ -static void -FSDestroyColormap( - ColormapPtr pCmap) -{ - CGPaletteRelease( CMAP_PRIV(pCmap) ); -} - - -/* - * FSInstallColormap - * Set the current CoreGraphics pallete to the pallete corresponding - * to the provided colormap. - */ -static void -FSInstallColormap( - ColormapPtr pCmap) -{ - CGDirectPaletteRef palette = CMAP_PRIV(pCmap); - ScreenPtr pScreen = pCmap->pScreen; - FSScreenPtr fsDisplayInfo = FULLSCREEN_PRIV(pScreen); - - // Inform all interested parties that the map is being changed. - miInstallColormap(pCmap); - - if (quartzServerVisible) - CGDisplaySetPalette(fsDisplayInfo->displayID, palette); - - fsDisplayInfo->xPalette = palette; -} - - -/* - * FSStoreColors - * This is a callback from X to change the hardware colormap - * when using PsuedoColor in full screen mode. - */ -static void -FSStoreColors( - ColormapPtr pCmap, - int numEntries, - xColorItem *pdefs) -{ - CGDirectPaletteRef palette = CMAP_PRIV(pCmap); - ScreenPtr pScreen = pCmap->pScreen; - FSScreenPtr fsDisplayInfo = FULLSCREEN_PRIV(pScreen); - CGDeviceColor color; - int i; - - if (! palette) - return; - - for (i = 0; i < numEntries; i++) { - color.red = pdefs[i].red / 65535.0; - color.green = pdefs[i].green / 65535.0; - color.blue = pdefs[i].blue / 65535.0; - CGPaletteSetColorAtIndex(palette, color, pdefs[i].pixel); - } - - // Update hardware colormap - if (quartzServerVisible) - CGDisplaySetPalette(fsDisplayInfo->displayID, palette); -} - - -/* - ============================================================================= - - Switching between Aqua and X - - ============================================================================= -*/ - -/* - * FSCapture - * Capture the screen so we can draw. Called directly from the main thread - * to synchronize with hiding the menubar. - */ -static void FSCapture(void) -{ - int i; - - if (quartzRootless) return; - - for (i = 0; i < quartzNumScreens; i++) { - FSScreenPtr fsDisplayInfo = quartzScreens[i]; - CGDirectDisplayID cgID = fsDisplayInfo->displayID; - - if (!CGDisplayIsCaptured(cgID)) { - CGDisplayCapture(cgID); - fsDisplayInfo->aquaDisplayMode = CGDisplayCurrentMode(cgID); - if (fsDisplayInfo->xDisplayMode != fsDisplayInfo->aquaDisplayMode) - CGDisplaySwitchToMode(cgID, fsDisplayInfo->xDisplayMode); - if (fsDisplayInfo->xPalette) - CGDisplaySetPalette(cgID, fsDisplayInfo->xPalette); - } - } -} - - -/* - * FSRelease - * Release the screen so others can draw. - */ -static void FSRelease(void) -{ - int i; - - if (quartzRootless) return; - - for (i = 0; i < quartzNumScreens; i++) { - FSScreenPtr fsDisplayInfo = quartzScreens[i]; - CGDirectDisplayID cgID = fsDisplayInfo->displayID; - - if (CGDisplayIsCaptured(cgID)) { - if (fsDisplayInfo->xDisplayMode != fsDisplayInfo->aquaDisplayMode) - CGDisplaySwitchToMode(cgID, fsDisplayInfo->aquaDisplayMode); - if (fsDisplayInfo->aquaPalette) - CGDisplaySetPalette(cgID, fsDisplayInfo->aquaPalette); - CGDisplayRelease(cgID); - } - } -} - - -/* - * FSSuspendScreen - * Suspend X11 cursor and drawing to the screen. - */ -static void FSSuspendScreen( - ScreenPtr pScreen) -{ - QuartzSuspendXCursor(pScreen); - xf86SetRootClip(pScreen, FALSE); -} - - -/* - * FSResumeScreen - * Resume X11 cursor and drawing to the screen. - */ -static void FSResumeScreen( - ScreenPtr pScreen, - int x, // cursor location - int y ) -{ - QuartzResumeXCursor(pScreen, x, y); - xf86SetRootClip(pScreen, TRUE); -} - - -/* - ============================================================================= - - Screen initialization - - ============================================================================= -*/ - -/* - * FSDisplayInit - * Full screen specific initialization called from InitOutput. - */ -static void FSDisplayInit(void) -{ - static unsigned long generation = 0; - CGDisplayCount quartzDisplayCount = 0; - - ErrorF("Display mode: Full screen Quartz -- Direct Display\n"); - - // Allocate private storage for each screen's mode specific info - if (generation != serverGeneration) { - fsScreenIndex = AllocateScreenPrivateIndex(); - generation = serverGeneration; - } - - // Find all the CoreGraphics displays - CGGetActiveDisplayList(0, NULL, &quartzDisplayCount); - quartzDisplayList = xalloc(quartzDisplayCount * sizeof(CGDirectDisplayID)); - CGGetActiveDisplayList(quartzDisplayCount, quartzDisplayList, - &quartzDisplayCount); - - darwinScreensFound = quartzDisplayCount; - atexit(FSRelease); -} - - -/* - * FSFindDisplayMode - * Find the appropriate display mode to use in full screen mode. - * If display mode is not the same as the current Aqua mode, switch - * to the new mode. - */ -static Bool FSFindDisplayMode( - FSScreenPtr fsDisplayInfo) -{ - CGDirectDisplayID cgID = fsDisplayInfo->displayID; - size_t height, width, bpp; - boolean_t exactMatch; - - fsDisplayInfo->aquaDisplayMode = CGDisplayCurrentMode(cgID); - - // If no user options, use current display mode - if (darwinDesiredWidth == 0 && darwinDesiredDepth == -1 && - darwinDesiredRefresh == -1) - { - fsDisplayInfo->xDisplayMode = fsDisplayInfo->aquaDisplayMode; - return TRUE; - } - - // If the user has no choice for size, use current - if (darwinDesiredWidth == 0) { - width = CGDisplayPixelsWide(cgID); - height = CGDisplayPixelsHigh(cgID); - } else { - width = darwinDesiredWidth; - height = darwinDesiredHeight; - } - - switch (darwinDesiredDepth) { - case 0: - bpp = 8; - break; - case 1: - bpp = 16; - break; - case 2: - bpp = 32; - break; - default: - bpp = CGDisplayBitsPerPixel(cgID); - } - - if (darwinDesiredRefresh == -1) { - fsDisplayInfo->xDisplayMode = - CGDisplayBestModeForParameters(cgID, bpp, width, height, - &exactMatch); - } else { - fsDisplayInfo->xDisplayMode = - CGDisplayBestModeForParametersAndRefreshRate(cgID, bpp, - width, height, darwinDesiredRefresh, &exactMatch); - } - if (!exactMatch) { - fsDisplayInfo->xDisplayMode = fsDisplayInfo->aquaDisplayMode; - return FALSE; - } - - // Switch to the new display mode - CGDisplaySwitchToMode(cgID, fsDisplayInfo->xDisplayMode); - return TRUE; -} - - -/* - * FSAddScreen - * Do initialization of each screen for Quartz in full screen mode. - */ -static Bool FSAddScreen( - int index, - ScreenPtr pScreen) -{ - DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen); - QuartzScreenPtr displayInfo = QUARTZ_PRIV(pScreen); - CGDirectDisplayID cgID = quartzDisplayList[index]; - CGRect bounds; - FSScreenPtr fsDisplayInfo; - - // Allocate space for private per screen fullscreen specific storage. - fsDisplayInfo = xalloc(sizeof(FSScreenRec)); - FULLSCREEN_PRIV(pScreen) = fsDisplayInfo; - - displayInfo->displayCount = 1; - displayInfo->displayIDs = xrealloc(displayInfo->displayIDs, - 1 * sizeof(CGDirectDisplayID)); - displayInfo->displayIDs[0] = cgID; - - fsDisplayInfo->displayID = cgID; - fsDisplayInfo->xDisplayMode = 0; - fsDisplayInfo->aquaDisplayMode = 0; - fsDisplayInfo->xPalette = 0; - fsDisplayInfo->aquaPalette = 0; - - // Capture full screen because X doesn't like read-only framebuffer. - // We need to do this before we (potentially) switch the display mode. - CGDisplayCapture(cgID); - - if (! FSFindDisplayMode(fsDisplayInfo)) { - ErrorF("Could not support specified display mode on screen %i.\n", - index); - xfree(fsDisplayInfo); - return FALSE; - } - - // Don't need to flip y-coordinate as CoreGraphics treats (0, 0) - // as the top left of main screen. - bounds = CGDisplayBounds(cgID); - dfb->x = bounds.origin.x; - dfb->y = bounds.origin.y; - dfb->width = bounds.size.width; - dfb->height = bounds.size.height; - dfb->pitch = CGDisplayBytesPerRow(cgID); - dfb->bitsPerPixel = CGDisplayBitsPerPixel(cgID); - - if (dfb->bitsPerPixel == 8) { - if (CGDisplayCanSetPalette(cgID)) { - dfb->colorType = PseudoColor; - } else { - dfb->colorType = StaticColor; - } - dfb->bitsPerComponent = 8; - dfb->colorBitsPerPixel = 8; - } else { - dfb->colorType = TrueColor; - dfb->bitsPerComponent = CGDisplayBitsPerSample(cgID); - dfb->colorBitsPerPixel = CGDisplaySamplesPerPixel(cgID) * - dfb->bitsPerComponent; - } - - fsDisplayInfo->framebuffer = CGDisplayBaseAddress(cgID); - - // allocate shadow framebuffer - fsDisplayInfo->shadowPtr = xalloc(dfb->pitch * dfb->height); - dfb->framebuffer = fsDisplayInfo->shadowPtr; - - return TRUE; -} - - -/* - * FSShadowUpdate - * Update the damaged regions of the shadow framebuffer on the display. - */ -static void FSShadowUpdate( - ScreenPtr pScreen, - shadowBufPtr pBuf) -{ - DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen); - FSScreenPtr fsDisplayInfo = FULLSCREEN_PRIV(pScreen); - RegionPtr damage = &pBuf->damage; - int numBox = REGION_NUM_RECTS(damage); - BoxPtr pBox = REGION_RECTS(damage); - int pitch = dfb->pitch; - int bpp = dfb->bitsPerPixel/8; - - // Don't update if the X server is not visible - if (!quartzServerVisible) - return; - - // Loop through all the damaged boxes - while (numBox--) { - int width, height, offset; - unsigned char *src, *dst; - - width = (pBox->x2 - pBox->x1) * bpp; - height = pBox->y2 - pBox->y1; - offset = (pBox->y1 * pitch) + (pBox->x1 * bpp); - src = fsDisplayInfo->shadowPtr + offset; - dst = fsDisplayInfo->framebuffer + offset; - - while (height--) { - memcpy(dst, src, width); - dst += pitch; - src += pitch; - } - - // Get the next box - pBox++; - } -} - - -/* - * FSSetupScreen - * Finalize full screen specific setup of each screen. - */ -static Bool FSSetupScreen( - int index, - ScreenPtr pScreen) -{ - DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen); - FSScreenPtr fsDisplayInfo = FULLSCREEN_PRIV(pScreen); - CGDirectDisplayID cgID = fsDisplayInfo->displayID; - - // Initialize shadow framebuffer support - if (! shadowInit(pScreen, FSShadowUpdate, NULL)) { - ErrorF("Failed to initalize shadow framebuffer for screen %i.\n", - index); - return FALSE; - } - - if (dfb->colorType == PseudoColor) { - // Initialize colormap handling - size_t aquaBpp; - - // If Aqua is using 8 bits we need to keep track of its pallete. - CFNumberGetValue(CFDictionaryGetValue(fsDisplayInfo->aquaDisplayMode, - kCGDisplayBitsPerPixel), kCFNumberLongType, &aquaBpp); - if (aquaBpp <= 8) - fsDisplayInfo->aquaPalette = CGPaletteCreateWithDisplay(cgID); - - pScreen->CreateColormap = FSCreateColormap; - pScreen->DestroyColormap = FSDestroyColormap; - pScreen->InstallColormap = FSInstallColormap; - pScreen->StoreColors = FSStoreColors; - - } - - quartzScreens[quartzNumScreens++] = fsDisplayInfo; - return TRUE; -} - - -/* - * Quartz display mode function list. - */ -static QuartzModeProcsRec fsModeProcs = { - FSDisplayInit, - FSAddScreen, - FSSetupScreen, - NULL, // Not needed - QuartzInitCursor, - QuartzReallySetCursor, - FSSuspendScreen, - FSResumeScreen, - FSCapture, - FSRelease, - NULL, // No dynamic screen change support - NULL, - NULL, - NULL, // No rootless code in fullscreen - NULL, - NULL, - NULL, - NULL, // No support for DRI surfaces - NULL -}; - - -/* - * QuartzModeBundleInit - * Initialize the display mode bundle after loading. - */ -Bool -QuartzModeBundleInit(void) -{ - quartzProcs = &fsModeProcs; - quartzOpenGLBundle = NULL; // Only Mesa support for now - return TRUE; -} diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/fullscreen/quartzCursor.c b/nx-X11/programs/Xserver/hw/darwin/quartz/fullscreen/quartzCursor.c deleted file mode 100644 index 8abce2318..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/fullscreen/quartzCursor.c +++ /dev/null @@ -1,653 +0,0 @@ -/************************************************************** - * - * Support for using the Quartz Window Manager cursor - * - **************************************************************/ -/* - * Copyright (c) 2001-2003 Torrey T. Lyons and Greg Parker. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzCursor.c,v 1.5 2003/01/23 00:34:26 torrey Exp $ */ - -#include "quartzCommon.h" -#include "quartzCursor.h" -#include "darwin.h" - -#include - -#include "mi.h" -#include "scrnintstr.h" -#include "cursorstr.h" -#include "mipointrst.h" -#include "globals.h" - -// Size of the QuickDraw cursor -#define CURSORWIDTH 16 -#define CURSORHEIGHT 16 - -typedef struct { - int qdCursorMode; - int qdCursorVisible; - int useQDCursor; - QueryBestSizeProcPtr QueryBestSize; - miPointerSpriteFuncPtr spriteFuncs; -} QuartzCursorScreenRec, *QuartzCursorScreenPtr; - -static int darwinCursorScreenIndex = -1; -static unsigned long darwinCursorGeneration = 0; -static CursorPtr quartzLatentCursor = NULL; -static QD_Cursor gQDArrow; // QuickDraw arrow cursor - -// Cursor for the main thread to set (NULL = arrow cursor). -static CCrsrHandle currentCursor = NULL; -static pthread_mutex_t cursorMutex; -static pthread_cond_t cursorCondition; - -#define CURSOR_PRIV(pScreen) \ - ((QuartzCursorScreenPtr)pScreen->devPrivates[darwinCursorScreenIndex].ptr) - -#define HIDE_QD_CURSOR(pScreen, visible) \ - if (visible) { \ - int ix; \ - for (ix = 0; ix < QUARTZ_PRIV(pScreen)->displayCount; ix++) { \ - CGDisplayHideCursor(QUARTZ_PRIV(pScreen)->displayIDs[ix]); \ - } \ - visible = FALSE; \ - } ((void)0) - -#define SHOW_QD_CURSOR(pScreen, visible) \ - { \ - int ix; \ - for (ix = 0; ix < QUARTZ_PRIV(pScreen)->displayCount; ix++) { \ - CGDisplayShowCursor(QUARTZ_PRIV(pScreen)->displayIDs[ix]); \ - } \ - visible = TRUE; \ - } ((void)0) - -#define CHANGE_QD_CURSOR(cursorH) \ - if (!quartzServerQuitting) { \ - /* Acquire lock and tell the main thread to change cursor */ \ - pthread_mutex_lock(&cursorMutex); \ - currentCursor = (CCrsrHandle) (cursorH); \ - QuartzMessageMainThread(kQuartzCursorUpdate, NULL, 0); \ - \ - /* Wait for the main thread to change the cursor */ \ - pthread_cond_wait(&cursorCondition, &cursorMutex); \ - pthread_mutex_unlock(&cursorMutex); \ - } ((void)0) - - -/* - * MakeQDCursor helpers: CTAB_ENTER, interleave - */ - -// Add a color entry to a ctab -#define CTAB_ENTER(ctab, index, r, g, b) \ - ctab->ctTable[index].value = index; \ - ctab->ctTable[index].rgb.red = r; \ - ctab->ctTable[index].rgb.green = g; \ - ctab->ctTable[index].rgb.blue = b - -// Make an unsigned short by interleaving the bits of bytes c1 and c2. -// High bit of c1 is first; low bit of c2 is last. -// Interleave is a built-in INTERCAL operator. -static unsigned short -interleave( - unsigned char c1, - unsigned char c2 ) -{ - return - ((c1 & 0x80) << 8) | ((c2 & 0x80) << 7) | - ((c1 & 0x40) << 7) | ((c2 & 0x40) << 6) | - ((c1 & 0x20) << 6) | ((c2 & 0x20) << 5) | - ((c1 & 0x10) << 5) | ((c2 & 0x10) << 4) | - ((c1 & 0x08) << 4) | ((c2 & 0x08) << 3) | - ((c1 & 0x04) << 3) | ((c2 & 0x04) << 2) | - ((c1 & 0x02) << 2) | ((c2 & 0x02) << 1) | - ((c1 & 0x01) << 1) | ((c2 & 0x01) << 0) ; -} - -/* - * MakeQDCursor - * Make a QuickDraw color cursor from the given X11 cursor. - * Warning: This code is nasty. Color cursors were meant to be read - * from resources; constructing the structures programmatically is messy. - */ -/* - QuickDraw cursor representation: - Our color cursor is a 2 bit per pixel pixmap. - Each pixel's bits are (source<<1 | mask) from the original X cursor pixel. - The cursor's color table maps the colors like this: - (2-bit value | X result | colortable | Mac result) - 00 | transparent | white | transparent (white outside mask) - 01 | back color | back color | back color - 10 | undefined | black | invert background (just for fun) - 11 | fore color | fore color | fore color -*/ -static CCrsrHandle -MakeQDCursor( - CursorPtr pCursor ) -{ - CCrsrHandle result; - CCrsrPtr curs; - int i, w, h; - unsigned short rowMask; - PixMap *pix; - ColorTable *ctab; - unsigned short *image; - - result = (CCrsrHandle) NewHandleClear(sizeof(CCrsr)); - if (!result) return NULL; - HLock((Handle)result); - curs = *result; - - // Initialize CCrsr - curs->crsrType = 0x8001; // 0x8000 = b&w, 0x8001 = color - curs->crsrMap = (PixMapHandle) NewHandleClear(sizeof(PixMap)); - if (!curs->crsrMap) goto pixAllocFailed; - HLock((Handle)curs->crsrMap); - pix = *curs->crsrMap; - curs->crsrData = NULL; // raw cursor image data (set below) - curs->crsrXData = NULL; // QD's processed data - curs->crsrXValid = 0; // zero means QD must re-process cursor data - curs->crsrXHandle = NULL; // reserved - memset(curs->crsr1Data, 0, CURSORWIDTH*CURSORHEIGHT/8); // b&w data - memset(curs->crsrMask, 0, CURSORWIDTH*CURSORHEIGHT/8); // b&w & color mask - curs->crsrHotSpot.h = min(CURSORWIDTH, pCursor->bits->xhot); // hot spot - curs->crsrHotSpot.v = min(CURSORHEIGHT, pCursor->bits->yhot); // hot spot - curs->crsrXTable = 0; // reserved - curs->crsrID = GetCTSeed(); // unique ID from Color Manager - - // Set the b&w data and mask - w = min(pCursor->bits->width, CURSORWIDTH); - h = min(pCursor->bits->height, CURSORHEIGHT); - rowMask = ~((1 << (CURSORWIDTH - w)) - 1); - for (i = 0; i < h; i++) { - curs->crsr1Data[i] = rowMask & - ((pCursor->bits->source[i*4]<<8) | pCursor->bits->source[i*4+1]); - curs->crsrMask[i] = rowMask & - ((pCursor->bits->mask[i*4]<<8) | pCursor->bits->mask[i*4+1]); - } - - // Set the color data and mask - // crsrMap: defines bit depth and size and colortable only - pix->rowBytes = (CURSORWIDTH * 2 / 8) | 0x8000; // last bit on means PixMap - SetRect(&pix->bounds, 0, 0, CURSORWIDTH, CURSORHEIGHT); // see TN 1020 - pix->pixelSize = 2; - pix->cmpCount = 1; - pix->cmpSize = 2; - // pix->pmTable set below - - // crsrData is the pixel data. crsrMap's baseAddr is not used. - curs->crsrData = NewHandleClear(CURSORWIDTH*CURSORHEIGHT * 2 / 8); - if (!curs->crsrData) goto imageAllocFailed; - HLock((Handle)curs->crsrData); - image = (unsigned short *) *curs->crsrData; - // Pixel data is just 1-bit data and mask interleaved (see above) - for (i = 0; i < h; i++) { - unsigned char s, m; - s = pCursor->bits->source[i*4] & (rowMask >> 8); - m = pCursor->bits->mask[i*4] & (rowMask >> 8); - image[2*i] = interleave(s, m); - s = pCursor->bits->source[i*4+1] & (rowMask & 0x00ff); - m = pCursor->bits->mask[i*4+1] & (rowMask & 0x00ff); - image[2*i+1] = interleave(s, m); - } - - // Build the color table (entries described above) - // NewPixMap allocates a color table handle. - pix->pmTable = (CTabHandle) NewHandleClear(sizeof(ColorTable) + 3 - * sizeof(ColorSpec)); - if (!pix->pmTable) goto ctabAllocFailed; - HLock((Handle)pix->pmTable); - ctab = *pix->pmTable; - ctab->ctSeed = GetCTSeed(); - ctab->ctFlags = 0; - ctab->ctSize = 3; // color count - 1 - CTAB_ENTER(ctab, 0, 0xffff, 0xffff, 0xffff); - CTAB_ENTER(ctab, 1, pCursor->backRed, pCursor->backGreen, - pCursor->backBlue); - CTAB_ENTER(ctab, 2, 0x0000, 0x0000, 0x0000); - CTAB_ENTER(ctab, 3, pCursor->foreRed, pCursor->foreGreen, - pCursor->foreBlue); - - HUnlock((Handle)pix->pmTable); // ctab - HUnlock((Handle)curs->crsrData); // image data - HUnlock((Handle)curs->crsrMap); // pix - HUnlock((Handle)result); // cursor - - return result; - - // "What we have here is a failure to allocate" -ctabAllocFailed: - HUnlock((Handle)curs->crsrData); - DisposeHandle((Handle)curs->crsrData); -imageAllocFailed: - HUnlock((Handle)curs->crsrMap); - DisposeHandle((Handle)curs->crsrMap); -pixAllocFailed: - HUnlock((Handle)result); - DisposeHandle((Handle)result); - return NULL; -} - - -/* - * FreeQDCursor - * Destroy a QuickDraw color cursor created with MakeQDCursor(). - * The cursor must not currently be on screen. - */ -static void FreeQDCursor(CCrsrHandle cursHandle) -{ - CCrsrPtr curs; - PixMap *pix; - - HLock((Handle)cursHandle); - curs = *cursHandle; - HLock((Handle)curs->crsrMap); - pix = *curs->crsrMap; - DisposeHandle((Handle)pix->pmTable); - HUnlock((Handle)curs->crsrMap); - DisposeHandle((Handle)curs->crsrMap); - DisposeHandle((Handle)curs->crsrData); - HUnlock((Handle)cursHandle); - DisposeHandle((Handle)cursHandle); -} - - -/* -=========================================================================== - - Pointer sprite functions - -=========================================================================== -*/ - -/* - * QuartzRealizeCursor - * Convert the X cursor representation to QuickDraw format if possible. - */ -Bool -QuartzRealizeCursor( - ScreenPtr pScreen, - CursorPtr pCursor ) -{ - CCrsrHandle qdCursor; - QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); - - if(!pCursor || !pCursor->bits) - return FALSE; - - // if the cursor is too big we use a software cursor - if ((pCursor->bits->height > CURSORHEIGHT) || - (pCursor->bits->width > CURSORWIDTH) || !ScreenPriv->useQDCursor) - { - if (quartzRootless) { - // rootless can't use a software cursor - return TRUE; - } else { - return (*ScreenPriv->spriteFuncs->RealizeCursor) - (pScreen, pCursor); - } - } - - // make new cursor image - qdCursor = MakeQDCursor(pCursor); - if (!qdCursor) return FALSE; - - // save the result - pCursor->devPriv[pScreen->myNum] = (pointer) qdCursor; - - return TRUE; -} - - -/* - * QuartzUnrealizeCursor - * Free the storage space associated with a realized cursor. - */ -Bool -QuartzUnrealizeCursor( - ScreenPtr pScreen, - CursorPtr pCursor ) -{ - QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); - - if ((pCursor->bits->height > CURSORHEIGHT) || - (pCursor->bits->width > CURSORWIDTH) || !ScreenPriv->useQDCursor) - { - if (quartzRootless) { - return TRUE; - } else { - return (*ScreenPriv->spriteFuncs->UnrealizeCursor) - (pScreen, pCursor); - } - } else { - CCrsrHandle oldCursor = (CCrsrHandle) pCursor->devPriv[pScreen->myNum]; - - if (currentCursor != oldCursor) { - // This should only fail when quitting, in which case we just leak. - FreeQDCursor(oldCursor); - } - pCursor->devPriv[pScreen->myNum] = NULL; - return TRUE; - } -} - - -/* - * QuartzSetCursor - * Set the cursor sprite and position. - * Use QuickDraw cursor if possible. - */ -static void -QuartzSetCursor( - ScreenPtr pScreen, - CursorPtr pCursor, - int x, - int y) -{ - QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); - - quartzLatentCursor = pCursor; - - // Don't touch Mac OS cursor if X is hidden! - if (!quartzServerVisible) - return; - - if (!pCursor) { - // Remove the cursor completely. - HIDE_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible); - if (! ScreenPriv->qdCursorMode) - (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, 0, x, y); - } - else if ((pCursor->bits->height <= CURSORHEIGHT) && - (pCursor->bits->width <= CURSORWIDTH) && ScreenPriv->useQDCursor) - { - // Cursor is small enough to use QuickDraw directly. - if (! ScreenPriv->qdCursorMode) // remove the X cursor - (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, 0, x, y); - ScreenPriv->qdCursorMode = TRUE; - - CHANGE_QD_CURSOR(pCursor->devPriv[pScreen->myNum]); - SHOW_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible); - } - else if (quartzRootless) { - // Rootless can't use a software cursor, so we just use Mac OS arrow. - CHANGE_QD_CURSOR(NULL); - SHOW_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible); - } - else { - // Cursor is too big for QuickDraw. Use X software cursor. - HIDE_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible); - ScreenPriv->qdCursorMode = FALSE; - (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, pCursor, x, y); - } -} - - -/* - * QuartzReallySetCursor - * Set the QuickDraw cursor. Called from the main thread since changing the - * cursor with QuickDraw is not thread safe on dual processor machines. - */ -void -QuartzReallySetCursor() -{ - pthread_mutex_lock(&cursorMutex); - - if (currentCursor) { - SetCCursor(currentCursor); - } else { - SetCursor(&gQDArrow); - } - - pthread_cond_signal(&cursorCondition); - pthread_mutex_unlock(&cursorMutex); -} - - -/* - * QuartzMoveCursor - * Move the cursor. This is a noop for QuickDraw. - */ -static void -QuartzMoveCursor( - ScreenPtr pScreen, - int x, - int y) -{ - QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); - - // only the X cursor needs to be explicitly moved - if (!ScreenPriv->qdCursorMode) - (*ScreenPriv->spriteFuncs->MoveCursor)(pScreen, x, y); -} - - -static miPointerSpriteFuncRec quartzSpriteFuncsRec = { - QuartzRealizeCursor, - QuartzUnrealizeCursor, - QuartzSetCursor, - QuartzMoveCursor -}; - - -/* -=========================================================================== - - Pointer screen functions - -=========================================================================== -*/ - -/* - * QuartzCursorOffScreen - */ -static Bool QuartzCursorOffScreen(ScreenPtr *pScreen, int *x, int *y) -{ - return FALSE; -} - - -/* - * QuartzCrossScreen - */ -static void QuartzCrossScreen(ScreenPtr pScreen, Bool entering) -{ - return; -} - - -/* - * QuartzWarpCursor - * Change the cursor position without generating an event or motion history. - * The input coordinates (x,y) are in pScreen-local X11 coordinates. - * - */ -static void -QuartzWarpCursor( - ScreenPtr pScreen, - int x, - int y) -{ - static int neverMoved = TRUE; - - if (neverMoved) { - // Don't move the cursor the first time. This is the jump-to-center - // initialization, and it's annoying because we may still be in MacOS. - neverMoved = FALSE; - return; - } - - if (quartzServerVisible) { - CGDisplayErr cgErr; - CGPoint cgPoint; - // Only need to do this for one display. Any display will do. - CGDirectDisplayID cgID = QUARTZ_PRIV(pScreen)->displayIDs[0]; - CGRect cgRect = CGDisplayBounds(cgID); - - // Convert (x,y) to CoreGraphics screen-local CG coordinates. - // This is necessary because the X11 screen and CG screen may not - // coincide. (e.g. X11 screen may be moved to dodge the menu bar) - - // Make point in X11 global coordinates - cgPoint = CGPointMake(x + dixScreenOrigins[pScreen->myNum].x, - y + dixScreenOrigins[pScreen->myNum].y); - // Shift to CoreGraphics global screen coordinates - cgPoint.x += darwinMainScreenX; - cgPoint.y += darwinMainScreenY; - // Shift to CoreGraphics screen-local coordinates - cgPoint.x -= cgRect.origin.x; - cgPoint.y -= cgRect.origin.y; - - cgErr = CGDisplayMoveCursorToPoint(cgID, cgPoint); - if (cgErr != CGDisplayNoErr) { - ErrorF("Could not set cursor position with error code 0x%x.\n", - cgErr); - } - } - - miPointerWarpCursor(pScreen, x, y); - miPointerUpdate(); -} - - -static miPointerScreenFuncRec quartzScreenFuncsRec = { - QuartzCursorOffScreen, - QuartzCrossScreen, - QuartzWarpCursor, - DarwinEQPointerPost, - DarwinEQSwitchScreen -}; - - -/* -=========================================================================== - - Other screen functions - -=========================================================================== -*/ - -/* - * QuartzCursorQueryBestSize - * Handle queries for best cursor size - */ -static void -QuartzCursorQueryBestSize( - int class, - unsigned short *width, - unsigned short *height, - ScreenPtr pScreen) -{ - QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); - - if (class == CursorShape) { - *width = CURSORWIDTH; - *height = CURSORHEIGHT; - } else { - (*ScreenPriv->QueryBestSize)(class, width, height, pScreen); - } -} - - -/* - * QuartzInitCursor - * Initialize cursor support - */ -Bool -QuartzInitCursor( - ScreenPtr pScreen ) -{ - QuartzCursorScreenPtr ScreenPriv; - miPointerScreenPtr PointPriv; - DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen); - - // initialize software cursor handling (always needed as backup) - if (!miDCInitialize(pScreen, &quartzScreenFuncsRec)) { - return FALSE; - } - - // allocate private storage for this screen's QuickDraw cursor info - if (darwinCursorGeneration != serverGeneration) { - if ((darwinCursorScreenIndex = AllocateScreenPrivateIndex()) < 0) - return FALSE; - darwinCursorGeneration = serverGeneration; - } - - ScreenPriv = xcalloc( 1, sizeof(QuartzCursorScreenRec) ); - if (!ScreenPriv) return FALSE; - - CURSOR_PRIV(pScreen) = ScreenPriv; - - // override some screen procedures - ScreenPriv->QueryBestSize = pScreen->QueryBestSize; - pScreen->QueryBestSize = QuartzCursorQueryBestSize; - - // initialize QuickDraw cursor handling - GetQDGlobalsArrow(&gQDArrow); - PointPriv = (miPointerScreenPtr) - pScreen->devPrivates[miPointerScreenIndex].ptr; - - ScreenPriv->spriteFuncs = PointPriv->spriteFuncs; - PointPriv->spriteFuncs = &quartzSpriteFuncsRec; - - if (!quartzRootless) - ScreenPriv->useQDCursor = QuartzFSUseQDCursor(dfb->colorBitsPerPixel); - else - ScreenPriv->useQDCursor = TRUE; - ScreenPriv->qdCursorMode = TRUE; - ScreenPriv->qdCursorVisible = TRUE; - - // initialize cursor mutex lock - pthread_mutex_init(&cursorMutex, NULL); - - // initialize condition for waiting - pthread_cond_init(&cursorCondition, NULL); - - return TRUE; -} - - -// X server is hiding. Restore the Aqua cursor. -void QuartzSuspendXCursor( - ScreenPtr pScreen ) -{ - QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); - - CHANGE_QD_CURSOR(NULL); - SHOW_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible); -} - - -// X server is showing. Restore the X cursor. -void QuartzResumeXCursor( - ScreenPtr pScreen, - int x, - int y ) -{ - QuartzSetCursor(pScreen, quartzLatentCursor, x, y); -} diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/fullscreen/quartzCursor.h b/nx-X11/programs/Xserver/hw/darwin/quartz/fullscreen/quartzCursor.h deleted file mode 100644 index efcc4435e..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/fullscreen/quartzCursor.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * quartzCursor.h - * - * External interface for Quartz hardware cursor - */ -/* - * Copyright (c) 2001 Torrey T. Lyons and Greg Parker. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzCursor.h,v 1.1 2002/03/28 02:21:19 torrey Exp $ */ - -#ifndef QUARTZCURSOR_H -#define QUARTZCURSOR_H - -#include "screenint.h" - -Bool QuartzInitCursor(ScreenPtr pScreen); -void QuartzReallySetCursor(void); -void QuartzSuspendXCursor(ScreenPtr pScreen); -void QuartzResumeXCursor(ScreenPtr pScreen, int x, int y); - -#endif diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/keysym2ucs.c b/nx-X11/programs/Xserver/hw/darwin/quartz/keysym2ucs.c deleted file mode 100644 index 98b8b6fee..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/keysym2ucs.c +++ /dev/null @@ -1,909 +0,0 @@ -/* $XFree86: $ - * - * This module converts keysym values into the corresponding ISO 10646 - * (UCS, Unicode) values. - * - * The array keysymtab[] contains pairs of X11 keysym values for graphical - * characters and the corresponding Unicode value. The function - * keysym2ucs() maps a keysym onto a Unicode value using a binary search, - * therefore keysymtab[] must remain SORTED by keysym value. - * - * The keysym -> UTF-8 conversion will hopefully one day be provided - * by Xlib via XmbLookupString() and should ideally not have to be - * done in X applications. But we are not there yet. - * - * We allow to represent any UCS character in the range U-00000000 to - * U-00FFFFFF by a keysym value in the range 0x01000000 to 0x01ffffff. - * This admittedly does not cover the entire 31-bit space of UCS, but - * it does cover all of the characters up to U-10FFFF, which can be - * represented by UTF-16, and more, and it is very unlikely that higher - * UCS codes will ever be assigned by ISO. So to get Unicode character - * U+ABCD you can directly use keysym 0x0100abcd. - * - * NOTE: The comments in the table below contain the actual character - * encoded in UTF-8, so for viewing and editing best use an editor in - * UTF-8 mode. - * - * Author: Markus G. Kuhn , University of Cambridge, April 2001 - * - * Special thanks to Richard Verhoeven for preparing - * an initial draft of the mapping table. - * - * This software is in the public domain. Share and enjoy! - * - * AUTOMATICALLY GENERATED FILE, DO NOT EDIT !!! (unicode/convmap.pl) - */ - -#include "keysym2ucs.h" - -#include -#include - -struct codepair { - unsigned short keysym; - unsigned short ucs; -}; - -const static struct codepair keysymtab[] = { - { 0x01a1, 0x0104 }, - { 0x01a2, 0x02d8 }, - { 0x01a3, 0x0141 }, - { 0x01a5, 0x013d }, - { 0x01a6, 0x015a }, - { 0x01a9, 0x0160 }, - { 0x01aa, 0x015e }, - { 0x01ab, 0x0164 }, - { 0x01ac, 0x0179 }, - { 0x01ae, 0x017d }, - { 0x01af, 0x017b }, - { 0x01b1, 0x0105 }, - { 0x01b2, 0x02db }, - { 0x01b3, 0x0142 }, - { 0x01b5, 0x013e }, - { 0x01b6, 0x015b }, - { 0x01b7, 0x02c7 }, - { 0x01b9, 0x0161 }, - { 0x01ba, 0x015f }, - { 0x01bb, 0x0165 }, - { 0x01bc, 0x017a }, - { 0x01bd, 0x02dd }, - { 0x01be, 0x017e }, - { 0x01bf, 0x017c }, - { 0x01c0, 0x0154 }, - { 0x01c3, 0x0102 }, - { 0x01c5, 0x0139 }, - { 0x01c6, 0x0106 }, - { 0x01c8, 0x010c }, - { 0x01ca, 0x0118 }, - { 0x01cc, 0x011a }, - { 0x01cf, 0x010e }, - { 0x01d0, 0x0110 }, - { 0x01d1, 0x0143 }, - { 0x01d2, 0x0147 }, - { 0x01d5, 0x0150 }, - { 0x01d8, 0x0158 }, - { 0x01d9, 0x016e }, - { 0x01db, 0x0170 }, - { 0x01de, 0x0162 }, - { 0x01e0, 0x0155 }, - { 0x01e3, 0x0103 }, - { 0x01e5, 0x013a }, - { 0x01e6, 0x0107 }, - { 0x01e8, 0x010d }, - { 0x01ea, 0x0119 }, - { 0x01ec, 0x011b }, - { 0x01ef, 0x010f }, - { 0x01f0, 0x0111 }, - { 0x01f1, 0x0144 }, - { 0x01f2, 0x0148 }, - { 0x01f5, 0x0151 }, - { 0x01f8, 0x0159 }, - { 0x01f9, 0x016f }, - { 0x01fb, 0x0171 }, - { 0x01fe, 0x0163 }, - { 0x01ff, 0x02d9 }, - { 0x02a1, 0x0126 }, - { 0x02a6, 0x0124 }, - { 0x02a9, 0x0130 }, - { 0x02ab, 0x011e }, - { 0x02ac, 0x0134 }, - { 0x02b1, 0x0127 }, - { 0x02b6, 0x0125 }, - { 0x02b9, 0x0131 }, - { 0x02bb, 0x011f }, - { 0x02bc, 0x0135 }, - { 0x02c5, 0x010a }, - { 0x02c6, 0x0108 }, - { 0x02d5, 0x0120 }, - { 0x02d8, 0x011c }, - { 0x02dd, 0x016c }, - { 0x02de, 0x015c }, - { 0x02e5, 0x010b }, - { 0x02e6, 0x0109 }, - { 0x02f5, 0x0121 }, - { 0x02f8, 0x011d }, - { 0x02fd, 0x016d }, - { 0x02fe, 0x015d }, - { 0x03a2, 0x0138 }, - { 0x03a3, 0x0156 }, - { 0x03a5, 0x0128 }, - { 0x03a6, 0x013b }, - { 0x03aa, 0x0112 }, - { 0x03ab, 0x0122 }, - { 0x03ac, 0x0166 }, - { 0x03b3, 0x0157 }, - { 0x03b5, 0x0129 }, - { 0x03b6, 0x013c }, - { 0x03ba, 0x0113 }, - { 0x03bb, 0x0123 }, - { 0x03bc, 0x0167 }, - { 0x03bd, 0x014a }, - { 0x03bf, 0x014b }, - { 0x03c0, 0x0100 }, - { 0x03c7, 0x012e }, - { 0x03cc, 0x0116 }, - { 0x03cf, 0x012a }, - { 0x03d1, 0x0145 }, - { 0x03d2, 0x014c }, - { 0x03d3, 0x0136 }, - { 0x03d9, 0x0172 }, - { 0x03dd, 0x0168 }, - { 0x03de, 0x016a }, - { 0x03e0, 0x0101 }, - { 0x03e7, 0x012f }, - { 0x03ec, 0x0117 }, - { 0x03ef, 0x012b }, - { 0x03f1, 0x0146 }, - { 0x03f2, 0x014d }, - { 0x03f3, 0x0137 }, - { 0x03f9, 0x0173 }, - { 0x03fd, 0x0169 }, - { 0x03fe, 0x016b }, - { 0x047e, 0x203e }, - { 0x04a1, 0x3002 }, - { 0x04a2, 0x300c }, - { 0x04a3, 0x300d }, - { 0x04a4, 0x3001 }, - { 0x04a5, 0x30fb }, - { 0x04a6, 0x30f2 }, - { 0x04a7, 0x30a1 }, - { 0x04a8, 0x30a3 }, - { 0x04a9, 0x30a5 }, - { 0x04aa, 0x30a7 }, - { 0x04ab, 0x30a9 }, - { 0x04ac, 0x30e3 }, - { 0x04ad, 0x30e5 }, - { 0x04ae, 0x30e7 }, - { 0x04af, 0x30c3 }, - { 0x04b0, 0x30fc }, - { 0x04b1, 0x30a2 }, - { 0x04b2, 0x30a4 }, - { 0x04b3, 0x30a6 }, - { 0x04b4, 0x30a8 }, - { 0x04b5, 0x30aa }, - { 0x04b6, 0x30ab }, - { 0x04b7, 0x30ad }, - { 0x04b8, 0x30af }, - { 0x04b9, 0x30b1 }, - { 0x04ba, 0x30b3 }, - { 0x04bb, 0x30b5 }, - { 0x04bc, 0x30b7 }, - { 0x04bd, 0x30b9 }, - { 0x04be, 0x30bb }, - { 0x04bf, 0x30bd }, - { 0x04c0, 0x30bf }, - { 0x04c1, 0x30c1 }, - { 0x04c2, 0x30c4 }, - { 0x04c3, 0x30c6 }, - { 0x04c4, 0x30c8 }, - { 0x04c5, 0x30ca }, - { 0x04c6, 0x30cb }, - { 0x04c7, 0x30cc }, - { 0x04c8, 0x30cd }, - { 0x04c9, 0x30ce }, - { 0x04ca, 0x30cf }, - { 0x04cb, 0x30d2 }, - { 0x04cc, 0x30d5 }, - { 0x04cd, 0x30d8 }, - { 0x04ce, 0x30db }, - { 0x04cf, 0x30de }, - { 0x04d0, 0x30df }, - { 0x04d1, 0x30e0 }, - { 0x04d2, 0x30e1 }, - { 0x04d3, 0x30e2 }, - { 0x04d4, 0x30e4 }, - { 0x04d5, 0x30e6 }, - { 0x04d6, 0x30e8 }, - { 0x04d7, 0x30e9 }, - { 0x04d8, 0x30ea }, - { 0x04d9, 0x30eb }, - { 0x04da, 0x30ec }, - { 0x04db, 0x30ed }, - { 0x04dc, 0x30ef }, - { 0x04dd, 0x30f3 }, - { 0x04de, 0x309b }, - { 0x04df, 0x309c }, - { 0x05ac, 0x060c }, - { 0x05bb, 0x061b }, - { 0x05bf, 0x061f }, - { 0x05c1, 0x0621 }, - { 0x05c2, 0x0622 }, - { 0x05c3, 0x0623 }, - { 0x05c4, 0x0624 }, - { 0x05c5, 0x0625 }, - { 0x05c6, 0x0626 }, - { 0x05c7, 0x0627 }, - { 0x05c8, 0x0628 }, - { 0x05c9, 0x0629 }, - { 0x05ca, 0x062a }, - { 0x05cb, 0x062b }, - { 0x05cc, 0x062c }, - { 0x05cd, 0x062d }, - { 0x05ce, 0x062e }, - { 0x05cf, 0x062f }, - { 0x05d0, 0x0630 }, - { 0x05d1, 0x0631 }, - { 0x05d2, 0x0632 }, - { 0x05d3, 0x0633 }, - { 0x05d4, 0x0634 }, - { 0x05d5, 0x0635 }, - { 0x05d6, 0x0636 }, - { 0x05d7, 0x0637 }, - { 0x05d8, 0x0638 }, - { 0x05d9, 0x0639 }, - { 0x05da, 0x063a }, - { 0x05e0, 0x0640 }, - { 0x05e1, 0x0641 }, - { 0x05e2, 0x0642 }, - { 0x05e3, 0x0643 }, - { 0x05e4, 0x0644 }, - { 0x05e5, 0x0645 }, - { 0x05e6, 0x0646 }, - { 0x05e7, 0x0647 }, - { 0x05e8, 0x0648 }, - { 0x05e9, 0x0649 }, - { 0x05ea, 0x064a }, - { 0x05eb, 0x064b }, - { 0x05ec, 0x064c }, - { 0x05ed, 0x064d }, - { 0x05ee, 0x064e }, - { 0x05ef, 0x064f }, - { 0x05f0, 0x0650 }, - { 0x05f1, 0x0651 }, - { 0x05f2, 0x0652 }, - { 0x06a1, 0x0452 }, - { 0x06a2, 0x0453 }, - { 0x06a3, 0x0451 }, - { 0x06a4, 0x0454 }, - { 0x06a5, 0x0455 }, - { 0x06a6, 0x0456 }, - { 0x06a7, 0x0457 }, - { 0x06a8, 0x0458 }, - { 0x06a9, 0x0459 }, - { 0x06aa, 0x045a }, - { 0x06ab, 0x045b }, - { 0x06ac, 0x045c }, - { 0x06ae, 0x045e }, - { 0x06af, 0x045f }, - { 0x06b0, 0x2116 }, - { 0x06b1, 0x0402 }, - { 0x06b2, 0x0403 }, - { 0x06b3, 0x0401 }, - { 0x06b4, 0x0404 }, - { 0x06b5, 0x0405 }, - { 0x06b6, 0x0406 }, - { 0x06b7, 0x0407 }, - { 0x06b8, 0x0408 }, - { 0x06b9, 0x0409 }, - { 0x06ba, 0x040a }, - { 0x06bb, 0x040b }, - { 0x06bc, 0x040c }, - { 0x06be, 0x040e }, - { 0x06bf, 0x040f }, - { 0x06c0, 0x044e }, - { 0x06c1, 0x0430 }, - { 0x06c2, 0x0431 }, - { 0x06c3, 0x0446 }, - { 0x06c4, 0x0434 }, - { 0x06c5, 0x0435 }, - { 0x06c6, 0x0444 }, - { 0x06c7, 0x0433 }, - { 0x06c8, 0x0445 }, - { 0x06c9, 0x0438 }, - { 0x06ca, 0x0439 }, - { 0x06cb, 0x043a }, - { 0x06cc, 0x043b }, - { 0x06cd, 0x043c }, - { 0x06ce, 0x043d }, - { 0x06cf, 0x043e }, - { 0x06d0, 0x043f }, - { 0x06d1, 0x044f }, - { 0x06d2, 0x0440 }, - { 0x06d3, 0x0441 }, - { 0x06d4, 0x0442 }, - { 0x06d5, 0x0443 }, - { 0x06d6, 0x0436 }, - { 0x06d7, 0x0432 }, - { 0x06d8, 0x044c }, - { 0x06d9, 0x044b }, - { 0x06da, 0x0437 }, - { 0x06db, 0x0448 }, - { 0x06dc, 0x044d }, - { 0x06dd, 0x0449 }, - { 0x06de, 0x0447 }, - { 0x06df, 0x044a }, - { 0x06e0, 0x042e }, - { 0x06e1, 0x0410 }, - { 0x06e2, 0x0411 }, - { 0x06e3, 0x0426 }, - { 0x06e4, 0x0414 }, - { 0x06e5, 0x0415 }, - { 0x06e6, 0x0424 }, - { 0x06e7, 0x0413 }, - { 0x06e8, 0x0425 }, - { 0x06e9, 0x0418 }, - { 0x06ea, 0x0419 }, - { 0x06eb, 0x041a }, - { 0x06ec, 0x041b }, - { 0x06ed, 0x041c }, - { 0x06ee, 0x041d }, - { 0x06ef, 0x041e }, - { 0x06f0, 0x041f }, - { 0x06f1, 0x042f }, - { 0x06f2, 0x0420 }, - { 0x06f3, 0x0421 }, - { 0x06f4, 0x0422 }, - { 0x06f5, 0x0423 }, - { 0x06f6, 0x0416 }, - { 0x06f7, 0x0412 }, - { 0x06f8, 0x042c }, - { 0x06f9, 0x042b }, - { 0x06fa, 0x0417 }, - { 0x06fb, 0x0428 }, - { 0x06fc, 0x042d }, - { 0x06fd, 0x0429 }, - { 0x06fe, 0x0427 }, - { 0x06ff, 0x042a }, - { 0x07a1, 0x0386 }, - { 0x07a2, 0x0388 }, - { 0x07a3, 0x0389 }, - { 0x07a4, 0x038a }, - { 0x07a5, 0x03aa }, - { 0x07a7, 0x038c }, - { 0x07a8, 0x038e }, - { 0x07a9, 0x03ab }, - { 0x07ab, 0x038f }, - { 0x07ae, 0x0385 }, - { 0x07af, 0x2015 }, - { 0x07b1, 0x03ac }, - { 0x07b2, 0x03ad }, - { 0x07b3, 0x03ae }, - { 0x07b4, 0x03af }, - { 0x07b5, 0x03ca }, - { 0x07b6, 0x0390 }, - { 0x07b7, 0x03cc }, - { 0x07b8, 0x03cd }, - { 0x07b9, 0x03cb }, - { 0x07ba, 0x03b0 }, - { 0x07bb, 0x03ce }, - { 0x07c1, 0x0391 }, - { 0x07c2, 0x0392 }, - { 0x07c3, 0x0393 }, - { 0x07c4, 0x0394 }, - { 0x07c5, 0x0395 }, - { 0x07c6, 0x0396 }, - { 0x07c7, 0x0397 }, - { 0x07c8, 0x0398 }, - { 0x07c9, 0x0399 }, - { 0x07ca, 0x039a }, - { 0x07cb, 0x039b }, - { 0x07cc, 0x039c }, - { 0x07cd, 0x039d }, - { 0x07ce, 0x039e }, - { 0x07cf, 0x039f }, - { 0x07d0, 0x03a0 }, - { 0x07d1, 0x03a1 }, - { 0x07d2, 0x03a3 }, - { 0x07d4, 0x03a4 }, - { 0x07d5, 0x03a5 }, - { 0x07d6, 0x03a6 }, - { 0x07d7, 0x03a7 }, - { 0x07d8, 0x03a8 }, - { 0x07d9, 0x03a9 }, - { 0x07e1, 0x03b1 }, - { 0x07e2, 0x03b2 }, - { 0x07e3, 0x03b3 }, - { 0x07e4, 0x03b4 }, - { 0x07e5, 0x03b5 }, - { 0x07e6, 0x03b6 }, - { 0x07e7, 0x03b7 }, - { 0x07e8, 0x03b8 }, - { 0x07e9, 0x03b9 }, - { 0x07ea, 0x03ba }, - { 0x07eb, 0x03bb }, - { 0x07ec, 0x03bc }, - { 0x07ed, 0x03bd }, - { 0x07ee, 0x03be }, - { 0x07ef, 0x03bf }, - { 0x07f0, 0x03c0 }, - { 0x07f1, 0x03c1 }, - { 0x07f2, 0x03c3 }, - { 0x07f3, 0x03c2 }, - { 0x07f4, 0x03c4 }, - { 0x07f5, 0x03c5 }, - { 0x07f6, 0x03c6 }, - { 0x07f7, 0x03c7 }, - { 0x07f8, 0x03c8 }, - { 0x07f9, 0x03c9 }, - { 0x08a1, 0x23b7 }, - { 0x08a2, 0x250c }, - { 0x08a3, 0x2500 }, - { 0x08a4, 0x2320 }, - { 0x08a5, 0x2321 }, - { 0x08a6, 0x2502 }, - { 0x08a7, 0x23a1 }, - { 0x08a8, 0x23a3 }, - { 0x08a9, 0x23a4 }, - { 0x08aa, 0x23a6 }, - { 0x08ab, 0x239b }, - { 0x08ac, 0x239d }, - { 0x08ad, 0x239e }, - { 0x08ae, 0x23a0 }, - { 0x08af, 0x23a8 }, - { 0x08b0, 0x23ac }, - { 0x08bc, 0x2264 }, - { 0x08bd, 0x2260 }, - { 0x08be, 0x2265 }, - { 0x08bf, 0x222b }, - { 0x08c0, 0x2234 }, - { 0x08c1, 0x221d }, - { 0x08c2, 0x221e }, - { 0x08c5, 0x2207 }, - { 0x08c8, 0x223c }, - { 0x08c9, 0x2243 }, - { 0x08cd, 0x21d4 }, - { 0x08ce, 0x21d2 }, - { 0x08cf, 0x2261 }, - { 0x08d6, 0x221a }, - { 0x08da, 0x2282 }, - { 0x08db, 0x2283 }, - { 0x08dc, 0x2229 }, - { 0x08dd, 0x222a }, - { 0x08de, 0x2227 }, - { 0x08df, 0x2228 }, - { 0x08ef, 0x2202 }, - { 0x08f6, 0x0192 }, - { 0x08fb, 0x2190 }, - { 0x08fc, 0x2191 }, - { 0x08fd, 0x2192 }, - { 0x08fe, 0x2193 }, - { 0x09e0, 0x25c6 }, - { 0x09e1, 0x2592 }, - { 0x09e2, 0x2409 }, - { 0x09e3, 0x240c }, - { 0x09e4, 0x240d }, - { 0x09e5, 0x240a }, - { 0x09e8, 0x2424 }, - { 0x09e9, 0x240b }, - { 0x09ea, 0x2518 }, - { 0x09eb, 0x2510 }, - { 0x09ec, 0x250c }, - { 0x09ed, 0x2514 }, - { 0x09ee, 0x253c }, - { 0x09ef, 0x23ba }, - { 0x09f0, 0x23bb }, - { 0x09f1, 0x2500 }, - { 0x09f2, 0x23bc }, - { 0x09f3, 0x23bd }, - { 0x09f4, 0x251c }, - { 0x09f5, 0x2524 }, - { 0x09f6, 0x2534 }, - { 0x09f7, 0x252c }, - { 0x09f8, 0x2502 }, - { 0x0aa1, 0x2003 }, - { 0x0aa2, 0x2002 }, - { 0x0aa3, 0x2004 }, - { 0x0aa4, 0x2005 }, - { 0x0aa5, 0x2007 }, - { 0x0aa6, 0x2008 }, - { 0x0aa7, 0x2009 }, - { 0x0aa8, 0x200a }, - { 0x0aa9, 0x2014 }, - { 0x0aaa, 0x2013 }, - { 0x0aae, 0x2026 }, - { 0x0aaf, 0x2025 }, - { 0x0ab0, 0x2153 }, - { 0x0ab1, 0x2154 }, - { 0x0ab2, 0x2155 }, - { 0x0ab3, 0x2156 }, - { 0x0ab4, 0x2157 }, - { 0x0ab5, 0x2158 }, - { 0x0ab6, 0x2159 }, - { 0x0ab7, 0x215a }, - { 0x0ab8, 0x2105 }, - { 0x0abb, 0x2012 }, - { 0x0abc, 0x2329 }, - { 0x0abe, 0x232a }, - { 0x0ac3, 0x215b }, - { 0x0ac4, 0x215c }, - { 0x0ac5, 0x215d }, - { 0x0ac6, 0x215e }, - { 0x0ac9, 0x2122 }, - { 0x0aca, 0x2613 }, - { 0x0acc, 0x25c1 }, - { 0x0acd, 0x25b7 }, - { 0x0ace, 0x25cb }, - { 0x0acf, 0x25af }, - { 0x0ad0, 0x2018 }, - { 0x0ad1, 0x2019 }, - { 0x0ad2, 0x201c }, - { 0x0ad3, 0x201d }, - { 0x0ad4, 0x211e }, - { 0x0ad6, 0x2032 }, - { 0x0ad7, 0x2033 }, - { 0x0ad9, 0x271d }, - { 0x0adb, 0x25ac }, - { 0x0adc, 0x25c0 }, - { 0x0add, 0x25b6 }, - { 0x0ade, 0x25cf }, - { 0x0adf, 0x25ae }, - { 0x0ae0, 0x25e6 }, - { 0x0ae1, 0x25ab }, - { 0x0ae2, 0x25ad }, - { 0x0ae3, 0x25b3 }, - { 0x0ae4, 0x25bd }, - { 0x0ae5, 0x2606 }, - { 0x0ae6, 0x2022 }, - { 0x0ae7, 0x25aa }, - { 0x0ae8, 0x25b2 }, - { 0x0ae9, 0x25bc }, - { 0x0aea, 0x261c }, - { 0x0aeb, 0x261e }, - { 0x0aec, 0x2663 }, - { 0x0aed, 0x2666 }, - { 0x0aee, 0x2665 }, - { 0x0af0, 0x2720 }, - { 0x0af1, 0x2020 }, - { 0x0af2, 0x2021 }, - { 0x0af3, 0x2713 }, - { 0x0af4, 0x2717 }, - { 0x0af5, 0x266f }, - { 0x0af6, 0x266d }, - { 0x0af7, 0x2642 }, - { 0x0af8, 0x2640 }, - { 0x0af9, 0x260e }, - { 0x0afa, 0x2315 }, - { 0x0afb, 0x2117 }, - { 0x0afc, 0x2038 }, - { 0x0afd, 0x201a }, - { 0x0afe, 0x201e }, - { 0x0ba3, 0x003c }, - { 0x0ba6, 0x003e }, - { 0x0ba8, 0x2228 }, - { 0x0ba9, 0x2227 }, - { 0x0bc0, 0x00af }, - { 0x0bc2, 0x22a5 }, - { 0x0bc3, 0x2229 }, - { 0x0bc4, 0x230a }, - { 0x0bc6, 0x005f }, - { 0x0bca, 0x2218 }, - { 0x0bcc, 0x2395 }, - { 0x0bce, 0x22a4 }, - { 0x0bcf, 0x25cb }, - { 0x0bd3, 0x2308 }, - { 0x0bd6, 0x222a }, - { 0x0bd8, 0x2283 }, - { 0x0bda, 0x2282 }, - { 0x0bdc, 0x22a2 }, - { 0x0bfc, 0x22a3 }, - { 0x0cdf, 0x2017 }, - { 0x0ce0, 0x05d0 }, - { 0x0ce1, 0x05d1 }, - { 0x0ce2, 0x05d2 }, - { 0x0ce3, 0x05d3 }, - { 0x0ce4, 0x05d4 }, - { 0x0ce5, 0x05d5 }, - { 0x0ce6, 0x05d6 }, - { 0x0ce7, 0x05d7 }, - { 0x0ce8, 0x05d8 }, - { 0x0ce9, 0x05d9 }, - { 0x0cea, 0x05da }, - { 0x0ceb, 0x05db }, - { 0x0cec, 0x05dc }, - { 0x0ced, 0x05dd }, - { 0x0cee, 0x05de }, - { 0x0cef, 0x05df }, - { 0x0cf0, 0x05e0 }, - { 0x0cf1, 0x05e1 }, - { 0x0cf2, 0x05e2 }, - { 0x0cf3, 0x05e3 }, - { 0x0cf4, 0x05e4 }, - { 0x0cf5, 0x05e5 }, - { 0x0cf6, 0x05e6 }, - { 0x0cf7, 0x05e7 }, - { 0x0cf8, 0x05e8 }, - { 0x0cf9, 0x05e9 }, - { 0x0cfa, 0x05ea }, - { 0x0da1, 0x0e01 }, - { 0x0da2, 0x0e02 }, - { 0x0da3, 0x0e03 }, - { 0x0da4, 0x0e04 }, - { 0x0da5, 0x0e05 }, - { 0x0da6, 0x0e06 }, - { 0x0da7, 0x0e07 }, - { 0x0da8, 0x0e08 }, - { 0x0da9, 0x0e09 }, - { 0x0daa, 0x0e0a }, - { 0x0dab, 0x0e0b }, - { 0x0dac, 0x0e0c }, - { 0x0dad, 0x0e0d }, - { 0x0dae, 0x0e0e }, - { 0x0daf, 0x0e0f }, - { 0x0db0, 0x0e10 }, - { 0x0db1, 0x0e11 }, - { 0x0db2, 0x0e12 }, - { 0x0db3, 0x0e13 }, - { 0x0db4, 0x0e14 }, - { 0x0db5, 0x0e15 }, - { 0x0db6, 0x0e16 }, - { 0x0db7, 0x0e17 }, - { 0x0db8, 0x0e18 }, - { 0x0db9, 0x0e19 }, - { 0x0dba, 0x0e1a }, - { 0x0dbb, 0x0e1b }, - { 0x0dbc, 0x0e1c }, - { 0x0dbd, 0x0e1d }, - { 0x0dbe, 0x0e1e }, - { 0x0dbf, 0x0e1f }, - { 0x0dc0, 0x0e20 }, - { 0x0dc1, 0x0e21 }, - { 0x0dc2, 0x0e22 }, - { 0x0dc3, 0x0e23 }, - { 0x0dc4, 0x0e24 }, - { 0x0dc5, 0x0e25 }, - { 0x0dc6, 0x0e26 }, - { 0x0dc7, 0x0e27 }, - { 0x0dc8, 0x0e28 }, - { 0x0dc9, 0x0e29 }, - { 0x0dca, 0x0e2a }, - { 0x0dcb, 0x0e2b }, - { 0x0dcc, 0x0e2c }, - { 0x0dcd, 0x0e2d }, - { 0x0dce, 0x0e2e }, - { 0x0dcf, 0x0e2f }, - { 0x0dd0, 0x0e30 }, - { 0x0dd1, 0x0e31 }, - { 0x0dd2, 0x0e32 }, - { 0x0dd3, 0x0e33 }, - { 0x0dd4, 0x0e34 }, - { 0x0dd5, 0x0e35 }, - { 0x0dd6, 0x0e36 }, - { 0x0dd7, 0x0e37 }, - { 0x0dd8, 0x0e38 }, - { 0x0dd9, 0x0e39 }, - { 0x0dda, 0x0e3a }, - { 0x0ddf, 0x0e3f }, - { 0x0de0, 0x0e40 }, - { 0x0de1, 0x0e41 }, - { 0x0de2, 0x0e42 }, - { 0x0de3, 0x0e43 }, - { 0x0de4, 0x0e44 }, - { 0x0de5, 0x0e45 }, - { 0x0de6, 0x0e46 }, - { 0x0de7, 0x0e47 }, - { 0x0de8, 0x0e48 }, - { 0x0de9, 0x0e49 }, - { 0x0dea, 0x0e4a }, - { 0x0deb, 0x0e4b }, - { 0x0dec, 0x0e4c }, - { 0x0ded, 0x0e4d }, - { 0x0df0, 0x0e50 }, - { 0x0df1, 0x0e51 }, - { 0x0df2, 0x0e52 }, - { 0x0df3, 0x0e53 }, - { 0x0df4, 0x0e54 }, - { 0x0df5, 0x0e55 }, - { 0x0df6, 0x0e56 }, - { 0x0df7, 0x0e57 }, - { 0x0df8, 0x0e58 }, - { 0x0df9, 0x0e59 }, - { 0x0ea1, 0x3131 }, - { 0x0ea2, 0x3132 }, - { 0x0ea3, 0x3133 }, - { 0x0ea4, 0x3134 }, - { 0x0ea5, 0x3135 }, - { 0x0ea6, 0x3136 }, - { 0x0ea7, 0x3137 }, - { 0x0ea8, 0x3138 }, - { 0x0ea9, 0x3139 }, - { 0x0eaa, 0x313a }, - { 0x0eab, 0x313b }, - { 0x0eac, 0x313c }, - { 0x0ead, 0x313d }, - { 0x0eae, 0x313e }, - { 0x0eaf, 0x313f }, - { 0x0eb0, 0x3140 }, - { 0x0eb1, 0x3141 }, - { 0x0eb2, 0x3142 }, - { 0x0eb3, 0x3143 }, - { 0x0eb4, 0x3144 }, - { 0x0eb5, 0x3145 }, - { 0x0eb6, 0x3146 }, - { 0x0eb7, 0x3147 }, - { 0x0eb8, 0x3148 }, - { 0x0eb9, 0x3149 }, - { 0x0eba, 0x314a }, - { 0x0ebb, 0x314b }, - { 0x0ebc, 0x314c }, - { 0x0ebd, 0x314d }, - { 0x0ebe, 0x314e }, - { 0x0ebf, 0x314f }, - { 0x0ec0, 0x3150 }, - { 0x0ec1, 0x3151 }, - { 0x0ec2, 0x3152 }, - { 0x0ec3, 0x3153 }, - { 0x0ec4, 0x3154 }, - { 0x0ec5, 0x3155 }, - { 0x0ec6, 0x3156 }, - { 0x0ec7, 0x3157 }, - { 0x0ec8, 0x3158 }, - { 0x0ec9, 0x3159 }, - { 0x0eca, 0x315a }, - { 0x0ecb, 0x315b }, - { 0x0ecc, 0x315c }, - { 0x0ecd, 0x315d }, - { 0x0ece, 0x315e }, - { 0x0ecf, 0x315f }, - { 0x0ed0, 0x3160 }, - { 0x0ed1, 0x3161 }, - { 0x0ed2, 0x3162 }, - { 0x0ed3, 0x3163 }, - { 0x0ed4, 0x11a8 }, - { 0x0ed5, 0x11a9 }, - { 0x0ed6, 0x11aa }, - { 0x0ed7, 0x11ab }, - { 0x0ed8, 0x11ac }, - { 0x0ed9, 0x11ad }, - { 0x0eda, 0x11ae }, - { 0x0edb, 0x11af }, - { 0x0edc, 0x11b0 }, - { 0x0edd, 0x11b1 }, - { 0x0ede, 0x11b2 }, - { 0x0edf, 0x11b3 }, - { 0x0ee0, 0x11b4 }, - { 0x0ee1, 0x11b5 }, - { 0x0ee2, 0x11b6 }, - { 0x0ee3, 0x11b7 }, - { 0x0ee4, 0x11b8 }, - { 0x0ee5, 0x11b9 }, - { 0x0ee6, 0x11ba }, - { 0x0ee7, 0x11bb }, - { 0x0ee8, 0x11bc }, - { 0x0ee9, 0x11bd }, - { 0x0eea, 0x11be }, - { 0x0eeb, 0x11bf }, - { 0x0eec, 0x11c0 }, - { 0x0eed, 0x11c1 }, - { 0x0eee, 0x11c2 }, - { 0x0eef, 0x316d }, - { 0x0ef0, 0x3171 }, - { 0x0ef1, 0x3178 }, - { 0x0ef2, 0x317f }, - { 0x0ef3, 0x3181 }, - { 0x0ef4, 0x3184 }, - { 0x0ef5, 0x3186 }, - { 0x0ef6, 0x318d }, - { 0x0ef7, 0x318e }, - { 0x0ef8, 0x11eb }, - { 0x0ef9, 0x11f0 }, - { 0x0efa, 0x11f9 }, - { 0x0eff, 0x20a9 }, -#if 0 - /* FIXME: there is no keysym 0x13a4? But 0x20ac is EuroSign in both - keysym and Unicode */ - { 0x13a4, 0x20ac }, -#endif - { 0x13bc, 0x0152 }, - { 0x13bd, 0x0153 }, - { 0x13be, 0x0178 }, - { 0x20ac, 0x20ac }, - - /* Special function keys. */ - - { 0xff08, 0x0008 }, /* XK_BackSpace */ - { 0xff09, 0x0009 }, /* XK_Tab */ - { 0xff0a, 0x000a }, /* XK_Linefeed */ - { 0xff0d, 0x000d }, /* XK_Return */ - { 0xff13, 0x0013 }, /* XK_Pause */ - { 0xff1b, 0x001b }, /* XK_Escape */ - { 0xff50, 0x0001 }, /* XK_Home */ - { 0xff51, 0x001c }, /* XK_Left */ - { 0xff52, 0x001e }, /* XK_Up */ - { 0xff53, 0x001d }, /* XK_Right */ - { 0xff54, 0x001f }, /* XK_Down */ - { 0xff55, 0x000b }, /* XK_Prior */ - { 0xff56, 0x000c }, /* XK_Next */ - { 0xff57, 0x0004 }, /* XK_End */ - { 0xff6a, 0x0005 }, /* XK_Help */ - { 0xffff, 0x007f }, /* XK_Delete */ -}; - -long keysym2ucs(int keysym) -{ - int min = 0; - int max = sizeof(keysymtab) / sizeof(struct codepair) - 1; - int mid; - - /* first check for Latin-1 characters (1:1 mapping) */ - if ((keysym >= 0x0020 && keysym <= 0x007e) || - (keysym >= 0x00a0 && keysym <= 0x00ff)) - return keysym; - - /* also check for directly encoded 24-bit UCS characters */ - if ((keysym & 0xff000000) == 0x01000000) - return keysym & 0x00ffffff; - - /* binary search in table */ - while (max >= min) { - mid = (min + max) / 2; - if (keysymtab[mid].keysym < keysym) - min = mid + 1; - else if (keysymtab[mid].keysym > keysym) - max = mid - 1; - else { - /* found it */ - return keysymtab[mid].ucs; - } - } - - /* no matching Unicode value found */ - return -1; -} - -static int reverse_compare (const void *a, const void *b) -{ - const struct codepair *ca = a, *cb = b; - - return ca->ucs - cb->ucs; -} - -int ucs2keysym(long ucs) -{ - static struct codepair *reverse_keysymtab; - - int min = 0; - int max = sizeof(keysymtab) / sizeof(struct codepair) - 1; - int mid; - - if (reverse_keysymtab == NULL) - { - reverse_keysymtab = malloc (sizeof (keysymtab)); - memcpy (reverse_keysymtab, keysymtab, sizeof (keysymtab)); - - qsort (reverse_keysymtab, - sizeof (keysymtab) / sizeof (struct codepair), - sizeof (struct codepair), - reverse_compare); - } - - /* first check for Latin-1 characters (1:1 mapping) */ - if ((ucs >= 0x0020 && ucs <= 0x007e) || - (ucs >= 0x00a0 && ucs <= 0x00ff)) - return ucs; - - /* binary search in table */ - while (max >= min) { - mid = (min + max) / 2; - if (reverse_keysymtab[mid].ucs < ucs) - min = mid + 1; - else if (reverse_keysymtab[mid].ucs > ucs) - max = mid - 1; - else { - /* found it */ - return reverse_keysymtab[mid].keysym; - } - } - - /* finally, assume a directly encoded 24-bit UCS character */ - return ucs | 0x01000000; -} diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/keysym2ucs.h b/nx-X11/programs/Xserver/hw/darwin/quartz/keysym2ucs.h deleted file mode 100644 index c7ff6f3b3..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/keysym2ucs.h +++ /dev/null @@ -1,37 +0,0 @@ -/* $XFree86: $ - * - * This module converts keysym values into the corresponding ISO 10646 - * (UCS, Unicode) values. - * - * The array keysymtab[] contains pairs of X11 keysym values for graphical - * characters and the corresponding Unicode value. The function - * keysym2ucs() maps a keysym onto a Unicode value using a binary search, - * therefore keysymtab[] must remain SORTED by keysym value. - * - * The keysym -> UTF-8 conversion will hopefully one day be provided - * by Xlib via XmbLookupString() and should ideally not have to be - * done in X applications. But we are not there yet. - * - * We allow to represent any UCS character in the range U-00000000 to - * U-00FFFFFF by a keysym value in the range 0x01000000 to 0x01ffffff. - * This admittedly does not cover the entire 31-bit space of UCS, but - * it does cover all of the characters up to U-10FFFF, which can be - * represented by UTF-16, and more, and it is very unlikely that higher - * UCS codes will ever be assigned by ISO. So to get Unicode character - * U+ABCD you can directly use keysym 0x0100abcd. - * - * Author: Markus G. Kuhn , University of Cambridge, April 2001 - * - * Special thanks to Richard Verhoeven for preparing - * an initial draft of the mapping table. - * - * This software is in the public domain. Share and enjoy! - */ - -#ifndef KEYSYM2UCS_H -#define KEYSYM2UCS_H 1 - -extern long keysym2ucs(int keysym); -extern int ucs2keysym(long ucs); - -#endif /* KEYSYM2UCS_H */ diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/pseudoramiX.c b/nx-X11/programs/Xserver/hw/darwin/quartz/pseudoramiX.c deleted file mode 100644 index 71093f5fb..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/pseudoramiX.c +++ /dev/null @@ -1,430 +0,0 @@ -/* - * Minimal implementation of PanoramiX/Xinerama - * - * This is used in rootless mode where the underlying window server - * already provides an abstracted view of multiple screens as one - * large screen area. - * - * This code is largely based on panoramiX.c, which contains the - * following copyright notice: - */ -/***************************************************************** -Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, -BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of Digital Equipment Corporation -shall not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from Digital -Equipment Corporation. -******************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/pseudoramiX.c,v 1.4 2004/07/02 01:30:33 torrey Exp $ */ - -#include "pseudoramiX.h" - -#include "extnsionst.h" -#include "dixstruct.h" -#include "window.h" -#include -#include "globals.h" - -extern int ProcPanoramiXQueryVersion (ClientPtr client); - -static void PseudoramiXResetProc(ExtensionEntry *extEntry); - -static int ProcPseudoramiXQueryVersion(ClientPtr client); -static int ProcPseudoramiXGetState(ClientPtr client); -static int ProcPseudoramiXGetScreenCount(ClientPtr client); -static int ProcPseudoramiXGetScreenSize(ClientPtr client); -static int ProcPseudoramiXIsActive(ClientPtr client); -static int ProcPseudoramiXQueryScreens(ClientPtr client); -static int ProcPseudoramiXDispatch(ClientPtr client); - -static int SProcPseudoramiXQueryVersion(ClientPtr client); -static int SProcPseudoramiXGetState(ClientPtr client); -static int SProcPseudoramiXGetScreenCount(ClientPtr client); -static int SProcPseudoramiXGetScreenSize(ClientPtr client); -static int SProcPseudoramiXIsActive(ClientPtr client); -static int SProcPseudoramiXQueryScreens(ClientPtr client); -static int SProcPseudoramiXDispatch(ClientPtr client); - - -typedef struct { - int x; - int y; - int w; - int h; -} PseudoramiXScreenRec; - -static PseudoramiXScreenRec *pseudoramiXScreens = NULL; -static int pseudoramiXScreensAllocated = 0; -static int pseudoramiXNumScreens = 0; -static unsigned long pseudoramiXGeneration = 0; - - -// Add a PseudoramiX screen. -// The rest of the X server will know nothing about this screen. -// Can be called before or after extension init. -// Screens must be re-added once per generation. -void -PseudoramiXAddScreen(int x, int y, int w, int h) -{ - PseudoramiXScreenRec *s; - - if (noPseudoramiXExtension) return; - - if (pseudoramiXNumScreens == pseudoramiXScreensAllocated) { - pseudoramiXScreensAllocated += pseudoramiXScreensAllocated + 1; - pseudoramiXScreens = xrealloc(pseudoramiXScreens, - pseudoramiXScreensAllocated * - sizeof(PseudoramiXScreenRec)); - } - - s = &pseudoramiXScreens[pseudoramiXNumScreens++]; - s->x = x; - s->y = y; - s->w = w; - s->h = h; -} - - -// Initialize PseudoramiX. -// Copied from PanoramiXExtensionInit -void PseudoramiXExtensionInit(int argc, char *argv[]) -{ - Bool success = FALSE; - ExtensionEntry *extEntry; - - if (noPseudoramiXExtension) return; - - /* Even with only one screen we need to enable PseudoramiX to allow - dynamic screen configuration changes. */ -#if 0 - if (pseudoramiXNumScreens == 1) { - // Only one screen - disable Xinerama extension. - noPseudoramiXExtension = TRUE; - return; - } -#endif - - // The server must not run the PanoramiX operations. - noPanoramiXExtension = TRUE; - - if (pseudoramiXGeneration != serverGeneration) { - extEntry = AddExtension(PANORAMIX_PROTOCOL_NAME, 0, 0, - ProcPseudoramiXDispatch, - SProcPseudoramiXDispatch, - PseudoramiXResetProc, - StandardMinorOpcode); - if (!extEntry) { - ErrorF("PseudoramiXExtensionInit(): AddExtension failed\n"); - } else { - pseudoramiXGeneration = serverGeneration; - success = TRUE; - } - } - - if (!success) { - ErrorF("%s Extension (PseudoramiX) failed to initialize\n", - PANORAMIX_PROTOCOL_NAME); - return; - } -} - - -void PseudoramiXResetScreens(void) -{ - pseudoramiXNumScreens = 0; -} - - -static void PseudoramiXResetProc(ExtensionEntry *extEntry) -{ - PseudoramiXResetScreens(); -} - - -// was PanoramiX -static int ProcPseudoramiXQueryVersion(ClientPtr client) -{ - return ProcPanoramiXQueryVersion(client); -} - - -// was PanoramiX -static int ProcPseudoramiXGetState(ClientPtr client) -{ - REQUEST(xPanoramiXGetStateReq); - WindowPtr pWin; - xPanoramiXGetStateReply rep; - register int n; - - REQUEST_SIZE_MATCH(xPanoramiXGetStateReq); - pWin = LookupWindow (stuff->window, client); - if (!pWin) - return BadWindow; - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.state = !noPseudoramiXExtension; - if (client->swapped) { - swaps (&rep.sequenceNumber, n); - swapl (&rep.length, n); - swaps (&rep.state, n); - } - WriteToClient (client, sizeof (xPanoramiXGetStateReply), (char *) &rep); - return client->noClientException; -} - - -// was PanoramiX -static int ProcPseudoramiXGetScreenCount(ClientPtr client) -{ - REQUEST(xPanoramiXGetScreenCountReq); - WindowPtr pWin; - xPanoramiXGetScreenCountReply rep; - register int n; - - REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); - pWin = LookupWindow (stuff->window, client); - if (!pWin) - return BadWindow; - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.ScreenCount = pseudoramiXNumScreens; - if (client->swapped) { - swaps (&rep.sequenceNumber, n); - swapl (&rep.length, n); - swaps (&rep.ScreenCount, n); - } - WriteToClient (client, sizeof(xPanoramiXGetScreenCountReply), (char *)&rep); - return client->noClientException; -} - - -// was PanoramiX -static int ProcPseudoramiXGetScreenSize(ClientPtr client) -{ - REQUEST(xPanoramiXGetScreenSizeReq); - WindowPtr pWin; - xPanoramiXGetScreenSizeReply rep; - register int n; - - REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); - pWin = LookupWindow (stuff->window, client); - if (!pWin) - return BadWindow; - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - /* screen dimensions */ - rep.width = pseudoramiXScreens[stuff->screen].w; - // was panoramiXdataPtr[stuff->screen].width; - rep.height = pseudoramiXScreens[stuff->screen].h; - // was panoramiXdataPtr[stuff->screen].height; - if (client->swapped) { - swaps (&rep.sequenceNumber, n); - swapl (&rep.length, n); - swaps (&rep.width, n); - swaps (&rep.height, n); - } - WriteToClient (client, sizeof(xPanoramiXGetScreenSizeReply), (char *)&rep); - return client->noClientException; -} - - -// was Xinerama -static int ProcPseudoramiXIsActive(ClientPtr client) -{ - /* REQUEST(xXineramaIsActiveReq); */ - xXineramaIsActiveReply rep; - - REQUEST_SIZE_MATCH(xXineramaIsActiveReq); - - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.state = !noPseudoramiXExtension; - if (client->swapped) { - register int n; - swaps (&rep.sequenceNumber, n); - swapl (&rep.length, n); - swapl (&rep.state, n); - } - WriteToClient (client, sizeof (xXineramaIsActiveReply), (char *) &rep); - return client->noClientException; -} - - -// was Xinerama -static int ProcPseudoramiXQueryScreens(ClientPtr client) -{ - /* REQUEST(xXineramaQueryScreensReq); */ - xXineramaQueryScreensReply rep; - - REQUEST_SIZE_MATCH(xXineramaQueryScreensReq); - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.number = noPseudoramiXExtension ? 0 : pseudoramiXNumScreens; - rep.length = rep.number * sz_XineramaScreenInfo >> 2; - if (client->swapped) { - register int n; - swaps (&rep.sequenceNumber, n); - swapl (&rep.length, n); - swapl (&rep.number, n); - } - WriteToClient (client, sizeof (xXineramaQueryScreensReply), (char *) &rep); - - if (!noPseudoramiXExtension) { - xXineramaScreenInfo scratch; - int i; - - for(i = 0; i < pseudoramiXNumScreens; i++) { - scratch.x_org = pseudoramiXScreens[i].x; - scratch.y_org = pseudoramiXScreens[i].y; - scratch.width = pseudoramiXScreens[i].w; - scratch.height = pseudoramiXScreens[i].h; - - if(client->swapped) { - register int n; - swaps (&scratch.x_org, n); - swaps (&scratch.y_org, n); - swaps (&scratch.width, n); - swaps (&scratch.height, n); - } - WriteToClient (client, sz_XineramaScreenInfo, (char *) &scratch); - } - } - - return client->noClientException; -} - - -// was PanoramiX -static int ProcPseudoramiXDispatch (ClientPtr client) -{ REQUEST(xReq); - switch (stuff->data) - { - case X_PanoramiXQueryVersion: - return ProcPseudoramiXQueryVersion(client); - case X_PanoramiXGetState: - return ProcPseudoramiXGetState(client); - case X_PanoramiXGetScreenCount: - return ProcPseudoramiXGetScreenCount(client); - case X_PanoramiXGetScreenSize: - return ProcPseudoramiXGetScreenSize(client); - case X_XineramaIsActive: - return ProcPseudoramiXIsActive(client); - case X_XineramaQueryScreens: - return ProcPseudoramiXQueryScreens(client); - } - return BadRequest; -} - - - -static int -SProcPseudoramiXQueryVersion (ClientPtr client) -{ - REQUEST(xPanoramiXQueryVersionReq); - register int n; - - swaps(&stuff->length,n); - REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq); - return ProcPseudoramiXQueryVersion(client); -} - -static int -SProcPseudoramiXGetState(ClientPtr client) -{ - REQUEST(xPanoramiXGetStateReq); - register int n; - - swaps (&stuff->length, n); - REQUEST_SIZE_MATCH(xPanoramiXGetStateReq); - return ProcPseudoramiXGetState(client); -} - -static int -SProcPseudoramiXGetScreenCount(ClientPtr client) -{ - REQUEST(xPanoramiXGetScreenCountReq); - register int n; - - swaps (&stuff->length, n); - REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); - return ProcPseudoramiXGetScreenCount(client); -} - -static int -SProcPseudoramiXGetScreenSize(ClientPtr client) -{ - REQUEST(xPanoramiXGetScreenSizeReq); - register int n; - - swaps (&stuff->length, n); - REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); - return ProcPseudoramiXGetScreenSize(client); -} - - -static int -SProcPseudoramiXIsActive(ClientPtr client) -{ - REQUEST(xXineramaIsActiveReq); - register int n; - - swaps (&stuff->length, n); - REQUEST_SIZE_MATCH(xXineramaIsActiveReq); - return ProcPseudoramiXIsActive(client); -} - - -static int -SProcPseudoramiXQueryScreens(ClientPtr client) -{ - REQUEST(xXineramaQueryScreensReq); - register int n; - - swaps (&stuff->length, n); - REQUEST_SIZE_MATCH(xXineramaQueryScreensReq); - return ProcPseudoramiXQueryScreens(client); -} - - -static int -SProcPseudoramiXDispatch (ClientPtr client) -{ REQUEST(xReq); - switch (stuff->data) - { - case X_PanoramiXQueryVersion: - return SProcPseudoramiXQueryVersion(client); - case X_PanoramiXGetState: - return SProcPseudoramiXGetState(client); - case X_PanoramiXGetScreenCount: - return SProcPseudoramiXGetScreenCount(client); - case X_PanoramiXGetScreenSize: - return SProcPseudoramiXGetScreenSize(client); - case X_XineramaIsActive: - return SProcPseudoramiXIsActive(client); - case X_XineramaQueryScreens: - return SProcPseudoramiXQueryScreens(client); - } - return BadRequest; -} diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/pseudoramiX.h b/nx-X11/programs/Xserver/hw/darwin/quartz/pseudoramiX.h deleted file mode 100644 index c2943369d..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/pseudoramiX.h +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Minimal implementation of PanoramiX/Xinerama - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/pseudoramiX.h,v 1.3 2004/07/02 01:30:33 torrey Exp $ */ - -extern int noPseudoramiXExtension; - -void PseudoramiXAddScreen(int x, int y, int w, int h); -void PseudoramiXExtensionInit(int argc, char *argv[]); -void PseudoramiXResetScreens(void); diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/quartz.c b/nx-X11/programs/Xserver/hw/darwin/quartz/quartz.c deleted file mode 100644 index 7a0155f98..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/quartz.c +++ /dev/null @@ -1,426 +0,0 @@ -/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/quartz.c,v 1.4 2005/07/01 22:43:07 daniels Exp $ */ -/************************************************************** - * - * Quartz-specific support for the Darwin X Server - * - **************************************************************/ -/* - * Copyright (c) 2001-2004 Greg Parker and Torrey T. Lyons. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartz.c,v 1.16 2004/07/02 01:30:33 torrey Exp $ */ - -#include "quartzCommon.h" -#include "quartz.h" -#include "darwin.h" -#include "quartzAudio.h" -#include "pseudoramiX.h" -#define _APPLEWM_SERVER_ -#include "applewm.h" -#include "applewmExt.h" - -// X headers -#include "scrnintstr.h" -#include "windowstr.h" -#include "colormapst.h" -#include "globals.h" - -// System headers -#include -#include -#include -#include - -// Shared global variables for Quartz modes -int quartzEventWriteFD = -1; -int quartzStartClients = 1; -int quartzRootless = -1; -int quartzUseSysBeep = 0; -int quartzUseAGL = 1; -int quartzEnableKeyEquivalents = 1; -int quartzServerVisible = TRUE; -int quartzServerQuitting = FALSE; -int quartzScreenIndex = 0; -int aquaMenuBarHeight = 0; -int noPseudoramiXExtension = TRUE; -QuartzModeProcsPtr quartzProcs = NULL; -const char *quartzOpenGLBundle = NULL; - -/* -=========================================================================== - - Screen functions - -=========================================================================== -*/ - -/* - * DarwinModeAddScreen - * Do mode dependent initialization of each screen for Quartz. - */ -Bool DarwinModeAddScreen( - int index, - ScreenPtr pScreen) -{ - // allocate space for private per screen Quartz specific storage - QuartzScreenPtr displayInfo = xcalloc(sizeof(QuartzScreenRec), 1); - QUARTZ_PRIV(pScreen) = displayInfo; - - // do Quartz mode specific initialization - return quartzProcs->AddScreen(index, pScreen); -} - - -/* - * DarwinModeSetupScreen - * Finalize mode specific setup of each screen. - */ -Bool DarwinModeSetupScreen( - int index, - ScreenPtr pScreen) -{ - // do Quartz mode specific setup - if (! quartzProcs->SetupScreen(index, pScreen)) - return FALSE; - - // setup cursor support - if (! quartzProcs->InitCursor(pScreen)) - return FALSE; - - return TRUE; -} - - -/* - * DarwinModeInitOutput - * Quartz display initialization. - */ -void DarwinModeInitOutput( - int argc, - char **argv ) -{ - static unsigned long generation = 0; - - // Allocate private storage for each screen's Quartz specific info - if (generation != serverGeneration) { - quartzScreenIndex = AllocateScreenPrivateIndex(); - generation = serverGeneration; - } - - if (serverGeneration == 0) { - QuartzAudioInit(); - } - - if (!RegisterBlockAndWakeupHandlers(QuartzBlockHandler, - QuartzWakeupHandler, - NULL)) - { - FatalError("Could not register block and wakeup handlers."); - } - - // Do display mode specific initialization - quartzProcs->DisplayInit(); - - // Init PseudoramiX implementation of Xinerama. - // This should be in InitExtensions, but that causes link errors - // for servers that don't link in pseudoramiX.c. - if (!noPseudoramiXExtension) { - PseudoramiXExtensionInit(argc, argv); - } -} - - -/* - * DarwinModeInitInput - * Inform the main thread the X server is ready to handle events. - */ -void DarwinModeInitInput( - int argc, - char **argv ) -{ - QuartzMessageMainThread(kQuartzServerStarted, NULL, 0); - - // Do final display mode specific initialization before handling events - if (quartzProcs->InitInput) - quartzProcs->InitInput(argc, argv); -} - - -/* - * QuartzUpdateScreens - * Adjust for screen arrangement changes. - */ -static void QuartzUpdateScreens(void) -{ - ScreenPtr pScreen; - WindowPtr pRoot; - int x, y, width, height, sx, sy; - xEvent e; - - if (noPseudoramiXExtension || screenInfo.numScreens != 1) - { - /* FIXME: if not using Xinerama, we have multiple screens, and - to do this properly may need to add or remove screens. Which - isn't possible. So don't do anything. Another reason why - we default to running with Xinerama. */ - - return; - } - - pScreen = screenInfo.screens[0]; - - PseudoramiXResetScreens(); - quartzProcs->AddPseudoramiXScreens(&x, &y, &width, &height); - - dixScreenOrigins[pScreen->myNum].x = x; - dixScreenOrigins[pScreen->myNum].y = y; - pScreen->mmWidth = pScreen->mmWidth * ((double) width / pScreen->width); - pScreen->mmHeight = pScreen->mmHeight * ((double) height / pScreen->height); - pScreen->width = width; - pScreen->height = height; - - /* FIXME: should probably do something with RandR here. */ - - DarwinAdjustScreenOrigins(&screenInfo); - quartzProcs->UpdateScreen(pScreen); - - sx = dixScreenOrigins[pScreen->myNum].x + darwinMainScreenX; - sy = dixScreenOrigins[pScreen->myNum].y + darwinMainScreenY; - - /* Adjust the root window. */ - pRoot = WindowTable[pScreen->myNum]; - AppleWMSetScreenOrigin(pRoot); - pScreen->ResizeWindow(pRoot, x - sx, y - sy, width, height, NULL); - pScreen->PaintWindowBackground(pRoot, &pRoot->borderClip, PW_BACKGROUND); -// QuartzIgnoreNextWarpCursor(); - DefineInitialRootWindow(pRoot); - - /* Send an event for the root reconfigure */ - e.u.u.type = ConfigureNotify; - e.u.configureNotify.window = pRoot->drawable.id; - e.u.configureNotify.aboveSibling = None; - e.u.configureNotify.x = x - sx; - e.u.configureNotify.y = y - sy; - e.u.configureNotify.width = width; - e.u.configureNotify.height = height; - e.u.configureNotify.borderWidth = wBorderWidth(pRoot); - e.u.configureNotify.override = pRoot->overrideRedirect; - DeliverEvents(pRoot, &e, 1, NullWindow); - - /* FIXME: Should we use RREditConnectionInfo(pScreen)? */ -} - - -/* - * QuartzShow - * Show the X server on screen. Does nothing if already shown. - * Calls mode specific screen resume to restore the X clip regions - * (if needed) and the X server cursor state. - */ -static void QuartzShow( - int x, // cursor location - int y ) -{ - int i; - - if (!quartzServerVisible) { - quartzServerVisible = TRUE; - for (i = 0; i < screenInfo.numScreens; i++) { - if (screenInfo.screens[i]) { - quartzProcs->ResumeScreen(screenInfo.screens[i], x, y); - } - } - } -} - - -/* - * QuartzHide - * Remove the X server display from the screen. Does nothing if already - * hidden. Calls mode specific screen suspend to set X clip regions to - * prevent drawing (if needed) and restore the Aqua cursor. - */ -static void QuartzHide(void) -{ - int i; - - if (quartzServerVisible) { - for (i = 0; i < screenInfo.numScreens; i++) { - if (screenInfo.screens[i]) { - quartzProcs->SuspendScreen(screenInfo.screens[i]); - } - } - } - quartzServerVisible = FALSE; - QuartzMessageMainThread(kQuartzServerHidden, NULL, 0); -} - - -/* - * QuartzSetRootClip - * Enable or disable rendering to the X screen. - */ -static void QuartzSetRootClip( - BOOL enable) -{ - int i; - - if (!quartzServerVisible) - return; - - for (i = 0; i < screenInfo.numScreens; i++) { - if (screenInfo.screens[i]) { - xf86SetRootClip(screenInfo.screens[i], enable); - } - } -} - - -/* - * QuartzMessageServerThread - * Send the X server thread a message by placing it on the event queue. - */ -void -QuartzMessageServerThread( - int type, - int argc, ...) -{ - xEvent xe; - INT32 *argv; - int i, max_args; - va_list args; - - memset(&xe, 0, sizeof(xe)); - xe.u.u.type = type; - xe.u.clientMessage.u.l.type = type; - - argv = &xe.u.clientMessage.u.l.longs0; - max_args = 4; - - if (argc > 0 && argc <= max_args) { - va_start (args, argc); - for (i = 0; i < argc; i++) - argv[i] = (int) va_arg (args, int); - va_end (args); - } - - DarwinEQEnqueue(&xe); -} - - -/* - * DarwinModeProcessEvent - * Process Quartz specific events. - */ -void DarwinModeProcessEvent( - xEvent *xe) -{ - switch (xe->u.u.type) { - - case kXDarwinActivate: - QuartzShow(xe->u.keyButtonPointer.rootX, - xe->u.keyButtonPointer.rootY); - AppleWMSendEvent(AppleWMActivationNotify, - AppleWMActivationNotifyMask, - AppleWMIsActive, 0); - break; - - case kXDarwinDeactivate: - AppleWMSendEvent(AppleWMActivationNotify, - AppleWMActivationNotifyMask, - AppleWMIsInactive, 0); - QuartzHide(); - break; - - case kXDarwinSetRootClip: - QuartzSetRootClip((BOOL)xe->u.clientMessage.u.l.longs0); - break; - - case kXDarwinQuit: - GiveUp(0); - break; - - case kXDarwinReadPasteboard: - QuartzReadPasteboard(); - break; - - case kXDarwinWritePasteboard: - QuartzWritePasteboard(); - break; - - /* - * AppleWM events - */ - case kXDarwinControllerNotify: - AppleWMSendEvent(AppleWMControllerNotify, - AppleWMControllerNotifyMask, - xe->u.clientMessage.u.l.longs0, - xe->u.clientMessage.u.l.longs1); - break; - - case kXDarwinPasteboardNotify: - AppleWMSendEvent(AppleWMPasteboardNotify, - AppleWMPasteboardNotifyMask, - xe->u.clientMessage.u.l.longs0, - xe->u.clientMessage.u.l.longs1); - break; - - case kXDarwinDisplayChanged: - QuartzUpdateScreens(); - break; - - case kXDarwinWindowState: - case kXDarwinWindowMoved: - // FIXME: Not implemented yet - break; - - default: - ErrorF("Unknown application defined event type %d.\n", - xe->u.u.type); - } -} - - -/* - * DarwinModeGiveUp - * Cleanup before X server shutdown - * Release the screen and restore the Aqua cursor. - */ -void DarwinModeGiveUp(void) -{ -#if 0 -// Trying to switch cursors when quitting causes deadlock - int i; - - for (i = 0; i < screenInfo.numScreens; i++) { - if (screenInfo.screens[i]) { - QuartzSuspendXCursor(screenInfo.screens[i]); - } - } -#endif - - if (!quartzRootless) - quartzProcs->ReleaseScreens(); -} diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/quartz.h b/nx-X11/programs/Xserver/hw/darwin/quartz/quartz.h deleted file mode 100644 index 9e2f90f78..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/quartz.h +++ /dev/null @@ -1,131 +0,0 @@ -/* - * quartz.h - * - * External interface of the Quartz display modes seen by the generic, mode - * independent parts of the Darwin X server. - */ -/* - * Copyright (c) 2001-2003 Greg Parker and Torrey T. Lyons. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/quartz.h,v 1.4 2005/07/01 22:43:07 daniels Exp $ */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartz.h,v 1.7 2003/11/12 20:21:51 torrey Exp $ */ - -#ifndef _QUARTZ_H -#define _QUARTZ_H - -#include "quartzPasteboard.h" - -#include "screenint.h" -#include "window.h" - -/*------------------------------------------ - Quartz display mode function types - ------------------------------------------*/ - -/* - * Display mode initialization - */ -typedef void (*DisplayInitProc)(void); -typedef Bool (*AddScreenProc)(int index, ScreenPtr pScreen); -typedef Bool (*SetupScreenProc)(int index, ScreenPtr pScreen); -typedef void (*InitInputProc)(int argc, char **argv); - -/* - * Cursor functions - */ -typedef Bool (*InitCursorProc)(ScreenPtr pScreen); -typedef void (*CursorUpdateProc)(void); - -/* - * Suspend and resume X11 activity - */ -typedef void (*SuspendScreenProc)(ScreenPtr pScreen); -typedef void (*ResumeScreenProc)(ScreenPtr pScreen, int x, int y); -typedef void (*CaptureScreensProc)(void); -typedef void (*ReleaseScreensProc)(void); - -/* - * Screen state change support - */ -typedef void (*ScreenChangedProc)(void); -typedef void (*AddPseudoramiXScreensProc)(int *x, int *y, int *width, int *height); -typedef void (*UpdateScreenProc)(ScreenPtr pScreen); - -/* - * Rootless helper functions - */ -typedef Bool (*IsX11WindowProc)(void *nsWindow, int windowNumber); -typedef void (*HideWindowsProc)(Bool hide); - -/* - * Rootless functions for optional export to GLX layer - */ -typedef void * (*FrameForWindowProc)(WindowPtr pWin, Bool create); -typedef WindowPtr (*TopLevelParentProc)(WindowPtr pWindow); -typedef Bool (*CreateSurfaceProc) - (ScreenPtr pScreen, Drawable id, DrawablePtr pDrawable, - unsigned int client_id, unsigned int *surface_id, - unsigned int key[2], void (*notify) (void *arg, void *data), - void *notify_data); -typedef Bool (*DestroySurfaceProc) - (ScreenPtr pScreen, Drawable id, DrawablePtr pDrawable, - void (*notify) (void *arg, void *data), void *notify_data); - -/* - * Quartz display mode function list - */ -typedef struct _QuartzModeProcs { - DisplayInitProc DisplayInit; - AddScreenProc AddScreen; - SetupScreenProc SetupScreen; - InitInputProc InitInput; - - InitCursorProc InitCursor; - CursorUpdateProc CursorUpdate; // Not used if NULL - - SuspendScreenProc SuspendScreen; - ResumeScreenProc ResumeScreen; - CaptureScreensProc CaptureScreens; // Only called in fullscreen - ReleaseScreensProc ReleaseScreens; // Only called in fullscreen - - ScreenChangedProc ScreenChanged; - AddPseudoramiXScreensProc AddPseudoramiXScreens; - UpdateScreenProc UpdateScreen; - - IsX11WindowProc IsX11Window; - HideWindowsProc HideWindows; - - FrameForWindowProc FrameForWindow; - TopLevelParentProc TopLevelParent; - CreateSurfaceProc CreateSurface; - DestroySurfaceProc DestroySurface; -} QuartzModeProcsRec, *QuartzModeProcsPtr; - -extern QuartzModeProcsPtr quartzProcs; - -Bool QuartzLoadDisplayBundle(const char *dpyBundleName); - -#endif diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/quartzAudio.c b/nx-X11/programs/Xserver/hw/darwin/quartz/quartzAudio.c deleted file mode 100644 index 2106dfad4..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/quartzAudio.c +++ /dev/null @@ -1,342 +0,0 @@ -// -// QuartzAudio.m -// -// X Window bell support using CoreAudio or AppKit. -// Greg Parker gparker@cs.stanford.edu 19 Feb 2001 -// -// Info about sine wave sound playback: -// CoreAudio code derived from macosx-dev posting by Tim Wood -// http://www.omnigroup.com/mailman/archive/macosx-dev/2000-May/002004.html -// Smoothing transitions between sounds -// http://www.wam.umd.edu/~mphoenix/dss/dss.html -// -/* - * Copyright (c) 2001 Greg Parker. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzAudio.c,v 1.1 2002/03/28 02:21:18 torrey Exp $ */ - -#include "quartzCommon.h" -#include "quartzAudio.h" - -#include -#include - -#include "inputstr.h" -#include - -void NSBeep(); - -typedef struct QuartzAudioRec { - double frequency; - double amplitude; - - UInt32 curFrame; - UInt32 remainingFrames; - UInt32 totalFrames; - UInt32 bytesPerFrame; - double sampleRate; - UInt32 fadeLength; - - UInt32 bufferByteCount; - Boolean playing; - pthread_mutex_t lock; - - // used to fade out interrupted sound and avoid 'pop' - double prevFrequency; - double prevAmplitude; - UInt32 prevFrame; -} QuartzAudioRec; - -static AudioDeviceID quartzAudioDevice = kAudioDeviceUnknown; -static QuartzAudioRec data; - - -/* - * QuartzAudioEnvelope - * Fade sound in and out to avoid pop. - * Sounds with shorter duration will never reach full amplitude. Deal. - */ -static double QuartzAudioEnvelope( - UInt32 curFrame, - UInt32 totalFrames, - UInt32 fadeLength ) -{ - double fadeFrames = min(fadeLength, totalFrames / 2); - if (fadeFrames < 1) return 0; - - if (curFrame < fadeFrames) { - return curFrame / fadeFrames; - } else if (curFrame > totalFrames - fadeFrames) { - return (totalFrames-curFrame) / fadeFrames; - } else { - return 1.0; - } -} - - -/* - * QuartzFillBuffer - * Fill this buffer with data and update the data position. - * FIXME: this is ugly - */ -static void QuartzFillBuffer( - AudioBuffer *audiobuffer, - QuartzAudioRec *data ) -{ - float *buffer, *b; - unsigned int frame, frameCount; - unsigned int bufferFrameCount; - float multiplier, v; - int i; - - buffer = (float *)audiobuffer->mData; - bufferFrameCount = audiobuffer->mDataByteSize / data->bytesPerFrame; - - frameCount = min(bufferFrameCount, data->remainingFrames); - - // Fade out previous sine wave, if any. - b = buffer; - if (data->prevFrame) { - multiplier = 2*M_PI*(data->prevFrequency/data->sampleRate); - for (frame = 0; frame < data->fadeLength; frame++) { - v = data->prevAmplitude * - QuartzAudioEnvelope(frame+data->fadeLength, - 2*data->fadeLength, - data->fadeLength) * - sin(multiplier * (data->prevFrame+frame)); - for (i = 0; i < audiobuffer->mNumberChannels; i++) { - *b++ = v; - } - } - // no more prev fade - data->prevFrame = 0; - - // adjust for space eaten by prev fade - buffer += audiobuffer->mNumberChannels*frame; - bufferFrameCount -= frame; - frameCount = min(bufferFrameCount, data->remainingFrames); - } - - // Write a sine wave with the specified frequency and amplitude - multiplier = 2*M_PI*(data->frequency/data->sampleRate); - for (frame = 0; frame < frameCount; frame++) { - v = data->amplitude * - QuartzAudioEnvelope(data->curFrame+frame, data->totalFrames, - data->fadeLength) * - sin(multiplier * (data->curFrame+frame)); - for (i = 0; i < audiobuffer->mNumberChannels; i++) { - *b++ = v; - } - } - - // Zero out the rest of the buffer, if any - memset(b, 0, sizeof(float) * audiobuffer->mNumberChannels * - (bufferFrameCount-frame)); - - data->curFrame += frameCount; - data->remainingFrames -= frameCount; - if (data->remainingFrames == 0) { - data->playing = FALSE; - data->curFrame = 0; - } -} - - -/* - * QuartzAudioIOProc - * Callback function for audio playback. - * FIXME: use inOutputTime to correct for skipping - */ -static OSStatus -QuartzAudioIOProc( - AudioDeviceID inDevice, - const AudioTimeStamp *inNow, - const AudioBufferList *inInputData, - const AudioTimeStamp *inInputTime, - AudioBufferList *outOutputData, - const AudioTimeStamp *inOutputTime, - void *inClientData ) -{ - QuartzAudioRec *data = (QuartzAudioRec *)inClientData; - int i; - Boolean wasPlaying; - - pthread_mutex_lock(&data->lock); - wasPlaying = data->playing; - for (i = 0; i < outOutputData->mNumberBuffers; i++) { - if (data->playing) { - QuartzFillBuffer(outOutputData->mBuffers+i, data); - } - else { - memset(outOutputData->mBuffers[i].mData, 0, - outOutputData->mBuffers[i].mDataByteSize); - } - } - if (wasPlaying && !data->playing) { - OSStatus err; - err = AudioDeviceStop(inDevice, QuartzAudioIOProc); - } - pthread_mutex_unlock(&data->lock); - return 0; -} - - -/* - * QuartzCoreAudioBell - * Play a tone using the CoreAudio API - */ -static void QuartzCoreAudioBell( - int volume, // volume is % of max - int pitch, // pitch is Hz - int duration ) // duration is milliseconds -{ - if (quartzAudioDevice == kAudioDeviceUnknown) return; - - pthread_mutex_lock(&data.lock); - - // fade previous sound, if any - data.prevFrequency = data.frequency; - data.prevAmplitude = data.amplitude; - data.prevFrame = data.curFrame; - - // set new sound - data.frequency = pitch; - data.amplitude = volume / 100.0; - data.curFrame = 0; - data.totalFrames = (int)(data.sampleRate * duration / 1000.0); - data.remainingFrames = data.totalFrames; - - if (! data.playing) { - OSStatus status; - status = AudioDeviceStart(quartzAudioDevice, QuartzAudioIOProc); - if (status) { - ErrorF("QuartzAudioBell: AudioDeviceStart returned %ld\n", status); - } else { - data.playing = TRUE; - } - } - pthread_mutex_unlock(&data.lock); -} - - -/* - * DarwinModeBell - * Ring the bell - */ -void DarwinModeBell( - int volume, // volume in percent of max - DeviceIntPtr pDevice, - pointer ctrl, - int class ) -{ - int pitch; // pitch in Hz - int duration; // duration in milliseconds - - if (class == BellFeedbackClass) { - pitch = ((BellCtrl*)ctrl)->pitch; - duration = ((BellCtrl*)ctrl)->duration; - } else if (class == KbdFeedbackClass) { - pitch = ((KeybdCtrl*)ctrl)->bell_pitch; - duration = ((KeybdCtrl*)ctrl)->bell_duration; - } else { - ErrorF("QuartzBell: bad bell class %d\n", class); - return; - } - - if (quartzUseSysBeep) { - if (volume) - NSBeep(); - } else { - QuartzCoreAudioBell(volume, pitch, duration); - } -} - - -/* - * QuartzAudioInit - * Prepare to play the bell with the CoreAudio API - */ -void QuartzAudioInit(void) -{ - UInt32 propertySize; - OSStatus status; - AudioDeviceID outputDevice; - AudioStreamBasicDescription outputStreamDescription; - double sampleRate; - - // Get the default output device - propertySize = sizeof(outputDevice); - status = AudioHardwareGetProperty( - kAudioHardwarePropertyDefaultOutputDevice, - &propertySize, &outputDevice); - if (status) { - ErrorF("QuartzAudioInit: AudioHardwareGetProperty returned %ld\n", - status); - return; - } - if (outputDevice == kAudioDeviceUnknown) { - ErrorF("QuartzAudioInit: No audio output devices available.\n"); - return; - } - - // Get the basic device description - propertySize = sizeof(outputStreamDescription); - status = AudioDeviceGetProperty(outputDevice, 0, FALSE, - kAudioDevicePropertyStreamFormat, - &propertySize, &outputStreamDescription); - if (status) { - ErrorF("QuartzAudioInit: GetProperty(stream format) returned %ld\n", - status); - return; - } - sampleRate = outputStreamDescription.mSampleRate; - - // Fill in the playback data - data.frequency = 0; - data.amplitude = 0; - data.curFrame = 0; - data.remainingFrames = 0; - data.bytesPerFrame = outputStreamDescription.mBytesPerFrame; - data.sampleRate = sampleRate; - // data.bufferByteCount = bufferByteCount; - data.playing = FALSE; - data.prevAmplitude = 0; - data.prevFrame = 0; - data.prevFrequency = 0; - data.fadeLength = data.sampleRate / 200; - pthread_mutex_init(&data.lock, NULL); // fixme error check - - // fixme assert fadeLength - -#import "Preferences.h" -#include "pseudoramiX.h" - -extern void FatalError(const char *, ...); -extern char *display; -extern int noPanoramiXExtension; - - -/* - * QuartzReadPreferences - * Read the user preferences from the Cocoa front end. - */ -void QuartzReadPreferences(void) -{ - char *fileString; - - darwinFakeButtons = [Preferences fakeButtons]; - darwinFakeMouse2Mask = [Preferences button2Mask]; - darwinFakeMouse3Mask = [Preferences button3Mask]; - darwinMouseAccelChange = [Preferences mouseAccelChange]; - quartzUseSysBeep = [Preferences systemBeep]; - quartzEnableKeyEquivalents = [Preferences enableKeyEquivalents]; - - // quartzRootless has already been set - if (quartzRootless) { - // Use PseudoramiX instead of Xinerama - noPanoramiXExtension = TRUE; - noPseudoramiXExtension = ![Preferences xinerama]; - - quartzUseAGL = [Preferences useAGL]; - } else { - noPanoramiXExtension = ![Preferences xinerama]; - noPseudoramiXExtension = TRUE; - - // Full screen can't use AGL for GLX - quartzUseAGL = FALSE; - } - - if ([Preferences useKeymapFile]) { - fileString = (char *) [[Preferences keymapFile] lossyCString]; - darwinKeymapFile = (char *) malloc(strlen(fileString)+1); - if (! darwinKeymapFile) - FatalError("malloc failed in QuartzReadPreferences()!\n"); - strcpy(darwinKeymapFile, fileString); - } - - display = (char *) malloc(8); - if (! display) - FatalError("malloc failed in QuartzReadPreferences()!\n"); - snprintf(display, 8, "%i", [Preferences display]); - - darwinDesiredDepth = [Preferences depth] - 1; -} - - -/* - * QuartzWriteCocoaPasteboard - * Write text to the Mac OS X pasteboard. - */ -void QuartzWriteCocoaPasteboard( - char *text) -{ - NSPasteboard *pasteboard; - NSArray *pasteboardTypes; - NSString *string; - - if (! text) return; - pasteboard = [NSPasteboard generalPasteboard]; - if (! pasteboard) return; - string = [NSString stringWithCString:text]; - if (! string) return; - pasteboardTypes = [NSArray arrayWithObject:NSStringPboardType]; - - // nil owner because we don't provide type translations - [pasteboard declareTypes:pasteboardTypes owner:nil]; - [pasteboard setString:string forType:NSStringPboardType]; -} - - -/* - * QuartzReadCocoaPasteboard - * Read text from the Mac OS X pasteboard and return it as a heap string. - * The caller must free the string. - */ -char *QuartzReadCocoaPasteboard(void) -{ - NSPasteboard *pasteboard; - NSArray *pasteboardTypes; - NSString *existingType; - char *text = NULL; - - pasteboardTypes = [NSArray arrayWithObject:NSStringPboardType]; - pasteboard = [NSPasteboard generalPasteboard]; - if (! pasteboard) return NULL; - - existingType = [pasteboard availableTypeFromArray:pasteboardTypes]; - if (existingType) { - NSString *string = [pasteboard stringForType:existingType]; - char *buffer; - - if (! string) return NULL; - buffer = (char *) [string lossyCString]; - text = (char *) malloc(strlen(buffer)+1); - if (text) - strcpy(text, buffer); - } - - return text; -} - - -/* - * QuartzFSUseQDCursor - * Return whether the screen should use a QuickDraw cursor. - */ -int QuartzFSUseQDCursor( - int depth) // screen depth -{ - switch ([Preferences useQDCursor]) { - case qdCursor_Always: - return TRUE; - case qdCursor_Never: - return FALSE; - case qdCursor_Not8Bit: - if (depth > 8) - return TRUE; - else - return FALSE; - } - return TRUE; -} - - -/* - * QuartzBlockHandler - * Clean out any autoreleased objects. - */ -void QuartzBlockHandler( - void *blockData, - void *pTimeout, - void *pReadmask) -{ - static NSAutoreleasePool *aPool = nil; - - [aPool release]; - aPool = [[NSAutoreleasePool alloc] init]; -} - - -/* - * QuartzWakeupHandler - */ -void QuartzWakeupHandler( - void *blockData, - int result, - void *pReadmask) -{ - // nothing here -} diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/quartzCommon.h b/nx-X11/programs/Xserver/hw/darwin/quartz/quartzCommon.h deleted file mode 100644 index d0f743662..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/quartzCommon.h +++ /dev/null @@ -1,108 +0,0 @@ -/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/quartzCommon.h,v 1.4 2005/07/01 22:43:07 daniels Exp $ */ -/* - * quartzCommon.h - * - * Common definitions used internally by all Quartz modes - * - * This file should be included before any X11 or IOKit headers - * so that it can avoid symbol conflicts. - * - * Copyright (c) 2001-2004 Torrey T. Lyons and Greg Parker. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzCommon.h,v 1.15 2004/06/08 22:58:10 torrey Exp $ */ - -#ifndef _QUARTZCOMMON_H -#define _QUARTZCOMMON_H - -// QuickDraw in ApplicationServices has the following conflicts with -// the basic X server headers. Use QD_ to use the QuickDraw -// definition of any of these symbols, or the normal name for the -// X11 definition. -#define Cursor QD_Cursor -#define WindowPtr QD_WindowPtr -#define Picture QD_Picture -#include -#undef Cursor -#undef WindowPtr -#undef Picture - -// Quartz specific per screen storage structure -typedef struct { - // List of CoreGraphics displays that this X11 screen covers. - // This is more than one CG display for video mirroring and - // rootless PseudoramiX mode. - // No CG display will be covered by more than one X11 screen. - int displayCount; - CGDirectDisplayID *displayIDs; -} QuartzScreenRec, *QuartzScreenPtr; - -#define QUARTZ_PRIV(pScreen) \ - ((QuartzScreenPtr)pScreen->devPrivates[quartzScreenIndex].ptr) - -// Data stored at startup for Cocoa front end -extern int quartzEventWriteFD; -extern int quartzStartClients; - -// User preferences used by Quartz modes -extern int quartzRootless; -extern int quartzUseSysBeep; -extern int quartzUseAGL; -extern int quartzEnableKeyEquivalents; - -// Other shared data -extern int quartzServerVisible; -extern int quartzServerQuitting; -extern int quartzScreenIndex; -extern int aquaMenuBarHeight; - -// Name of GLX bundle for native OpenGL -extern const char *quartzOpenGLBundle; - -void QuartzReadPreferences(void); -void QuartzMessageMainThread(unsigned msg, void *data, unsigned length); -void QuartzMessageServerThread(int type, int argc, ...); -void QuartzSetWindowMenu(int nitems, const char **items, - const char *shortcuts); -void QuartzFSCapture(void); -void QuartzFSRelease(void); -int QuartzFSUseQDCursor(int depth); -void QuartzBlockHandler(void *blockData, void *pTimeout, void *pReadmask); -void QuartzWakeupHandler(void *blockData, int result, void *pReadmask); - -// Messages that can be sent to the main thread. -enum { - kQuartzServerHidden, - kQuartzServerStarted, - kQuartzServerDied, - kQuartzCursorUpdate, - kQuartzPostEvent, - kQuartzSetWindowMenu, - kQuartzSetWindowMenuCheck, - kQuartzSetFrontProcess, - kQuartzSetCanQuit -}; - -#endif /* _QUARTZCOMMON_H */ diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/quartzCursor.c b/nx-X11/programs/Xserver/hw/darwin/quartz/quartzCursor.c deleted file mode 100644 index 711ce64f0..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/quartzCursor.c +++ /dev/null @@ -1,653 +0,0 @@ -/************************************************************** - * - * Support for using the Quartz Window Manager cursor - * - **************************************************************/ -/* - * Copyright (c) 2001-2003 Torrey T. Lyons and Greg Parker. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzCursor.c,v 1.4 2002/11/19 23:01:30 torrey Exp $ */ - -#include "quartzCommon.h" -#include "quartzCursor.h" -#include "darwin.h" - -#include - -#include "mi.h" -#include "scrnintstr.h" -#include "cursorstr.h" -#include "mipointrst.h" -#include "globals.h" - -// Size of the QuickDraw cursor -#define CURSORWIDTH 16 -#define CURSORHEIGHT 16 - -typedef struct { - int qdCursorMode; - int qdCursorVisible; - int useQDCursor; - QueryBestSizeProcPtr QueryBestSize; - miPointerSpriteFuncPtr spriteFuncs; -} QuartzCursorScreenRec, *QuartzCursorScreenPtr; - -static int darwinCursorScreenIndex = -1; -static unsigned long darwinCursorGeneration = 0; -static CursorPtr quartzLatentCursor = NULL; -static QD_Cursor gQDArrow; // QuickDraw arrow cursor - -// Cursor for the main thread to set (NULL = arrow cursor). -static CCrsrHandle currentCursor = NULL; -static pthread_mutex_t cursorMutex; -static pthread_cond_t cursorCondition; - -#define CURSOR_PRIV(pScreen) \ - ((QuartzCursorScreenPtr)pScreen->devPrivates[darwinCursorScreenIndex].ptr) - -#define HIDE_QD_CURSOR(pScreen, visible) \ - if (visible) { \ - int ix; \ - for (ix = 0; ix < QUARTZ_PRIV(pScreen)->displayCount; ix++) { \ - CGDisplayHideCursor(QUARTZ_PRIV(pScreen)->displayIDs[ix]); \ - } \ - visible = FALSE; \ - } ((void)0) - -#define SHOW_QD_CURSOR(pScreen, visible) \ - { \ - int ix; \ - for (ix = 0; ix < QUARTZ_PRIV(pScreen)->displayCount; ix++) { \ - CGDisplayShowCursor(QUARTZ_PRIV(pScreen)->displayIDs[ix]); \ - } \ - visible = TRUE; \ - } ((void)0) - -#define CHANGE_QD_CURSOR(cursorH) \ - if (!quartzServerQuitting) { \ - /* Acquire lock and tell the main thread to change cursor */ \ - pthread_mutex_lock(&cursorMutex); \ - currentCursor = (CCrsrHandle) (cursorH); \ - QuartzMessageMainThread(kQuartzCursorUpdate, NULL, 0); \ - \ - /* Wait for the main thread to change the cursor */ \ - pthread_cond_wait(&cursorCondition, &cursorMutex); \ - pthread_mutex_unlock(&cursorMutex); \ - } ((void)0) - - -/* - * MakeQDCursor helpers: CTAB_ENTER, interleave - */ - -// Add a color entry to a ctab -#define CTAB_ENTER(ctab, index, r, g, b) \ - ctab->ctTable[index].value = index; \ - ctab->ctTable[index].rgb.red = r; \ - ctab->ctTable[index].rgb.green = g; \ - ctab->ctTable[index].rgb.blue = b - -// Make an unsigned short by interleaving the bits of bytes c1 and c2. -// High bit of c1 is first; low bit of c2 is last. -// Interleave is a built-in INTERCAL operator. -static unsigned short -interleave( - unsigned char c1, - unsigned char c2 ) -{ - return - ((c1 & 0x80) << 8) | ((c2 & 0x80) << 7) | - ((c1 & 0x40) << 7) | ((c2 & 0x40) << 6) | - ((c1 & 0x20) << 6) | ((c2 & 0x20) << 5) | - ((c1 & 0x10) << 5) | ((c2 & 0x10) << 4) | - ((c1 & 0x08) << 4) | ((c2 & 0x08) << 3) | - ((c1 & 0x04) << 3) | ((c2 & 0x04) << 2) | - ((c1 & 0x02) << 2) | ((c2 & 0x02) << 1) | - ((c1 & 0x01) << 1) | ((c2 & 0x01) << 0) ; -} - -/* - * MakeQDCursor - * Make a QuickDraw color cursor from the given X11 cursor. - * Warning: This code is nasty. Color cursors were meant to be read - * from resources; constructing the structures programmatically is messy. - */ -/* - QuickDraw cursor representation: - Our color cursor is a 2 bit per pixel pixmap. - Each pixel's bits are (source<<1 | mask) from the original X cursor pixel. - The cursor's color table maps the colors like this: - (2-bit value | X result | colortable | Mac result) - 00 | transparent | white | transparent (white outside mask) - 01 | back color | back color | back color - 10 | undefined | black | invert background (just for fun) - 11 | fore color | fore color | fore color -*/ -static CCrsrHandle -MakeQDCursor( - CursorPtr pCursor ) -{ - CCrsrHandle result; - CCrsrPtr curs; - int i, w, h; - unsigned short rowMask; - PixMap *pix; - ColorTable *ctab; - unsigned short *image; - - result = (CCrsrHandle) NewHandleClear(sizeof(CCrsr)); - if (!result) return NULL; - HLock((Handle)result); - curs = *result; - - // Initialize CCrsr - curs->crsrType = 0x8001; // 0x8000 = b&w, 0x8001 = color - curs->crsrMap = (PixMapHandle) NewHandleClear(sizeof(PixMap)); - if (!curs->crsrMap) goto pixAllocFailed; - HLock((Handle)curs->crsrMap); - pix = *curs->crsrMap; - curs->crsrData = NULL; // raw cursor image data (set below) - curs->crsrXData = NULL; // QD's processed data - curs->crsrXValid = 0; // zero means QD must re-process cursor data - curs->crsrXHandle = NULL; // reserved - memset(curs->crsr1Data, 0, CURSORWIDTH*CURSORHEIGHT/8); // b&w data - memset(curs->crsrMask, 0, CURSORWIDTH*CURSORHEIGHT/8); // b&w & color mask - curs->crsrHotSpot.h = min(CURSORWIDTH, pCursor->bits->xhot); // hot spot - curs->crsrHotSpot.v = min(CURSORHEIGHT, pCursor->bits->yhot); // hot spot - curs->crsrXTable = 0; // reserved - curs->crsrID = GetCTSeed(); // unique ID from Color Manager - - // Set the b&w data and mask - w = min(pCursor->bits->width, CURSORWIDTH); - h = min(pCursor->bits->height, CURSORHEIGHT); - rowMask = ~((1 << (CURSORWIDTH - w)) - 1); - for (i = 0; i < h; i++) { - curs->crsr1Data[i] = rowMask & - ((pCursor->bits->source[i*4]<<8) | pCursor->bits->source[i*4+1]); - curs->crsrMask[i] = rowMask & - ((pCursor->bits->mask[i*4]<<8) | pCursor->bits->mask[i*4+1]); - } - - // Set the color data and mask - // crsrMap: defines bit depth and size and colortable only - pix->rowBytes = (CURSORWIDTH * 2 / 8) | 0x8000; // last bit on means PixMap - SetRect(&pix->bounds, 0, 0, CURSORWIDTH, CURSORHEIGHT); // see TN 1020 - pix->pixelSize = 2; - pix->cmpCount = 1; - pix->cmpSize = 2; - // pix->pmTable set below - - // crsrData is the pixel data. crsrMap's baseAddr is not used. - curs->crsrData = NewHandleClear(CURSORWIDTH*CURSORHEIGHT * 2 / 8); - if (!curs->crsrData) goto imageAllocFailed; - HLock((Handle)curs->crsrData); - image = (unsigned short *) *curs->crsrData; - // Pixel data is just 1-bit data and mask interleaved (see above) - for (i = 0; i < h; i++) { - unsigned char s, m; - s = pCursor->bits->source[i*4] & (rowMask >> 8); - m = pCursor->bits->mask[i*4] & (rowMask >> 8); - image[2*i] = interleave(s, m); - s = pCursor->bits->source[i*4+1] & (rowMask & 0x00ff); - m = pCursor->bits->mask[i*4+1] & (rowMask & 0x00ff); - image[2*i+1] = interleave(s, m); - } - - // Build the color table (entries described above) - // NewPixMap allocates a color table handle. - pix->pmTable = (CTabHandle) NewHandleClear(sizeof(ColorTable) + 3 - * sizeof(ColorSpec)); - if (!pix->pmTable) goto ctabAllocFailed; - HLock((Handle)pix->pmTable); - ctab = *pix->pmTable; - ctab->ctSeed = GetCTSeed(); - ctab->ctFlags = 0; - ctab->ctSize = 3; // color count - 1 - CTAB_ENTER(ctab, 0, 0xffff, 0xffff, 0xffff); - CTAB_ENTER(ctab, 1, pCursor->backRed, pCursor->backGreen, - pCursor->backBlue); - CTAB_ENTER(ctab, 2, 0x0000, 0x0000, 0x0000); - CTAB_ENTER(ctab, 3, pCursor->foreRed, pCursor->foreGreen, - pCursor->foreBlue); - - HUnlock((Handle)pix->pmTable); // ctab - HUnlock((Handle)curs->crsrData); // image data - HUnlock((Handle)curs->crsrMap); // pix - HUnlock((Handle)result); // cursor - - return result; - - // "What we have here is a failure to allocate" -ctabAllocFailed: - HUnlock((Handle)curs->crsrData); - DisposeHandle((Handle)curs->crsrData); -imageAllocFailed: - HUnlock((Handle)curs->crsrMap); - DisposeHandle((Handle)curs->crsrMap); -pixAllocFailed: - HUnlock((Handle)result); - DisposeHandle((Handle)result); - return NULL; -} - - -/* - * FreeQDCursor - * Destroy a QuickDraw color cursor created with MakeQDCursor(). - * The cursor must not currently be on screen. - */ -static void FreeQDCursor(CCrsrHandle cursHandle) -{ - CCrsrPtr curs; - PixMap *pix; - - HLock((Handle)cursHandle); - curs = *cursHandle; - HLock((Handle)curs->crsrMap); - pix = *curs->crsrMap; - DisposeHandle((Handle)pix->pmTable); - HUnlock((Handle)curs->crsrMap); - DisposeHandle((Handle)curs->crsrMap); - DisposeHandle((Handle)curs->crsrData); - HUnlock((Handle)cursHandle); - DisposeHandle((Handle)cursHandle); -} - - -/* -=========================================================================== - - Pointer sprite functions - -=========================================================================== -*/ - -/* - * QuartzRealizeCursor - * Convert the X cursor representation to QuickDraw format if possible. - */ -Bool -QuartzRealizeCursor( - ScreenPtr pScreen, - CursorPtr pCursor ) -{ - CCrsrHandle qdCursor; - QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); - - if(!pCursor || !pCursor->bits) - return FALSE; - - // if the cursor is too big we use a software cursor - if ((pCursor->bits->height > CURSORHEIGHT) || - (pCursor->bits->width > CURSORWIDTH) || !ScreenPriv->useQDCursor) - { - if (quartzRootless) { - // rootless can't use a software cursor - return TRUE; - } else { - return (*ScreenPriv->spriteFuncs->RealizeCursor) - (pScreen, pCursor); - } - } - - // make new cursor image - qdCursor = MakeQDCursor(pCursor); - if (!qdCursor) return FALSE; - - // save the result - pCursor->devPriv[pScreen->myNum] = (pointer) qdCursor; - - return TRUE; -} - - -/* - * QuartzUnrealizeCursor - * Free the storage space associated with a realized cursor. - */ -Bool -QuartzUnrealizeCursor( - ScreenPtr pScreen, - CursorPtr pCursor ) -{ - QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); - - if ((pCursor->bits->height > CURSORHEIGHT) || - (pCursor->bits->width > CURSORWIDTH) || !ScreenPriv->useQDCursor) - { - if (quartzRootless) { - return TRUE; - } else { - return (*ScreenPriv->spriteFuncs->UnrealizeCursor) - (pScreen, pCursor); - } - } else { - CCrsrHandle oldCursor = (CCrsrHandle) pCursor->devPriv[pScreen->myNum]; - - if (currentCursor != oldCursor) { - // This should only fail when quitting, in which case we just leak. - FreeQDCursor(oldCursor); - } - pCursor->devPriv[pScreen->myNum] = NULL; - return TRUE; - } -} - - -/* - * QuartzSetCursor - * Set the cursor sprite and position. - * Use QuickDraw cursor if possible. - */ -static void -QuartzSetCursor( - ScreenPtr pScreen, - CursorPtr pCursor, - int x, - int y) -{ - QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); - - quartzLatentCursor = pCursor; - - // Don't touch Mac OS cursor if X is hidden! - if (!quartzServerVisible) - return; - - if (!pCursor) { - // Remove the cursor completely. - HIDE_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible); - if (! ScreenPriv->qdCursorMode) - (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, 0, x, y); - } - else if ((pCursor->bits->height <= CURSORHEIGHT) && - (pCursor->bits->width <= CURSORWIDTH) && ScreenPriv->useQDCursor) - { - // Cursor is small enough to use QuickDraw directly. - if (! ScreenPriv->qdCursorMode) // remove the X cursor - (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, 0, x, y); - ScreenPriv->qdCursorMode = TRUE; - - CHANGE_QD_CURSOR(pCursor->devPriv[pScreen->myNum]); - SHOW_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible); - } - else if (quartzRootless) { - // Rootless can't use a software cursor, so we just use Mac OS arrow. - CHANGE_QD_CURSOR(NULL); - SHOW_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible); - } - else { - // Cursor is too big for QuickDraw. Use X software cursor. - HIDE_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible); - ScreenPriv->qdCursorMode = FALSE; - (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, pCursor, x, y); - } -} - - -/* - * QuartzReallySetCursor - * Set the QuickDraw cursor. Called from the main thread since changing the - * cursor with QuickDraw is not thread safe on dual processor machines. - */ -void -QuartzReallySetCursor() -{ - pthread_mutex_lock(&cursorMutex); - - if (currentCursor) { - SetCCursor(currentCursor); - } else { - SetCursor(&gQDArrow); - } - - pthread_cond_signal(&cursorCondition); - pthread_mutex_unlock(&cursorMutex); -} - - -/* - * QuartzMoveCursor - * Move the cursor. This is a noop for QuickDraw. - */ -static void -QuartzMoveCursor( - ScreenPtr pScreen, - int x, - int y) -{ - QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); - - // only the X cursor needs to be explicitly moved - if (!ScreenPriv->qdCursorMode) - (*ScreenPriv->spriteFuncs->MoveCursor)(pScreen, x, y); -} - - -static miPointerSpriteFuncRec quartzSpriteFuncsRec = { - QuartzRealizeCursor, - QuartzUnrealizeCursor, - QuartzSetCursor, - QuartzMoveCursor -}; - - -/* -=========================================================================== - - Pointer screen functions - -=========================================================================== -*/ - -/* - * QuartzCursorOffScreen - */ -static Bool QuartzCursorOffScreen(ScreenPtr *pScreen, int *x, int *y) -{ - return FALSE; -} - - -/* - * QuartzCrossScreen - */ -static void QuartzCrossScreen(ScreenPtr pScreen, Bool entering) -{ - return; -} - - -/* - * QuartzWarpCursor - * Change the cursor position without generating an event or motion history. - * The input coordinates (x,y) are in pScreen-local X11 coordinates. - * - */ -static void -QuartzWarpCursor( - ScreenPtr pScreen, - int x, - int y) -{ - static int neverMoved = TRUE; - - if (neverMoved) { - // Don't move the cursor the first time. This is the jump-to-center - // initialization, and it's annoying because we may still be in MacOS. - neverMoved = FALSE; - return; - } - - if (quartzServerVisible) { - CGDisplayErr cgErr; - CGPoint cgPoint; - // Only need to do this for one display. Any display will do. - CGDirectDisplayID cgID = QUARTZ_PRIV(pScreen)->displayIDs[0]; - CGRect cgRect = CGDisplayBounds(cgID); - - // Convert (x,y) to CoreGraphics screen-local CG coordinates. - // This is necessary because the X11 screen and CG screen may not - // coincide. (e.g. X11 screen may be moved to dodge the menu bar) - - // Make point in X11 global coordinates - cgPoint = CGPointMake(x + dixScreenOrigins[pScreen->myNum].x, - y + dixScreenOrigins[pScreen->myNum].y); - // Shift to CoreGraphics global screen coordinates - cgPoint.x += darwinMainScreenX; - cgPoint.y += darwinMainScreenY; - // Shift to CoreGraphics screen-local coordinates - cgPoint.x -= cgRect.origin.x; - cgPoint.y -= cgRect.origin.y; - - cgErr = CGDisplayMoveCursorToPoint(cgID, cgPoint); - if (cgErr != CGDisplayNoErr) { - ErrorF("Could not set cursor position with error code 0x%x.\n", - cgErr); - } - } - - miPointerWarpCursor(pScreen, x, y); - miPointerUpdate(); -} - - -static miPointerScreenFuncRec quartzScreenFuncsRec = { - QuartzCursorOffScreen, - QuartzCrossScreen, - QuartzWarpCursor, - DarwinEQPointerPost, - DarwinEQSwitchScreen -}; - - -/* -=========================================================================== - - Other screen functions - -=========================================================================== -*/ - -/* - * QuartzCursorQueryBestSize - * Handle queries for best cursor size - */ -static void -QuartzCursorQueryBestSize( - int class, - unsigned short *width, - unsigned short *height, - ScreenPtr pScreen) -{ - QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); - - if (class == CursorShape) { - *width = CURSORWIDTH; - *height = CURSORHEIGHT; - } else { - (*ScreenPriv->QueryBestSize)(class, width, height, pScreen); - } -} - - -/* - * QuartzInitCursor - * Initialize cursor support - */ -Bool -QuartzInitCursor( - ScreenPtr pScreen ) -{ - QuartzCursorScreenPtr ScreenPriv; - miPointerScreenPtr PointPriv; - DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen); - - // initialize software cursor handling (always needed as backup) - if (!miDCInitialize(pScreen, &quartzScreenFuncsRec)) { - return FALSE; - } - - // allocate private storage for this screen's QuickDraw cursor info - if (darwinCursorGeneration != serverGeneration) { - if ((darwinCursorScreenIndex = AllocateScreenPrivateIndex()) < 0) - return FALSE; - darwinCursorGeneration = serverGeneration; - } - - ScreenPriv = xcalloc( 1, sizeof(QuartzCursorScreenRec) ); - if (!ScreenPriv) return FALSE; - - CURSOR_PRIV(pScreen) = ScreenPriv; - - // override some screen procedures - ScreenPriv->QueryBestSize = pScreen->QueryBestSize; - pScreen->QueryBestSize = QuartzCursorQueryBestSize; - - // initialize QuickDraw cursor handling - GetQDGlobalsArrow(&gQDArrow); - PointPriv = (miPointerScreenPtr) - pScreen->devPrivates[miPointerScreenIndex].ptr; - - ScreenPriv->spriteFuncs = PointPriv->spriteFuncs; - PointPriv->spriteFuncs = &quartzSpriteFuncsRec; - - if (!quartzRootless) - ScreenPriv->useQDCursor = QuartzFSUseQDCursor(dfb->colorBitsPerPixel); - else - ScreenPriv->useQDCursor = TRUE; - ScreenPriv->qdCursorMode = TRUE; - ScreenPriv->qdCursorVisible = TRUE; - - // initialize cursor mutex lock - pthread_mutex_init(&cursorMutex, NULL); - - // initialize condition for waiting - pthread_cond_init(&cursorCondition, NULL); - - return TRUE; -} - - -// X server is hiding. Restore the Aqua cursor. -void QuartzSuspendXCursor( - ScreenPtr pScreen ) -{ - QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); - - CHANGE_QD_CURSOR(NULL); - SHOW_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible); -} - - -// X server is showing. Restore the X cursor. -void QuartzResumeXCursor( - ScreenPtr pScreen, - int x, - int y ) -{ - QuartzSetCursor(pScreen, quartzLatentCursor, x, y); -} diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/quartzCursor.h b/nx-X11/programs/Xserver/hw/darwin/quartz/quartzCursor.h deleted file mode 100644 index 4db5531fa..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/quartzCursor.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * quartzCursor.h - * - * External interface for Quartz hardware cursor - */ -/* - * Copyright (c) 2001 Torrey T. Lyons and Greg Parker. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/quartzCursor.h,v 1.2 2001/09/23 04:04:49 torrey Exp $ */ - -#ifndef QUARTZCURSOR_H -#define QUARTZCURSOR_H - -#include "screenint.h" - -Bool QuartzInitCursor(ScreenPtr pScreen); -void QuartzSuspendXCursor(ScreenPtr pScreen); -void QuartzResumeXCursor(ScreenPtr pScreen, int x, int y); - -#endif diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/quartzKeyboard.c b/nx-X11/programs/Xserver/hw/darwin/quartz/quartzKeyboard.c deleted file mode 100644 index f960b496f..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/quartzKeyboard.c +++ /dev/null @@ -1,388 +0,0 @@ -/* - quartzKeyboard.c - $Id: quartzKeyboard.c,v 1.4 2005/07/01 22:43:07 daniels Exp $ - - Code to build a keymap using the Carbon Keyboard Layout API, - which is supported on Mac OS X 10.2 and newer. - - Copyright (c) 2003 Apple Computer, Inc. All rights reserved. - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT - HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. - - Except as contained in this notice, the name(s) of the above - copyright holders shall not be used in advertising or otherwise to - promote the sale, use or other dealings in this Software without - prior written authorization. -*/ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzKeyboard.c,v 1.1 2003/11/01 08:13:08 torrey Exp $ */ - -#include "quartzCommon.h" - -#include -#include - -#include "darwinKeyboard.h" -#include "keysym.h" -#include "keysym2ucs.h" - -#ifdef HAS_KL_API - -#define HACK_MISSING 1 -#define HACK_KEYPAD 1 - -enum { - MOD_COMMAND = 256, - MOD_SHIFT = 512, - MOD_OPTION = 2048, - MOD_CONTROL = 4096, -}; - -#define UKEYSYM(u) ((u) | 0x01000000) - -/* Table of keycode->keysym mappings we use to fallback on for important - keys that are often not in the Unicode mapping. */ - -const static struct { - unsigned short keycode; - KeySym keysym; -} known_keys[] = { - {55, XK_Meta_L}, - {56, XK_Shift_L}, - {57, XK_Caps_Lock}, - {58, XK_Alt_L}, - {59, XK_Control_L}, - - {60, XK_Shift_R}, - {61, XK_Alt_R}, - {62, XK_Control_R}, - {63, XK_Meta_R}, - - {122, XK_F1}, - {120, XK_F2}, - {99, XK_F3}, - {118, XK_F4}, - {96, XK_F5}, - {97, XK_F6}, - {98, XK_F7}, - {100, XK_F8}, - {101, XK_F9}, - {109, XK_F10}, - {103, XK_F11}, - {111, XK_F12}, - {105, XK_F13}, - {107, XK_F14}, - {113, XK_F15}, -}; - -/* Table of keycode->old,new-keysym mappings we use to fixup the numeric - keypad entries. */ - -const static struct { - unsigned short keycode; - KeySym normal, keypad; -} known_numeric_keys[] = { - {65, XK_period, XK_KP_Decimal}, - {67, XK_asterisk, XK_KP_Multiply}, - {69, XK_plus, XK_KP_Add}, - {75, XK_slash, XK_KP_Divide}, - {76, 0x01000003, XK_KP_Enter}, - {78, XK_minus, XK_KP_Subtract}, - {81, XK_equal, XK_KP_Equal}, - {82, XK_0, XK_KP_0}, - {83, XK_1, XK_KP_1}, - {84, XK_2, XK_KP_2}, - {85, XK_3, XK_KP_3}, - {86, XK_4, XK_KP_4}, - {87, XK_5, XK_KP_5}, - {88, XK_6, XK_KP_6}, - {89, XK_7, XK_KP_7}, - {91, XK_8, XK_KP_8}, - {92, XK_9, XK_KP_9}, -}; - -/* Table mapping normal keysyms to their dead equivalents. - FIXME: all the unicode keysyms (apart from circumflex) were guessed. */ - -const static struct { - KeySym normal, dead; -} dead_keys[] = { - {XK_grave, XK_dead_grave}, - {XK_acute, XK_dead_acute}, - {XK_asciicircum, XK_dead_circumflex}, - {UKEYSYM (0x2c6), XK_dead_circumflex}, /* MODIFIER LETTER CIRCUMFLEX ACCENT */ - {XK_asciitilde, XK_dead_tilde}, - {UKEYSYM (0x2dc), XK_dead_tilde}, /* SMALL TILDE */ - {XK_macron, XK_dead_macron}, - {XK_breve, XK_dead_breve}, - {XK_abovedot, XK_dead_abovedot}, - {XK_diaeresis, XK_dead_diaeresis}, - {UKEYSYM (0x2da), XK_dead_abovering}, /* DOT ABOVE */ - {XK_doubleacute, XK_dead_doubleacute}, - {XK_caron, XK_dead_caron}, - {XK_cedilla, XK_dead_cedilla}, - {XK_ogonek, XK_dead_ogonek}, - {UKEYSYM (0x269), XK_dead_iota}, /* LATIN SMALL LETTER IOTA */ - {UKEYSYM (0x2ec), XK_dead_voiced_sound}, /* MODIFIER LETTER VOICING */ -/* {XK_semivoiced_sound, XK_dead_semivoiced_sound}, */ - {UKEYSYM (0x323), XK_dead_belowdot}, /* COMBINING DOT BELOW */ - {UKEYSYM (0x309), XK_dead_hook}, /* COMBINING HOOK ABOVE */ - {UKEYSYM (0x31b), XK_dead_horn}, /* COMBINING HORN */ -}; - -unsigned int -DarwinModeSystemKeymapSeed (void) -{ - static unsigned int seed; - - static KeyboardLayoutRef last_key_layout; - KeyboardLayoutRef key_layout; - - KLGetCurrentKeyboardLayout (&key_layout); - - if (key_layout != last_key_layout) - seed++; - - last_key_layout = key_layout; - - return seed; -} - -static inline UniChar -macroman2ucs (unsigned char c) -{ - /* Precalculated table mapping MacRoman-128 to Unicode. Generated - by creating single element CFStringRefs then extracting the - first character. */ - - static const unsigned short table[128] = { - 0xc4, 0xc5, 0xc7, 0xc9, 0xd1, 0xd6, 0xdc, 0xe1, - 0xe0, 0xe2, 0xe4, 0xe3, 0xe5, 0xe7, 0xe9, 0xe8, - 0xea, 0xeb, 0xed, 0xec, 0xee, 0xef, 0xf1, 0xf3, - 0xf2, 0xf4, 0xf6, 0xf5, 0xfa, 0xf9, 0xfb, 0xfc, - 0x2020, 0xb0, 0xa2, 0xa3, 0xa7, 0x2022, 0xb6, 0xdf, - 0xae, 0xa9, 0x2122, 0xb4, 0xa8, 0x2260, 0xc6, 0xd8, - 0x221e, 0xb1, 0x2264, 0x2265, 0xa5, 0xb5, 0x2202, 0x2211, - 0x220f, 0x3c0, 0x222b, 0xaa, 0xba, 0x3a9, 0xe6, 0xf8, - 0xbf, 0xa1, 0xac, 0x221a, 0x192, 0x2248, 0x2206, 0xab, - 0xbb, 0x2026, 0xa0, 0xc0, 0xc3, 0xd5, 0x152, 0x153, - 0x2013, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0xf7, 0x25ca, - 0xff, 0x178, 0x2044, 0x20ac, 0x2039, 0x203a, 0xfb01, 0xfb02, - 0x2021, 0xb7, 0x201a, 0x201e, 0x2030, 0xc2, 0xca, 0xc1, - 0xcb, 0xc8, 0xcd, 0xce, 0xcf, 0xcc, 0xd3, 0xd4, - 0xf8ff, 0xd2, 0xda, 0xdb, 0xd9, 0x131, 0x2c6, 0x2dc, - 0xaf, 0x2d8, 0x2d9, 0x2da, 0xb8, 0x2dd, 0x2db, 0x2c7, - }; - - if (c < 128) - return c; - else - return table[c - 128]; -} - -static KeySym -make_dead_key (KeySym in) -{ - int i; - - for (i = 0; i < sizeof (dead_keys) / sizeof (dead_keys[0]); i++) - { - if (dead_keys[i].normal == in) - return dead_keys[i].dead; - } - - return in; -} - -Bool -DarwinModeReadSystemKeymap (darwinKeyboardInfo *info) -{ - KeyboardLayoutRef key_layout; - const void *chr_data; - int num_keycodes = NUM_KEYCODES; - UInt32 keyboard_type = 0; - int is_uchr, i, j; - OSStatus err; - KeySym *k; - - KLGetCurrentKeyboardLayout (&key_layout); - KLGetKeyboardLayoutProperty (key_layout, kKLuchrData, &chr_data); - - if (chr_data != NULL) - { - is_uchr = 1; - keyboard_type = LMGetKbdType (); - } - else - { - KLGetKeyboardLayoutProperty (key_layout, kKLKCHRData, &chr_data); - - if (chr_data == NULL) - { - ErrorF ( "Couldn't get uchr or kchr resource\n"); - return FALSE; - } - - is_uchr = 0; - num_keycodes = 128; - } - - - /* Scan the keycode range for the Unicode character that each - key produces in the four shift states. Then convert that to - an X11 keysym (which may just the bit that says "this is - Unicode" if it can't find the real symbol.) */ - - for (i = 0; i < num_keycodes; i++) - { - static const int mods[4] = {0, MOD_SHIFT, MOD_OPTION, - MOD_OPTION | MOD_SHIFT}; - - k = info->keyMap + i * GLYPHS_PER_KEY; - - for (j = 0; j < 4; j++) - { - if (is_uchr) - { - UniChar s[8]; - UniCharCount len; - UInt32 dead_key_state, extra_dead; - - dead_key_state = 0; - err = UCKeyTranslate (chr_data, i, kUCKeyActionDown, - mods[j] >> 8, keyboard_type, 0, - &dead_key_state, 8, &len, s); - if (err != noErr) - continue; - - if (len == 0 && dead_key_state != 0) - { - /* Found a dead key. Work out which one it is, but - remembering that it's dead. */ - - extra_dead = 0; - err = UCKeyTranslate (chr_data, i, kUCKeyActionDown, - mods[j] >> 8, keyboard_type, - kUCKeyTranslateNoDeadKeysMask, - &extra_dead, 8, &len, s); - if (err != noErr) - continue; - } - - if (len > 0 && s[0] != 0x0010) - { - k[j] = ucs2keysym (s[0]); - - if (dead_key_state != 0) - k[j] = make_dead_key (k[j]); - } - } - else - { - UInt32 c, state = 0; - UInt16 code; - - code = i | mods[j]; - c = KeyTranslate (chr_data, code, &state); - - /* Dead keys are only processed on key-down, so ask - to translate those events. When we find a dead key, - translating the matching key up event will give - us the actual dead character. */ - - if (state != 0) - { - UInt32 state2 = 0; - c = KeyTranslate (chr_data, code | 128, &state2); - } - - /* Characters seem to be in MacRoman encoding. */ - - if (c != 0 && c != 0x0010) - { - k[j] = ucs2keysym (macroman2ucs (c & 255)); - - if (state != 0) - k[j] = make_dead_key (k[j]); - } - } - } - - if (k[3] == k[2]) - k[3] = NoSymbol; - if (k[2] == k[1]) - k[2] = NoSymbol; - if (k[1] == k[0]) - k[1] = NoSymbol; - if (k[0] == k[2] && k[1] == k[3]) - k[2] = k[3] = NoSymbol; - } - - /* Fix up some things that are normally missing.. */ - - if (HACK_MISSING) - { - for (i = 0; i < sizeof (known_keys) / sizeof (known_keys[0]); i++) - { - k = info->keyMap + known_keys[i].keycode * GLYPHS_PER_KEY; - - if (k[0] == NoSymbol && k[1] == NoSymbol - && k[2] == NoSymbol && k[3] == NoSymbol) - { - k[0] = known_keys[i].keysym; - } - } - } - - /* And some more things. We find the right symbols for the numeric - keypad, but not the KP_ keysyms. So try to convert known keycodes. */ - - if (HACK_KEYPAD) - { - for (i = 0; i < sizeof (known_numeric_keys) - / sizeof (known_numeric_keys[0]); i++) - { - k = info->keyMap + known_numeric_keys[i].keycode * GLYPHS_PER_KEY; - - if (k[0] == known_numeric_keys[i].normal) - { - k[0] = known_numeric_keys[i].keypad; - } - } - } - - return TRUE; -} - -#else /* !HAS_KL_API */ - -unsigned int -DarwinModeSystemKeymapSeed (void) -{ - return 0; -} - -Bool -DarwinModeReadSystemKeymap (darwinKeyboardInfo *info) -{ - return FALSE; -} - -#endif /* HAS_KL_API */ diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/quartzPasteboard.c b/nx-X11/programs/Xserver/hw/darwin/quartz/quartzPasteboard.c deleted file mode 100644 index 536dcc336..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/quartzPasteboard.c +++ /dev/null @@ -1,150 +0,0 @@ -/************************************************************** - * quartzPasteboard.c - * - * Aqua pasteboard <-> X cut buffer - * Greg Parker gparker@cs.stanford.edu March 8, 2001 - **************************************************************/ -/* - * Copyright (c) 2001 Greg Parker. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/quartzPasteboard.c,v 1.3 2001/09/23 04:04:49 torrey Exp $ */ - -#include "quartzPasteboard.h" - -#include -#include "windowstr.h" -#include "propertyst.h" -#include "scrnintstr.h" -#include "selection.h" -#include "globals.h" - -extern Selection *CurrentSelections; -extern int NumCurrentSelections; - - -// Helper function to read the X11 cut buffer -// FIXME: What about multiple screens? Currently, this reads the first -// CUT_BUFFER0 from the first screen where the buffer content is a string. -// Returns a string on the heap that the caller must free. -// Returns NULL if there is no cut text or there is not enough memory. -static char * QuartzReadCutBuffer(void) -{ - int i; - char *text = NULL; - - for (i = 0; i < screenInfo.numScreens; i++) { - ScreenPtr pScreen = screenInfo.screens[i]; - PropertyPtr pProp; - - pProp = wUserProps (WindowTable[pScreen->myNum]); - while (pProp && pProp->propertyName != XA_CUT_BUFFER0) { - pProp = pProp->next; - } - if (! pProp) continue; - if (pProp->type != XA_STRING) continue; - if (pProp->format != 8) continue; - - text = xalloc(1 + pProp->size); - if (! text) continue; - memcpy(text, pProp->data, pProp->size); - text[pProp->size] = '\0'; - return text; - } - - // didn't find any text - return NULL; -} - -// Write X cut buffer to Mac OS X pasteboard -// Called by ProcessInputEvents() in response to request from X server thread. -void QuartzWritePasteboard(void) -{ - char *text; - text = QuartzReadCutBuffer(); - if (text) { - QuartzWriteCocoaPasteboard(text); - free(text); - } -} - -#define strequal(a, b) (0 == strcmp((a), (b))) - -// Read Mac OS X pasteboard into X cut buffer -// Called by ProcessInputEvents() in response to request from X server thread. -void QuartzReadPasteboard(void) -{ - char *oldText = QuartzReadCutBuffer(); - char *text = QuartzReadCocoaPasteboard(); - - // Compare text with current cut buffer contents. - // Change the buffer if both exist and are different - // OR if there is new text but no old text. - // Otherwise, don't clear the selection unnecessarily. - - if ((text && oldText && !strequal(text, oldText)) || - (text && !oldText)) { - int scrn, sel; - - for (scrn = 0; scrn < screenInfo.numScreens; scrn++) { - ScreenPtr pScreen = screenInfo.screens[scrn]; - // Set the cut buffers on each screen - // fixme really on each screen? - ChangeWindowProperty(WindowTable[pScreen->myNum], XA_CUT_BUFFER0, - XA_STRING, 8, PropModeReplace, - strlen(text), (pointer)text, TRUE); - } - - // Undo any current X selection (similar to code in dispatch.c) - // FIXME: what about secondary selection? - // FIXME: only touch first XA_PRIMARY selection? - sel = 0; - while ((sel < NumCurrentSelections) && - CurrentSelections[sel].selection != XA_PRIMARY) - sel++; - if (sel < NumCurrentSelections) { - // Notify client if necessary - if (CurrentSelections[sel].client) { - xEvent event; - - event.u.u.type = SelectionClear; - event.u.selectionClear.time = GetTimeInMillis(); - event.u.selectionClear.window = CurrentSelections[sel].window; - event.u.selectionClear.atom = CurrentSelections[sel].selection; - TryClientEvents(CurrentSelections[sel].client, &event, 1, - NoEventMask, NoEventMask /*CantBeFiltered*/, - NullGrab); - } - - // Erase it - // FIXME: need to erase .selection too? dispatch.c doesn't - CurrentSelections[sel].pWin = NullWindow; - CurrentSelections[sel].window = None; - CurrentSelections[sel].client = NullClient; - } - } - - if (text) free(text); - if (oldText) free(oldText); -} diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/quartzPasteboard.h b/nx-X11/programs/Xserver/hw/darwin/quartz/quartzPasteboard.h deleted file mode 100644 index 296c52c17..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/quartzPasteboard.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - QuartzPasteboard.h - - Mac OS X pasteboard <-> X cut buffer - Greg Parker gparker@cs.stanford.edu March 8, 2001 -*/ -/* - * Copyright (c) 2001 Greg Parker. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/quartzPasteboard.h,v 1.1 2001/03/15 22:24:27 torrey Exp $ */ - -#ifndef _QUARTZPASTEBOARD_H -#define _QUARTZPASTEBOARD_H - -// Aqua->X -void QuartzReadPasteboard(); -char * QuartzReadCocoaPasteboard(void); // caller must free string - -// X->Aqua -void QuartzWritePasteboard(); -void QuartzWriteCocoaPasteboard(char *text); - -#endif /* _QUARTZPASTEBOARD_H */ \ No newline at end of file diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/quartzStartup.c b/nx-X11/programs/Xserver/hw/darwin/quartz/quartzStartup.c deleted file mode 100644 index cd58701b1..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/quartzStartup.c +++ /dev/null @@ -1,291 +0,0 @@ -/************************************************************** - * - * Startup code for the Quartz Darwin X Server - * - **************************************************************/ -/* - * Copyright (c) 2001-2004 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzStartup.c,v 1.8 2003/11/05 00:15:00 torrey Exp $ */ - -#include -#include -#include -#include "quartzCommon.h" -#include "darwin.h" -#include "quartz.h" -#include "opaque.h" -#include "micmap.h" - -int NSApplicationMain(int argc, char *argv[]); - -char **envpGlobal; // argcGlobal and argvGlobal - // are from dix/globals.c - -// GLX bundle function pointers -typedef void (*GlxExtensionInitPtr)(void); -static GlxExtensionInitPtr GlxExtensionInit = NULL; - -typedef void (*GlxWrapInitVisualsPtr)(miInitVisualsProcPtr *); -static GlxWrapInitVisualsPtr GlxWrapInitVisuals = NULL; - -typedef Bool (*QuartzModeBundleInitPtr)(void); - - -/* - * DarwinHandleGUI - * This function is called first from main(). The first time - * it is called we start the Mac OS X front end. The front end - * will call main() again from another thread to run the X - * server. On the second call this function loads the user - * preferences set by the Mac OS X front end. - */ -void DarwinHandleGUI( - int argc, - char *argv[], - char *envp[] ) -{ - static Bool been_here = FALSE; - int main_exit, i; - int fd[2]; - - if (been_here) { - QuartzReadPreferences(); - return; - } - been_here = TRUE; - - // Make a pipe to pass events - assert( pipe(fd) == 0 ); - darwinEventReadFD = fd[0]; - darwinEventWriteFD = fd[1]; - fcntl(darwinEventReadFD, F_SETFL, O_NONBLOCK); - - // Store command line arguments to pass back to main() - argcGlobal = argc; - argvGlobal = argv; - envpGlobal = envp; - - quartzStartClients = 1; - for (i = 1; i < argc; i++) { - // Display version info without starting Mac OS X UI if requested - if (!strcmp( argv[i], "-showconfig" ) || !strcmp( argv[i], "-version" )) { - DarwinPrintBanner(); - exit(0); - } - - // Determine if we need to start X clients - // and what display mode to use - if (!strcmp(argv[i], "-nostartx")) { - quartzStartClients = 0; - } else if (!strcmp( argv[i], "-fullscreen")) { - quartzRootless = 0; - } else if (!strcmp( argv[i], "-rootless")) { - quartzRootless = 1; - } - } - - main_exit = NSApplicationMain(argc, argv); - exit(main_exit); -} - - -/* - * QuartzLoadDisplayBundle - * Try to load the appropriate bundle containing the back end display code. - */ -Bool QuartzLoadDisplayBundle( - const char *dpyBundleName) -{ - CFBundleRef mainBundle; - CFStringRef bundleName; - CFURLRef bundleURL; - CFBundleRef dpyBundle; - QuartzModeBundleInitPtr bundleInit; - - // Get the main bundle for the application - mainBundle = CFBundleGetMainBundle(); - - // Make CFString from bundle name - bundleName = CFStringCreateWithCStringNoCopy(kCFAllocatorDefault, - dpyBundleName, - kCFStringEncodingASCII, - kCFAllocatorNull); - - // Look for the appropriate bundle in the main bundle - bundleURL = CFBundleCopyResourceURL(mainBundle, bundleName, - NULL, NULL); - if (!bundleURL) { - ErrorF("Could not find display mode bundle %s.\n", dpyBundleName); - return FALSE; - } - - // Make a bundle instance using the URLRef - dpyBundle = CFBundleCreate(kCFAllocatorDefault, bundleURL); - - if (!CFBundleLoadExecutable(dpyBundle)) { - ErrorF("Could not load display mode bundle %s.\n", dpyBundleName); - return FALSE; - } - - // Lookup the bundle initialization function - bundleInit = (void *) - CFBundleGetFunctionPointerForName(dpyBundle, - CFSTR("QuartzModeBundleInit")); - if (!bundleInit) { - ErrorF("Could not initialize display mode bundle %s.\n", - dpyBundleName); - return FALSE; - } - if (!bundleInit()) - return FALSE; - - // Release the CF objects - CFRelease(bundleName); - CFRelease(bundleURL); - - return TRUE; -} - - -/* - * LoadGlxBundle - * The Quartz mode X server needs to dynamically load the appropriate - * bundle before initializing GLX. - */ -static void LoadGlxBundle(void) -{ - CFBundleRef mainBundle; - CFStringRef bundleName; - CFURLRef bundleURL; - CFBundleRef glxBundle; - - // Get the main bundle for the application - mainBundle = CFBundleGetMainBundle(); - - // Choose the bundle to load - ErrorF("Loading GLX bundle "); - if (quartzUseAGL) { - bundleName = CFStringCreateWithCStringNoCopy(kCFAllocatorDefault, - quartzOpenGLBundle, - kCFStringEncodingASCII, - kCFAllocatorNull); - ErrorF("%s (using Apple's OpenGL)\n", quartzOpenGLBundle); - } else { - bundleName = CFSTR("glxMesa.bundle"); - CFRetain(bundleName); // so we can release later - ErrorF("glxMesa.bundle (using Mesa)\n"); - } - - // Look for the appropriate GLX bundle in the main bundle by name - bundleURL = CFBundleCopyResourceURL(mainBundle, bundleName, - NULL, NULL); - if (!bundleURL) { - FatalError("Could not find GLX bundle."); - } - - // Make a bundle instance using the URLRef - glxBundle = CFBundleCreate(kCFAllocatorDefault, bundleURL); - - if (!CFBundleLoadExecutable(glxBundle)) { - FatalError("Could not load GLX bundle."); - } - - // Find the GLX init functions - GlxExtensionInit = (void *) CFBundleGetFunctionPointerForName( - glxBundle, CFSTR("GlxExtensionInit")); - - GlxWrapInitVisuals = (void *) CFBundleGetFunctionPointerForName( - glxBundle, CFSTR("GlxWrapInitVisuals")); - - if (!GlxExtensionInit || !GlxWrapInitVisuals) { - FatalError("Could not initialize GLX bundle."); - } - - // Release the CF objects - CFRelease(bundleName); - CFRelease(bundleURL); -} - - -/* - * DarwinGlxExtensionInit - * Initialize the GLX extension. - */ -void DarwinGlxExtensionInit(void) -{ - if (!GlxExtensionInit) - LoadGlxBundle(); - - GlxExtensionInit(); -} - - -/* - * DarwinGlxWrapInitVisuals - */ -void DarwinGlxWrapInitVisuals( - miInitVisualsProcPtr *procPtr) -{ - if (!GlxWrapInitVisuals) - LoadGlxBundle(); - - GlxWrapInitVisuals(procPtr); -} - - -int DarwinModeProcessArgument( int argc, char *argv[], int i ) -{ - // fullscreen: CoreGraphics full-screen mode - // rootless: Cocoa rootless mode - // quartz: Default, either fullscreen or rootless - - if ( !strcmp( argv[i], "-fullscreen" ) ) { - ErrorF( "Running full screen in parallel with Mac OS X Quartz window server.\n" ); - return 1; - } - - if ( !strcmp( argv[i], "-rootless" ) ) { - ErrorF( "Running rootless inside Mac OS X window server.\n" ); - return 1; - } - - if ( !strcmp( argv[i], "-quartz" ) ) { - ErrorF( "Running in parallel with Mac OS X Quartz window server.\n" ); - return 1; - } - - // The Mac OS X front end uses this argument, which we just ignore here. - if ( !strcmp( argv[i], "-nostartx" ) ) { - return 1; - } - - // This command line arg is passed when launched from the Aqua GUI. - if ( !strncmp( argv[i], "-psn_", 5 ) ) { - return 1; - } - - return 0; -} \ No newline at end of file diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/Imakefile b/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/Imakefile deleted file mode 100644 index 77a420958..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/Imakefile +++ /dev/null @@ -1,35 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/Imakefile,v 1.3 2003/08/12 23:47:10 torrey Exp $ - -#include - -SRCS = appledir.c \ - dri.c \ - xprAppleWM.c \ - xprCursor.c \ - xprFrame.c \ - xprScreen.c \ - x-hash.c \ - x-hook.c \ - x-list.c - -OBJS = appledri.o \ - dri.o \ - xprAppleWM.o \ - xprCursor.o \ - xprFrame.o \ - xprScreen.o \ - x-hash.o \ - x-hook.o \ - x-list.o - -INCLUDES = -I. -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi -I$(SERVERSRC)/include \ - -I$(XINCLUDESRC) -I$(FONTINCSRC) -I$(SERVERSRC)/render \ - -I$(SERVERSRC)/miext/rootless -I$(SERVERSRC)/miext/damage \ - -I$(EXTINCSRC) -I.. -I../.. \ - -I$(SERVERSRC)/miext/rootless/safeAlpha \ - -I$(SERVERSRC)/Xext -I$(LIBSRC)/GL/apple -I$(APPLEWMLIBSRC) - -NormalLibraryObjectRule() -NormalLibraryTarget(xpr,$(OBJS)) - -DependTarget() diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/Xplugin.h b/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/Xplugin.h deleted file mode 100644 index 7673a0de3..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/Xplugin.h +++ /dev/null @@ -1,591 +0,0 @@ -/* Xplugin.h -- windowing API for rootless X11 server - $Id: Xplugin.h,v 1.3 2005/07/01 22:43:08 daniels Exp $ - - Copyright (c) 2002 Apple Computer, Inc. All rights reserved. - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT - HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. - - Except as contained in this notice, the name(s) of the above - copyright holders shall not be used in advertising or otherwise to - promote the sale, use or other dealings in this Software without - prior written authorization. - - Note that these interfaces are provided solely for the use of the - X11 server. Any other uses are unsupported and strongly discouraged. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/Xplugin.h,v 1.2 2003/05/02 00:08:49 torrey Exp $ */ - -#ifndef XPLUGIN_H -#define XPLUGIN_H 1 - -#include - -/* By default we use the X server definition of BoxRec to define xp_box, - so that the compiler can silently convert between the two. But if - XP_NO_X_HEADERS is defined, we'll define it ourselves. */ - -#ifndef XP_NO_X_HEADERS -# include "miscstruct.h" - typedef BoxRec xp_box; -#else - struct xp_box_struct { - short x1, y1, x2, y2; - }; - typedef struct xp_box_struct xp_box; -#endif - -typedef unsigned int xp_resource_id; -typedef xp_resource_id xp_window_id; -typedef xp_resource_id xp_surface_id; -typedef unsigned int xp_client_id; -typedef unsigned int xp_request_type; -typedef int xp_error; -typedef int xp_bool; - - -/* Error codes that the functions declared here may return. They all - numerically match their X equivalents, i.e. the XP_ can be dropped - if has been included. */ - -enum xp_error_enum { - XP_Success = 0, - XP_BadRequest = 1, - XP_BadValue = 2, - XP_BadWindow = 3, - XP_BadMatch = 8, - XP_BadAccess = 10, - XP_BadImplementation = 17, -}; - - -/* Event types generated by the plugin. */ - -enum xp_event_type_enum { - /* The global display configuration changed somehow. */ - XP_EVENT_DISPLAY_CHANGED = 1 << 0, - - /* A window changed state. Argument is xp_window_state_event */ - XP_EVENT_WINDOW_STATE_CHANGED = 1 << 1, - - /* An async request encountered an error. Argument is of type - xp_async_error_event */ - XP_EVENT_ASYNC_ERROR = 1 << 2, - - /* Sent when a surface is destroyed as a side effect of destroying - a window. Arg is of type xp_surface_id. */ - XP_EVENT_SURFACE_DESTROYED = 1 << 3, - - /* Sent when any GL contexts pointing at the given surface need to - call xp_update_gl_context () to refresh their state (because the - window moved or was resized. Arg is of type xp_surface_id. */ - XP_EVENT_SURFACE_CHANGED = 1 << 4, - - /* Sent when a window has been moved. Arg is of type xp_window_id. */ - XP_EVENT_WINDOW_MOVED = 1 << 5, -}; - -/* Function type used to receive events. */ - -typedef void (xp_event_fun) (unsigned int type, const void *arg, - unsigned int arg_size, void *user_data); - - -/* Operation types. Used when reporting errors asynchronously. */ - -enum xp_request_type_enum { - XP_REQUEST_NIL = 0, - XP_REQUEST_DESTROY_WINDOW = 1, - XP_REQUEST_CONFIGURE_WINDOW = 2, - XP_REQUEST_FLUSH_WINDOW = 3, - XP_REQUEST_COPY_WINDOW = 4, - XP_REQUEST_UNLOCK_WINDOW = 5, - XP_REQUEST_DISABLE_UPDATE = 6, - XP_REQUEST_REENABLE_UPDATE = 7, - XP_REQUEST_HIDE_CURSOR = 8, - XP_REQUEST_SHOW_CURSOR = 9, - XP_REQUEST_FRAME_DRAW = 10, -}; - -/* Structure used to report an error asynchronously. Passed as the "arg" - of an XP_EVENT_ASYNC_ERROR event. */ - -struct xp_async_error_event_struct { - xp_request_type request_type; - xp_resource_id id; - xp_error error; -}; - -typedef struct xp_async_error_event_struct xp_async_error_event; - - -/* Possible window states. */ - -enum xp_window_state_enum { - /* The window is not in the global list of possibly-visible windows. */ - XP_WINDOW_STATE_OFFSCREEN = 1 << 0, - - /* Parts of the window may be obscured by other windows. */ - XP_WINDOW_STATE_OBSCURED = 1 << 1, -}; - -/* Structure passed as argument of an XP_EVENT_WINDOW_STATE_CHANGED event. */ - -struct xp_window_state_event_struct { - xp_window_id id; - unsigned int state; -}; - -typedef struct xp_window_state_event_struct xp_window_state_event; - - -/* Function type used to supply a colormap for indexed drawables. */ - -typedef xp_error (xp_colormap_fun) (void *data, int first_color, - int n_colors, uint32_t *colors); - - -/* Window attributes structure. Used when creating and configuring windows. - Also used when configuring surfaces attached to windows. Functions that - take one of these structures also take a bit mask defining which - fields are set to meaningful values. */ - -enum xp_window_changes_enum { - XP_ORIGIN = 1 << 0, - XP_SIZE = 1 << 1, - XP_BOUNDS = XP_ORIGIN | XP_SIZE, - XP_SHAPE = 1 << 2, - XP_STACKING = 1 << 3, - XP_DEPTH = 1 << 4, - XP_COLORMAP = 1 << 5, - XP_WINDOW_LEVEL = 1 << 6, -}; - -struct xp_window_changes_struct { - /* XP_ORIGIN */ - int x, y; - - /* XP_SIZE */ - unsigned int width, height; - int bit_gravity; /* how to resize the backing store */ - - /* XP_SHAPE */ - int shape_nrects; /* -1 = remove shape */ - xp_box *shape_rects; - int shape_tx, shape_ty; /* translation for shape */ - - /* XP_STACKING */ - int stack_mode; - xp_window_id sibling; /* may be zero; in ABOVE/BELOW modes - it may specify a relative window */ - /* XP_DEPTH, window-only */ - unsigned int depth; - - /* XP_COLORMAP, window-only */ - xp_colormap_fun *colormap; - void *colormap_data; - - /* XP_WINDOW_LEVEL, window-only */ - int window_level; -}; - -typedef struct xp_window_changes_struct xp_window_changes; - -/* Values for bit_gravity field */ - -enum xp_bit_gravity_enum { - XP_GRAVITY_NONE = 0, /* no gravity, fill everything */ - XP_GRAVITY_NORTH_WEST = 1, /* anchor to top-left corner */ - XP_GRAVITY_NORTH_EAST = 2, /* anchor to top-right corner */ - XP_GRAVITY_SOUTH_EAST = 3, /* anchor to bottom-right corner */ - XP_GRAVITY_SOUTH_WEST = 4, /* anchor to bottom-left corner */ -}; - -/* Values for stack_mode field */ - -enum xp_window_stack_mode_enum { - XP_UNMAPPED = 0, /* remove the window */ - XP_MAPPED_ABOVE = 1, /* display the window on top */ - XP_MAPPED_BELOW = 2, /* display the window at bottom */ -}; - -/* Data formats for depth field and composite functions */ - -enum xp_depth_enum { - XP_DEPTH_NIL = 0, /* null source when compositing */ - XP_DEPTH_ARGB8888, - XP_DEPTH_RGB555, - XP_DEPTH_A8, /* for masks when compositing */ - XP_DEPTH_INDEX8, -}; - -/* Options that may be passed to the xp_init () function. */ - -enum xp_init_options_enum { - /* Don't mark that this process can be in the foreground. */ - XP_IN_BACKGROUND = 1 << 0, - - /* Deliver background pointer events to this process. */ - XP_BACKGROUND_EVENTS = 1 << 1, -}; - - - -/* Miscellaneous functions */ - -/* Initialize the plugin library. Only the copy/fill/composite functions - may be called without having previously called xp_init () */ - -extern xp_error xp_init (unsigned int options); - -/* Sets the current set of requested notifications to MASK. When any of - these arrive, CALLBACK will be invoked with CALLBACK-DATA. Note that - calling this function cancels any previously requested notifications - that aren't set in MASK. */ - -extern xp_error xp_select_events (unsigned int mask, - xp_event_fun *callback, - void *callback_data); - -/* Waits for all initiated operations to complete. */ - -extern xp_error xp_synchronize (void); - -/* Causes any display update initiated through the plugin libary to be - queued until update is reenabled. Note that calls to these functions - nest. */ - -extern xp_error xp_disable_update (void); -extern xp_error xp_reenable_update (void); - - - -/* Cursor functions. */ - -/* Installs the specified cursor. ARGB-DATA should point to 32-bit - premultiplied big-endian ARGB data. The HOT-X,HOT-Y parameters - specify the offset to the cursor's hot spot from its top-left - corner. */ - -extern xp_error xp_set_cursor (unsigned int width, unsigned int height, - unsigned int hot_x, unsigned int hot_y, - const uint32_t *argb_data, - unsigned int rowbytes); - -/* Hide and show the cursor if it's owned by the current process. Calls - to these functions nest. */ - -extern xp_error xp_hide_cursor (void); -extern xp_error xp_show_cursor (void); - - - -/* Window functions. */ - -/* Create a new window as defined by MASK and VALUES. MASK must contain - XP_BOUNDS or an error is raised. The id of the newly created window - is stored in *RET-ID if this function returns XP_Success. */ - -extern xp_error xp_create_window (unsigned int mask, - const xp_window_changes *values, - xp_window_id *ret_id); - -/* Destroys the window identified by ID. */ - -extern xp_error xp_destroy_window (xp_window_id id); - -/* Reconfigures the given window according to MASK and VALUES. */ - -extern xp_error xp_configure_window (xp_window_id id, unsigned int mask, - const xp_window_changes *values); - - -/* Returns true if NATIVE-ID is a window created by the plugin library. - If so and RET-ID is non-null, stores the id of the window in *RET-ID. */ - -extern xp_bool xp_lookup_native_window (unsigned int native_id, - xp_window_id *ret_id); - -/* If ID names a window created by the plugin library, stores it's native - window id in *RET-NATIVE-ID. */ - -extern xp_error xp_get_native_window (xp_window_id id, - unsigned int *ret_native_id); - - -/* Locks the rectangle IN-RECT (or, if null, the entire window) of the - given window's backing store. Any other non-null parameters are filled - in as follows: - - DEPTH = format of returned data. Currently either XP_DEPTH_ARGB8888 - or XP_DEPTH_RGB565 (possibly with 8 bit planar alpha). Data is - always stored in native byte order. - - BITS[0] = pointer to top-left pixel of locked color data - BITS[1] = pointer to top-left of locked alpha data, or null if window - has no alpha. If the alpha data is meshed, then BITS[1] = BITS[0]. - - ROWBYTES[0,1] = size in bytes of each row of color,alpha data - - OUT-RECT = rectangle specifying the current position and size of the - locked region relative to the window origin. - - Note that an error is raised when trying to lock an already locked - window. While the window is locked, the only operations that may - be performed on it are to modify, access or flush its marked region. */ - -extern xp_error xp_lock_window (xp_window_id id, - const xp_box *in_rect, - unsigned int *depth, - void *bits[2], - unsigned int rowbytes[2], - xp_box *out_rect); - -/* Mark that the region specified by SHAPE-NRECTS, SHAPE-RECTS, - SHAPE-TX, and SHAPE-TY in the specified window has been updated, and - will need to subsequently be redisplayed. */ - -extern xp_error xp_mark_window (xp_window_id id, int shape_nrects, - const xp_box *shape_rects, - int shape_tx, int shape_ty); - -/* Unlocks the specified window. If FLUSH is true, then any marked - regions are immediately redisplayed. Note that it's an error to - unlock an already unlocked window. */ - -extern xp_error xp_unlock_window (xp_window_id id, xp_bool flush); - -/* If anything is marked in the given window for redisplay, do it now. */ - -extern xp_error xp_flush_window (xp_window_id id); - -/* Moves the contents of the region DX,DY pixels away from that specified - by DST_RECTS and DST_NRECTS in the window with SRC-ID to the - destination region in the window DST-ID. Note that currently source - and destination windows must be the same. */ - -extern xp_error xp_copy_window (xp_window_id src_id, xp_window_id dst_id, - int dst_nrects, const xp_box *dst_rects, - int dx, int dy); - -/* Returns true if the given window has any regions marked for - redisplay. */ - -extern xp_bool xp_is_window_marked (xp_window_id id); - -/* If successful returns a superset of the region marked for update in - the given window. Use xp_free_region () to release the returned data. */ - -extern xp_error xp_get_marked_shape (xp_window_id id, - int *ret_nrects, xp_box **ret_rects); - -extern void xp_free_shape (int nrects, xp_box *rects); - -/* Searches for the first window below ABOVE-ID containing the point X,Y, - and returns it's window id in *RET-ID. If no window is found, *RET-ID - is set to zero. If ABOVE-ID is zero, finds the topmost window - containing the given point. */ - -extern xp_error xp_find_window (int x, int y, xp_window_id above_id, - xp_window_id *ret_id); - -/* Returns the current origin and size of the window ID in *BOUNDS-RET if - successful. */ -extern xp_error xp_get_window_bounds (xp_window_id id, xp_box *bounds_ret); - - - -/* Window surface functions. */ - -/* Create a new VRAM surface on the specified window. If successful, - returns the identifier of the new surface in *RET-SID. */ - -extern xp_error xp_create_surface (xp_window_id id, xp_surface_id *ret_sid); - -/* Destroys the specified surface. */ - -extern xp_error xp_destroy_surface (xp_surface_id sid); - -/* Reconfigures the specified surface as defined by MASK and VALUES. - Note that specifying XP_DEPTH is an error. */ - -extern xp_error xp_configure_surface (xp_surface_id sid, unsigned int mask, - const xp_window_changes *values); - -/* If successful, places the client identifier of the current process - in *RET-CLIENT. */ - -extern xp_error xp_get_client_id (xp_client_id *ret_client); - -/* Given a valid window,surface combination created by the current - process, attempts to allow the specified external client access - to that surface. If successful, returns two integers in RET-KEY - which the client can use to import the surface into their process. */ - -extern xp_error xp_export_surface (xp_window_id wid, xp_surface_id sid, - xp_client_id client, - unsigned int ret_key[2]); - -/* Given a two integer key returned from xp_export_surface (), tries - to import the surface into the current process. If successful the - local surface identifier is stored in *SID-RET. */ - -extern xp_error xp_import_surface (const unsigned int key[2], - xp_surface_id *sid_ret); - -/* If successful, stores the number of surfaces attached to the - specified window in *RET. */ - -extern xp_error xp_get_window_surface_count (xp_window_id id, - unsigned int *ret); - -/* Attaches the CGLContextObj CGL-CTX to the specified surface. */ - -extern xp_error xp_attach_gl_context (void *cgl_ctx, xp_surface_id sid); - -/* Updates the CGLContextObj CGL-CTX to reflect any recent changes to - the surface it's attached to. */ - -extern xp_error xp_update_gl_context (void *cgl_ctx); - - - -/* Window frame functions. */ - -/* Possible arguments to xp_frame_get_rect (). */ - -enum xp_frame_rect_enum { - XP_FRAME_RECT_TITLEBAR = 1, - XP_FRAME_RECT_TRACKING = 2, - XP_FRAME_RECT_GROWBOX = 3, -}; - -/* Classes of window frame. */ - -enum xp_frame_class_enum { - XP_FRAME_CLASS_DOCUMENT = 1 << 0, - XP_FRAME_CLASS_DIALOG = 1 << 1, - XP_FRAME_CLASS_MODAL_DIALOG = 1 << 2, - XP_FRAME_CLASS_SYSTEM_MODAL_DIALOG = 1 << 3, - XP_FRAME_CLASS_UTILITY = 1 << 4, - XP_FRAME_CLASS_TOOLBAR = 1 << 5, - XP_FRAME_CLASS_MENU = 1 << 6, - XP_FRAME_CLASS_SPLASH = 1 << 7, - XP_FRAME_CLASS_BORDERLESS = 1 << 8, -}; - -/* Attributes of window frames. */ - -enum xp_frame_attr_enum { - XP_FRAME_ACTIVE = 0x0001, - XP_FRAME_URGENT = 0x0002, - XP_FRAME_TITLE = 0x0004, - XP_FRAME_PRELIGHT = 0x0008, - XP_FRAME_SHADED = 0x0010, - XP_FRAME_CLOSE_BOX = 0x0100, - XP_FRAME_COLLAPSE = 0x0200, - XP_FRAME_ZOOM = 0x0400, - XP_FRAME_ANY_BUTTON = 0x0700, - XP_FRAME_CLOSE_BOX_CLICKED = 0x0800, - XP_FRAME_COLLAPSE_BOX_CLICKED = 0x1000, - XP_FRAME_ZOOM_BOX_CLICKED = 0x2000, - XP_FRAME_ANY_CLICKED = 0x3800, - XP_FRAME_GROW_BOX = 0x4000, -}; - -#define XP_FRAME_ATTR_IS_SET(a,b) (((a) & (b)) == (b)) -#define XP_FRAME_ATTR_IS_CLICKED(a,m) ((a) & ((m) << 3)) -#define XP_FRAME_ATTR_SET_CLICKED(a,m) ((a) |= ((m) << 3)) -#define XP_FRAME_ATTR_UNSET_CLICKED(a,m) ((a) &= ~((m) << 3)) - -#define XP_FRAME_POINTER_ATTRS (XP_FRAME_PRELIGHT \ - | XP_FRAME_ANY_BUTTON \ - | XP_FRAME_ANY_CLICKED) - -extern xp_error xp_frame_get_rect (int type, int class, const xp_box *outer, - const xp_box *inner, xp_box *ret); -extern xp_error xp_frame_hit_test (int class, int x, int y, - const xp_box *outer, - const xp_box *inner, int *ret); -extern xp_error xp_frame_draw (xp_window_id wid, int class, unsigned int attr, - const xp_box *outer, const xp_box *inner, - unsigned int title_len, - const unsigned char *title_bytes); - - - -/* Memory manipulation functions. */ - -enum xp_composite_op_enum { - XP_COMPOSITE_SRC = 0, - XP_COMPOSITE_OVER, -}; - -#define XP_COMPOSITE_FUNCTION(op, src_depth, mask_depth, dest_depth) \ - (((op) << 24) | ((src_depth) << 16) \ - | ((mask_depth) << 8) | ((dest_depth) << 0)) - -#define XP_COMPOSITE_FUNCTION_OP(f) (((f) >> 24) & 255) -#define XP_COMPOSITE_FUNCTION_SRC_DEPTH(f) (((f) >> 16) & 255) -#define XP_COMPOSITE_FUNCTION_MASK_DEPTH(f) (((f) >> 8) & 255) -#define XP_COMPOSITE_FUNCTION_DEST_DEPTH(f) (((f) >> 0) & 255) - -/* Composite WIDTH by HEIGHT pixels from source and mask to destination - using a specified function (if source and destination overlap, - undefined behavior results). - - For SRC and DEST, the first element of the array is the color data. If - the second element is non-null it implies that there is alpha data - (which may be meshed or planar). Data without alpha is assumed to be - opaque. - - Passing a null SRC-ROWBYTES pointer implies that the data SRC points - to is a single element. - - Operations that are not supported will return XP_BadImplementation. */ - -extern xp_error xp_composite_pixels (unsigned int width, unsigned int height, - unsigned int function, - void *src[2], unsigned int src_rowbytes[2], - void *mask, unsigned int mask_rowbytes, - void *dest[2], unsigned int dest_rowbytes[2]); - -/* Fill HEIGHT rows of data starting at DST. Each row will have WIDTH - bytes filled with the 32-bit pattern VALUE. Each row is DST-ROWBYTES - wide in total. */ - -extern void xp_fill_bytes (unsigned int width, - unsigned int height, uint32_t value, - void *dst, unsigned int dst_rowbytes); - -/* Copy HEIGHT rows of bytes from SRC to DST. Each row will have WIDTH - bytes copied. SRC and DST may overlap, and the right thing will happen. */ - -extern void xp_copy_bytes (unsigned int width, unsigned int height, - const void *src, unsigned int src_rowbytes, - void *dst, unsigned int dst_rowbytes); - -/* Suggestions for the minimum number of bytes or pixels for which it - makes sense to use some of the xp_ functions */ - -extern unsigned int xp_fill_bytes_threshold, xp_copy_bytes_threshold, - xp_composite_area_threshold, xp_scroll_area_threshold; - - -#endif /* XPLUGIN_H */ diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/appledri.c b/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/appledri.c deleted file mode 100644 index d4cd27b8f..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/appledri.c +++ /dev/null @@ -1,350 +0,0 @@ -/* $XFree86: xc/programs/Xserver/GL/dri/xf86dri.c,v 1.10 2000/12/07 20:26:14 dawes Exp $ */ -/************************************************************************** - -Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -Copyright 2000 VA Linux Systems, Inc. -Copyright (c) 2002 Apple Computer, Inc. -All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sub license, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice (including the -next paragraph) shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -**************************************************************************/ - -/* - * Authors: - * Kevin E. Martin - * Jens Owen - * Rickard E. (Rik) Faith - * - */ - -#define NEED_REPLIES -#define NEED_EVENTS -#include -#include -#include "misc.h" -#include "dixstruct.h" -#include "extnsionst.h" -#include "colormapst.h" -#include "cursorstr.h" -#include "scrnintstr.h" -#include "servermd.h" -#define _APPLEDRI_SERVER_ -#include "appledristr.h" -#include "swaprep.h" -#include "dri.h" -#include "dristruct.h" - -static int DRIErrorBase = 0; - -static DISPATCH_PROC(ProcAppleDRIDispatch); -static DISPATCH_PROC(SProcAppleDRIDispatch); - -static void AppleDRIResetProc(ExtensionEntry* extEntry); - -static unsigned char DRIReqCode = 0; -static int DRIEventBase = 0; - -static void SNotifyEvent(xAppleDRINotifyEvent *from, xAppleDRINotifyEvent *to); - -typedef struct _DRIEvent *DRIEventPtr; -typedef struct _DRIEvent { - DRIEventPtr next; - ClientPtr client; - XID clientResource; - unsigned int mask; -} DRIEventRec; - - -void -AppleDRIExtensionInit(void) -{ - ExtensionEntry* extEntry; - - if (DRIExtensionInit() && - (extEntry = AddExtension(APPLEDRINAME, - AppleDRINumberEvents, - AppleDRINumberErrors, - ProcAppleDRIDispatch, - SProcAppleDRIDispatch, - AppleDRIResetProc, - StandardMinorOpcode))) { - DRIReqCode = (unsigned char)extEntry->base; - DRIErrorBase = extEntry->errorBase; - DRIEventBase = extEntry->eventBase; - EventSwapVector[DRIEventBase] = (EventSwapPtr) SNotifyEvent; - } -} - -/*ARGSUSED*/ -static void -AppleDRIResetProc ( - ExtensionEntry* extEntry -) -{ - DRIReset(); -} - -static int -ProcAppleDRIQueryVersion( - register ClientPtr client -) -{ - xAppleDRIQueryVersionReply rep; - register int n; - - REQUEST_SIZE_MATCH(xAppleDRIQueryVersionReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.majorVersion = APPLE_DRI_MAJOR_VERSION; - rep.minorVersion = APPLE_DRI_MINOR_VERSION; - rep.patchVersion = APPLE_DRI_PATCH_VERSION; - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - } - WriteToClient(client, sizeof(xAppleDRIQueryVersionReply), (char *)&rep); - return (client->noClientException); -} - - -/* surfaces */ - -static int -ProcAppleDRIQueryDirectRenderingCapable( - register ClientPtr client -) -{ - xAppleDRIQueryDirectRenderingCapableReply rep; - Bool isCapable; - - REQUEST(xAppleDRIQueryDirectRenderingCapableReq); - REQUEST_SIZE_MATCH(xAppleDRIQueryDirectRenderingCapableReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - - if (!DRIQueryDirectRenderingCapable( screenInfo.screens[stuff->screen], - &isCapable)) { - return BadValue; - } - rep.isCapable = isCapable; - - if (!LocalClient(client)) - rep.isCapable = 0; - - WriteToClient(client, - sizeof(xAppleDRIQueryDirectRenderingCapableReply), (char *)&rep); - return (client->noClientException); -} - -static int -ProcAppleDRIAuthConnection( - register ClientPtr client -) -{ - xAppleDRIAuthConnectionReply rep; - - REQUEST(xAppleDRIAuthConnectionReq); - REQUEST_SIZE_MATCH(xAppleDRIAuthConnectionReq); - - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.authenticated = 1; - - if (!DRIAuthConnection( screenInfo.screens[stuff->screen], stuff->magic)) { - ErrorF("Failed to authenticate %u\n", stuff->magic); - rep.authenticated = 0; - } - WriteToClient(client, sizeof(xAppleDRIAuthConnectionReply), (char *)&rep); - return (client->noClientException); -} - -static void surface_notify( - void *_arg, - void *data -) -{ - DRISurfaceNotifyArg *arg = _arg; - int client_index = (int) data; - ClientPtr client; - xAppleDRINotifyEvent se; - - if (client_index < 0 || client_index >= currentMaxClients) - return; - - client = clients[client_index]; - if (client == NULL || client == serverClient || client->clientGone) - return; - - se.type = DRIEventBase + AppleDRISurfaceNotify; - se.kind = arg->kind; - se.arg = arg->id; - se.sequenceNumber = client->sequence; - se.time = currentTime.milliseconds; - WriteEventsToClient (client, 1, (xEvent *) &se); -} - -static int -ProcAppleDRICreateSurface( - ClientPtr client -) -{ - xAppleDRICreateSurfaceReply rep; - DrawablePtr pDrawable; - xp_surface_id sid; - unsigned int key[2]; - - REQUEST(xAppleDRICreateSurfaceReq); - REQUEST_SIZE_MATCH(xAppleDRICreateSurfaceReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - - if (!(pDrawable = (DrawablePtr)SecurityLookupDrawable( - (Drawable)stuff->drawable, - client, - SecurityReadAccess))) { - return BadValue; - } - - rep.key_0 = rep.key_1 = rep.uid = 0; - - if (!DRICreateSurface( screenInfo.screens[stuff->screen], - (Drawable)stuff->drawable, pDrawable, - stuff->client_id, &sid, key, - surface_notify, (void *) client->index)) { - return BadValue; - } - - rep.key_0 = key[0]; - rep.key_1 = key[1]; - rep.uid = sid; - - WriteToClient(client, sizeof(xAppleDRICreateSurfaceReply), (char *)&rep); - return (client->noClientException); -} - -static int -ProcAppleDRIDestroySurface( - register ClientPtr client -) -{ - REQUEST(xAppleDRIDestroySurfaceReq); - DrawablePtr pDrawable; - REQUEST_SIZE_MATCH(xAppleDRIDestroySurfaceReq); - - if (!(pDrawable = (DrawablePtr)SecurityLookupDrawable( - (Drawable)stuff->drawable, - client, - SecurityReadAccess))) { - return BadValue; - } - - if (!DRIDestroySurface( screenInfo.screens[stuff->screen], - (Drawable)stuff->drawable, - pDrawable, NULL, NULL)) { - return BadValue; - } - - return (client->noClientException); -} - - -/* dispatch */ - -static int -ProcAppleDRIDispatch ( - register ClientPtr client -) -{ - REQUEST(xReq); - - switch (stuff->data) - { - case X_AppleDRIQueryVersion: - return ProcAppleDRIQueryVersion(client); - case X_AppleDRIQueryDirectRenderingCapable: - return ProcAppleDRIQueryDirectRenderingCapable(client); - } - - if (!LocalClient(client)) - return DRIErrorBase + AppleDRIClientNotLocal; - - switch (stuff->data) - { - case X_AppleDRIAuthConnection: - return ProcAppleDRIAuthConnection(client); - case X_AppleDRICreateSurface: - return ProcAppleDRICreateSurface(client); - case X_AppleDRIDestroySurface: - return ProcAppleDRIDestroySurface(client); - default: - return BadRequest; - } -} - -static void -SNotifyEvent( - xAppleDRINotifyEvent *from, - xAppleDRINotifyEvent *to -) -{ - to->type = from->type; - to->kind = from->kind; - cpswaps (from->sequenceNumber, to->sequenceNumber); - cpswapl (from->time, to->time); - cpswapl (from->arg, to->arg); -} - -static int -SProcAppleDRIQueryVersion( - register ClientPtr client -) -{ - register int n; - REQUEST(xAppleDRIQueryVersionReq); - swaps(&stuff->length, n); - return ProcAppleDRIQueryVersion(client); -} - -static int -SProcAppleDRIDispatch ( - register ClientPtr client -) -{ - REQUEST(xReq); - - /* It is bound to be non-local when there is byte swapping */ - if (!LocalClient(client)) - return DRIErrorBase + AppleDRIClientNotLocal; - - /* only local clients are allowed DRI access */ - switch (stuff->data) - { - case X_AppleDRIQueryVersion: - return SProcAppleDRIQueryVersion(client); - default: - return BadRequest; - } -} diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/dri.c b/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/dri.c deleted file mode 100644 index e8e49f965..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/dri.c +++ /dev/null @@ -1,757 +0,0 @@ -/* $XFree86: xc/programs/Xserver/GL/dri/dri.c,v 1.34 2001/12/10 19:07:19 dawes Exp $ */ -/************************************************************************** - -Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -Copyright 2000 VA Linux Systems, Inc. -Copyright (c) 2002 Apple Computer, Inc. -All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sub license, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice (including the -next paragraph) shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -**************************************************************************/ - -/* - * Authors: - * Jens Owen - * Rickard E. (Rik) Faith - * - */ - -#ifdef XFree86LOADER -#include "xf86.h" -#include "xf86_ansic.h" -#else -#include -#include -#endif - -#define NEED_REPLIES -#define NEED_EVENTS -#include -#include -#include "misc.h" -#include "dixstruct.h" -#include "extnsionst.h" -#include "colormapst.h" -#include "cursorstr.h" -#include "scrnintstr.h" -#include "windowstr.h" -#include "servermd.h" -#define _APPLEDRI_SERVER_ -#include "appledristr.h" -#include "swaprep.h" -#include "dri.h" -#include "dristruct.h" -#include "mi.h" -#include "mipointer.h" -#include "rootless.h" -#include "x-hash.h" -#include "x-hook.h" - -#include - -static int DRIScreenPrivIndex = -1; -static int DRIWindowPrivIndex = -1; -static int DRIPixmapPrivIndex = -1; - -static RESTYPE DRIDrawablePrivResType; - -static x_hash_table *surface_hash; /* maps surface ids -> drawablePrivs */ - -/* FIXME: don't hardcode this? */ -#define CG_INFO_FILE "/System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Resources/Info-macos.plist" - -/* Corresponds to SU Jaguar Green */ -#define CG_REQUIRED_MAJOR 1 -#define CG_REQUIRED_MINOR 157 -#define CG_REQUIRED_MICRO 11 - -/* Returns version as major.minor.micro in 10.10.10 fixed form */ -static unsigned int -get_cg_version (void) -{ - static unsigned int version; - - FILE *fh; - char *ptr; - - if (version != 0) - return version; - - /* I tried CFBundleGetVersion, but it returns zero, so.. */ - - fh = fopen (CG_INFO_FILE, "r"); - if (fh != NULL) - { - char buf[256]; - - while (fgets (buf, sizeof (buf), fh) != NULL) - { - unsigned char c; - - if (!strstr (buf, "CFBundleShortVersionString") - || fgets (buf, sizeof (buf), fh) == NULL) - { - continue; - } - - ptr = strstr (buf, ""); - if (ptr == NULL) - continue; - - ptr += strlen (""); - - /* Now PTR points to "MAJOR.MINOR.MICRO". */ - - version = 0; - - again: - switch ((c = *ptr++)) - { - case '.': - version = version * 1024; - goto again; - - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - version = ((version & ~0x3ff) - + (version & 0x3ff) * 10 + (c - '0')); - goto again; - } - break; - } - - fclose (fh); - } - - return version; -} - -static Bool -test_cg_version (unsigned int major, unsigned int minor, unsigned int micro) -{ - unsigned int cg_ver = get_cg_version (); - - unsigned int cg_major = (cg_ver >> 20) & 0x3ff; - unsigned int cg_minor = (cg_ver >> 10) & 0x3ff; - unsigned int cg_micro = cg_ver & 0x3ff; - - if (cg_major > major) - return TRUE; - else if (cg_major < major) - return FALSE; - - /* cg_major == major */ - - if (cg_minor > minor) - return TRUE; - else if (cg_minor < minor) - return FALSE; - - /* cg_minor == minor */ - - if (cg_micro < micro) - return FALSE; - - return TRUE; -} - -Bool -DRIScreenInit(ScreenPtr pScreen) -{ - DRIScreenPrivPtr pDRIPriv; - int i; - - pDRIPriv = (DRIScreenPrivPtr) xcalloc(1, sizeof(DRIScreenPrivRec)); - if (!pDRIPriv) { - pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL; - return FALSE; - } - - pScreen->devPrivates[DRIScreenPrivIndex].ptr = (pointer) pDRIPriv; - pDRIPriv->directRenderingSupport = TRUE; - pDRIPriv->nrWindows = 0; - - /* Need recent cg for window access update */ - if (!test_cg_version (CG_REQUIRED_MAJOR, - CG_REQUIRED_MINOR, - CG_REQUIRED_MICRO)) - { - ErrorF ("[DRI] disabled direct rendering; requires CoreGraphics %d.%d.%d\n", - CG_REQUIRED_MAJOR, CG_REQUIRED_MINOR, CG_REQUIRED_MICRO); - - pDRIPriv->directRenderingSupport = FALSE; - - /* Note we don't nuke the dri private, since we need it for - managing indirect surfaces. */ - } - - /* Initialize drawable tables */ - for (i = 0; i < DRI_MAX_DRAWABLES; i++) { - pDRIPriv->DRIDrawables[i] = NULL; - } - - return TRUE; -} - -Bool -DRIFinishScreenInit(ScreenPtr pScreen) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - - /* Allocate zero sized private area for each window. Should a window - * become a DRI window, we'll hang a DRIWindowPrivateRec off of this - * private index. - */ - if (!AllocateWindowPrivate(pScreen, DRIWindowPrivIndex, 0)) - return FALSE; - - /* Wrap DRI support */ - pDRIPriv->wrap.ValidateTree = pScreen->ValidateTree; - pScreen->ValidateTree = DRIValidateTree; - - pDRIPriv->wrap.PostValidateTree = pScreen->PostValidateTree; - pScreen->PostValidateTree = DRIPostValidateTree; - - pDRIPriv->wrap.WindowExposures = pScreen->WindowExposures; - pScreen->WindowExposures = DRIWindowExposures; - - pDRIPriv->wrap.CopyWindow = pScreen->CopyWindow; - pScreen->CopyWindow = DRICopyWindow; - - pDRIPriv->wrap.ClipNotify = pScreen->ClipNotify; - pScreen->ClipNotify = DRIClipNotify; - - ErrorF("[DRI] screen %d installation complete\n", pScreen->myNum); - - return TRUE; -} - -void -DRICloseScreen(ScreenPtr pScreen) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - - if (pDRIPriv && pDRIPriv->directRenderingSupport) { - xfree(pDRIPriv); - pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL; - } -} - -Bool -DRIExtensionInit(void) -{ - static unsigned long DRIGeneration = 0; - - if (DRIGeneration != serverGeneration) { - if ((DRIScreenPrivIndex = AllocateScreenPrivateIndex()) < 0) - return FALSE; - DRIGeneration = serverGeneration; - } - - /* - * Allocate a window private index with a zero sized private area for - * each window, then should a window become a DRI window, we'll hang - * a DRIWindowPrivateRec off of this private index. Do same for pixmaps. - */ - if ((DRIWindowPrivIndex = AllocateWindowPrivateIndex()) < 0) - return FALSE; - if ((DRIPixmapPrivIndex = AllocatePixmapPrivateIndex()) < 0) - return FALSE; - - DRIDrawablePrivResType = CreateNewResourceType(DRIDrawablePrivDelete); - - return TRUE; -} - -void -DRIReset(void) -{ - /* - * This stub routine is called when the X Server recycles, resources - * allocated by DRIExtensionInit need to be managed here. - * - * Currently this routine is a stub because all the interesting resources - * are managed via the screen init process. - */ -} - -Bool -DRIQueryDirectRenderingCapable(ScreenPtr pScreen, Bool* isCapable) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - - if (pDRIPriv) - *isCapable = pDRIPriv->directRenderingSupport; - else - *isCapable = FALSE; - - return TRUE; -} - -Bool -DRIAuthConnection(ScreenPtr pScreen, unsigned int magic) -{ -#if 0 - /* FIXME: something? */ - - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - - if (drmAuthMagic(pDRIPriv->drmFD, magic)) return FALSE; -#endif - return TRUE; -} - -static void -DRIUpdateSurface(DRIDrawablePrivPtr pDRIDrawablePriv, DrawablePtr pDraw) -{ - xp_window_changes wc; - unsigned int flags = 0; - - if (pDRIDrawablePriv->sid == 0) - return; - -#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 - wc.depth = (pDraw->bitsPerPixel == 32 ? XP_DEPTH_ARGB8888 - : pDraw->bitsPerPixel == 16 ? XP_DEPTH_RGB555 : XP_DEPTH_NIL); - if (wc.depth != XP_DEPTH_NIL) - flags |= XP_DEPTH; -#endif - - if (pDraw->type == DRAWABLE_WINDOW) { - WindowPtr pWin = (WindowPtr) pDraw; - WindowPtr pTopWin = TopLevelParent(pWin); - - wc.x = pWin->drawable.x - (pTopWin->drawable.x - pTopWin->borderWidth); - wc.y = pWin->drawable.y - (pTopWin->drawable.y - pTopWin->borderWidth); - wc.width = pWin->drawable.width + 2 * pWin->borderWidth; - wc.height = pWin->drawable.height + 2 * pWin->borderWidth; - wc.bit_gravity = XP_GRAVITY_NONE; - - wc.shape_nrects = REGION_NUM_RECTS(&pWin->clipList); - wc.shape_rects = REGION_RECTS(&pWin->clipList); - wc.shape_tx = - (pTopWin->drawable.x - pTopWin->borderWidth); - wc.shape_ty = - (pTopWin->drawable.y - pTopWin->borderWidth); - - flags |= XP_BOUNDS | XP_SHAPE; - - } else if (pDraw->type == DRAWABLE_PIXMAP) { - wc.x = 0; - wc.y = 0; - wc.width = pDraw->width; - wc.height = pDraw->height; - wc.bit_gravity = XP_GRAVITY_NONE; - flags |= XP_BOUNDS; - } - - xp_configure_surface(pDRIDrawablePriv->sid, flags, &wc); -} - -Bool -DRICreateSurface(ScreenPtr pScreen, Drawable id, - DrawablePtr pDrawable, xp_client_id client_id, - xp_surface_id *surface_id, unsigned int ret_key[2], - void (*notify) (void *arg, void *data), void *notify_data) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - DRIDrawablePrivPtr pDRIDrawablePriv; - xp_window_id wid = 0; - - if (pDrawable->type == DRAWABLE_WINDOW) { - WindowPtr pWin = (WindowPtr)pDrawable; - - pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin); - if (pDRIDrawablePriv == NULL) { - xp_error err; - xp_window_changes wc; - - /* allocate a DRI Window Private record */ - if (!(pDRIDrawablePriv = xalloc(sizeof(DRIDrawablePrivRec)))) { - return FALSE; - } - - pDRIDrawablePriv->pDraw = pDrawable; - pDRIDrawablePriv->pScreen = pScreen; - pDRIDrawablePriv->refCount = 0; - pDRIDrawablePriv->drawableIndex = -1; - pDRIDrawablePriv->notifiers = NULL; - - /* find the physical window */ - wid = (xp_window_id) RootlessFrameForWindow(pWin, TRUE); - if (wid == 0) { - xfree(pDRIDrawablePriv); - return FALSE; - } - - /* allocate the physical surface */ - err = xp_create_surface(wid, &pDRIDrawablePriv->sid); - if (err != Success) { - xfree(pDRIDrawablePriv); - return FALSE; - } - - /* Make it visible */ - wc.stack_mode = XP_MAPPED_ABOVE; - wc.sibling = 0; - err = xp_configure_surface(pDRIDrawablePriv->sid, XP_STACKING, &wc); - if (err != Success) - { - xp_destroy_surface(pDRIDrawablePriv->sid); - xfree(pDRIDrawablePriv); - return FALSE; - } - - /* save private off of preallocated index */ - pWin->devPrivates[DRIWindowPrivIndex].ptr = (pointer)pDRIDrawablePriv; - } - } - -#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 - else if (pDrawable->type == DRAWABLE_PIXMAP) { - PixmapPtr pPix = (PixmapPtr)pDrawable; - - pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_PIXMAP(pPix); - if (pDRIDrawablePriv == NULL) { - xp_error err; - - /* allocate a DRI Window Private record */ - if (!(pDRIDrawablePriv = xcalloc(1, sizeof(DRIDrawablePrivRec)))) { - return FALSE; - } - - pDRIDrawablePriv->pDraw = pDrawable; - pDRIDrawablePriv->pScreen = pScreen; - pDRIDrawablePriv->refCount = 0; - pDRIDrawablePriv->drawableIndex = -1; - pDRIDrawablePriv->notifiers = NULL; - - /* Passing a null window id to Xplugin in 10.3+ asks for - an accelerated offscreen surface. */ - - err = xp_create_surface(0, &pDRIDrawablePriv->sid); - if (err != Success) { - xfree(pDRIDrawablePriv); - return FALSE; - } - - /* save private off of preallocated index */ - pPix->devPrivates[DRIPixmapPrivIndex].ptr = (pointer)pDRIDrawablePriv; - } - } -#endif - - else { /* for GLX 1.3, a PBuffer */ - /* NOT_DONE */ - return FALSE; - } - - /* Finish initialization of new surfaces */ - if (pDRIDrawablePriv->refCount == 0) { - unsigned int key[2] = {0}; - xp_error err; - - /* try to give the client access to the surface */ - if (client_id != 0 && wid != 0) - { - err = xp_export_surface(wid, pDRIDrawablePriv->sid, - client_id, key); - if (err != Success) { - xp_destroy_surface(pDRIDrawablePriv->sid); - xfree(pDRIDrawablePriv); - return FALSE; - } - } - - pDRIDrawablePriv->key[0] = key[0]; - pDRIDrawablePriv->key[1] = key[1]; - - ++pDRIPriv->nrWindows; - - /* and stash it by surface id */ - if (surface_hash == NULL) - surface_hash = x_hash_table_new(NULL, NULL, NULL, NULL); - x_hash_table_insert(surface_hash, - (void *) pDRIDrawablePriv->sid, pDRIDrawablePriv); - - /* track this in case this window is destroyed */ - AddResource(id, DRIDrawablePrivResType, (pointer)pDrawable); - - /* Initialize shape */ - DRIUpdateSurface(pDRIDrawablePriv, pDrawable); - } - - pDRIDrawablePriv->refCount++; - - *surface_id = pDRIDrawablePriv->sid; - - if (ret_key != NULL) { - ret_key[0] = pDRIDrawablePriv->key[0]; - ret_key[1] = pDRIDrawablePriv->key[1]; - } - - if (notify != NULL) { - pDRIDrawablePriv->notifiers = x_hook_add(pDRIDrawablePriv->notifiers, - notify, notify_data); - } - - return TRUE; -} - -Bool -DRIDestroySurface(ScreenPtr pScreen, Drawable id, DrawablePtr pDrawable, - void (*notify) (void *, void *), void *notify_data) -{ - DRIDrawablePrivPtr pDRIDrawablePriv; - - if (pDrawable->type == DRAWABLE_WINDOW) { - pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW((WindowPtr)pDrawable); - } else if (pDrawable->type == DRAWABLE_PIXMAP) { - pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_PIXMAP((PixmapPtr)pDrawable); - } else { - return FALSE; - } - - if (pDRIDrawablePriv != NULL) { - if (notify != NULL) { - pDRIDrawablePriv->notifiers = x_hook_remove(pDRIDrawablePriv->notifiers, - notify, notify_data); - } - if (--pDRIDrawablePriv->refCount <= 0) { - /* This calls back to DRIDrawablePrivDelete - which frees the private area */ - FreeResourceByType(id, DRIDrawablePrivResType, FALSE); - } - } - - return TRUE; -} - -Bool -DRIDrawablePrivDelete(pointer pResource, XID id) -{ - DrawablePtr pDrawable = (DrawablePtr)pResource; - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pDrawable->pScreen); - DRIDrawablePrivPtr pDRIDrawablePriv = NULL; - WindowPtr pWin = NULL; - PixmapPtr pPix = NULL; - - if (pDrawable->type == DRAWABLE_WINDOW) { - pWin = (WindowPtr)pDrawable; - pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin); - } else if (pDrawable->type == DRAWABLE_PIXMAP) { - pPix = (PixmapPtr)pDrawable; - pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_PIXMAP(pPix); - } - - if (pDRIDrawablePriv == NULL) - return FALSE; - - if (pDRIDrawablePriv->drawableIndex != -1) { - /* release drawable table entry */ - pDRIPriv->DRIDrawables[pDRIDrawablePriv->drawableIndex] = NULL; - } - - if (pDRIDrawablePriv->sid != 0) { - xp_destroy_surface(pDRIDrawablePriv->sid); - x_hash_table_remove(surface_hash, (void *) pDRIDrawablePriv->sid); - } - - if (pDRIDrawablePriv->notifiers != NULL) - x_hook_free(pDRIDrawablePriv->notifiers); - - xfree(pDRIDrawablePriv); - - if (pDrawable->type == DRAWABLE_WINDOW) { - pWin->devPrivates[DRIWindowPrivIndex].ptr = NULL; - } else if (pDrawable->type == DRAWABLE_PIXMAP) { - pPix->devPrivates[DRIPixmapPrivIndex].ptr = NULL; - } - - --pDRIPriv->nrWindows; - - return TRUE; -} - -void -DRIWindowExposures(WindowPtr pWin, RegionPtr prgn, RegionPtr bsreg) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - DRIDrawablePrivPtr pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin); - - if (pDRIDrawablePriv) { - /* FIXME: something? */ - } - - pScreen->WindowExposures = pDRIPriv->wrap.WindowExposures; - - (*pScreen->WindowExposures)(pWin, prgn, bsreg); - - pDRIPriv->wrap.WindowExposures = pScreen->WindowExposures; - pScreen->WindowExposures = DRIWindowExposures; -} - -void -DRICopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - DRIDrawablePrivPtr pDRIDrawablePriv; - - if (pDRIPriv->nrWindows > 0) { - pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin); - if (pDRIDrawablePriv != NULL) { - DRIUpdateSurface(pDRIDrawablePriv, &pWin->drawable); - } - } - - /* unwrap */ - pScreen->CopyWindow = pDRIPriv->wrap.CopyWindow; - - /* call lower layers */ - (*pScreen->CopyWindow)(pWin, ptOldOrg, prgnSrc); - - /* rewrap */ - pDRIPriv->wrap.CopyWindow = pScreen->CopyWindow; - pScreen->CopyWindow = DRICopyWindow; -} - -int -DRIValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind) -{ - ScreenPtr pScreen = pParent->drawable.pScreen; - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - int returnValue; - - /* unwrap */ - pScreen->ValidateTree = pDRIPriv->wrap.ValidateTree; - - /* call lower layers */ - returnValue = (*pScreen->ValidateTree)(pParent, pChild, kind); - - /* rewrap */ - pDRIPriv->wrap.ValidateTree = pScreen->ValidateTree; - pScreen->ValidateTree = DRIValidateTree; - - return returnValue; -} - -void -DRIPostValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind) -{ - ScreenPtr pScreen; - DRIScreenPrivPtr pDRIPriv; - - if (pParent) { - pScreen = pParent->drawable.pScreen; - } else { - pScreen = pChild->drawable.pScreen; - } - pDRIPriv = DRI_SCREEN_PRIV(pScreen); - - if (pDRIPriv->wrap.PostValidateTree) { - /* unwrap */ - pScreen->PostValidateTree = pDRIPriv->wrap.PostValidateTree; - - /* call lower layers */ - (*pScreen->PostValidateTree)(pParent, pChild, kind); - - /* rewrap */ - pDRIPriv->wrap.PostValidateTree = pScreen->PostValidateTree; - pScreen->PostValidateTree = DRIPostValidateTree; - } -} - -void -DRIClipNotify(WindowPtr pWin, int dx, int dy) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - DRIDrawablePrivPtr pDRIDrawablePriv; - - if ((pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin))) { - DRIUpdateSurface(pDRIDrawablePriv, &pWin->drawable); - } - - if (pDRIPriv->wrap.ClipNotify) { - pScreen->ClipNotify = pDRIPriv->wrap.ClipNotify; - - (*pScreen->ClipNotify)(pWin, dx, dy); - - pDRIPriv->wrap.ClipNotify = pScreen->ClipNotify; - pScreen->ClipNotify = DRIClipNotify; - } -} - -/* This lets us get at the unwrapped functions so that they can correctly - * call the lower level functions, and choose whether they will be - * called at every level of recursion (eg in validatetree). - */ -DRIWrappedFuncsRec * -DRIGetWrappedFuncs(ScreenPtr pScreen) -{ - return &(DRI_SCREEN_PRIV(pScreen)->wrap); -} - -void -DRIQueryVersion(int *majorVersion, - int *minorVersion, - int *patchVersion) -{ - *majorVersion = APPLE_DRI_MAJOR_VERSION; - *minorVersion = APPLE_DRI_MINOR_VERSION; - *patchVersion = APPLE_DRI_PATCH_VERSION; -} - -void -DRISurfaceNotify(xp_surface_id id, int kind) -{ - DRIDrawablePrivPtr pDRIDrawablePriv = NULL; - DRISurfaceNotifyArg arg; - - arg.id = id; - arg.kind = kind; - - if (surface_hash != NULL) - { - pDRIDrawablePriv = x_hash_table_lookup(surface_hash, - (void *) id, NULL); - } - - if (pDRIDrawablePriv == NULL) - return; - - if (kind == AppleDRISurfaceNotifyDestroyed) - { - pDRIDrawablePriv->sid = 0; - x_hash_table_remove(surface_hash, (void *) id); - } - - x_hook_run(pDRIDrawablePriv->notifiers, &arg); - - if (kind == AppleDRISurfaceNotifyDestroyed) - { - /* Kill off the handle. */ - - FreeResourceByType(pDRIDrawablePriv->pDraw->id, - DRIDrawablePrivResType, FALSE); - } -} diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/dri.h b/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/dri.h deleted file mode 100644 index f826167f6..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/dri.h +++ /dev/null @@ -1,129 +0,0 @@ -/* $XFree86: xc/programs/Xserver/GL/dri/dri.h,v 1.18 2001/03/21 16:21:40 dawes Exp $ */ -/************************************************************************** - -Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -Copyright (c) 2002 Apple Computer, Inc. -All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sub license, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice (including the -next paragraph) shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -**************************************************************************/ - -/* - * Authors: - * Jens Owen - * - */ - -/* Prototypes for AppleDRI functions */ - -#ifndef _DRI_H_ -#define _DRI_H_ - -#include -#include "scrnintstr.h" -#define _APPLEDRI_SERVER_ -#include "appledri.h" -#include "Xplugin.h" - -typedef void (*ClipNotifyPtr)( WindowPtr, int, int ); - - -/* - * These functions can be wrapped by the DRI. Each of these have - * generic default funcs (initialized in DRICreateInfoRec) and can be - * overridden by the driver in its [driver]DRIScreenInit function. - */ -typedef struct { - WindowExposuresProcPtr WindowExposures; - CopyWindowProcPtr CopyWindow; - ValidateTreeProcPtr ValidateTree; - PostValidateTreeProcPtr PostValidateTree; - ClipNotifyProcPtr ClipNotify; -} DRIWrappedFuncsRec, *DRIWrappedFuncsPtr; - -typedef struct { - xp_surface_id id; - int kind; -} DRISurfaceNotifyArg; - -extern Bool DRIScreenInit(ScreenPtr pScreen); - -extern Bool DRIFinishScreenInit(ScreenPtr pScreen); - -extern void DRICloseScreen(ScreenPtr pScreen); - -extern Bool DRIExtensionInit(void); - -extern void DRIReset(void); - -extern Bool DRIQueryDirectRenderingCapable(ScreenPtr pScreen, - Bool *isCapable); - -extern Bool DRIAuthConnection(ScreenPtr pScreen, unsigned int magic); - -extern Bool DRICreateSurface(ScreenPtr pScreen, - Drawable id, - DrawablePtr pDrawable, - xp_client_id client_id, - xp_surface_id *surface_id, - unsigned int key[2], - void (*notify) (void *arg, void *data), - void *notify_data); - -extern Bool DRIDestroySurface(ScreenPtr pScreen, - Drawable id, - DrawablePtr pDrawable, - void (*notify) (void *arg, void *data), - void *notify_data); - -extern Bool DRIDrawablePrivDelete(pointer pResource, - XID id); - -extern DRIWrappedFuncsRec *DRIGetWrappedFuncs(ScreenPtr pScreen); - -extern void DRICopyWindow(WindowPtr pWin, - DDXPointRec ptOldOrg, - RegionPtr prgnSrc); - -extern int DRIValidateTree(WindowPtr pParent, - WindowPtr pChild, - VTKind kind); - -extern void DRIPostValidateTree(WindowPtr pParent, - WindowPtr pChild, - VTKind kind); - -extern void DRIClipNotify(WindowPtr pWin, - int dx, - int dy); - -extern void DRIWindowExposures(WindowPtr pWin, - RegionPtr prgn, - RegionPtr bsreg); - -extern void DRISurfaceNotify (xp_surface_id id, int kind); - -extern void DRIQueryVersion(int *majorVersion, - int *minorVersion, - int *patchVersion); - -#endif diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/dristruct.h b/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/dristruct.h deleted file mode 100644 index 0df8f1890..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/dristruct.h +++ /dev/null @@ -1,82 +0,0 @@ -/* $XFree86: xc/programs/Xserver/GL/dri/dristruct.h,v 1.10 2001/03/21 16:21:40 dawes Exp $ */ -/************************************************************************** - -Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -Copyright (c) 2002 Apple Computer, Inc. -All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sub license, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice (including the -next paragraph) shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -**************************************************************************/ - -/* - * Authors: - * Jens Owen - * - */ - -#ifndef DRI_STRUCT_H -#define DRI_STRUCT_H - -#include "dri.h" -#include "x-list.h" - -#define DRI_MAX_DRAWABLES 256 - -#define DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin) \ - ((DRIWindowPrivIndex < 0) ? \ - NULL : \ - ((DRIDrawablePrivPtr)((pWin)->devPrivates[DRIWindowPrivIndex].ptr))) - -#define DRI_DRAWABLE_PRIV_FROM_PIXMAP(pPix) \ - ((DRIPixmapPrivIndex < 0) ? \ - NULL : \ - ((DRIDrawablePrivPtr)((pPix)->devPrivates[DRIPixmapPrivIndex].ptr))) - -typedef struct _DRIDrawablePrivRec -{ - xp_surface_id sid; - int drawableIndex; - DrawablePtr pDraw; - ScreenPtr pScreen; - int refCount; - unsigned int key[2]; - x_list *notifiers; /* list of (FUN . DATA) */ -} DRIDrawablePrivRec, *DRIDrawablePrivPtr; - -#define DRI_SCREEN_PRIV(pScreen) \ - ((DRIScreenPrivIndex < 0) ? \ - NULL : \ - ((DRIScreenPrivPtr)((pScreen)->devPrivates[DRIScreenPrivIndex].ptr))) - -#define DRI_SCREEN_PRIV_FROM_INDEX(screenIndex) ((DRIScreenPrivPtr) \ - (screenInfo.screens[screenIndex]->devPrivates[DRIScreenPrivIndex].ptr)) - - -typedef struct _DRIScreenPrivRec -{ - Bool directRenderingSupport; - int nrWindows; - DRIWrappedFuncsRec wrap; - DrawablePtr DRIDrawables[DRI_MAX_DRAWABLES]; -} DRIScreenPrivRec, *DRIScreenPrivPtr; - -#endif /* DRI_STRUCT_H */ diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/x-hash.c b/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/x-hash.c deleted file mode 100644 index a1c6655f7..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/x-hash.c +++ /dev/null @@ -1,341 +0,0 @@ -/* x-hash.c - basic hash tables - $Id: x-hash.c,v 1.5 2005/07/01 22:43:08 daniels Exp $ - - Copyright (c) 2002 Apple Computer, Inc. All rights reserved. - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT - HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. - - Except as contained in this notice, the name(s) of the above - copyright holders shall not be used in advertising or otherwise to - promote the sale, use or other dealings in this Software without - prior written authorization. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/x-hash.c,v 1.1 2003/04/30 23:15:42 torrey Exp $ */ - -#include "x-hash.h" -#include "x-list.h" -#include -#include - -struct x_hash_table_struct { - unsigned int bucket_index; - unsigned int total_keys; - x_list **buckets; - - x_hash_fun *hash_key; - x_compare_fun *compare_keys; - x_destroy_fun *destroy_key; - x_destroy_fun *destroy_value; -}; - -#define ITEM_NEW(k, v) X_PFX (list_prepend) ((x_list *) (k), v) -#define ITEM_FREE(i) X_PFX (list_free_1) (i) -#define ITEM_KEY(i) ((void *) (i)->next) -#define ITEM_VALUE(i) ((i)->data) - -#define SPLIT_THRESHOLD_FACTOR 2 - -/* http://planetmath.org/?op=getobj&from=objects&name=GoodHashTablePrimes */ -static const unsigned int bucket_sizes[] = { - 29, 53, 97, 193, 389, 769, 1543, 3079, 6151, 12289, 24593, 49157, - 98317, 196613, 393241, 786433, 1572869, 3145739, 6291469, 12582917, - 25165843, 50331653, 100663319, 201326611, 402653189, 805306457, - 1610612741 -}; - -#define N_BUCKET_SIZES (sizeof (bucket_sizes) / sizeof (bucket_sizes[0])) - -static inline unsigned int -hash_table_total_buckets (x_hash_table *h) -{ - return bucket_sizes[h->bucket_index]; -} - -static inline void -hash_table_destroy_item (x_hash_table *h, void *k, void *v) -{ - if (h->destroy_key != 0) - (*h->destroy_key) (k); - - if (h->destroy_value != 0) - (*h->destroy_value) (v); -} - -static inline unsigned int -hash_table_hash_key (x_hash_table *h, void *k) -{ - if (h->hash_key != 0) - return (*h->hash_key) (k); - else - return (unsigned int) k; -} - -static inline int -hash_table_compare_keys (x_hash_table *h, void *k1, void *k2) -{ - if (h->compare_keys == 0) - return k1 == k2; - else - return (*h->compare_keys) (k1, k2) == 0; -} - -static void -hash_table_split (x_hash_table *h) -{ - x_list **new, **old; - x_list *node, *item, *next; - int new_size, old_size; - unsigned int b; - int i; - - if (h->bucket_index == N_BUCKET_SIZES - 1) - return; - - old_size = hash_table_total_buckets (h); - old = h->buckets; - - h->bucket_index++; - - new_size = hash_table_total_buckets (h); - new = calloc (new_size, sizeof (x_list *)); - - if (new == 0) - { - h->bucket_index--; - return; - } - - for (i = 0; i < old_size; i++) - { - for (node = old[i]; node != 0; node = next) - { - next = node->next; - item = node->data; - - b = hash_table_hash_key (h, ITEM_KEY (item)) % new_size; - - node->next = new[b]; - new[b] = node; - } - } - - h->buckets = new; - free (old); -} - -X_EXTERN x_hash_table * -X_PFX (hash_table_new) (x_hash_fun *hash, - x_compare_fun *compare, - x_destroy_fun *key_destroy, - x_destroy_fun *value_destroy) -{ - x_hash_table *h; - - h = calloc (1, sizeof (x_hash_table)); - if (h == 0) - return 0; - - h->bucket_index = 0; - h->buckets = calloc (hash_table_total_buckets (h), sizeof (x_list *)); - - if (h->buckets == 0) - { - free (h); - return 0; - } - - h->hash_key = hash; - h->compare_keys = compare; - h->destroy_key = key_destroy; - h->destroy_value = value_destroy; - - return h; -} - -X_EXTERN void -X_PFX (hash_table_free) (x_hash_table *h) -{ - int n, i; - x_list *node, *item; - - assert (h != NULL); - - n = hash_table_total_buckets (h); - - for (i = 0; i < n; i++) - { - for (node = h->buckets[i]; node != 0; node = node->next) - { - item = node->data; - hash_table_destroy_item (h, ITEM_KEY (item), ITEM_VALUE (item)); - ITEM_FREE (item); - } - X_PFX (list_free) (h->buckets[i]); - } - - free (h->buckets); - free (h); -} - -X_EXTERN unsigned int -X_PFX (hash_table_size) (x_hash_table *h) -{ - assert (h != NULL); - - return h->total_keys; -} - -static void -hash_table_modify (x_hash_table *h, void *k, void *v, int replace) -{ - unsigned int hash_value; - x_list *node, *item; - - assert (h != NULL); - - hash_value = hash_table_hash_key (h, k); - - for (node = h->buckets[hash_value % hash_table_total_buckets (h)]; - node != 0; node = node->next) - { - item = node->data; - - if (hash_table_compare_keys (h, ITEM_KEY (item), k)) - { - if (replace) - { - hash_table_destroy_item (h, ITEM_KEY (item), - ITEM_VALUE (item)); - item->next = k; - ITEM_VALUE (item) = v; - } - else - { - hash_table_destroy_item (h, k, ITEM_VALUE (item)); - ITEM_VALUE (item) = v; - } - return; - } - } - - /* Key isn't already in the table. Insert it. */ - - if (h->total_keys + 1 - > hash_table_total_buckets (h) * SPLIT_THRESHOLD_FACTOR) - { - hash_table_split (h); - } - - hash_value = hash_value % hash_table_total_buckets (h); - h->buckets[hash_value] = X_PFX (list_prepend) (h->buckets[hash_value], - ITEM_NEW (k, v)); - h->total_keys++; -} - -X_EXTERN void -X_PFX (hash_table_insert) (x_hash_table *h, void *k, void *v) -{ - hash_table_modify (h, k, v, 0); -} - -X_EXTERN void -X_PFX (hash_table_replace) (x_hash_table *h, void *k, void *v) -{ - hash_table_modify (h, k, v, 1); -} - -X_EXTERN void -X_PFX (hash_table_remove) (x_hash_table *h, void *k) -{ - unsigned int hash_value; - x_list **ptr, *item; - - assert (h != NULL); - - hash_value = hash_table_hash_key (h, k); - - for (ptr = &h->buckets[hash_value % hash_table_total_buckets (h)]; - *ptr != 0; ptr = &((*ptr)->next)) - { - item = (*ptr)->data; - - if (hash_table_compare_keys (h, ITEM_KEY (item), k)) - { - hash_table_destroy_item (h, ITEM_KEY (item), ITEM_VALUE (item)); - ITEM_FREE (item); - item = *ptr; - *ptr = item->next; - X_PFX (list_free_1) (item); - h->total_keys--; - return; - } - } -} - -X_EXTERN void * -X_PFX (hash_table_lookup) (x_hash_table *h, void *k, void **k_ret) -{ - unsigned int hash_value; - x_list *node, *item; - - assert (h != NULL); - - hash_value = hash_table_hash_key (h, k); - - for (node = h->buckets[hash_value % hash_table_total_buckets (h)]; - node != 0; node = node->next) - { - item = node->data; - - if (hash_table_compare_keys (h, ITEM_KEY (item), k)) - { - if (k_ret != 0) - *k_ret = ITEM_KEY (item); - - return ITEM_VALUE (item); - } - } - - if (k_ret != 0) - *k_ret = 0; - - return 0; -} - -X_EXTERN void -X_PFX (hash_table_foreach) (x_hash_table *h, - x_hash_foreach_fun *fun, void *data) -{ - int i, n; - x_list *node, *item; - - assert (h != NULL); - - n = hash_table_total_buckets (h); - - for (i = 0; i < n; i++) - { - for (node = h->buckets[i]; node != 0; node = node->next) - { - item = node->data; - (*fun) (ITEM_KEY (item), ITEM_VALUE (item), data); - } - } -} diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/x-hash.h b/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/x-hash.h deleted file mode 100644 index 5ee069cda..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/x-hash.h +++ /dev/null @@ -1,62 +0,0 @@ -/* x-hash.h -- basic hash table class - $Id: x-hash.h,v 1.3 2005/07/01 22:43:08 daniels Exp $ - - Copyright (c) 2002 Apple Computer, Inc. All rights reserved. - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT - HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. - - Except as contained in this notice, the name(s) of the above - copyright holders shall not be used in advertising or otherwise to - promote the sale, use or other dealings in this Software without - prior written authorization. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/x-hash.h,v 1.1 2003/04/30 23:15:42 torrey Exp $ */ - -#ifndef X_HASH_H -#define X_HASH_H 1 - -typedef struct x_hash_table_struct x_hash_table; - -typedef int (x_compare_fun) (const void *a, const void *b); -typedef unsigned int (x_hash_fun) (const void *k); -typedef void (x_destroy_fun) (void *x); -typedef void (x_hash_foreach_fun) (void *k, void *v, void *data); - -/* for X_PFX and X_EXTERN */ -#include "x-list.h" - -X_EXTERN x_hash_table *X_PFX (hash_table_new) (x_hash_fun *hash, - x_compare_fun *compare, - x_destroy_fun *key_destroy, - x_destroy_fun *value_destroy); -X_EXTERN void X_PFX (hash_table_free) (x_hash_table *h); - -X_EXTERN unsigned int X_PFX (hash_table_size) (x_hash_table *h); - -X_EXTERN void X_PFX (hash_table_insert) (x_hash_table *h, void *k, void *v); -X_EXTERN void X_PFX (hash_table_replace) (x_hash_table *h, void *k, void *v); -X_EXTERN void X_PFX (hash_table_remove) (x_hash_table *h, void *k); -X_EXTERN void *X_PFX (hash_table_lookup) (x_hash_table *h, - void *k, void **k_ret); -X_EXTERN void X_PFX (hash_table_foreach) (x_hash_table *h, - x_hash_foreach_fun *fun, - void *data); - -#endif /* X_HASH_H */ diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/x-hook.c b/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/x-hook.c deleted file mode 100644 index b4e6673eb..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/x-hook.c +++ /dev/null @@ -1,106 +0,0 @@ -/* x-hook.c - $Id: x-hook.c,v 1.3 2005/07/01 22:43:08 daniels Exp $ - - Copyright (c) 2003 Apple Computer, Inc. All rights reserved. - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT - HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. - - Except as contained in this notice, the name(s) of the above - copyright holders shall not be used in advertising or otherwise to - promote the sale, use or other dealings in this Software without - prior written authorization. */ -/* $XFree86: $ */ - -#include "x-hook.h" -#include -#include - -#define CELL_NEW(f,d) X_PFX (list_prepend) ((x_list *) (f), (d)) -#define CELL_FREE(c) X_PFX (list_free_1) (c) -#define CELL_FUN(c) ((x_hook_function *) ((c)->next)) -#define CELL_DATA(c) ((c)->data) - -X_EXTERN x_list * -X_PFX (hook_add) (x_list *lst, x_hook_function *fun, void *data) -{ - return X_PFX (list_prepend) (lst, CELL_NEW (fun, data)); -} - -X_EXTERN x_list * -X_PFX (hook_remove) (x_list *lst, x_hook_function *fun, void *data) -{ - x_list *node, *cell; - x_list *to_delete = NULL; - - for (node = lst; node != NULL; node = node->next) - { - cell = node->data; - if (CELL_FUN (cell) == fun && CELL_DATA (cell) == data) - to_delete = X_PFX (list_prepend) (to_delete, cell); - } - - for (node = to_delete; node != NULL; node = node->next) - { - cell = node->data; - lst = X_PFX (list_remove) (lst, cell); - CELL_FREE (cell); - } - - X_PFX (list_free) (to_delete); -} - -X_EXTERN void -X_PFX (hook_run) (x_list *lst, void *arg) -{ - x_list *node, *cell; - x_hook_function **fun; - void **data; - int length, i; - - length = X_PFX (list_length) (lst); - fun = alloca (sizeof (x_hook_function *) * length); - data = alloca (sizeof (void *) * length); - - for (i = 0, node = lst; node != NULL; node = node->next, i++) - { - cell = node->data; - fun[i] = CELL_FUN (cell); - data[i] = CELL_DATA (cell); - } - - for (i = 0; i < length; i++) - { - (*fun[i]) (arg, data[i]); - } -} - -X_EXTERN void -X_PFX (hook_free) (x_list *lst) -{ - x_list *node; - - for (node = lst; node != NULL; node = node->next) - { - CELL_FREE (node->data); - } - - X_PFX (list_free) (lst); -} diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/x-hook.h b/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/x-hook.h deleted file mode 100644 index 08b29a94e..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/x-hook.h +++ /dev/null @@ -1,44 +0,0 @@ -/* x-hook.h -- lists of function,data pairs to call. - $Id: x-hook.h,v 1.3 2005/07/01 22:43:08 daniels Exp $ - - Copyright (c) 2003 Apple Computer, Inc. All rights reserved. - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT - HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. - - Except as contained in this notice, the name(s) of the above - copyright holders shall not be used in advertising or otherwise to - promote the sale, use or other dealings in this Software without - prior written authorization. */ -/* $XFree86: $ */ - -#ifndef X_HOOK_H -#define X_HOOK_H 1 - -#include "x-list.h" - -typedef void x_hook_function (void *arg, void *data); - -X_EXTERN x_list *X_PFX (hook_add) (x_list *lst, x_hook_function *fun, void *data); -X_EXTERN x_list *X_PFX (hook_remove) (x_list *lst, x_hook_function *fun, void *data); -X_EXTERN void X_PFX (hook_run) (x_list *lst, void *arg); -X_EXTERN void X_PFX (hook_free) (x_list *lst); - -#endif /* X_HOOK_H */ diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/x-list.c b/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/x-list.c deleted file mode 100644 index fdadee212..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/x-list.c +++ /dev/null @@ -1,335 +0,0 @@ -/* x-list.c - $Id: x-list.c,v 1.4 2005/07/01 22:43:08 daniels Exp $ - - Copyright (c) 2002 Apple Computer, Inc. All rights reserved. - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT - HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. - - Except as contained in this notice, the name(s) of the above - copyright holders shall not be used in advertising or otherwise to - promote the sale, use or other dealings in this Software without - prior written authorization. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/x-list.c,v 1.1 2003/04/30 23:15:42 torrey Exp $ */ - -#include "x-list.h" -#include -#include -#include - -/* Allocate in ~4k blocks */ -#define NODES_PER_BLOCK 508 - -typedef struct x_list_block_struct x_list_block; - -struct x_list_block_struct { - x_list l[NODES_PER_BLOCK]; -}; - -static x_list *freelist; - -static pthread_mutex_t freelist_lock = PTHREAD_MUTEX_INITIALIZER; - -static inline void -list_free_1 (x_list *node) -{ - node->next = freelist; - freelist = node; -} - -X_EXTERN void -X_PFX (list_free_1) (x_list *node) -{ - assert (node != NULL); - - pthread_mutex_lock (&freelist_lock); - - list_free_1 (node); - - pthread_mutex_unlock (&freelist_lock); -} - -X_EXTERN void -X_PFX (list_free) (x_list *lst) -{ - x_list *next; - - pthread_mutex_lock (&freelist_lock); - - for (; lst != NULL; lst = next) - { - next = lst->next; - list_free_1 (lst); - } - - pthread_mutex_unlock (&freelist_lock); -} - -X_EXTERN x_list * -X_PFX (list_prepend) (x_list *lst, void *data) -{ - x_list *node; - - pthread_mutex_lock (&freelist_lock); - - if (freelist == NULL) - { - x_list_block *b; - int i; - - b = malloc (sizeof (x_list_block)); - - for (i = 0; i < NODES_PER_BLOCK - 1; i++) - b->l[i].next = &(b->l[i+1]); - b->l[i].next = NULL; - - freelist = b->l; - } - - node = freelist; - freelist = node->next; - - pthread_mutex_unlock (&freelist_lock); - - node->next = lst; - node->data = data; - - return node; -} - -X_EXTERN x_list * -X_PFX (list_append) (x_list *lst, void *data) -{ - x_list *head = lst; - - if (lst == NULL) - return X_PFX (list_prepend) (NULL, data); - - while (lst->next != NULL) - lst = lst->next; - - lst->next = X_PFX (list_prepend) (NULL, data); - - return head; -} - -X_EXTERN x_list * -X_PFX (list_reverse) (x_list *lst) -{ - x_list *head = NULL, *next; - - while (lst != NULL) - { - next = lst->next; - lst->next = head; - head = lst; - lst = next; - } - - return head; -} - -X_EXTERN x_list * -X_PFX (list_find) (x_list *lst, void *data) -{ - for (; lst != NULL; lst = lst->next) - { - if (lst->data == data) - return lst; - } - - return NULL; -} - -X_EXTERN x_list * -X_PFX (list_nth) (x_list *lst, int n) -{ - while (n-- > 0 && lst != NULL) - lst = lst->next; - - return lst; -} - -X_EXTERN x_list * -X_PFX (list_pop) (x_list *lst, void **data_ret) -{ - void *data = NULL; - - if (lst != NULL) - { - x_list *tem = lst; - data = lst->data; - lst = lst->next; - X_PFX (list_free_1) (tem); - } - - if (data_ret != NULL) - *data_ret = data; - - return lst; -} - -X_EXTERN x_list * -X_PFX (list_filter) (x_list *lst, - int (*pred) (void *item, void *data), void *data) -{ - x_list *ret = NULL, *node; - - for (node = lst; node != NULL; node = node->next) - { - if ((*pred) (node->data, data)) - ret = X_PFX (list_prepend) (ret, node->data); - } - - return X_PFX (list_reverse) (ret); -} - -X_EXTERN x_list * -X_PFX (list_map) (x_list *lst, - void *(*fun) (void *item, void *data), void *data) -{ - x_list *ret = NULL, *node; - - for (node = lst; node != NULL; node = node->next) - { - X_PFX (list_prepend) (ret, fun (node->data, data)); - } - - return X_PFX (list_reverse) (ret); -} - -X_EXTERN x_list * -X_PFX (list_copy) (x_list *lst) -{ - x_list *copy = NULL; - - for (; lst != NULL; lst = lst->next) - { - copy = X_PFX (list_prepend) (copy, lst->data); - } - - return X_PFX (list_reverse) (copy); -} - -X_EXTERN x_list * -X_PFX (list_remove) (x_list *lst, void *data) -{ - x_list **ptr, *node; - - for (ptr = &lst; *ptr != NULL;) - { - node = *ptr; - - if (node->data == data) - { - *ptr = node->next; - X_PFX (list_free_1) (node); - } - else - ptr = &((*ptr)->next); - } - - return lst; -} - -X_EXTERN unsigned int -X_PFX (list_length) (x_list *lst) -{ - unsigned int n; - - n = 0; - for (; lst != NULL; lst = lst->next) - n++; - - return n; -} - -X_EXTERN void -X_PFX (list_foreach) (x_list *lst, - void (*fun) (void *data, void *user_data), - void *user_data) -{ - for (; lst != NULL; lst = lst->next) - { - (*fun) (lst->data, user_data); - } -} - -static x_list * -list_sort_1 (x_list *lst, int length, - int (*less) (const void *, const void *)) -{ - x_list *mid, *ptr; - x_list *out_head, *out; - int mid_point, i; - - /* This is a standard (stable) list merge sort */ - - if (length < 2) - return lst; - - /* Calculate the halfway point. Split the list into two sub-lists. */ - - mid_point = length / 2; - ptr = lst; - for (i = mid_point - 1; i > 0; i--) - ptr = ptr->next; - mid = ptr->next; - ptr->next = NULL; - - /* Sort each sub-list. */ - - lst = list_sort_1 (lst, mid_point, less); - mid = list_sort_1 (mid, length - mid_point, less); - - /* Then merge them back together. */ - - assert (lst != NULL && mid != NULL); - - if ((*less) (mid->data, lst->data)) - out = out_head = mid, mid = mid->next; - else - out = out_head = lst, lst = lst->next; - - while (lst != NULL && mid != NULL) - { - if ((*less) (mid->data, lst->data)) - out = out->next = mid, mid = mid->next; - else - out = out->next = lst, lst = lst->next; - } - - if (lst != NULL) - out->next = lst; - else - out->next = mid; - - return out_head; -} - -X_EXTERN x_list * -X_PFX (list_sort) (x_list *lst, int (*less) (const void *, const void *)) -{ - int length; - - length = X_PFX (list_length) (lst); - - return list_sort_1 (lst, length, less); -} diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/x-list.h b/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/x-list.h deleted file mode 100644 index 8da37a91b..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/x-list.h +++ /dev/null @@ -1,79 +0,0 @@ -/* x-list.h -- simple list type - $Id: x-list.h,v 1.4 2005/07/01 22:43:08 daniels Exp $ - - Copyright (c) 2002 Apple Computer, Inc. All rights reserved. - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT - HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. - - Except as contained in this notice, the name(s) of the above - copyright holders shall not be used in advertising or otherwise to - promote the sale, use or other dealings in this Software without - prior written authorization. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/x-list.h,v 1.1 2003/04/30 23:15:42 torrey Exp $ */ - -#ifndef X_LIST_H -#define X_LIST_H 1 - -/* This is just a cons. */ - -typedef struct x_list_struct x_list; - -struct x_list_struct { - void *data; - x_list *next; -}; - -#ifndef X_PFX -# define X_PFX(x) x_ ## x -#endif - -#ifndef X_EXTERN -# define X_EXTERN __private_extern__ -#endif - -X_EXTERN void X_PFX (list_free_1) (x_list *node); -X_EXTERN x_list *X_PFX (list_prepend) (x_list *lst, void *data); - -X_EXTERN x_list *X_PFX (list_append) (x_list *lst, void *data); -X_EXTERN x_list *X_PFX (list_remove) (x_list *lst, void *data); -X_EXTERN void X_PFX (list_free) (x_list *lst); -X_EXTERN x_list *X_PFX (list_pop) (x_list *lst, void **data_ret); - -X_EXTERN x_list *X_PFX (list_copy) (x_list *lst); -X_EXTERN x_list *X_PFX (list_reverse) (x_list *lst); -X_EXTERN x_list *X_PFX (list_find) (x_list *lst, void *data); -X_EXTERN x_list *X_PFX (list_nth) (x_list *lst, int n); -X_EXTERN x_list *X_PFX (list_filter) (x_list *src, - int (*pred) (void *item, void *data), - void *data); -X_EXTERN x_list *X_PFX (list_map) (x_list *src, - void *(*fun) (void *item, void *data), - void *data); - -X_EXTERN unsigned int X_PFX (list_length) (x_list *lst); -X_EXTERN void X_PFX (list_foreach) (x_list *lst, void (*fun) - (void *data, void *user_data), - void *user_data); - -X_EXTERN x_list *X_PFX (list_sort) (x_list *lst, int (*less) (const void *, - const void *)); - -#endif /* X_LIST_H */ diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/xpr.h b/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/xpr.h deleted file mode 100644 index ac7e74f08..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/xpr.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Xplugin rootless implementation - */ -/* - * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/xpr/xpr.h,v 1.3 2005/07/01 22:43:08 daniels Exp $ */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/xpr.h,v 1.4 2003/11/12 20:21:52 torrey Exp $ */ - -#ifndef XPR_H -#define XPR_H - -#include "screenint.h" - -extern Bool QuartzModeBundleInit(void); - -void AppleDRIExtensionInit(void); -void xprAppleWMInit(void); -Bool xprInit(ScreenPtr pScreen); -Bool xprIsX11Window(void *nsWindow, int windowNumber); -void xprHideWindows(Bool hide); - -Bool QuartzInitCursor(ScreenPtr pScreen); -void QuartzSuspendXCursor(ScreenPtr pScreen); -void QuartzResumeXCursor(ScreenPtr pScreen, int x, int y); - -#endif /* XPR_H */ diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/xprAppleWM.c b/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/xprAppleWM.c deleted file mode 100644 index 2db6a2432..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/xprAppleWM.c +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Xplugin rootless implementation functions for AppleWM extension - */ -/* - * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. - * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/xprFrame.c,v 1.2 2003/06/30 01:45:13 torrey Exp $ */ - -#include "xpr.h" -#include "applewmExt.h" -#include "rootless.h" -#include "Xplugin.h" -#include - - -static int xprSetWindowLevel( - WindowPtr pWin, - int level) -{ - xp_window_id wid; - xp_window_changes wc; - - wid = (xp_window_id) RootlessFrameForWindow (pWin, TRUE); - if (wid == 0) - return BadWindow; - - RootlessStopDrawing (pWin, FALSE); - - wc.window_level = level; - if (xp_configure_window (wid, XP_WINDOW_LEVEL, &wc) != Success) { - return BadValue; - } - - return Success; -} - - -static int xprFrameDraw( - WindowPtr pWin, - int class, - unsigned int attr, - const BoxRec *outer, - const BoxRec *inner, - unsigned int title_len, - const unsigned char *title_bytes) -{ - xp_window_id wid; - - wid = (xp_window_id) RootlessFrameForWindow (pWin, FALSE); - if (wid == 0) - return BadWindow; - - if (xp_frame_draw (wid, class, attr, outer, inner, - title_len, title_bytes) != Success) - { - return BadValue; - } - - return Success; -} - - -static AppleWMProcsRec xprAppleWMProcs = { - xp_disable_update, - xp_reenable_update, - xprSetWindowLevel, - xp_frame_get_rect, - xp_frame_hit_test, - xprFrameDraw -}; - - -void xprAppleWMInit(void) -{ - AppleWMExtensionInit(&xprAppleWMProcs); -} diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/xprCursor.c b/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/xprCursor.c deleted file mode 100644 index ee06043df..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/xprCursor.c +++ /dev/null @@ -1,420 +0,0 @@ -/************************************************************** - * - * Xplugin cursor support - * - **************************************************************/ -/* - * Copyright (c) 2001 Torrey T. Lyons and Greg Parker. - * Copyright (c) 2002 Apple Computer, Inc. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/xprCursor.c,v 1.1 2003/04/30 23:15:42 torrey Exp $ */ - -#include "quartzCommon.h" -#include "xpr.h" -#include "darwin.h" -#include "Xplugin.h" - -#include "mi.h" -#include "scrnintstr.h" -#include "cursorstr.h" -#include "mipointrst.h" -#include "windowstr.h" -#include "globals.h" -#include "servermd.h" -#include "dixevents.h" - -typedef struct { - int cursorVisible; - QueryBestSizeProcPtr QueryBestSize; - miPointerSpriteFuncPtr spriteFuncs; -} QuartzCursorScreenRec, *QuartzCursorScreenPtr; - -static int darwinCursorScreenIndex = -1; -static unsigned long darwinCursorGeneration = 0; - -#define CURSOR_PRIV(pScreen) \ - ((QuartzCursorScreenPtr)pScreen->devPrivates[darwinCursorScreenIndex].ptr) - - -static Bool -load_cursor(CursorPtr src, int screen) -{ - uint32_t *data; - uint32_t rowbytes; - int width, height; - int hot_x, hot_y; - - uint32_t fg_color, bg_color; - uint8_t *srow, *sptr; - uint8_t *mrow, *mptr; - uint32_t *drow, *dptr; - unsigned xcount, ycount; - - xp_error err; - - width = src->bits->width; - height = src->bits->height; - hot_x = src->bits->xhot; - hot_y = src->bits->yhot; - -#ifdef ARGB_CURSOR - if (src->bits->argb != NULL) - { - rowbytes = src->bits->width * sizeof(CARD32); - data = (uint32_t *) src->bits->argb; - } - else -#endif - { - fg_color = 0xFF00 | (src->foreRed >> 8); - fg_color <<= 16; - fg_color |= src->foreGreen & 0xFF00; - fg_color |= src->foreBlue >> 8; - - bg_color = 0xFF00 | (src->backRed >> 8); - bg_color <<= 16; - bg_color |= src->backGreen & 0xFF00; - bg_color |= src->backBlue >> 8; - - fg_color = htonl(fg_color); - bg_color = htonl(bg_color); - - /* round up to 8 pixel boundary so we can convert whole bytes */ - rowbytes = ((src->bits->width * 4) + 31) & ~31; - data = alloca(rowbytes * src->bits->height); - - if (!src->bits->emptyMask) - { - ycount = src->bits->height; - srow = src->bits->source; mrow = src->bits->mask; - drow = data; - - while (ycount-- > 0) - { - xcount = (src->bits->width + 7) / 8; - sptr = srow; mptr = mrow; - dptr = drow; - - while (xcount-- > 0) - { - uint8_t s, m; - int i; - - s = *sptr++; m = *mptr++; - for (i = 0; i < 8; i++) - { -#if BITMAP_BIT_ORDER == MSBFirst - if (m & 128) - *dptr++ = (s & 128) ? fg_color : bg_color; - else - *dptr++ = 0; - s <<= 1; m <<= 1; -#else - if (m & 1) - *dptr++ = (s & 1) ? fg_color : bg_color; - else - *dptr++ = 0; - s >>= 1; m >>= 1; -#endif - } - } - - srow += BitmapBytePad(src->bits->width); - mrow += BitmapBytePad(src->bits->width); - drow = (uint32_t *) ((char *) drow + rowbytes); - } - } - else - { - memset(data, 0, src->bits->height * rowbytes); - } - } - - err = xp_set_cursor(width, height, hot_x, hot_y, data, rowbytes); - return err == Success; -} - - -/* -=========================================================================== - - Pointer sprite functions - -=========================================================================== -*/ - -/* - * QuartzRealizeCursor - * Convert the X cursor representation to native format if possible. - */ -static Bool -QuartzRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) -{ - if(pCursor == NULL || pCursor->bits == NULL) - return FALSE; - - /* FIXME: cache ARGB8888 representation? */ - - return TRUE; -} - - -/* - * QuartzUnrealizeCursor - * Free the storage space associated with a realized cursor. - */ -static Bool -QuartzUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) -{ - return TRUE; -} - - -/* - * QuartzSetCursor - * Set the cursor sprite and position. - */ -static void -QuartzSetCursor(ScreenPtr pScreen, CursorPtr pCursor, int x, int y) -{ - QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); - - if (!quartzServerVisible) - return; - - if (pCursor == NULL) - { - if (ScreenPriv->cursorVisible) - { - xp_hide_cursor(); - ScreenPriv->cursorVisible = FALSE; - } - } - else - { - load_cursor(pCursor, pScreen->myNum); - - if (!ScreenPriv->cursorVisible) - { - xp_show_cursor(); - ScreenPriv->cursorVisible = TRUE; - } - } -} - - -/* - * QuartzMoveCursor - * Move the cursor. This is a noop for us. - */ -static void -QuartzMoveCursor(ScreenPtr pScreen, int x, int y) -{ -} - - -static miPointerSpriteFuncRec quartzSpriteFuncsRec = { - QuartzRealizeCursor, - QuartzUnrealizeCursor, - QuartzSetCursor, - QuartzMoveCursor -}; - - -/* -=========================================================================== - - Pointer screen functions - -=========================================================================== -*/ - -/* - * QuartzCursorOffScreen - */ -static Bool -QuartzCursorOffScreen(ScreenPtr *pScreen, int *x, int *y) -{ - return FALSE; -} - - -/* - * QuartzCrossScreen - */ -static void -QuartzCrossScreen(ScreenPtr pScreen, Bool entering) -{ - return; -} - - -/* - * QuartzWarpCursor - * Change the cursor position without generating an event or motion history. - * The input coordinates (x,y) are in pScreen-local X11 coordinates. - * - */ -static void -QuartzWarpCursor(ScreenPtr pScreen, int x, int y) -{ - static Bool neverMoved = TRUE; - - if (neverMoved) - { - /* Don't move the cursor the first time. This is the - jump-to-center initialization, and it's annoying. */ - neverMoved = FALSE; - return; - } - - if (quartzServerVisible) - { - int sx, sy; - - sx = dixScreenOrigins[pScreen->myNum].x + darwinMainScreenX; - sy = dixScreenOrigins[pScreen->myNum].y + darwinMainScreenY; - - CGWarpMouseCursorPosition(CGPointMake(sx + x, sy + y)); - } - - miPointerWarpCursor(pScreen, x, y); - miPointerUpdate(); -} - - -static miPointerScreenFuncRec quartzScreenFuncsRec = { - QuartzCursorOffScreen, - QuartzCrossScreen, - QuartzWarpCursor, - DarwinEQPointerPost, - DarwinEQSwitchScreen -}; - - -/* -=========================================================================== - - Other screen functions - -=========================================================================== -*/ - -/* - * QuartzCursorQueryBestSize - * Handle queries for best cursor size - */ -static void -QuartzCursorQueryBestSize(int class, unsigned short *width, - unsigned short *height, ScreenPtr pScreen) -{ - QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); - - if (class == CursorShape) - { - /* FIXME: query window server? */ - *width = 32; - *height = 32; - } - else - { - (*ScreenPriv->QueryBestSize)(class, width, height, pScreen); - } -} - -/* - * QuartzInitCursor - * Initialize cursor support - */ -Bool -QuartzInitCursor(ScreenPtr pScreen) -{ - QuartzCursorScreenPtr ScreenPriv; - miPointerScreenPtr PointPriv; - - /* initialize software cursor handling (always needed as backup) */ - if (!miDCInitialize(pScreen, &quartzScreenFuncsRec)) - return FALSE; - - /* allocate private storage for this screen's QuickDraw cursor info */ - if (darwinCursorGeneration != serverGeneration) - { - if ((darwinCursorScreenIndex = AllocateScreenPrivateIndex()) < 0) - return FALSE; - - darwinCursorGeneration = serverGeneration; - } - - ScreenPriv = xcalloc(1, sizeof(QuartzCursorScreenRec)); - if (ScreenPriv == NULL) - return FALSE; - - CURSOR_PRIV(pScreen) = ScreenPriv; - - /* override some screen procedures */ - ScreenPriv->QueryBestSize = pScreen->QueryBestSize; - pScreen->QueryBestSize = QuartzCursorQueryBestSize; - - PointPriv = (miPointerScreenPtr) pScreen->devPrivates[miPointerScreenIndex].ptr; - - ScreenPriv->spriteFuncs = PointPriv->spriteFuncs; - PointPriv->spriteFuncs = &quartzSpriteFuncsRec; - - ScreenPriv->cursorVisible = TRUE; - return TRUE; -} - - -/* - * QuartzSuspendXCursor - * X server is hiding. Restore the Aqua cursor. - */ -void -QuartzSuspendXCursor(ScreenPtr pScreen) -{ -} - - -/* - * QuartzResumeXCursor - * X server is showing. Restore the X cursor. - */ -void -QuartzResumeXCursor(ScreenPtr pScreen, int x, int y) -{ - WindowPtr pWin; - CursorPtr pCursor; - - pWin = GetSpriteWindow(); - if (pWin->drawable.pScreen != pScreen) - return; - - pCursor = GetSpriteCursor(); - if (pCursor == NULL) - return; - - QuartzSetCursor(pScreen, pCursor, x, y); -} diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/xprFrame.c b/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/xprFrame.c deleted file mode 100644 index 7836091f6..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/xprFrame.c +++ /dev/null @@ -1,495 +0,0 @@ -/* - * Xplugin rootless implementation frame functions - */ -/* - * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. - * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/xpr/xprFrame.c,v 1.5 2005/07/01 22:43:08 daniels Exp $ */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/xprFrame.c,v 1.4 2003/11/12 20:21:52 torrey Exp $ */ - -#include "xpr.h" -#include "rootlessCommon.h" -#include "Xplugin.h" -#include "x-hash.h" -#include "x-list.h" -#include "applewmExt.h" - -#include "propertyst.h" -#include "dix.h" -#include -#include "windowstr.h" - -#include - -#define DEFINE_ATOM_HELPER(func,atom_name) \ -static Atom func (void) { \ - static int generation; \ - static Atom atom; \ - if (generation != serverGeneration) { \ - generation = serverGeneration; \ - atom = MakeAtom (atom_name, strlen (atom_name), TRUE); \ - } \ - return atom; \ -} - -DEFINE_ATOM_HELPER(xa_native_window_id, "_NATIVE_WINDOW_ID") - -/* Maps xp_window_id -> RootlessWindowRec */ -static x_hash_table *window_hash; -static pthread_mutex_t window_hash_mutex; - -static Bool no_configure_window; - - -static inline xp_error -xprConfigureWindow(xp_window_id id, unsigned int mask, - const xp_window_changes *values) -{ - if (!no_configure_window) - return xp_configure_window(id, mask, values); - else - return XP_Success; -} - - -static void -xprSetNativeProperty(RootlessWindowPtr pFrame) -{ - xp_error err; - unsigned int native_id; - long data; - - err = xp_get_native_window((xp_window_id) pFrame->wid, &native_id); - if (err == Success) - { - /* FIXME: move this to AppleWM extension */ - - data = native_id; - ChangeWindowProperty(pFrame->win, xa_native_window_id(), - XA_INTEGER, 32, PropModeReplace, 1, &data, TRUE); - } -} - - -/* - * Create and display a new frame. - */ -Bool -xprCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen, - int newX, int newY, RegionPtr pShape) -{ - WindowPtr pWin = pFrame->win; - xp_window_changes wc; - unsigned int mask = 0; - xp_error err; - - wc.x = newX; - wc.y = newY; - wc.width = pFrame->width; - wc.height = pFrame->height; - wc.bit_gravity = XP_GRAVITY_NONE; - mask |= XP_BOUNDS; - - if (pWin->drawable.depth == 8) - { - wc.depth = XP_DEPTH_INDEX8; -#if 0 - wc.colormap = xprColormapCallback; - wc.colormap_data = pScreen; - mask |= XP_COLORMAP; -#endif - } - else if (pWin->drawable.depth == 15) - wc.depth = XP_DEPTH_RGB555; - else if (pWin->drawable.depth == 24) - wc.depth = XP_DEPTH_ARGB8888; - else - wc.depth = XP_DEPTH_NIL; - mask |= XP_DEPTH; - - if (pShape != NULL) - { - wc.shape_nrects = REGION_NUM_RECTS(pShape); - wc.shape_rects = REGION_RECTS(pShape); - wc.shape_tx = wc.shape_ty = 0; - mask |= XP_SHAPE; - } - - err = xp_create_window(mask, &wc, (xp_window_id *) &pFrame->wid); - - if (err != Success) - { - return FALSE; - } - - if (window_hash == NULL) - { - window_hash = x_hash_table_new(NULL, NULL, NULL, NULL); - pthread_mutex_init(&window_hash_mutex, NULL); - } - - pthread_mutex_lock(&window_hash_mutex); - x_hash_table_insert(window_hash, pFrame->wid, pFrame); - pthread_mutex_unlock(&window_hash_mutex); - - xprSetNativeProperty(pFrame); - - return TRUE; -} - - -/* - * Destroy a frame. - */ -void -xprDestroyFrame(RootlessFrameID wid) -{ - pthread_mutex_lock(&window_hash_mutex); - x_hash_table_remove(window_hash, wid); - pthread_mutex_unlock(&window_hash_mutex); - - xp_destroy_window((xp_window_id) wid); -} - - -/* - * Move a frame on screen. - */ -void -xprMoveFrame(RootlessFrameID wid, ScreenPtr pScreen, int newX, int newY) -{ - xp_window_changes wc; - - wc.x = newX; - wc.y = newY; - - xprConfigureWindow((xp_window_id) wid, XP_ORIGIN, &wc); -} - - -/* - * Resize and move a frame. - */ -void -xprResizeFrame(RootlessFrameID wid, ScreenPtr pScreen, - int newX, int newY, unsigned int newW, unsigned int newH, - unsigned int gravity) -{ - xp_window_changes wc; - - wc.x = newX; - wc.y = newY; - wc.width = newW; - wc.height = newH; - wc.bit_gravity = gravity; - - /* It's unlikely that being async will save us anything here. - But it can't hurt. */ - - xprConfigureWindow((xp_window_id) wid, XP_BOUNDS, &wc); -} - - -/* - * Change frame stacking. - */ -void -xprRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid) -{ - xp_window_changes wc; - - /* Stack frame below nextWid it if it exists, or raise - frame above everything otherwise. */ - - if (nextWid == NULL) - { - wc.stack_mode = XP_MAPPED_ABOVE; - wc.sibling = 0; - } - else - { - wc.stack_mode = XP_MAPPED_BELOW; - wc.sibling = (xp_window_id) nextWid; - } - - xprConfigureWindow((xp_window_id) wid, XP_STACKING, &wc); -} - - -/* - * Change the frame's shape. - */ -void -xprReshapeFrame(RootlessFrameID wid, RegionPtr pShape) -{ - xp_window_changes wc; - - if (pShape != NULL) - { - wc.shape_nrects = REGION_NUM_RECTS(pShape); - wc.shape_rects = REGION_RECTS(pShape); - } - else - { - wc.shape_nrects = -1; - wc.shape_rects = NULL; - } - - wc.shape_tx = wc.shape_ty = 0; - - xprConfigureWindow((xp_window_id) wid, XP_SHAPE, &wc); -} - - -/* - * Unmap a frame. - */ -void -xprUnmapFrame(RootlessFrameID wid) -{ - xp_window_changes wc; - - wc.stack_mode = XP_UNMAPPED; - wc.sibling = 0; - - xprConfigureWindow((xp_window_id) wid, XP_STACKING, &wc); -} - - -/* - * Start drawing to a frame. - * Prepare for direct access to its backing buffer. - */ -void -xprStartDrawing(RootlessFrameID wid, char **pixelData, int *bytesPerRow) -{ - void *data[2]; - unsigned int rowbytes[2]; - xp_error err; - - err = xp_lock_window((xp_window_id) wid, NULL, NULL, data, rowbytes, NULL); - if (err != Success) - FatalError("Could not lock window %i for drawing.", (int) wid); - - *pixelData = data[0]; - *bytesPerRow = rowbytes[0]; -} - - -/* - * Stop drawing to a frame. - */ -void -xprStopDrawing(RootlessFrameID wid, Bool flush) -{ - xp_unlock_window((xp_window_id) wid, flush); -} - - -/* - * Flush drawing updates to the screen. - */ -void -xprUpdateRegion(RootlessFrameID wid, RegionPtr pDamage) -{ - xp_flush_window((xp_window_id) wid); -} - - -/* - * Mark damaged rectangles as requiring redisplay to screen. - */ -void -xprDamageRects(RootlessFrameID wid, int nrects, const BoxRec *rects, - int shift_x, int shift_y) -{ - xp_mark_window((xp_window_id) wid, nrects, rects, shift_x, shift_y); -} - - -/* - * Called after the window associated with a frame has been switched - * to a new top-level parent. - */ -void -xprSwitchWindow(RootlessWindowPtr pFrame, WindowPtr oldWin) -{ - DeleteProperty(oldWin, xa_native_window_id()); - - xprSetNativeProperty(pFrame); -} - - -/* - * Called to check if the frame should be reordered when it is restacked. - */ -Bool xprDoReorderWindow(RootlessWindowPtr pFrame) -{ - WindowPtr pWin = pFrame->win; - - return AppleWMDoReorderWindow(pWin); -} - - -/* - * Copy area in frame to another part of frame. - * Used to accelerate scrolling. - */ -void -xprCopyWindow(RootlessFrameID wid, int dstNrects, const BoxRec *dstRects, - int dx, int dy) -{ - xp_copy_window((xp_window_id) wid, (xp_window_id) wid, - dstNrects, dstRects, dx, dy); -} - - -static RootlessFrameProcsRec xprRootlessProcs = { - xprCreateFrame, - xprDestroyFrame, - xprMoveFrame, - xprResizeFrame, - xprRestackFrame, - xprReshapeFrame, - xprUnmapFrame, - xprStartDrawing, - xprStopDrawing, - xprUpdateRegion, - xprDamageRects, - xprSwitchWindow, - xprDoReorderWindow, - xp_copy_bytes, - xp_fill_bytes, - xp_composite_pixels, - xprCopyWindow -}; - - -/* - * Initialize XPR implementation - */ -Bool -xprInit(ScreenPtr pScreen) -{ - RootlessInit(pScreen, &xprRootlessProcs); - - rootless_CopyBytes_threshold = xp_copy_bytes_threshold; - rootless_FillBytes_threshold = xp_fill_bytes_threshold; - rootless_CompositePixels_threshold = xp_composite_area_threshold; - rootless_CopyWindow_threshold = xp_scroll_area_threshold; - - no_configure_window = FALSE; - - return TRUE; -} - - -/* - * Given the id of a physical window, try to find the top-level (or root) - * X window that it represents. - */ -static WindowPtr -xprGetXWindow(xp_window_id wid) -{ - RootlessWindowRec *winRec; - - if (window_hash == NULL) - return NULL; - - winRec = x_hash_table_lookup(window_hash, (void *) wid, NULL); - - return winRec != NULL ? winRec->win : NULL; -} - - -/* - * The windowNumber is an AppKit window number. Returns TRUE if xpr is - * displaying a window with that number. - */ -Bool -xprIsX11Window(void *nsWindow, int windowNumber) -{ - Bool ret; - xp_window_id wid; - - if (window_hash == NULL) - return FALSE; - - /* need to lock, since this function can be called by any thread */ - - pthread_mutex_lock(&window_hash_mutex); - - if (xp_lookup_native_window(windowNumber, &wid)) - ret = xprGetXWindow(wid) != NULL; - else - ret = FALSE; - - pthread_mutex_unlock(&window_hash_mutex); - - return ret; -} - - -/* - * xprHideWindows - * Hide or unhide all top level windows. This is called for application hide/ - * unhide events if the window manager is not Apple-WM aware. Xplugin windows - * do not hide or unhide themselves. - */ -void -xprHideWindows(Bool hide) -{ - int screen; - WindowPtr pRoot, pWin; - - for (screen = 0; screen < screenInfo.numScreens; screen++) { - pRoot = WindowTable[screenInfo.screens[screen]->myNum]; - RootlessFrameID prevWid = NULL; - - for (pWin = pRoot->firstChild; pWin; pWin = pWin->nextSib) { - RootlessWindowRec *winRec = WINREC(pWin); - - if (winRec != NULL) { - if (hide) { - xprUnmapFrame(winRec->wid); - } else { - BoxRec box; - - xprRestackFrame(winRec->wid, prevWid); - prevWid = winRec->wid; - - box.x1 = 0; - box.y1 = 0; - box.x2 = winRec->width; - box.y2 = winRec->height; - - xprDamageRects(winRec->wid, 1, &box, 0, 0); - RootlessQueueRedisplay(screenInfo.screens[screen]); - } - } - } - } -} diff --git a/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/xprScreen.c b/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/xprScreen.c deleted file mode 100644 index ba89fd38f..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/quartz/xpr/xprScreen.c +++ /dev/null @@ -1,417 +0,0 @@ -/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/xpr/xprScreen.c,v 1.6 2005/07/01 22:43:08 daniels Exp $ */ -/* - * Xplugin rootless implementation screen functions - */ -/* - * Copyright (c) 2002 Apple Computer, Inc. All Rights Reserved. - * Copyright (c) 2004 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/xprScreen.c,v 1.11 2004/07/15 18:53:25 torrey Exp $ */ - -#include "quartzCommon.h" -#include "quartz.h" -#include "xpr.h" -#include "pseudoramiX.h" -#include "darwin.h" -#include "rootless.h" -#include "safeAlpha.h" -#include "dri.h" -#include "globals.h" -#include "Xplugin.h" -#include "applewmExt.h" - -#ifdef DAMAGE -# include "damage.h" -#endif - -// Name of GLX bundle for native OpenGL -static const char *xprOpenGLBundle = "glxCGL.bundle"; - - -/* - * eventHandler - * Callback handler for Xplugin events. - */ -static void -eventHandler(unsigned int type, const void *arg, - unsigned int arg_size, void *data) -{ - switch (type) - { - case XP_EVENT_DISPLAY_CHANGED: - QuartzMessageServerThread(kXDarwinDisplayChanged, 0); - break; - - case XP_EVENT_WINDOW_STATE_CHANGED: - if (arg_size >= sizeof(xp_window_state_event)) - { - const xp_window_state_event *ws_arg = arg; - - QuartzMessageServerThread(kXDarwinWindowState, 2, - ws_arg->id, ws_arg->state); - } - break; - - case XP_EVENT_WINDOW_MOVED: - if (arg_size == sizeof(xp_window_id)) - { - xp_window_id id = * (xp_window_id *) arg; - - QuartzMessageServerThread(kXDarwinWindowMoved, 1, id); - } - break; - - case XP_EVENT_SURFACE_DESTROYED: - case XP_EVENT_SURFACE_CHANGED: - if (arg_size == sizeof(xp_surface_id)) - { - int kind; - - if (type == XP_EVENT_SURFACE_DESTROYED) - kind = AppleDRISurfaceNotifyDestroyed; - else - kind = AppleDRISurfaceNotifyChanged; - - DRISurfaceNotify(*(xp_surface_id *) arg, kind); - } - break; - } -} - - -/* - * displayScreenBounds - * Return the display ID for a particular display index. - */ -static CGDirectDisplayID -displayAtIndex(int index) -{ - CGError err; - CGDisplayCount cnt; - CGDirectDisplayID dpy[index+1]; - - err = CGGetActiveDisplayList(index + 1, dpy, &cnt); - if (err == kCGErrorSuccess && cnt == index + 1) - return dpy[index]; - else - return kCGNullDirectDisplay; -} - - -/* - * displayScreenBounds - * Return the bounds of a particular display. - */ -static CGRect -displayScreenBounds(CGDirectDisplayID id) -{ - CGRect frame; - - frame = CGDisplayBounds(id); - - /* Remove menubar to help standard X11 window managers. */ - - if (frame.origin.x == 0 && frame.origin.y == 0) - { - frame.origin.y += aquaMenuBarHeight; - frame.size.height -= aquaMenuBarHeight; - } - - return frame; -} - - -/* - * xprAddPseudoramiXScreens - * Add a single virtual screen encompassing all the physical screens - * with PseudoramiX. - */ -static void -xprAddPseudoramiXScreens(int *x, int *y, int *width, int *height) -{ - CGDisplayCount i, displayCount; - CGDirectDisplayID *displayList = NULL; - CGRect unionRect = CGRectNull, frame; - - // Find all the CoreGraphics displays - CGGetActiveDisplayList(0, NULL, &displayCount); - displayList = xalloc(displayCount * sizeof(CGDirectDisplayID)); - CGGetActiveDisplayList(displayCount, displayList, &displayCount); - - /* Get the union of all screens */ - for (i = 0; i < displayCount; i++) - { - CGDirectDisplayID dpy = displayList[i]; - frame = displayScreenBounds(dpy); - unionRect = CGRectUnion(unionRect, frame); - } - - /* Use unionRect as the screen size for the X server. */ - *x = unionRect.origin.x; - *y = unionRect.origin.y; - *width = unionRect.size.width; - *height = unionRect.size.height; - - /* Tell PseudoramiX about the real screens. */ - for (i = 0; i < displayCount; i++) - { - CGDirectDisplayID dpy = displayList[i]; - - frame = displayScreenBounds(dpy); - - ErrorF("PseudoramiX screen %d added: %dx%d @ (%d,%d).\n", i, - (int)frame.size.width, (int)frame.size.height, - (int)frame.origin.x, (int)frame.origin.y); - - frame.origin.x -= unionRect.origin.x; - frame.origin.y -= unionRect.origin.y; - - ErrorF("PseudoramiX screen %d placed at X11 coordinate (%d,%d).\n", - i, (int)frame.origin.x, (int)frame.origin.y); - - PseudoramiXAddScreen(frame.origin.x, frame.origin.y, - frame.size.width, frame.size.height); - } - - xfree(displayList); -} - - -/* - * xprDisplayInit - * Find number of CoreGraphics displays and initialize Xplugin. - */ -static void -xprDisplayInit(void) -{ - CGDisplayCount displayCount; - - ErrorF("Display mode: Rootless Quartz -- Xplugin implementation\n"); - - CGGetActiveDisplayList(0, NULL, &displayCount); - - /* With PseudoramiX, the X server only sees one screen; only PseudoramiX - itself knows about all of the screens. */ - - if (noPseudoramiXExtension) - darwinScreensFound = displayCount; - else - darwinScreensFound = 1; - - if (xp_init(XP_IN_BACKGROUND) != Success) - { - FatalError("Could not initialize the Xplugin library."); - } - - xp_select_events(XP_EVENT_DISPLAY_CHANGED - | XP_EVENT_WINDOW_STATE_CHANGED - | XP_EVENT_WINDOW_MOVED - | XP_EVENT_SURFACE_CHANGED - | XP_EVENT_SURFACE_DESTROYED, - eventHandler, NULL); - - AppleDRIExtensionInit(); - xprAppleWMInit(); -} - - -/* - * xprAddScreen - * Init the framebuffer and record pixmap parameters for the screen. - */ -static Bool -xprAddScreen(int index, ScreenPtr pScreen) -{ - DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen); - - /* If no specific depth chosen, look for the depth of the main display. - Else if 16bpp specified, use that. Else use 32bpp. */ - - dfb->colorType = TrueColor; - dfb->bitsPerComponent = 8; - dfb->bitsPerPixel = 32; - dfb->colorBitsPerPixel = 24; - - if (darwinDesiredDepth == -1) - { - dfb->bitsPerComponent = CGDisplayBitsPerSample(kCGDirectMainDisplay); - dfb->bitsPerPixel = CGDisplayBitsPerPixel(kCGDirectMainDisplay); - dfb->colorBitsPerPixel = - CGDisplaySamplesPerPixel(kCGDirectMainDisplay) * - dfb->bitsPerComponent; - } - else if (darwinDesiredDepth == 15) - { - dfb->bitsPerComponent = 5; - dfb->bitsPerPixel = 16; - dfb->colorBitsPerPixel = 15; - } - else if (darwinDesiredDepth == 8) - { - dfb->colorType = PseudoColor; - dfb->bitsPerComponent = 8; - dfb->bitsPerPixel = 8; - dfb->colorBitsPerPixel = 8; - } - - if (noPseudoramiXExtension) - { - CGDirectDisplayID dpy; - CGRect frame; - - dpy = displayAtIndex(index); - - frame = displayScreenBounds(dpy); - - dfb->x = frame.origin.x; - dfb->y = frame.origin.y; - dfb->width = frame.size.width; - dfb->height = frame.size.height; - } - else - { - xprAddPseudoramiXScreens(&dfb->x, &dfb->y, &dfb->width, &dfb->height); - } - - /* Passing zero width (pitch) makes miCreateScreenResources set the - screen pixmap to the framebuffer pointer, i.e. NULL. The generic - rootless code takes care of making this work. */ - dfb->pitch = 0; - dfb->framebuffer = NULL; - - DRIScreenInit(pScreen); - - return TRUE; -} - - -/* - * xprSetupScreen - * Setup the screen for rootless access. - */ -static Bool -xprSetupScreen(int index, ScreenPtr pScreen) -{ - // Add alpha protecting replacements for fb screen functions - pScreen->PaintWindowBackground = SafeAlphaPaintWindow; - pScreen->PaintWindowBorder = SafeAlphaPaintWindow; - -#ifdef RENDER - { - PictureScreenPtr ps = GetPictureScreen(pScreen); - ps->Composite = SafeAlphaComposite; - } -#endif /* RENDER */ - - // Initialize accelerated rootless drawing - // Note that this must be done before DamageSetup(). - RootlessAccelInit(pScreen); - -#ifdef DAMAGE - // The Damage extension needs to wrap underneath the - // generic rootless layer, so do it now. - if (!DamageSetup(pScreen)) - return FALSE; -#endif - - // Initialize generic rootless code - if (!xprInit(pScreen)) - return FALSE; - - return DRIFinishScreenInit(pScreen); -} - - -/* - * xprUpdateScreen - * Update screen after configuation change. - */ -static void -xprUpdateScreen(ScreenPtr pScreen) -{ - rootlessGlobalOffsetX = darwinMainScreenX; - rootlessGlobalOffsetY = darwinMainScreenY; - - AppleWMSetScreenOrigin(WindowTable[pScreen->myNum]); - - RootlessRepositionWindows(pScreen); - RootlessUpdateScreenPixmap(pScreen); -} - - -/* - * xprInitInput - * Finalize xpr specific setup. - */ -static void -xprInitInput(int argc, char **argv) -{ - int i; - - rootlessGlobalOffsetX = darwinMainScreenX; - rootlessGlobalOffsetY = darwinMainScreenY; - - for (i = 0; i < screenInfo.numScreens; i++) - AppleWMSetScreenOrigin(WindowTable[i]); -} - - -/* - * Quartz display mode function list. - */ -static QuartzModeProcsRec xprModeProcs = { - xprDisplayInit, - xprAddScreen, - xprSetupScreen, - xprInitInput, - QuartzInitCursor, - NULL, // No need to update cursor - QuartzSuspendXCursor, - QuartzResumeXCursor, - NULL, // No capture or release in rootless mode - NULL, - NULL, // Xplugin sends screen change events directly - xprAddPseudoramiXScreens, - xprUpdateScreen, - xprIsX11Window, - xprHideWindows, - RootlessFrameForWindow, - TopLevelParent, - DRICreateSurface, - DRIDestroySurface -}; - - -/* - * QuartzModeBundleInit - * Initialize the display mode bundle after loading. - */ -Bool -QuartzModeBundleInit(void) -{ - quartzProcs = &xprModeProcs; - quartzOpenGLBundle = xprOpenGLBundle; - return TRUE; -} diff --git a/nx-X11/programs/Xserver/hw/darwin/utils/Imakefile b/nx-X11/programs/Xserver/hw/darwin/utils/Imakefile deleted file mode 100644 index b6ad53d8b..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/utils/Imakefile +++ /dev/null @@ -1,10 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/darwin/utils/Imakefile,v 1.2 2000/11/16 03:22:18 dawes Exp $ - - SRCS = dumpkeymap.c - OBJS = dumpkeymap.o -EXTRA_LOAD_FLAGS = -framework IOKit - -AllTarget(ProgramTargetName(dumpkeymap)) - -SimpleProgramTarget(dumpkeymap) - diff --git a/nx-X11/programs/Xserver/hw/darwin/utils/README.txt b/nx-X11/programs/Xserver/hw/darwin/utils/README.txt deleted file mode 100644 index fb6d4399e..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/utils/README.txt +++ /dev/null @@ -1,111 +0,0 @@ -dumpkeymap - Diagnostic dump and detailed description of .keymapping files -Version 4 - -Copyright (C)1999,2000 by Eric Sunshine -Eric Sunshine, 1 December 2000 - -OVERVIEW -======== -This package contains the diagnostic utility dumpkeymap, as well as highly -detailed documentation describing the internal layout of the Apple/NeXT -.keymapping file. - -The dumpkeymap utility displays detailed information about each .keymapping -file mentioned on the command-line. On Apple and NeXT platforms, if no -.keymapping files are mentioned on the command-line, then it will instead -dissect the key mapping currently in use by the WindowServer and AppKit. - -Documentation includes a thorough and detailed description of the internal -layout of the .keymapping file, as well as an explanation of how to interpret -the output of dumpkeymap. - -The complete set of documentation is available for perusal via dumpkeymap's -manual page (dumpkeymap.1), as well as via the command-line options described -below. - - --help - Usage summary. - --help-keymapping - Detailed discussion of the internal format of a .keymapping file. - --help-output - Explanation of dumpkeymap's output. - --help-files - List of key mapping-related files and directories. - --help-diagnostics - Explanation of diagnostic messages. - -Once the manual page is been installed, documentation can also be accessed -with the Unix `man' command: - - % man dumpkeymap - - -COMPILATION -=========== -MacOS/X, Darwin - - cc -Wall -o dumpkeymap dumpkeymap.c -framework IOKit - -MacOS/X DP4 (Developer Preview 4) - - cc -Wall -o dumpkeymap dumpkeymap.c -FKernel -framework IOKit - -MacOS/X Server, OpenStep, NextStep - - cc -Wall -o dumpkeymap dumpkeymap.c - -By default, dumpkeymap is configured to interface with the HID driver (Apple) -or event-status driver (NeXT), thus allowing it to dump the key mapping which -is currently in use by the WindowServer and AppKit. However, these facilities -are specific to Apple/NeXT. In order to build dumpkeymap for non-Apple/NeXT -platforms, you must define the DUMPKEYMAP_FILE_ONLY flag when compiling the -program. This flag inhibits use of the HID and event-status drivers and -configures dumpkeymap to work strictly with raw key mapping files. - -For example, to compile for Linux: - - gcc -Wall -DDUMPKEYMAP_FILE_ONLY -o dumpkeymap dumpkeymap.c - - -INSTALLATION -============ -Install the dumpkeymap executable image in a location mentioned in the PATH -environment variable. Typicall locations for executable files are: - - /usr/local/bin - $(HOME)/bin - -Install the manual page, dumpkeymap.1, in the `man1' subdirectory one of the -standard manual page locations or in any other location mentioned by the -MANPATH environment variable. - -Typical locations for manual pages on most Unix platforms are: - - /usr/local/man/man1 - -Typical locations for manual pages on MacOS/X, Darwin, and MacOS/X Server are: - - /usr/local/man/man1 - /Local/Documentation/ManPages/man1 - /Network/Documentation/ManPages/man1 - -Typical locations for manual pages on OpenStep and NextStep are: - - /usr/local/man/man1 - /LocalLibrary/Documentation/ManPages/man1 - /LocalDeveloper/Documentation/ManPages/man1 - - -CONCLUSION -========== -This program and its accompanying documentation were written by Eric Sunshine -and are copyright (C)1999,2000 by Eric Sunshine . - -The implementation of dumpkeymap is based upon information gathered on -September 3, 1997 by Eric Sunshine and Paul S. -McCarthy during an effort to reverse engineer the format -of the NeXT .keymapping file. - - - -$XFree86: xc/programs/Xserver/hw/darwin/utils/README.txt,v 1.1 2000/12/01 19:47:39 dawes Exp $ diff --git a/nx-X11/programs/Xserver/hw/darwin/utils/dumpkeymap.c b/nx-X11/programs/Xserver/hw/darwin/utils/dumpkeymap.c deleted file mode 100644 index 8f3340b15..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/utils/dumpkeymap.c +++ /dev/null @@ -1,1454 +0,0 @@ -// $XFree86: dumpkeymap.c,v 1.3 2000/12/05 21:18:34 dawes Exp $ -//============================================================================= -// -// Copyright (C) 1999,2000 by Eric Sunshine -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN -// NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -//============================================================================= -//----------------------------------------------------------------------------- -// dumpkeymap.c -// -// Prints a textual representation of each Apple/NeXT .keymapping file -// mentioned on the command-line. If no files are mentioned and if the -// local machine is an Apple or NeXT installation, then the key mapping -// currently in use by the WindowServer and the AppKit is printed -// instead. -// -// Invoke dumpkeymap with one of the options listed below in order to -// view detailed documentation about .keymapping files and the use of -// this program. -// -// --help: Usage summary. -// --help-keymapping: Detailed discussion of the internal format of a -// .keymapping file. -// --help-output: Explanation of dumpkeymap's output. -// --help-files: List of key mapping-related files and directories. -// --help-diagnostics: Explanation of diagnostic messages. -// -// COMPILATION INSTRUCTIONS -// -// MacOS/X, Darwin -// cc -Wall -o dumpkeymap dumpkeymap.c -framework IOKit -// -// MacOS/X DP4 (Developer Preview 4) -// cc -Wall -o dumpkeymap dumpkeymap.c -FKernel -framework IOKit -// -// MacOS/X Server, OpenStep, NextStep -// cc -Wall -o dumpkeymap dumpkeymap.c -// -// By default, dumpkeymap is configured to interface with the HID driver -// (Apple) or event-status driver (NeXT), thus allowing it to dump the -// key mapping which is currently in use by the WindowServer and AppKit. -// However, these facilities are specific to Apple/NeXT. In order to -// build dumpkeymap for non-Apple/NeXT platforms, you must define the -// DUMPKEYMAP_FILE_ONLY flag when compiling the program. This flag -// inhibits use of the HID and event-status drivers and configures -// dumpkeymap to work strictly with raw key mapping files. -// -// For example, to compile for Linux: -// gcc -Wall -DDUMPKEYMAP_FILE_ONLY -o dumpkeymap dumpkeymap.c -// -// CONCLUSION -// -// This program and its accompanying documentation were written by Eric -// Sunshine and are copyright (C)1999,2000 by Eric Sunshine -// . -// -// The implementation of dumpkeymap is based upon information gathered -// on September 3, 1997 by Eric Sunshine and -// Paul S. McCarthy during an effort to reverse -// engineer the format of the NeXT .keymapping file. -// -// HISTORY -// -// v4 2000/12/01 Eric Sunshine -// Updated manual page to work with `rman', the `man' to `HTML' -// translator. Unfortunately, however, rman is missing important -// roff features such as diversions, indentation, and tab stops, -// and is also hideously buggy, so getting the manual to work with -// rman required quite a few work-arounds. -// The manual page has now been tested with nroff (plain text), troff -// (PostScript, etc.), groff (PostScript), and rman (HTML, etc.) -// -// v3 2000/11/28 Eric Sunshine -// Considerably expanded the documentation. -// Augmented the existing description of .keymapping internals. -// Added these new documentation topics: -// - Output: Very important section describing how to interpret -// the output of dumpkeymap. -// - Files: Lists files and directories related to key mappings. -// - Diagnostics: Explains diagnostic messages issued by -// dumpkeymap. -// Created a manual page (dumpkeymap.1) which contains the complete -// set of documentation for key mapping files and dumpkeymap. -// Added command-line options (--help, --help-keymapping, -// --help-output, --help-files, --help-diagnostics) which allow -// access to all key mapping documentation. Previously the -// description of the internal layout of a .keymapping file was -// only available as source code comments. -// Added --version option. -// Ported to non-Apple/NeXT platforms. Defining the pre-processor -// flag DUMPKEYMAP_FILE_ONLY at compilation time inhibits use of -// Apple/NeXT-specific API. -// Added a README file. -// -// v2 2000/11/13 Eric Sunshine -// Converted from C++ to plain-C. -// Now parses and takes into account the "number-size" flag stored -// with each key map. This flag indicates the size, in bytes, of -// all remaining numeric values in the mapping. Updated all code -// to respect this flag. (Previously, the purpose of this field -// was unknown, and it was thus denoted as -// `KeyMapping::fill[2]'.) -// Updated all documentation; especially the "KEY MAPPING -// DESCRIPTION" section. Added discussion of the "number-size" -// flag and revamped all structure definitions to use the generic -// data type `number' instead of `uchar' or 'byte'. Clarified -// several sections of the documentation and added missing -// discussions about type definitions and the relationship of -// `interface' and `handler_id' to .keymapping and .keyboard -// files. -// Updated compilation instructions to include directions for all -// platforms on which this program might be built. -// Now published under the formal BSD license rather than a -// home-grown license. -// -// v1 1999/09/08 Eric Sunshine -// Created. -//----------------------------------------------------------------------------- -#include -#include -#include -#include -#include -#if !defined(DUMPKEYMAP_FILE_ONLY) -#include -#endif - -#define PROG_NAME "dumpkeymap" -#define PROG_VERSION "4" -#define AUTHOR_NAME "Eric Sunshine" -#define AUTHOR_EMAIL "sunshine@sunshineco.com" -#define AUTHOR_INFO AUTHOR_NAME " <" AUTHOR_EMAIL ">" -#define COPYRIGHT "Copyright (C) 1999,2000 by " AUTHOR_INFO - -typedef unsigned char byte; -typedef unsigned short word; -typedef unsigned int natural; -typedef unsigned long dword; -typedef dword number; - -#define ASCII_SET 0x00 -#define BIND_FUNCTION 0xfe -#define BIND_SPECIAL 0xff - -#define OPT_SWITCH(X) { char const* switched_str__=(X); if (0) { -#define OPT_CASE(X,Y) } else if (strcmp(switched_str__,(#X)) == 0 || \ - strcmp(switched_str__,(#Y)) == 0) { -#define OPT_DEFAULT } else { -#define OPT_SWITCH_END }} - -//----------------------------------------------------------------------------- -// Translation Tables -//----------------------------------------------------------------------------- -static char const* const SPECIAL_CODE[] = - { - "sound-up", - "sound-down", - "brightness-up", - "brightness-down", - "alpha-lock", - "help", - "power", - "secondary-up-arrow", - "secondary-down-arrow" - }; -#define N_SPECIAL_CODE (sizeof(SPECIAL_CODE) / sizeof(SPECIAL_CODE[0])) - -static char const* const MODIFIER_CODE[] = - { - "alpha-lock", - "shift", - "control", - "alternate", - "command", - "keypad", - "help" - }; -#define N_MODIFIER_CODE (sizeof(MODIFIER_CODE) / sizeof(MODIFIER_CODE[0])) - -static char const* const MODIFIER_MASK[] = - { - "-----", // R = carriage-return - "----L", // A = alternate - "---S-", // C = control - "---SL", // S = shift - "--C--", // L = alpha-lock - "--C-L", - "--CS-", - "--CSL", - "-A---", - "-A--L", - "-A-S-", - "-A-SL", - "-AC--", - "-AC-L", - "-ACS-", - "-ACSL", - "R----", - "R---L", - "R--S-", - "R--SL", - "R-C--", - "R-C-L", - "R-CS-", - "R-CSL", - "RA---", - "RA--L", - "RA-S-", - "RA-SL", - "RAC--", - "RAC-L", - "RACS-", - "RACSL", - }; -#define N_MODIFIER_MASK (sizeof(MODIFIER_MASK) / sizeof(MODIFIER_MASK[0])) - -#define FUNCTION_KEY_FIRST 0x20 -static char const* const FUNCTION_KEY[] = - { - "F1", // 0x20 - "F2", // 0x21 - "F3", // 0x22 - "F4", // 0x23 - "F5", // 0x24 - "F6", // 0x25 - "F7", // 0x26 - "F8", // 0x27 - "F9", // 0x28 - "F10", // 0x29 - "F11", // 0x2a - "F12", // 0x2b - "insert", // 0x2c - "delete", // 0x2d - "home", // 0x2e - "end", // 0x2f - "page up", // 0x30 - "page down", // 0x31 - "print screen", // 0x32 - "scroll lock", // 0x33 - "pause", // 0x34 - "sys-request", // 0x35 - "break", // 0x36 - "reset (HIL)", // 0x37 - "stop (HIL)", // 0x38 - "menu (HIL)", // 0x39 - "user (HIL)", // 0x3a - "system (HIL)", // 0x3b - "print (HIL)", // 0x3c - "clear line (HIL)", // 0x3d - "clear display (HIL)", // 0x3e - "insert line (HIL)", // 0x3f - "delete line (HIL)", // 0x40 - "insert char (HIL)", // 0x41 - "delete char (HIL)", // 0x42 - "prev (HIL)", // 0x43 - "next (HIL)", // 0x44 - "select (HIL)", // 0x45 - }; -#define N_FUNCTION_KEY (sizeof(FUNCTION_KEY) / sizeof(FUNCTION_KEY[0])) - - -//----------------------------------------------------------------------------- -// Data Stream Object -// Can be configured to treat embedded "numbers" as being composed of -// either 1, 2, or 4 bytes, apiece. -//----------------------------------------------------------------------------- -typedef struct _DataStream - { - byte const* data; - byte const* data_end; - natural number_size; // Size in bytes of a "number" in the stream. - } DataStream; - -static DataStream* new_data_stream( byte const* data, int size ) - { - DataStream* s = (DataStream*)malloc( sizeof(DataStream) ); - s->data = data; - s->data_end = data + size; - s->number_size = 1; // Default to byte-sized numbers. - return s; - } - -static void destroy_data_stream( DataStream* s ) - { - free(s); - } - -static int end_of_stream( DataStream* s ) - { - return (s->data >= s->data_end); - } - -static void expect_nbytes( DataStream* s, int nbytes ) - { - if (s->data + nbytes > s->data_end) - { - fputs( "Insufficient data in keymapping data stream.\n", stderr ); - exit(-1); - } - } - -static byte get_byte( DataStream* s ) - { - expect_nbytes( s, 1 ); - return *s->data++; - } - -static word get_word( DataStream* s ) - { - word hi, lo; - expect_nbytes( s, 2 ); - hi = *s->data++; - lo = *s->data++; - return ((hi << 8) | lo); - } - -static dword get_dword( DataStream* s ) - { - dword b1, b2, b3, b4; - expect_nbytes( s, 4 ); - b4 = *s->data++; - b3 = *s->data++; - b2 = *s->data++; - b1 = *s->data++; - return ((b4 << 24) | (b3 << 16) | (b2 << 8) | b1); - } - -static number get_number( DataStream* s ) - { - switch (s->number_size) - { - case 4: return get_dword(s); - case 2: return get_word(s); - default: return get_byte(s); - } - } - - -//----------------------------------------------------------------------------- -// Translation Utility Functions -//----------------------------------------------------------------------------- -static char const* special_code_desc( number n ) - { - if (n < N_SPECIAL_CODE) - return SPECIAL_CODE[n]; - else - return "invalid"; - } - -static char const* modifier_code_desc( number n ) - { - if (n < N_MODIFIER_CODE) - return MODIFIER_CODE[n]; - else - return "invalid"; - } - -static char const* modifier_mask_desc( number n ) - { - if (n < N_MODIFIER_MASK) - return MODIFIER_MASK[n]; - else - return "?????"; - } - -static char const* function_key_desc( number n ) - { - if (n >= FUNCTION_KEY_FIRST && n < N_FUNCTION_KEY + FUNCTION_KEY_FIRST) - return FUNCTION_KEY[ n - FUNCTION_KEY_FIRST ]; - else - return "unknown"; - } - -static number bits_set( number mask ) - { - number n = 0; - for ( ; mask != 0; mask >>= 1) - if ((mask & 0x01) != 0) - n++; - return n; - } - - -//----------------------------------------------------------------------------- -// Unparse a list of Modifier records. -//----------------------------------------------------------------------------- -static void unparse_modifiers( DataStream* s ) - { - number nmod = get_number(s); // Modifier count - printf( "MODIFIERS [%lu]\n", nmod ); - while (nmod-- > 0) - { - number nscan; - number const code = get_number(s); - printf( "%s:", modifier_code_desc(code) ); - nscan = get_number(s); - while (nscan-- > 0) - printf( " 0x%02x", (natural)get_number(s) ); - putchar( '\n' ); - } - putchar( '\n' ); - } - - -//----------------------------------------------------------------------------- -// Unparse a list of Character records. -//----------------------------------------------------------------------------- -typedef void (*UnparseSpecialFunc)( number code ); - -static void unparse_char_codes( - DataStream* s, number ncodes, UnparseSpecialFunc unparse_special ) - { - if (ncodes != 0) - { - while (ncodes-- > 0) - { - number const char_set = get_number(s); - number const code = get_number(s); - putchar(' '); - switch (char_set) - { - case ASCII_SET: - { - int const c = (int)code; - if (isprint(c)) - printf( "\"%c\"", c ); - else if (code < ' ') - printf( "\"^%c\"", c + '@' ); - else - printf( "%02x", c ); - break; - } - case BIND_FUNCTION: - printf( "[%s]", function_key_desc(code) ); - break; - case BIND_SPECIAL: - unparse_special( code ); - break; - default: - printf( "%02x/%02x", (natural)char_set, (natural)code ); - break; - } - } - } - } - - -//----------------------------------------------------------------------------- -// Unparse a list of scan code bindings. -//----------------------------------------------------------------------------- -static void unparse_key_special( number code ) - { - printf( "{seq#%lu}", code ); - } - -static void unparse_characters( DataStream* s ) - { - number const NOT_BOUND = 0xff; - number const nscans = get_number(s); - number scan; - printf( "CHARACTERS [%lu]\n", nscans ); - for (scan = 0; scan < nscans; scan++) - { - number const mask = get_number(s); - printf( "scan 0x%02x: ", (natural)scan ); - if (mask == NOT_BOUND) - fputs( "not-bound\n", stdout ); - else - { - number const bits = bits_set( mask ); - number const codes = 1 << bits; - printf( "%s ", modifier_mask_desc(mask) ); - unparse_char_codes( s, codes, unparse_key_special ); - putchar( '\n' ); - } - } - putchar( '\n' ); - } - - -//----------------------------------------------------------------------------- -// Unparse a list of key sequences. -//----------------------------------------------------------------------------- -static void unparse_sequence_special( number code ) - { - printf( "{%s}", (code == 0 ? "unmodify" : modifier_code_desc(code)) ); - } - -static void unparse_sequences( DataStream* s ) - { - number const nseqs = get_number(s); - number seq; - printf( "SEQUENCES [%lu]\n", nseqs ); - for (seq = 0; seq < nseqs; seq++) - { - number const nchars = get_number(s); - printf( "sequence %lu:", seq ); - unparse_char_codes( s, nchars, unparse_sequence_special ); - putchar( '\n' ); - } - putchar( '\n' ); - } - - -//----------------------------------------------------------------------------- -// Unparse a list of special keys. -//----------------------------------------------------------------------------- -static void unparse_specials( DataStream* s ) - { - number nspecials = get_number(s); - printf( "SPECIALS [%lu]\n", nspecials ); - while (nspecials-- > 0) - { - number const special = get_number(s); - number const scan = get_number(s); - printf( "%s: 0x%02x\n", special_code_desc(special), (natural)scan ); - } - putchar( '\n' ); - } - - -//----------------------------------------------------------------------------- -// Unparse the number-size flag. -//----------------------------------------------------------------------------- -static void unparse_numeric_size( DataStream* s ) - { - word const numbers_are_shorts = get_word(s); - s->number_size = numbers_are_shorts ? 2 : 1; - } - - -//----------------------------------------------------------------------------- -// Unparse an entire key map. -//----------------------------------------------------------------------------- -static void unparse_keymap_data( DataStream* s ) - { - unparse_numeric_size(s); - unparse_modifiers(s); - unparse_characters(s); - unparse_sequences(s); - unparse_specials(s); - } - - -//----------------------------------------------------------------------------- -// Unparse the active key map. -//----------------------------------------------------------------------------- -#if !defined(DUMPKEYMAP_FILE_ONLY) -static int unparse_active_keymap( void ) - { - int rc = 1; - NXEventHandle const h = NXOpenEventStatus(); - if (h == 0) - fputs( "Unable to open event status driver.\n", stderr ); - else - { - NXKeyMapping km; - km.size = NXKeyMappingLength(h); - if (km.size <= 0) - fprintf( stderr, "Bad key mapping length (%d).\n", km.size ); - else - { - km.mapping = (char*)malloc( km.size ); - if (NXGetKeyMapping( h, &km ) == 0) - fputs( "Unable to get current key mapping.\n", stderr ); - else - { - DataStream* stream = - new_data_stream( (byte const*)km.mapping, km.size ); - fputs( "=============\nACTIVE KEYMAP\n=============\n\n", - stdout); - unparse_keymap_data( stream ); - destroy_data_stream( stream ); - rc = 0; - } - free( km.mapping ); - } - NXCloseEventStatus(h); - } - return rc; - } -#endif - - -//----------------------------------------------------------------------------- -// Unparse one key map from a keymapping file. -//----------------------------------------------------------------------------- -static void unparse_keymap( DataStream* s ) - { - dword const interface = get_dword(s); - dword const handler_id = get_dword(s); - dword const map_size = get_dword(s); - printf( "interface: 0x%02lx\nhandler_id: 0x%02lx\nmap_size: %lu bytes\n\n", - interface, handler_id, map_size ); - unparse_keymap_data(s); - } - - -//----------------------------------------------------------------------------- -// Check the magic number of a keymapping file. -//----------------------------------------------------------------------------- -static int check_magic_number( DataStream* s ) - { - return (get_byte(s) == 'K' && - get_byte(s) == 'Y' && - get_byte(s) == 'M' && - get_byte(s) == '1'); - } - - -//----------------------------------------------------------------------------- -// Unparse all key maps within a keymapping file. -//----------------------------------------------------------------------------- -static int unparse_keymaps( DataStream* s ) - { - int rc = 0; - if (check_magic_number(s)) - { - int n = 1; - while (!end_of_stream(s)) - { - printf( "---------\nKEYMAP #%d\n---------\n", n++ ); - unparse_keymap(s); - } - } - else - { - fputs( "Bad magic number.\n", stderr ); - rc = 1; - } - return rc; - } - - -//----------------------------------------------------------------------------- -// Unparse a keymapping file. -//----------------------------------------------------------------------------- -static int unparse_keymap_file( char const* const path ) - { - int rc = 1; - FILE* file; - printf( "===========\nKEYMAP FILE\n===========\n%s\n\n", path ); - file = fopen( path, "rb" ); - if (file == 0) - perror( "Unable to open key mapping file" ); - else - { - struct stat st; - if (fstat( fileno(file), &st ) != 0) - perror( "Unable to determine key mapping file size" ); - else - { - byte* buffer = (byte*)malloc( st.st_size ); - if (fread( buffer, st.st_size, 1, file ) != 1) - perror( "Unable to read key mapping file" ); - else - { - DataStream* stream = new_data_stream(buffer, (int)st.st_size); - fclose( file ); file = 0; - rc = unparse_keymaps( stream ); - destroy_data_stream( stream ); - } - free( buffer ); - } - if (file != 0) - fclose( file ); - } - return rc; - } - - -//----------------------------------------------------------------------------- -// Handle the case when no documents are mentioned on the command-line. For -// Apple/NeXT platforms, dump the currently active key mapping; else display -// an error message. -//----------------------------------------------------------------------------- -static int handle_empty_document_list( void ) - { -#if !defined(DUMPKEYMAP_FILE_ONLY) - return unparse_active_keymap(); -#else - fputs( "ERROR: Must specify at least one .keymapping file.\n\n", stderr ); - return 1; -#endif - } - - -//----------------------------------------------------------------------------- -// Print a detailed description of the internal layout of a key mapping. -//----------------------------------------------------------------------------- -static void print_internal_layout_info( FILE* f ) - { - fputs( -"What follows is a detailed descriptions of the internal layout of an\n" -"Apple/NeXT .keymapping file.\n" -"\n" -"Types and Data\n" -"--------------\n" -"The following type definitions are employed throughout this discussion:\n" -"\n" -" typedef unsigned char byte;\n" -" typedef unsigned short word;\n" -" typedef unsigned long dword;\n" -"\n" -"Additionally, the type definition `number' is used generically to indicate\n" -"a numeric value. The actual size of the `number' type may be one or two\n" -"bytes depending upon how the data is stored in the key map. Although most\n" -"key maps use byte-sized numeric values, word-sized values are also allowed.\n" -"\n" -"Multi-byte values in a key mapping file are stored in big-endian byte\n" -"order.\n" -"\n" -"Key Mapping File and Device Mapping\n" -"-----------------------------------\n" -"A key mapping file begins with a magic-number and continues with a variable\n" -"number of device-specific key mappings.\n" -"\n" -" struct KeyMappingFile {\n" -" char magic_number[4]; // `KYM1'\n" -" DeviceMapping maps[...]; // Variable number of maps\n" -" };\n" -"\n" -" struct DeviceMapping {\n" -" dword interface; // Interface type\n" -" dword handler_id; // Interface subtype\n" -" dword map_size; // Byte count of `map' (below)\n" -" KeyMapping map;\n" -" };\n" -"\n" -"The value of `interface' represents a family of keyboard device types\n" -"(such as Intel PC, ADB, NeXT, Sun Type5, etc.), and is generally\n" -"specified as one of the constant values NX_EVS_DEVICE_INTERFACE_ADB,\n" -"NX_EVS_DEVICE_INTERFACE_ACE, etc., which are are defined in IOHIDTypes.h on\n" -"MacOS/X and Darwin, and in ev_types.h on MacOS/X Server, OpenStep, and\n" -"NextStep.\n" -"\n" -"The value of `handler_id' represents a specific keyboard layout within the\n" -"much broader `interface' family. For instance, for a 101-key Intel PC\n" -"keyboard (of type NX_EVS_DEVICE_INTERFACE_ACE) the `handler_id' is '0',\n" -"whereas for a 102-key keyboard it is `1'.\n" -"\n" -"Together, `interface' and `handler_id' identify the exact keyboard hardware\n" -"to which this mapping applies. Programs which display a visual\n" -"representation of a keyboard layout, match `interface' and `handler_id'\n" -"from the .keymapping file against the `interface' and `handler_id' values\n" -"found in each .keyboard file.\n" -"\n" -"Key Mapping\n" -"-----------\n" -"A key mapping completely defines the relationship of all scan codes with\n" -"their associated functionality. A KeyMapping structure is embedded within\n" -"the DeviceMapping structure in a KeyMappingFile. The key mapping currently\n" -"in use by the WindowServer and AppKit is also represented by a KeyMapping\n" -"structure, and can be referred to directly by calling NXGetKeyMapping() and\n" -"accessing the `mapping' data member of the returned NXKeyMapping structure.\n" -"\n" -" struct KeyMapping {\n" -" word number_size; // 0=1 byte, non-zero=2 bytes\n" -" number num_modifier_groups; // Modifier groups\n" -" ModifierGroup modifier_groups[...];\n" -" number num_scan_codes; // Scan groups\n" -" ScanGroup scan_table[...];\n" -" number num_sequence_lists; // Sequence lists\n" -" Sequence sequence_lists[...];\n" -" number num_special_keys; // Special keys\n" -" SpecialKey special_key[...];\n" -" };\n" -"\n" -"The `number_size' flag determines the size, in bytes, of all remaining\n" -"numeric values (denoted by the type definition `number') within the key\n" -"mapping. If its value is zero, then numbers are represented by a single\n" -"byte. If it is non-zero, then numbers are represented by a word (two\n" -"bytes).\n" -"\n" -"Modifier Group\n" -"--------------\n" -"A modifier group defines all scan codes which map to a particular type of\n" -"modifier, such as `shift', `control', etc.\n" -"\n" -" enum Modifier {\n" -" ALPHALOCK = 0,\n" -" SHIFT,\n" -" CONTROL,\n" -" ALTERNATE,\n" -" COMMAND,\n" -" KEYPAD,\n" -" HELP\n" -" };\n" -"\n" -" struct ModifierGroup {\n" -" number modifier; // A Modifier constant\n" -" number num_scan_codes;\n" -" number scan_codes[...]; // Variable number of scan codes\n" -" };\n" -"\n" -"The scan_codes[] array contains a list of all scan codes which map to the\n" -"specified modifier. The `shift', `command', and `alternate' modifiers are\n" -"frequently mapped to two different scan codes, apiece, since these\n" -"modifiers often appear on both the left and right sides of the keyboard.\n" -"\n" -"Scan Group\n" -"----------\n" -"There is one ScanGroup for each scan code generated by the given keyboard.\n" -"This number is given by KeyMapping::num_scan_codes. The first scan group\n" -"represents hardware scan code 0, the second represents scan code 1, etc.\n" -"\n" -" enum ModifierMask {\n" -" ALPHALOCK_MASK = 1 << 0,\n" -" SHIFT_MASK = 1 << 1,\n" -" CONTROL_MASK = 1 << 2,\n" -" ALTERNATE_MASK = 1 << 3,\n" -" CARRIAGE_RETURN_MASK = 1 << 4\n" -" };\n" -" #define NOT_BOUND 0xff\n" -"\n" -" struct ScanGroup {\n" -" number mask;\n" -" Character characters[...];\n" -" };\n" -"\n" -"For each scan code, `mask' defines which modifier combinations generate\n" -"characters. If `mask' is NOT_BOUND (0xff) then then this scan code does\n" -"not generate any characters ever, and its characters[] array is zero\n" -"length. Otherwise, the characters[] array contains one Character record\n" -"for each modifier combination.\n" -"\n" -"The number of records in characters[] is determined by computing (1 <<\n" -"bits_set_in_mask). In other words, if mask is zero, then zero bits are\n" -"set, so characters[] contains only one record. If `mask' is (SHIFT_MASK |\n" -"CONTROL_MASK), then two bits are set, so characters[] contains four\n" -"records.\n" -"\n" -"The first record always represents the character which is generated by that\n" -"key when no modifiers are active. The remaining records represent\n" -"characters generated by the various modifier combinations. Using the\n" -"example with the `shift' and `control' masks set, record two would\n" -"represent the character with the `shift' modifier active; record three, the\n" -"`control' modifier active; and record four, both the `shift' and `control'\n" -"modifiers active.\n" -"\n" -"As a special case, ALPHALOCK_MASK implies SHIFT_MASK, though only\n" -"ALPHALOCK_MASK appears in `mask'. In this case the same character is\n" -"generated for both the `shift' and `alpha-lock' modifiers, but only needs\n" -"to appear once in the characters[] array.\n" -"\n" -"CARRIAGE_RETURN_MASK does not actually refer to a modifier key. Instead,\n" -"it is used to distinguish the scan code which is given the special\n" -"pseudo-designation of `carriage return' key. Typically, this mask appears\n" -"solo in a ScanGroup record and only the two Character records for control-M\n" -"and control-C follow. This flag may be a throwback to an earlier time or\n" -"may be specially interpreted by the low-level keyboard driver, but its\n" -"purpose is otherwise enigmatic.\n" -"Character\n" -"---------\n" -"Each Character record indicates the character generated when this key is\n" -"pressed, as well as the character set which contains the character. Well\n" -"known character sets are `ASCII' and `Symbol'. The character set can also\n" -"be one of the meta values FUNCTION_KEY or KEY_SEQUENCE. If it is\n" -"FUNCTION_KEY then `char_code' represents a generally well-known function\n" -"key such as those enumerated by FunctionKey. If the character set is\n" -"KEY_SEQUENCE then `char_code' represents a zero-base index into\n" -"KeyMapping::sequence_lists[].\n" -"\n" -" enum CharacterSet {\n" -" ASCII = 0x00,\n" -" SYMBOL = 0x01,\n" -" ...\n" -" FUNCTION_KEY = 0xfe,\n" -" KEY_SEQUENCE = 0xff\n" -" };\n" -"\n" -" struct Character {\n" -" number set; // CharacterSet of generated character\n" -" number char_code; // Actual character generated\n" -" };\n" -"\n" -" enum FunctionKey {\n" -" F1 = 0x20, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12,\n" -" INSERT, DELETE, HOME, END, PAGE_UP, PAGE_DOWN, PRINT_SCREEN,\n" -" SCROLL_LOCK, PAUSE, SYS_REQUEST, BREAK, RESET, STOP, MENU, USER,\n" -" SYSTEM, PRINT, CLEAR_LINE, CLEAR_DISPLAY, INSERT_LINE,\n" -" DELETE_LINE, INSERT_CHAR, DELETE_CHAR, PREV, NEXT, SELECT\n" -" };\n" -"\n" -"Sequence\n" -"--------\n" -"When Character::set contains the meta value KEY_SEQUENCE, the scan code is\n" -"bound to a sequence of keys rather than a single character. A sequence is\n" -"a series of modifiers and characters which are automatically generated when\n" -"the associated key is depressed.\n" -"\n" -" #define MODIFIER_KEY 0xff\n" -"\n" -" struct Sequence {\n" -" number num_chars;\n" -" Character characters[...];\n" -" };\n" -"\n" -"Each generated Character is represented as previously described, with the\n" -"exception that MODIFIER_KEY may appear in place of KEY_SEQUENCE. When the\n" -"value of Character::set is MODIFIER_KEY then Character::char_code\n" -"represents a modifier key rather than an actual character. If the modifier\n" -"represented by `char_code' is non-zero, then it indicates that the\n" -"associated modifier key has been depressed. In this case, the value is one\n" -"of the constants enumerated by Modifier (SHIFT, CONTROL, ALTERNATE, etc.).\n" -"If the value is zero then it means that the modifier keys have been\n" -"released.\n" -"\n" -"Special Key\n" -"-----------\n" -"A special key is one which is scanned directly by the Mach kernel rather\n" -"than by the WindowServer. In general, events are not generated for special\n" -"keys.\n" -"\n" -" enum SpecialKeyType {\n" -" VOLUME_UP = 0,\n" -" VOLUME_DOWN,\n" -" BRIGHTNESS_UP,\n" -" BRIGHTNESS_DOWN,\n" -" ALPHA_LOCK,\n" -" HELP,\n" -" POWER,\n" -" SECONDARY_ARROW_UP,\n" -" SECONDARY_ARROW_DOWN\n" -" };\n" -"\n" -" struct SpecialKey {\n" -" number type; // A SpecialKeyType constant\n" -" number scan_code; // Actual scan code\n" -" };\n" -"\n", f ); - } - - -//----------------------------------------------------------------------------- -// Print an explanation of the output generated by this program. -//----------------------------------------------------------------------------- -static void print_output_info( FILE* f ) - { - fputs( -"What follows is an explanation and description of the various pieces of\n" -"information emitted by dumpkeymap.\n" -"\n" -"For a more thorough discussion of any particular piece of information\n" -"described here, refer to the detailed description of the internal layout of\n" -"a key mapping given by the --help-layout option.\n" -"\n" -"Conventions\n" -"-----------\n" -"Depending upon context, some numeric values are displayed in decimal\n" -"notation, whereas others are displayed in hexadecimal notation.\n" -"Hexadecimal numbers are denoted by a `0x' prefix (for instance, `0x7b'),\n" -"except when explicitly noted otherwise.\n" -"\n" -"Key Mapping Source\n" -"------------------\n" -"The first piece of information presented about a particular key mapping is\n" -"the source from which the data was gleaned. For a .keymapping file, the\n" -"title `KEYMAP FILE' is emitted along with the path and name of the file in\n" -"question. For the key mapping currently in use by the WindowServer and\n" -"AppKit, the title `ACTIVE KEYMAP' is emitted instead.\n" -"\n" -"Device Information\n" -"------------------\n" -"Each .keymapping file may contain one or more raw key mappings. For\n" -"example, a file which maps keys to a Dvorak-style layout might contain raw\n" -"mappings for Intel PC, ADB, NeXT, and Sun Type5 keyboards.\n" -"\n" -"For each raw mapping, the following information is emitted:\n" -"\n" -" o The title `KEYMAP' along with the mapping's relative position in the\n" -" .keymapping file.\n" -" o The `interface' identifier.\n" -" o The `handler_id' sub-identifier.\n" -" o The size of the raw mapping resource counted in bytes.\n" -"\n" -"The `interface' and `handler_id' values, taken together, define a specific\n" -"keyboard device. A .keyboard file, which describes the visual layout of a\n" -"keyboard, also contains `interface' and `handler_id' identifiers. The\n" -".keyboard file corresponding to a particular key mapping can be found by\n" -"matching the `interface' and `handler_id' values from each resource.\n" -"\n" -"Modifiers\n" -"---------\n" -"Each mapping may contain zero or more modifier records which associate\n" -"hardware scan codes with modifier descriptions such as `shift', `control',\n" -"`alternate', etc. The title `MODIFIERS' is printed along with the count of\n" -"modifier records which follow. For each modifier record, the modifier's\n" -"name is printed along with a list of scan codes, in hexadecimal format,\n" -"which generate that modifier value. For example:\n" -"\n" -" MODIFIERS [4]\n" -" alternate: 0x1d 0x60\n" -" control: 0x3a\n" -" keypad: 0x52 0x53 ... 0x63 0x62\n" -" shift: 0x2a 0x36\n" -"\n" -"Characters\n" -"----------\n" -"Each mapping may contain zero or more character records which associate\n" -"hardware scan codes with the actual characters generated by those scan\n" -"codes in the presence or absence of various modifier combinations. The\n" -"title `CHARACTERS' is printed along with the count of character records\n" -"which follow. Here is a highly abbreviated example:\n" -"\n" -" CHARACTERS [9]\n" -" scan 0x00: -AC-L \"a\" \"A\" \"^A\" \"^A\" ca c7 \"^A\" \"^A\"\n" -" scan 0x07: -AC-L \"x\" \"X\" \"^X\" \"^X\" 01/b4 01/ce \"^X\" \"^X\"\n" -" scan 0x0a: ---S- \"<\" \">\"\n" -" scan 0x13: -ACS- \"2\" \"@\" \"^@\" \"^@\" b2 b3 \"^@\" \"^@\"\n" -" scan 0x24: R---- \"^M\" \"^C\"\n" -" scan 0x3e: ----- [F4]\n" -" scan 0x4a: ----- [page up]\n" -" scan 0x60: ----- {seq#3}\n" -" scan 0x68: not-bound\n" -"\n" -"For each record, the hexadecimal value of the hardware scan code is\n" -"printed, followed by a list of modifier flag combinations and the actual\n" -"characters generated by this scan code with and without modifiers applied.\n" -"\n" -"The modifier flags field is composed of a combination of single letter\n" -"representations of the various modifier types. The letters stand for:\n" -"\n" -" L - alpha-lock\n" -" S - shift\n" -" C - control\n" -" A - alternate\n" -" R - carriage-return\n" -"\n" -"As a special case, the `alpha-lock' flag also implies the `shift' flag, so\n" -"these two flags never appear together in the same record.\n" -"\n" -"The combination of modifier flags determines the meaning and number of\n" -"fields which follow. The first field after the modifier flags always\n" -"represents the character that will be generated if no modifier keys are\n" -"depressed. The remaining fields represent characters generated by the\n" -"various modifier combinations. The order of the fields follows this\n" -"general pattern:\n" -"\n" -" o The character generated by this scan code when no modifiers are in\n" -" effect is listed first.\n" -"\n" -" o If the `L' or `S' flag is active, then the shifted character\n" -" generated by this scan code is listed next.\n" -"\n" -" o If the `C' flag is active, then the control-character generated by\n" -" this scan code is listed next. Furthermore, if the `L' or `S' flag\n" -" is also active, then the shifted control-character is listed after\n" -" that.\n" -"\n" -" o If the `A' flag is active, then the alternate-character generated by\n" -" this scan code is listed next. Furthermore, if the `L' or `S' flag\n" -" is active, then the shifted alternate-character is listed after that.\n" -" If the `C' flag is also active, then the alternate-control-character\n" -" is listed next. Finally, if the `C' and `L' or `C' and `S' flags are\n" -" also active, then the shifted alternate-control-character is listed.\n" -"\n" -"The `R' flag does not actually refer to a modifier key. Instead, it is\n" -"used to distinguish the scan code which is given the special\n" -"pseudo-designation of `carriage return' key. Typically, this mask appears\n" -"solo and only the two fields for control-M and control-C follow. This flag\n" -"may be a throwback to an earlier time or may be specially interpreted by\n" -"the low-level keyboard driver, but its purpose is otherwise enigmatic.\n" -"\n" -"Recalling the example from above, the following fields can be identified:\n" -"\n" -" scan 0x00: -AC-L \"a\" \"A\" \"^A\" \"^A\" ca c7 \"^A\" \"^A\"\n" -"\n" -" o Lower-case `a' is generated when no modifiers are active.\n" -" o Upper-case `A' is generated when `shift' or `alpha-lock' are active.\n" -" o Control-A is generated when `control' is active.\n" -" o Control-A is generated when `control' and `shift' are active.\n" -" o The character represented by the hexadecimal code 0xca is generated\n" -" when `alternate' is active.\n" -" o The character represented by 0xc7 is generated when `alternate' and\n" -" `shift' (or `alpha-lock') are active.\n" -" o Control-A is generated when `alternate' and `control' are active.\n" -" o Control-A is generated when `alternate', `control' and `shift' (or\n" -" `alpha-lock') are active.\n" -"\n" -"The notation used to represent a particular generated character varies.\n" -"\n" -" o Printable ASCII characters are quoted, as in \"x\" or \"X\".\n" -"\n" -" o Control-characters are quoted and prefixed with `^', as in \"^X\".\n" -"\n" -" o Characters with values greater than 127 (0x7f) are displayed as\n" -" hexadecimal values without the `0x' prefix.\n" -"\n" -" o Characters in a non-ASCII character set (such as `Symbol') are\n" -" displayed as two hexadecimal numbers separated by a slash, as in\n" -" `01/4a'. The first number is the character set's identification code\n" -" (such as `01' for the `Symbol' set), and the second number is the\n" -" value of the generated character.\n" -"\n" -" o Non-printing special function characters are displayed with the\n" -" function's common name enclosed in brackets, as in `[page up]' or\n" -" `[F4]'.\n" -"\n" -" o If the binding represents a key sequence rather than a single\n" -" character, then the sequence's identification number is enclosed in\n" -" braces, as in `{seq#3}'.\n" -"\n" -"Recalling a few examples from above, the following interpretations can be\n" -"made:\n" -"\n" -" scan 0x07: -AC-L \"x\" \"X\" \"^X\" \"^X\" 01/b4 01/ce \"^X\" \"^X\"\n" -" scan 0x3e: ----- [F4]\n" -" scan 0x4a: ----- [page up]\n" -" scan 0x60: ----- {seq#3}\n" -"\n" -" o \"x\" and \"X\" are printable ASCII characters.\n" -" o \"^X\" is a control-character.\n" -" o `01/b4' and `01/ce' represent the character codes 0xb4 and 0xce in\n" -" the `Symbol' character set.\n" -" o Scan code 0x3e generates function-key `F4', and scan code 0x4a\n" -" generates function-key `page up'.\n" -" o Scan code 0x60 is bound to key sequence #3.\n" -"\n" -"Finally, if a scan code is not bound to any characters, then it is\n" -"annotated with the label `not-bound', as with example scan code 0x68 from\n" -"above.\n" -"\n" -"Sequences\n" -"---------\n" -"A scan code (modified and unmodified) can be bound to a key sequence rather\n" -"than generating a single character or acting as a modifier. When it is\n" -"bound to a key sequence, a series of character invocations and modifier\n" -"actions are automatically generated rather than a single keystroke.\n" -"\n" -"Each mapping may contain zero or more key sequence records. The title\n" -"`SEQUENCES' is printed along with the count of sequence records which\n" -"follow. For example:\n" -"\n" -" SEQUENCES [3]\n" -" sequence 0: \"f\" \"o\" \"o\"\n" -" sequence 1: {alternate} \"b\" \"a\" \"r\" {unmodify}\n" -" sequence 2: [home] \"b\" \"a\" \"z\"\n" -"\n" -"The notation used to represent the sequence of generated characters is\n" -"identical to the notation already described in the `Characters' section\n" -"above, with the exception that modifier actions may be interposed between\n" -"generated characters. Such modifier actions are represented by the\n" -"modifier's name enclosed in braces. The special name `{unmodify}'\n" -"indicates the release of the modifier keys.\n" -"\n" -"Thus, the sequences in the above example can be interpreted as follows:\n" -"\n" -" o Sequence #0 generates `foo'.\n" -" o Sequence #1 invokes the `alternate' modifier, generates `bar', and\n" -" then releases `alternate'.\n" -" o Sequence #2 invokes the `home' key and then generates `baz'. In a\n" -" text editor, this would probably result in `baz' being prepended to\n" -" the line of text on which the cursor resides.\n" -"\n" -"Special Keys\n" -"------------\n" -"Certain keyboards feature keys which perform some type of special purpose\n" -"function rather than generating a character or acting as a modifier. For\n" -"instance, Apple keyboards often contain a `power' key, and NeXT keyboards\n" -"have historically featured screen brightness and volume control keys.\n" -"\n" -"Each mapping may contain zero or more special-key records which associate\n" -"hardware scan codes with such special purpose functions. The title\n" -"`SPECIALS' is printed along with the count of records which follow. For\n" -"each record, the special function's name is printed along with a list of\n" -"scan codes, in hexadecimal format, which are bound to that function. For\n" -"example:\n" -"\n" -" SPECIALS [6]\n" -" alpha-lock: 0x39\n" -" brightness-down: 0x79\n" -" brightness-up: 0x74\n" -" power: 0x7f\n" -" sound-down: 0x77\n" -" sound-up: 0x73\n" -"\n", f ); - } - - -//----------------------------------------------------------------------------- -// Print a summary of the various files and directories which are related to -// key mappings. -//----------------------------------------------------------------------------- -static void print_files_info( FILE* f ) - { - fputs( -"This is a summary of the various files and directories which are related to\n" -"key mappings.\n" -"\n" -"*.keymapping\n" -" A key mapping file which precisely defines the relationship of all\n" -" hardware-specific keyboard scan-codes with their associated\n" -" functionality.\n" -"\n" -"*.keyboard\n" -" A file describing the physical layout of keys on a particular type of\n" -" keyboard. Each `key' token in this file defines the position and shape\n" -" of the key on the keyboard, as well as the associated scan code which\n" -" that key generates. A .keymapping file, on the other hand, defines the\n" -" characters which are generated by a particular scan code depending upon\n" -" the state of the various modifier keys (such as shift, control, etc.).\n" -" The `interface' and `handler_id' values from a .keymapping file are\n" -" matched against those in each .keyboard file in order to associate a\n" -" particular .keyboard file with a key mapping. Various GUI programs use\n" -" the .keyboard file to display a visual representation of a keyboard for\n" -" the user. Since these files are just plain text, they can be easily\n" -" viewed and interpreted without the aid of a specialized program, thus\n" -" dumpkeymap leaves these files alone.\n" -"\n" -"/System/Library/Keyboards\n" -"/Network/Library/Keyboards\n" -"/Local/Library/Keyboards\n" -"/Library/Keyboards\n" -" Repositories for .keymapping and .keyboard files for MacOS/X, Darwin,\n" -" and MacOS/X Server.\n" -"\n" -"/NextLibrary/Keyboards\n" -"/LocalLibrary/Keyboards\n" -" Repositories for .keymapping and .keyboard files for OpenStep and\n" -" NextStep.\n" -"\n" -"$(HOME)/Library/Keyboards\n" -" Repository for personal .keymapping and .keyboard files.\n" -"\n", f ); - } - - -//----------------------------------------------------------------------------- -// Print a list of the various diagnostic messages which may be emitted. -//----------------------------------------------------------------------------- -static void print_diagnostics_info( FILE* f ) - { - fputs( -"The following diagnostic messages may be issued to the standard error\n" -"stream.\n" -"\n" -"Unrecognized option.\n" -" An unrecognized option was specified on the command-line. Invoke\n" -" dumpkeymap with the --help option to view a list of valid options.\n" -"\n" -"Insufficient data in keymapping data stream.\n" -" The key mapping file or data stream is corrupt. Either the file has\n" -" been incorrectly truncated or a field, such as those which indicates\n" -" the number of variable records which follow, contains a corrupt value.\n" -"\n" -"The following diagnostic messages have significance only when trying to\n" -"print .keymapping files mentioned on the command-line.\n" -"\n" -"Bad magic number.\n" -" The mentioned file is not a .keymapping file. The file's content does\n" -" not start with the string `KYM1'.\n" -"\n" -"Unable to open key mapping file.\n" -" The call to fopen() failed; probably because the specified path is\n" -" invalid or dumpkeymap does not have permission to read the file.\n" -"\n" -"Unable to determine key mapping file size.\n" -" The call to fstat() failed, thus memory can not be allocated for\n" -" loading the file.\n" -"\n" -"Unable to read key mapping file.\n" -" The call to fread() failed.\n" -"\n" -"The following diagnostic messages have significance only when trying to\n" -"print the currently active key mapping when no .keymapping files have been\n" -"mentioned on the command-line.\n" -"\n" -"Unable to open event status driver.\n" -" The call to NXOpenEventStatus() failed.\n" -"\n" -"Bad key mapping length.\n" -" The call to NXKeyMappingLength() returned a bogus value.\n" -"\n" -"Unable to get current key mapping.\n" -" The call to NXGetKeyMapping() failed.\n" -"\n" -"The following diagnostic messages have significance only when using\n" -"dumpkeymap on a non-Apple/NeXT platform.\n" -"\n" -"Must specify at least one .keymapping file.\n" -" No .keymapping files were mentioned on the command-line. On\n" -" non-Apple/NeXT platforms, there is no concept of a currently active\n" -" .keymapping file, so at least one file must be mentioned on the\n" -" command-line.\n" -"\n", f ); - } - - -//----------------------------------------------------------------------------- -// Print warranty. -//----------------------------------------------------------------------------- -static void print_warranty( FILE* f ) - { - fputs( -"This software is provided by the author `AS IS' and any express or implied\n" -"WARRANTIES, including, but not limited to, the implied warranties of\n" -"MERCHANTABILITY and FITNESS FOR A PARTICULAR PURPOSE are DISCLAIMED. In NO\n" -"EVENT shall the author be LIABLE for any DIRECT, INDIRECT, INCIDENTAL,\n" -"SPECIAL, EXEMPLARY, or CONSEQUENTIAL damages (including, but not limited\n" -"to, procurement of substitute goods or services; loss of use, data, or\n" -"profits; or business interruption) however caused and on any theory of\n" -"liability, whether in contract, strict liability, or tort (including\n" -"negligence or otherwise) arising in any way out of the use of this\n" -"software, even if advised of the possibility of such damage.\n" -"\n", f ); - } - - -//----------------------------------------------------------------------------- -// Print this program's version number. -//----------------------------------------------------------------------------- -static void print_version( FILE* f ) - { - fputs( "Version " PROG_VERSION " (built " __DATE__ ")\n\n", f ); - } - - -//----------------------------------------------------------------------------- -// Print a usage summary. -//----------------------------------------------------------------------------- -static void print_usage( FILE* f ) - { - fputs( -"Usage: dumpkeymap [options] [-] [file ...]\n" -"\n" -"Prints a textual representation of each Apple/NeXT .keymapping file\n" -"mentioned on the command-line. If no files are mentioned and if the local\n" -"machine is an Apple or NeXT installation, then the key mapping currently in\n" -"use by the WindowServer and the AppKit is printed instead.\n" -"\n" -"Options:\n" -" -h --help\n" -" Display general program instructions and option summary.\n" -"\n" -" -k --help-keymapping\n" -" Display a detailed description of the internal layout of a\n" -" .keymapping file.\n" -"\n" -" -o --help-output\n" -" Display an explanation of the output generated by dumpkeymap when\n" -" dissecting a .keymapping file.\n" -"\n" -" -f --help-files\n" -" Display a summary of the various files and directories which are\n" -" related to key mappings.\n" -"\n" -" -d --help-diagnostics\n" -" Display a list of the various diagnostic messages which may be\n" -" emitted by dumpkeymap.\n" -"\n" -" -v --version\n" -" Display the dumpkeymap version number and warranty information.\n" -"\n" -" - --\n" -" Inhibit processing of options at this point in the argument list.\n" -" An occurrence of `-' or `--' in the argument list causes all\n" -" following arguments to be treated as file names even if an argument\n" -" begins with a `-' character.\n" -"\n", f ); - } - - -//----------------------------------------------------------------------------- -// Print an informational banner. -//----------------------------------------------------------------------------- -static void print_banner( FILE* f ) - { - fputs( "\n" PROG_NAME " v" PROG_VERSION " by " AUTHOR_INFO "\n" - COPYRIGHT "\n\n", f ); - } - - -//----------------------------------------------------------------------------- -// Process command-line arguments. Examine options first; collecting files -// along the way. If all is well, process collected file list. -//----------------------------------------------------------------------------- -int main( int const argc, char const* const argv[] ) - { - int rc = 0, i, nfiles = 0, more_options = 1, process_files = 1; - int* files = (int*)calloc( argc - 1, sizeof(int) ); - print_banner( stdout ); - - for (i = 1; i < argc; i++) - { - char const* const s = argv[i]; - if (!more_options || *s != '-') - files[ nfiles++ ] = i; - else - { - OPT_SWITCH(s) - OPT_CASE(-,--) - more_options = 0; - OPT_CASE(-h,--help) - print_usage( stdout ); - process_files = 0; - OPT_CASE(-k,--help-keymapping) - print_internal_layout_info( stdout ); - process_files = 0; - OPT_CASE(-o,--help-output) - print_output_info( stdout ); - process_files = 0; - OPT_CASE(-f,--help-files) - print_files_info( stdout ); - process_files = 0; - OPT_CASE(-d,--help-diagnostics) - print_diagnostics_info( stdout ); - process_files = 0; - OPT_CASE(-v,--version) - print_version( stdout ); - print_warranty( stdout ); - process_files = 0; - OPT_DEFAULT - fprintf( stderr, "ERROR: Unrecognized option: %s\n\n", s ); - process_files = 0; - rc = 1; - OPT_SWITCH_END - } - } - - if (process_files) - { - if (nfiles == 0) - rc = handle_empty_document_list(); - else - for (i = 0; i < nfiles; i++) - rc |= unparse_keymap_file( argv[files[i]] ); - } - - free( files ); - return rc; - } diff --git a/nx-X11/programs/Xserver/hw/darwin/utils/dumpkeymap.man b/nx-X11/programs/Xserver/hw/darwin/utils/dumpkeymap.man deleted file mode 100644 index 12983bada..000000000 --- a/nx-X11/programs/Xserver/hw/darwin/utils/dumpkeymap.man +++ /dev/null @@ -1,1004 +0,0 @@ -.ig -//============================================================================= -// -// Manual page for `dumpkeymap'. -// -// Copyright (C) 1999,2000 by Eric Sunshine -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED -// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -//============================================================================= -// -// $XFree86$ -// -.. -.ig -//----------------------------------------------------------------------------- -// Local identification information. -//----------------------------------------------------------------------------- -.. -.nr VE 4 \" Version number -.TH DUMPKEYMAP 1 "v\n(VE \-\- 1 December 2000" "Version \n(VE" -.de UP -1 December 2000 -.. -.ig -//----------------------------------------------------------------------------- -// Annotation Macros -// ----------------- -// Facilitate creation of annotated, non-filled blocks of text. An -// annotated block is initiated with the `AS' macro. Each annotated, -// non-filled line within the block must be introduced with the `AN' macro -// which takes three arguments. The first argument is the detail text to -// be annotated. The second is a string of spaces used to align the -// annotations by certain (broken) roff interpreters which fail to -// implement the proper set of roff commands (such as diversions, -// indentation, and tab stops). It is assumed that the spaces will be -// used with fixed-point font. The third argument is the annotation -// itself. The block should be terminated with the `AE' macro. For all -// roff interpreters which properly implement diversions, indentation, and -// tab stops, all anotations within the block are automatically aligned at -// the same horizontal position. This position is guaranteed to be just -// to the right of the widest `AN' detail line. For broken roff -// interpreters, such as `rman', the string of spaces from the second -// argument are used to align the annotations. Finally, the `AZ' macro, -// which takes a single argument, can be used to to insert a non-annotated -// line into the block which does not play a part in the calculation of -// the horizontal annotation alignment. -// -// Implementation Notes -// -------------------- -// *1* These macros utilize a diversion (named `AD'). Since the prevailing -// indentation is stored along with the diverted text, we must muck with -// the indentation level in order to prevent the indentation from being -// applied to the text a second time when `AD' is finally emitted. -// -// *2* Unfortunately, `.if' strips leading whitespace from following text, so -// `AN' uses \& to preserve the whitespace. -// -// *3* This manual page has been tested for proper formatting with troff, -// groff, nroff and rman (the `man' to `HTML' converter). Unfortunately, -// rman fails to implement many useful features such as diversions, -// indentation, and tab stops, and is also hideously buggy. Furthermore -// it identifies itself as nroff and fails to provide any further -// identification, so there is no way to create macros which specifically -// work around its limitations. Following is a list of several bugs in -// rman which the implementation of these macros must avoid: -// o Fails with multi-line conditionals within macros. -// o Fails on macro definition within multi-line conditionals. -// o Fails when macro arguments are not delimited by exactly 1 space. -// o String definition `.ds' ignores the value; uses empty "" instead. -// As a consequence of these problems, the following macros are written -// using a series of ugly single-line `.if' conditionals rather than the -// more natural multi-line `.if' and `.ie' conditionals. Also, rman fails -// to understand the common idiom of `.\"' to introduce a comment, which -// is why all comments in this file are wrapped in ignore `.ig' blocks. -//----------------------------------------------------------------------------- -.. -.de AS -.if t .nr AW 0 -.if t .nr AI \\n(.i -.if t .in -\\n(AI -.nf -.. -.de AN -.if t .if \w'\\$1'>\\n(AW .nr AW \w'\\$1' -.if t .da AD -.if t \\&\\$1\\t\\$3 -.if t .da -.if n \\&\\$1 \\$2\\$3 -.. -.de AZ -.if t .da AD -\\$1 -.if t .da -.. -.de AE -.if t .in +\\n(AIu -.if t .if \\n(AW .ta \\n(AWu+\w'\\(em'u -.if t .AD -.if t .DT -.if t .rm AD -.if t .rm AW -.fi -.. -.ig -//----------------------------------------------------------------------------- -// Bulleted list macros -- `BG' begins a bulleted list; `BU' delimits -// bulleted entries; `BE' ends a bulleted list. -//----------------------------------------------------------------------------- -.. -.de BG -.PP -.RS -.. -.de BU -.HP -\\(bu\\ \\c -.. -.de BE -.RE -.PP -.. -.ig -//----------------------------------------------------------------------------- -// Indented paragraph with stylized hanging tag macro. `TG' takes a single -// argument and treats it as the hanging tag of the indented paragraph. -// The tag is italicized in troff but not in nroff. -//----------------------------------------------------------------------------- -.. -.de TG -.TP -.ie t .I "\\$1" -.el \\$1 -.. -.ig -//----------------------------------------------------------------------------- -// Manual page for `dumpkeymap'. -//----------------------------------------------------------------------------- -.. -.SH NAME -dumpkeymap \- Dianostic dump of a .keymapping file -.SH SYNOPSIS -.B dumpkeymap -.RI [ options "] [-] [" file "...]" -.SH DESCRIPTION -.I dumpkeymap -prints a textual representation of each Apple/\c -.SM NeXT -.I .keymapping -file mentioned on the command-line. If no files are mentioned and if the -local machine is an Apple or -.SM NeXT -installation, then the key mapping currently in use by the WindowServer and the -AppKit is printed instead. -.SH OPTIONS -.TP -.B "\-h \-\^\-help" -Display general program instructions and option summary. -.TP -.B "\-k \-\^\-help\-keymapping" -Display a detailed description of the internal layout of a -.I .keymapping -file. This is the same information as that presented in the -.I "Key Mapping Description" -section of this document. -.TP -.B "\-o \-\^\-help\-output" -Display an explanation of the output generated by -.I dumpkeymap -when dissecting a -.I .keymapping -file. This is the same information as that presented in the -.I "Output Description" -section of this document. -.TP -.B "\-f \-\^\-help\-files" -Display a summary of the various files and directories which are related to -key mappings. This is the same information as that presented in the -.I "Files" -section of this document. -.TP -.B "\-d \-\^\-help\-diagnostics" -Display a list of the various diagnostic messages which may be emitted by -.I dumpkeymap. -This is the same information as that presented in the -.I "Diagnostics" -section of this document. -.TP -.B "\-v \-\^\-version" -Display the -.I dumpkeymap -version number and warranty information. -.TP -.B "\- \-\^\-" -Inhibit processing of options at this point in the argument list. An -occurrence of `\-' or `\-\^\-' in the argument list causes all following -arguments to be treated as file names even if an argument begins with a `\-' -character. -.SH "KEY MAPPING DESCRIPTION" -The following sections describe, in complete detail, the format of a raw key -mapping resource, as well as the format of the -.I .keymapping -file which encapsulates one or more raw mappings. -.SH "Types and Data" -The following type definitions are employed throughout this discussion: -.PP -.RS -.AS -.AZ "typedef unsigned char byte;" -.AZ "typedef unsigned short word;" -.AZ "typedef unsigned long dword;" -.AE -.RE -.PP -Additionally, the type definition -.RI ` number ' -is used generically to -indicate a numeric value. The actual size of the -.RI ` number ' -type may be one or two bytes depending upon how the data is stored in the key -map. Although most key maps use byte-sized numeric values, word-sized values -are also allowed. -.PP -Multi-byte values in a key mapping file are stored in big-endian byte order. -.SH "Key Mapping File and Device Mapping" -A key mapping file begins with a magic-number and continues with a -variable number of device-specific key mappings. -.PP -.RS -.AS -.AZ "struct KeyMappingFile {" -.AN " char magic_number[4];" " " "// `KYM1'" -.AN " DeviceMapping maps[...];" "" "// Variable number of maps" -.AZ }; -.AE -.PP -.AS -.AZ "struct DeviceMapping {" -.AN " dword interface;" " " "// Interface type" -.AN " dword handler_id;" "" "// Interface subtype" -.AN " dword map_size;" " " "// Byte count of `map' (below)" -.AN " KeyMapping map;" -.AZ }; -.AE -.RE -.PP -The value of `interface' represents a family of keyboard device types -(such as Intel -.SM "PC, ADB, NeXT," -Sun Type5, etc.), and is generally specified as one of the constant values -.SM "NX_EVS_DEVICE_INTERFACE_ADB, NX_EVS_DEVICE_INTERFACE_ACE," -etc., which are are defined in IOHIDTypes.h on MacOS/X and Darwin, and in -ev_types.h on MacOS/X Server, OpenStep, and NextStep. -.PP -The value of `handler_id' represents a specific keyboard layout within the -much broader `interface' family. For instance, for a 101-key Intel -.SM PC -keyboard (of type -.SM NX_EVS_DEVICE_INTERFACE_ACE\c -) the `handler_id' is '0', whereas for a 102-key keyboard it is `1'. -.PP -Together, `interface' and `handler_id' identify the exact keyboard hardware to -which this mapping applies. Programs which display a visual representation of -a keyboard layout, match `interface' and `handler_id' from the -.I .keymapping -file against the `interface' and `handler_id' values found in each -.I .keyboard -file. -.SH "Key Mapping" -A key mapping completely defines the relationship of all scan codes with their -associated functionality. A -.I KeyMapping -structure is embedded within the -.I DeviceMapping -structure in a -.IR KeyMappingFile . -The key mapping currently in use by the WindowServer and AppKit is also -represented by a -.I KeyMapping -structure, and can be referred to directly by calling NXGetKeyMapping() and -accessing the `mapping' data member of the returned -.I NXKeyMapping -structure. -.PP -.RS -.AS -.AZ "struct KeyMapping {" -.AN " word number_size;" " " "// 0=1 byte, non-zero=2 bytes" -.AN " number num_modifier_groups;" "" "// Modifier groups" -.AZ " ModifierGroup modifier_groups[...];" -.AN " number num_scan_codes;" " " "// Scan groups" -.AN " ScanGroup scan_table[...];" -.AN " number num_sequence_lists;" " " "// Sequence lists" -.AN " Sequence sequence_lists[...];" -.AN " number num_special_keys;" " " "// Special keys" -.AN " SpecialKey special_key[...];" -.AZ }; -.AE -.RE -.PP -The `number_size' flag determines the size, in bytes, of all remaining numeric -values (denoted by the type definition -.RI ` number ') -within the -key mapping. If its value is zero, then numbers are represented by a single -byte. If it is non-zero, then numbers are represented by a word (two bytes). -.SH "Modifier Group" -A modifier group defines all scan codes which map to a particular type of -modifier, such as -.IR shift , -.IR control , -etc. -.PP -.RS -.AS -.AZ "enum Modifier {" -.AZ " ALPHALOCK = 0," -.AZ " SHIFT," -.AZ " CONTROL," -.AZ " ALTERNATE," -.AZ " COMMAND," -.AZ " KEYPAD," -.AZ " HELP" -.AZ }; -.AE -.PP -.AS -.AZ "struct ModifierGroup {" -.AN " number modifier;" " " "// A Modifier constant" -.AN " number num_scan_codes;" -.AN " number scan_codes[...];" "" "// Variable number of scan codes" -.AZ }; -.AE -.RE -.PP -The scan_codes[] array contains a list of all scan codes which map to the -specified modifier. The -.IR shift ", " command ", and " alternate -modifiers are frequently mapped to two different scan codes, apiece, -since these modifiers often appear on both the left and right sides of -the keyboard. -.SH "Scan Group" -There is one -.I ScanGroup -for each scan code generated by the given keyboard. This number is given by -KeyMapping::num_scan_codes. The first scan group represents hardware scan -code 0, the second represents scan code 1, etc. -.PP -.RS -.AS -.AZ "enum ModifierMask {" -.AN " ALPHALOCK_MASK" " " "= 1 << 0," -.AN " SHIFT_MASK" " " "= 1 << 1," -.AN " CONTROL_MASK" " " "= 1 << 2," -.AN " ALTERNATE_MASK" " " "= 1 << 3," -.AN " CARRIAGE_RETURN_MASK" "" "= 1 << 4" -.AZ }; -.AZ "#define NOT_BOUND 0xff" -.AE -.PP -.AS -.AZ "struct ScanGroup {" -.AN " number mask;" -.AN " Character characters[...];" -.AZ }; -.AE -.RE -.PP -For each scan code, `mask' defines which modifier combinations generate -characters. If `mask' is -.SM NOT_BOUND -(0xff) then then this scan code does not generate any characters ever, and its -characters[] array is zero length. Otherwise, the characters[] array contains -one -.I Character -record for each modifier combination. -.PP -The number of records in characters[] is determined by computing (1 << -bits_set_in_mask). In other words, if mask is zero, then zero bits are set, -so characters[] contains only one record. If `mask' is -.SM "(SHIFT_MASK | CONTROL_MASK)," -then two bits are set, so characters[] contains four records. -.PP -The first record always represents the character which is generated by that -key when no modifiers are active. The remaining records represent characters -generated by the various modifier combinations. Using the example with the -.I shift -and -.I control -masks set, record two would represent the character with the -.I shift -modifier active; record three, the -.I control -modifier active; and record four, both the -.I shift -and -.I control -modifiers active. -.PP -As a special case, -.SM ALPHALOCK_MASK -implies -.SM SHIFT_MASK, -though only -.SM ALPHALOCK_MASK -appears in `mask'. In this case the same character is generated for both the -.I shift -and -.I alpha-lock -modifiers, but only needs to appear once in the characters[] array. -.PP -.SM CARRIAGE_RETURN_MASK -does not actually refer to a modifier key. Instead, it is used to -distinguish the scan code which is given the special pseudo-designation of -.I "carriage return" -key. Typically, this mask appears solo in a -.I ScanGroup -record and only the two -.I Character -records for control-M and control-C follow. This flag may be a throwback to -an earlier time or may be specially interpreted by the low-level keyboard -driver, but its purpose is otherwise enigmatic. -.SH Character -Each -.I Character -record indicates the character generated when this key is pressed, as well as -the character set which contains the character. Well known character sets are -.SM `ASCII' -and `Symbol'. The character set can also be one of the meta values -.SM FUNCTION_KEY -or -.SM KEY_SEQUENCE. -If it is -.SM FUNCTION_KEY -then `char_code' represents a generally well-known function key such as those -enumerated by -.I FunctionKey. -If the character set is -.SM KEY_SEQUENCE -then `char_code' represents is a zero-base index into -KeyMapping::sequence_lists[]. -.PP -.RS -.AS -.AZ "enum CharacterSet {" -.AN " ASCII" " " "= 0x00," -.AN " SYMBOL" " " "= 0x01," -.AN " ..." -.AN " FUNCTION_KEY" "" "= 0xfe," -.AN " KEY_SEQUENCE" "" "= 0xff" -.AZ }; -.AE -.PP -.AS -.AZ "struct Character {" -.AN " number set;" " " "// CharacterSet of generated character" -.AN " number char_code;" "" "// Actual character generated" -.AZ }; -.AE -.PP -.AS -.AZ "enum FunctionKey {" -.AZ " F1 = 0x20, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12," -.AZ " INSERT, DELETE, HOME, END, PAGE_UP, PAGE_DOWN, PRINT_SCREEN," -.AZ " SCROLL_LOCK, PAUSE, SYS_REQUEST, BREAK, RESET, STOP, MENU," -.AZ " USER, SYSTEM, PRINT, CLEAR_LINE, CLEAR_DISPLAY, INSERT_LINE," -.AZ " DELETE_LINE, INSERT_CHAR, DELETE_CHAR, PREV, NEXT, SELECT" -.AZ }; -.AE -.RE -.SH Sequence -When Character::set contains the meta value -.SM KEY_SEQUENCE, -the scan code is bound to a sequence of keys rather than a single character. -A sequence is a series of modifiers and characters which are automatically -generated when the associated key is depressed. -.PP -.RS -.AS -.AZ "#define MODIFIER_KEY 0xff" -.AE -.PP -.AS -.AZ "struct Sequence {" -.AN " number num_chars;" -.AN " Character characters[...];" -.AZ }; -.AE -.RE -.PP -Each generated -.I Character -is represented as previously described, with the exception that -.SM MODIFIER_KEY -may appear in place of -.SM KEY_SEQUENCE. -When the value of Character::set is -.SM MODIFIER_KEY -then Character::char_code represents a modifier key rather than an actual -character. If the modifier represented by `char_code' is non-zero, then it -indicates that the associated modifier key has been depressed. In this case, -the value is one of the constants enumerated by -.I Modifier -(\c -.SM "SHIFT, CONTROL, ALTERNATE," -etc.). If the value is zero then it means that the modifier keys have been -released. -.SH "Special Key" -A special key is one which is scanned directly by the Mach kernel rather than -by the WindowServer. In general, events are not generated for special keys. -.PP -.RS -.AS -.AZ "enum SpecialKeyType {" -.AZ " VOLUME_UP = 0," -.AZ " VOLUME_DOWN," -.AZ " BRIGHTNESS_UP," -.AZ " BRIGHTNESS_DOWN," -.AZ " ALPHA_LOCK," -.AZ " HELP," -.AZ " POWER," -.AZ " SECONDARY_ARROW_UP," -.AZ " SECONDARY_ARROW_DOWN" -.AZ }; -.AE -.PP -.AS -.AZ "struct SpecialKey {" -.AN " number type;" " " "// A SpecialKeyType constant" -.AN " number scan_code;" "" "// Actual scan code" -.AZ }; -.AE -.RE -.SH OUTPUT -What follows is an explanation and description of the various pieces of -information emitted by -.I dumpkeymap. -.PP -For a more thorough discussion of any particular piece of information described -here, refer to the detailed description of the internal layout of a key mapping -provided by the -.I "Key Mapping Description" -section above. -.SH Conventions -Depending upon context, some numeric values are displayed in decimal -notation, whereas others are displayed in hexadecimal notation. -Hexadecimal numbers are denoted by a `0x' prefix (for instance, `0x7b'), -except when explicitly noted otherwise. -.SH "Key Mapping Source" -The first piece of information presented about a particular key mapping is the -source from which the data was gleaned. For a -.I .keymapping -file, the title -.SM "`KEYMAP FILE'" -is emitted along with the path and name of the file in question. For the key -mapping currently in use by the WindowServer and AppKit, the title -.SM "`ACTIVE KEYMAP'" -is emitted instead. -.SH "Device Information" -Each -.I .keymapping -file may contain one or more raw key mappings. For example, a file which maps -keys to a Dvorak-style layout might contain raw mappings for Intel -.SM "PC, ADB, NeXT," -and Sun Type5 keyboards. -.PP -For each raw mapping, the following information is emitted: -.BG -.BU -The title -.SM `KEYMAP' -along with the mapping's relative position in the -.I .keymapping -file. -.BU -The `interface' identifier. -.BU -The `handler_id' sub-identifier. -.BU -The size of the raw mapping resource counted in bytes. -.BE -The `interface' and `handler_id' values, taken together, define a specific -keyboard device. A -.I .keyboard -file, which describes the visual layout of a keyboard, also contains -`interface' and `handler_id' identifiers. The -.I .keyboard -file corresponding to a particular key mapping can be found by matching the -`interface' and `handler_id' values from each resource. -.SH Modifiers -Each mapping may contain zero or more modifier records which associate hardware -scan codes with modifier descriptions such as -.I "shift, control, alternate," -etc. The title -.SM `MODIFIERS' -is printed along with the count of modifier records which follow. For each -modifier record, the modifier's name is printed along with a list of scan -codes, in hexadecimal format, which generate that modifier value. For example: -.PP -.RS -.nf -MODIFIERS [4] -alternate: 0x1d 0x60 -control: 0x3a -keypad: 0x52 0x53 ... 0x63 0x62 -shift: 0x2a 0x36 -.fi -.RE -.SH Characters -Each mapping may contain zero or more character records which associate -hardware scan codes with the actual characters generated by those scan -codes in the presence or absence of various modifier combinations. The -title -.SM `CHARACTERS' -is printed along with the count of character records which follow. Here is a -highly abbreviated example: -.PP -.RS -.nf -CHARACTERS [9] -scan 0x00: -AC-L "a" "A" "^A" "^A" ca c7 "^A" "^A" -scan 0x07: -AC-L "x" "X" "^X" "^X" 01/b4 01/ce "^X" "^X" -scan 0x0a: ---S- "<" ">" -scan 0x13: -ACS- "2" "@" "^@" "^@" b2 b3 "^@" "^@" -scan 0x24: R---- "^M" "^C" -scan 0x3e: ----- [F4] -scan 0x4a: ----- [page up] -scan 0x60: ----- {seq#3} -scan 0x68: not-bound -.fi -.RE -.PP -For each record, the hexadecimal value of the hardware scan code is printed, -followed by a list of modifier flag combinations and the actual characters -generated by this scan code with and without modifiers applied. -.PP -The modifier flags field is composed of a combination of single letter -representations of the various modifier types. The letters stand for: -.PP -.RS -.nf -L \- alpha-lock -S \- shift -C \- control -A \- alternate -R \- carriage-return -.fi -.RE -.PP -As a special case, the -.I alpha-lock -flag also implies the -.I shift -flag, so these two flags never appear together in the same record. -.PP -The combination of modifier flags determines the meaning and number of fields -which follow. The first field after the modifier flags always represents the -character that will be generated if no modifier keys are depressed. The -remaining fields represent characters generated by the various modifier -combinations. The order of the fields follows this general pattern: -.BG -.BU -The character generated by this scan code when no modifiers are in effect is -listed first. -.BU -If the `L' or `S' flag is active, then the shifted character generated by this -scan code is listed next. -.BU -If the `C' flag is active, then the control-character generated by this scan -code is listed next. Furthermore, if the `L' or `S' flag is also active, then -the shifted control-character is listed after that. -.BU -If the `A' flag is active, then the alternate-character generated by this scan -code is listed next. Furthermore, if the `L' or `S' flag is active, then the -shifted alternate-character is listed after that. If the `C' flag is also -active, then the alternate-control-character is listed next. Finally, if the -`C' and `L' or `C' and `S' flags are also active, then the shifted -alternate-control-character is listed. -.BE -The `R' flag does not actually refer to a modifier key. Instead, it is used to -distinguish the scan code which is given the special pseudo-designation of -.I "carriage return" -key. Typically, this mask appears solo and only the two fields for control-M -and control-C follow. This flag may be a throwback to an earlier time or may -be specially interpreted by the low-level keyboard driver, but its purpose is -otherwise enigmatic. -.PP -Recalling the example from above, the following fields can be identified: -.PP -.RS -.nf -scan 0x00: -AC-L "a" "A" "^A" "^A" ca c7 "^A" "^A" -.fi -.RE -.BG -.BU -Lower-case `a' is generated when no modifiers are active. -.BU -Upper-case `A' is generated when -.IR shift " or " alpha-lock -are active. -.BU -Control-A is generated when -.I control -is active. -.BU -Control-A is generated when -.IR control " and " shift -are active. -.BU -The character represented by the hexadecimal code 0xca is generated when -.I alternate -is active. -.BU -The character represented by 0xc7 is generated when -.IR alternate " and " shift " (or " alpha-lock ") are active." -.BU -Control-A is generated when -.IR alternate " and " control -are active. -.BU -Control-A is generated when -.IR "alternate, control" " and " shift " (or " alpha-lock ") are active." -.BE -The notation used to represent a particular generated character varies. -.BG -.BU -Printable -.SM ASCII -characters are quoted, as in "x" or "X". -.BU -Control-characters are quoted and prefixed with `^', as in "^X". -.BU -Characters with values greater than 127 (0x7f) are displayed as hexadecimal -values without the `0x' prefix. -.BU -Characters in a non-\c -.SM ASCII -character set (such as `Symbol') are displayed as two hexadecimal numbers -separated by a slash, as in `01/4a'. The first number is the character set's -identification code (such as `01' for the `Symbol' set), and the second number -is the value of the generated character. -.BU -Non-printing special function characters are displayed with the function's -common name enclosed in brackets, as in `[page up]' or `[F4]'. -.BU -If the binding represents a key sequence rather than a single character, then -the sequence's identification number is enclosed in braces, as in `{seq#3}'. -.BE -Recalling a few examples from above, the following interpretations can be made: -.PP -.RS -.nf -scan 0x07: -AC-L "x" "X" "^X" "^X" 01/b4 01/ce "^X" "^X" -scan 0x3e: ----- [F4] -scan 0x4a: ----- [page up] -scan 0x60: ----- {seq#3} -.fi -.RE -.BG -.BU -"x" and "X" are printable -.SM ASCII -characters. -.BU -"^X" is a control-character. -.BU -`01/b4' and `01/ce' represent the character codes 0xb4 and 0xce in the `Symbol' -character set. -.BU -Scan code 0x3e generates function-key `F4', and scan code 0x4a generates -function-key `page up'. -.BU -Scan code 0x60 is bound to key sequence #3. -.BE -Finally, if a scan code is not bound to any characters, then it is annotated -with the label `not-bound', as with example scan code 0x68 from above. -.SH Sequences -A scan code (modified and unmodified) can be bound to a key sequence rather -than generating a single character or acting as a modifier. When it is bound -to a key sequence, a series of character invocations and modifier actions are -automatically generated rather than a single keystroke. -.PP -Each mapping may contain zero or more key sequence records. The title -.SM `SEQUENCES' -is printed along with the count of sequence records which follow. For example: -.PP -.RS -.nf -SEQUENCES [3] -sequence 0: "f" "o" "o" -sequence 1: {alternate} "b" "a" "r" {unmodify} -sequence 2: [home] "b" "a" "z" -.fi -.RE -.PP -The notation used to represent the sequence of generated characters is -identical to the notation already described in the -.I Characters -section above, with the exception that modifier actions may be interposed -between generated characters. Such modifier actions are represented by the -modifier's name enclosed in braces. The special name `{unmodify}' indicates -the release of the modifier keys. -.PP -Thus, the sequences in the above example can be interpreted as follows: -.BG -.BU -Sequence\ #0 generates `foo'. -.BU -Sequence\ #1 invokes the -.I alternate -modifier, generates `bar', and then releases -.I alternate. -.BU -Sequence\ #2 invokes the -.I home -key and then generates `baz'. In a text editor, this would probably result in -`baz' being prepended to the line of text on which the cursor resides. -.BE -.SH Special Keys -Certain keyboards feature keys which perform some type of special purpose -function rather than generating a character or acting as a modifier. For -instance, Apple keyboards often contain a -.I power -key, and -.SM NeXT -keyboards have historically featured screen brightness and volume control keys. -.PP -Each mapping may contain zero or more special-key records which associate -hardware scan codes with such special purpose functions. The title -.SM `SPECIALS' -is printed along with the count of records which follow. For each record, the -special function's name is printed along with a list of scan codes, in -hexadecimal format, which are bound to that function. For example: -.PP -.RS -.nf -SPECIALS [6] -alpha-lock: 0x39 -brightness-down: 0x79 -brightness-up: 0x74 -power: 0x7f -sound-down: 0x77 -sound-up: 0x73 -.fi -.RE -.SH FILES -.IP *.keymapping -A key mapping file which precisely defines the relationship of all -hardware-specific keyboard scan-codes with their associated functionality. -.IP *.keyboard -A file describing the physical layout of keys on a particular type of -keyboard. Each `key' token in this file defines the position and shape of the -key on the keyboard, as well as the associated scan code which that key -generates. A -.I .keymapping -file, on the other hand, defines the characters which are generated by a -particular scan code depending upon the state of the various modifier keys -(such as -.I shift, -.I control, -etc.). The `interface' and `handler_id' values from a -.I .keymapping -file are matched against those in each -.I .keyboard -file in order to associate a particular -.I .keyboard -file with a key mapping. Various -.SM GUI -programs use the -.I .keyboard -file to display a visual representation of a keyboard for the user. Since -these files are just plain text, they can be easily viewed and interpreted -without the aid of a specialized program, thus -.I dumpkeymap -leaves these files alone. -.PP -/System/Library/Keyboards -.br -/Network/Library/Keyboards -.br -/Local/Library/Keyboards -.br -/Library/Keyboards -.RS -Repositories for -.I .keymapping -and -.I .keyboard -files for MacOS/X, Darwin, and MacOS/X Server. -.RE -.PP -/NextLibrary/Keyboards -.br -/LocalLibrary/Keyboards -.RS -Repositories for -.I .keymapping -and -.I .keyboard -files for OpenStep and NextStep. -.RE -.IP $(HOME)/Library/Keyboards -Repository for personal -.I .keymapping -and -.I .keyboard -files. -.SH DIGANOSTICS -The following diagnostic messages may be issued to the standard error stream. -.TG "Unrecognized option." -An unrecognized option was specified on the command-line. Invoke -.I dumpkeymap -with the -.B "\-\^\-help" -option to view a list of valid options. -.TG "Insufficient data in keymapping data stream." -The key mapping file or data stream is corrupt. Either the file has been -incorrectly truncated or a field, such as those which indicates the number of -variable records which follow, contains a corrupt value. -.PP -The following diagnostic messages have significance only when trying to print -.I .keymapping -files mentioned on the command-line. -.TG "Bad magic number." -The mentioned file is not a -.I .keymapping -file. The file's content does not start with the string `KYM1'. -.TG "Unable to open key mapping file." -The call to fopen() failed; probably because the specified path is invalid or -.I dumpkeymap -does not have permission to read the file. -.TG "Unable to determine key mapping file size." -The call to fstat() failed, thus memory can not be allocated for loading the -file. -.TG "Unable to read key mapping file." -The call to fread() failed. -.PP -The following diagnostic messages have significance only when trying to print -the currently active key mapping when no -.I .keymapping -files have been mentioned on the command-line. -.TG "Unable to open event status driver." -The call to NXOpenEventStatus() failed. -.TG "Bad key mapping length." -The call to NXKeyMappingLength() returned a bogus value. -.TG "Unable to get current key mapping." -The call to NXGetKeyMapping() failed. -.PP -The following diagnostic messages have significance only when using -.I dumpkeymap -on a non-Apple/\c -.SM NeXT -platform. -.TG "Must specify at least one .keymapping file." -No -.I .keymapping -files were mentioned on the command-line. On non-Apple/\c -.SM NeXT -platforms, there is no concept of a currently active -.I .keymapping -file, so at least one file must be mentioned on the command-line. -.SH AUTHOR -Eric Sunshine wrote -.I dumpkeymap -and this document, the -.I "dumpkeymap user's manual." -Both -.I dumpkeymap -and this document are copyright \(co1999,2000 by Eric Sunshine -. All rights reserved. -.PP -The implementation of -.I dumpkeymap -is based upon information gathered on September 3, 1997 by Eric Sunshine - and Paul S. McCarthy during an -effort to reverse engineer the format of the -.SM NeXT -.I .keymapping -file. -.if n .PP -.if n Version \n(VE \-\- -.if n .UP diff --git a/nx-X11/programs/Xserver/hw/dmx/Imakefile b/nx-X11/programs/Xserver/hw/dmx/Imakefile deleted file mode 100644 index b8c16dd53..000000000 --- a/nx-X11/programs/Xserver/hw/dmx/Imakefile +++ /dev/null @@ -1,125 +0,0 @@ -XCOMM $XFree86$ - -#include - -#if BuildXinerama -PANORAMIX_SRCS = panoramiX.c -PANORAMIX_OBJS = panoramiX.o -#endif - -#if BuildGlxExt -GLX_SRCS = dmx_glxvisuals.c $(PANORAMIX_SRCS) -GLX_OBJS = dmx_glxvisuals.o $(PANORAMIX_OBJS) -DMX_GLX_DEFINES = $(GLX_DEFINES) -DGLXPROXY -GLXPROXY_SUBDIR = glxProxy -#endif - -#define IHaveSubdirs - -#if BuildServersOnly && !BuildDmxDevelTools -SUBDIRS = input config $(GLXPROXY_SUBDIR) -#else -SUBDIRS = input config doc examples $(GLXPROXY_SUBDIR) -#endif - -#if BuildRender -RENDER_SRCS = dmxpict.c -RENDER_OBJS = dmxpict.o -#endif - -SRCS = dmxinit.c \ - dmxscrinit.c \ - dmxshadow.c \ - dmxcursor.c \ - dmxinput.c \ - dmxdpms.c \ - dmxgc.c \ - dmxgcops.c \ - dmxwindow.c \ - dmxpixmap.c \ - dmxfont.c \ - dmxcmap.c \ - dmxvisual.c \ - dmxlog.c \ - dmxcb.c \ - dmxprop.c \ - dmxstat.c \ - dmxsync.c \ - dmxextension.c \ - miinitext.c \ - $(GLX_SRCS) \ - $(RENDER_SRCS) - -OBJS = dmxinit.o \ - dmxscrinit.o \ - dmxshadow.o \ - dmxcursor.o \ - dmxinput.o \ - dmxdpms.o \ - dmxgc.o \ - dmxgcops.o \ - dmxwindow.o \ - dmxpixmap.o \ - dmxfont.o \ - dmxcmap.o \ - dmxvisual.o \ - dmxlog.o \ - dmxcb.o \ - dmxprop.o \ - dmxstat.o \ - dmxsync.o \ - dmxextension.o \ - miinitext.o \ - $(GLX_OBJS) \ - $(RENDER_OBJS) - -#include - -#ifdef XVendorString - VENDORSTRING = XVendorString - VENDOR_STRING = -DVENDOR_STRING=\"$(VENDORSTRING)\" -#endif - -#ifdef XVendorRelease - VENDORRELEASE = XVendorRelease - VENDOR_RELEASE = -DVENDOR_RELEASE="$(VENDORRELEASE)" -#endif - -VENDOR_DEFINES = $(VENDOR_STRING) $(VENDOR_RELEASE) - - OSNAME = OSName - OSVENDOR = OSVendor -OSNAME_DEFINES = -DOSNAME='"$(OSNAME)"' -DOSVENDOR='"$(OSVENDOR)"' - -INCLUDES = -I. -I$(XBUILDINCDIR) -I$(FONTINCSRC) \ - -I../../mi -I../../include -I../../os \ - -I../../fb -I../../miext/shadow -I../../render \ - -I$(EXTINCSRC) -I$(XINCLUDESRC) -I$(SERVERSRC)/Xext - -DEFINES = $(OS_DEFINES) $(EXT_DEFINES) -DDMXEXT -DXTEST \ - $(DMX_GLX_DEFINES) $(DMX_DEFINES) $(VENDOR_DEFINES) \ - $(OSNAME_DEFINES) - -all:: $(OBJS) - -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) - -LinkSourceFile(miinitext.c,$(SERVERSRC)/mi) -SpecialCObjectRule(miinitext,$(ICONFIGFILES),-DDMXSERVER) - -#if BuildGlxExt -LinkSourceFile(panoramiX.c,$(SERVERSRC)/Xext) -#if HasGcc3 -SpecialCObjectRule(panoramiX,$(ICONFIGFILES),-Wno-missing-prototypes -Wno-strict-prototypes -Wno-missing-declarations -Wno-sign-compare) -#else -SpecialCObjectRule(panoramiX,$(ICONFIGFILES),$(_NOOP_)) -#endif -#endif - -NormalLibraryObjectRule() -NormalLibraryTarget(dmx,$(OBJS)) - -InstallManPage(Xdmx,$(MANDIR)) - -DependTarget() diff --git a/nx-X11/programs/Xserver/hw/dmx/Xdmx.man b/nx-X11/programs/Xserver/hw/dmx/Xdmx.man deleted file mode 100644 index 9c8bdea00..000000000 --- a/nx-X11/programs/Xserver/hw/dmx/Xdmx.man +++ /dev/null @@ -1,741 +0,0 @@ -.\" $XFree86$ -.\" -.\" Copyright 2001-2004 Red Hat Inc., Durham, North Carolina. -.\" All Rights Reserved. -.\" -.\" Permission is hereby granted, free of charge, to any person obtaining -.\" a copy of this software and associated documentation files (the -.\" "Software"), to deal in the Software without restriction, including -.\" without limitation on the rights to use, copy, modify, merge, -.\" publish, distribute, sublicense, and/or sell copies of the Software, -.\" and to permit persons to whom the Software is furnished to do so, -.\" subject to the following conditions: -.\" -.\" he above copyright notice and this permission notice (including the -.\" next paragraph) shall be included in all copies or substantial -.\" portions of the Software. -.\" -.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -.\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -.\" NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS -.\" BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -.\" ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -.\" CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -.\" SOFTWARE. -.TH Xdmx 1 __vendorversion__ -.SH NAME -Xdmx - Distributed Multi-head X server -.SH SYNOPSIS -.B Xdmx -[:display] [option ...] -.SH DESCRIPTION -.I Xdmx -is a proxy X server that uses one or more other X servers as its display -devices. It provides multi-head X functionality for displays that might -be located on different machines. -.I Xdmx -functions as a front-end X server that acts as a proxy to a set of -back-end X servers. All of the visible rendering is passed to the -back-end X servers. Clients connect to the -.I Xdmx -front-end, and everything appears as it would in a regular multi-head -configuration. If Xinerama is enabled (e.g., with -.B +xinerama -on the command line), the clients see a single large screen. -.PP -.I Xdmx -communicates to the back-end X servers using the standard X11 protocol, -and standard and/or commonly available X server extensions. -.SH OPTIONS -In addition to the normal X server options described in the -.I Xserver(1) -manual page, -.I Xdmx -accepts the following command line switches: -.TP 8 -.BI "\-display " display-name -This specifies the name(s) of the back-end X server display(s) to connect -to. This option may be specified multiple times to connect to more than -one back-end display. The first is used as screen 0, the second as screen 1, -etc. If this option is omitted, the -.B $DISPLAY -environment variable is used as the single back-end X server display. -.sp -.TP 8 -.BI "\-xinput " input-source -This specifies the source to use for XInput extension devices. The -choices are the same as for -.BR "\-input " , -described below, except that core devices on backend servers cannot be -treated as XInput extension devices. (Although extension devices on -backend and console servers are supported as extension devices under -.IR Xdmx ). -.sp -.TP 8 -.BI "\-input " input-source -This specifies the source to use for the core input devices. The choices are: -.RS -.TP 4 -.B dummy -A set of dummy core input drivers are used. These never generate any -input events. -.sp -.TP 4 -.B local -The raw keyboard and pointer from the local computer are used. A -comma-separated list of driver names can be appended. For example, to -select the example Linux keyboard and PS/2 mouse driver use: -.BR "-input local,kbd,ps2" . -The following drivers have been implemented for Linux: kbd, ms (a -two-button Microsoft mouse driver), ps2 (a PS/2 mouse driver), usb-mou -(a USB mouse driver), usb-kbd (a USB keyboard driver), and usb-oth (a -USB non-keyboard, non-mouse driver). Additional drivers may be -implemented in the future. Appropriate defaults will be used if no -comma-separated list is provided. -.sp -.TP 4 -.I display-name -If the display-name is a back-end server, then core input events are -taken from the server specified. Otherwise, a console window will be -opened on the specified display. -.sp -If the -.I display-name -is followed by ",xi" then XInput extension devices on the display will -be used as -.I Xdmx -XInput extension devices. If the -.I display-name -is followed by ",noxi" then XInput extension devices on the display will -.B not -be used as -.I Xdmx -XInput extension devices. Currently, the default is ",xi". -.sp -If the -.I display-name -is followed by ",console" and the -.I display-name -refers to a display that is used as a backend display, then a console -window will be opened on that display -.B and -that display will be treated as a backend display. Otherwise (or if -",noconsole" is used), the display will be treated purely as a backend -or a console display, as described above. -.sp -If the -.I display-name -is followed by ",windows", then outlines of the windows on the backend -will be displayed inside the console window. Otherwise (or if -",nowindows" is used), the console window will not display the outlines -of backend windows. (This option only applies to console input.) -.sp -If the -.I display-name -is followed by ",xkb", then the next 1 to 3 comma-separated parameters -will specify the keycodes, symbols, and geometry of the keyboard for -this input device. For example, ",xkb,xfree86,pc104" will specify that -the "xfree86" keycodes and the "pc104" symbols should be used to -initialize the keyboard. For an SGI keyboard, ",xkb,sgi/indy(pc102)" -might be useful. A list of keycodes, symbols, and geometries can be -found in -.IR /usr/X11R6/lib/X11/xkb . -If this option is not specified, the input device will be queried, -perhaps using the XKEYBOARD extension. -.RE -.sp -.RS -If this option isn't specified, the default input source is the first -back-end server (the one used for screen 0). The console window shows -the layout of the back-end display(s) and pointer movements and key -presses within the console window will be used as core input devices. -.sp -Several special function keys are active, depending on the input -source: -.sp -.RS -.B Ctrl-Alt-q -will terminate the -.I Xdmx -server in all modes. -.sp -.B Ctrl-Alt-g -will toggle a -server grab in console mode (a special cursor, currently a spider, is -used to indicate an active server grab). -.sp -.B Ctrl-Alt-f -will toggle fine-grain motion in console mode (a special cursor, -currently a cross hair, is used to indicate this mode). If this mode is -combined with a server grab, then the cursor will have 4 lines instead -of only 2. -.sp -.BR Ctrl-Alt-F1 " through " Ctrl-Alt-F12 -will switch to another VC in local (raw) mode. -.RE -.RE -.sp -.TP 8 -.BI "-shadowfb" -This option turns on (legacy) support for the shadow frame buffer. -.sp -.TP 8 -.BI "-noshadowfb" -This option turns off (legacy) support for the shadow frame buffer. -Note that this option has been deprecated and will be removed in the -next release. -.sp -.TP 8 -.BI "-nomulticursor" -This option turns off support for displaying multiple cursors on -overlapped back-end displays. This option is available for testing and -benchmarking purposes. -.sp -.TP 8 -.BI "-fontpath" -This option sets the -.I Xdmx -server's default font path. This option can be specified multiple times -to accommodate multiple font paths. See the -.B "FONT PATHS" -section below for very important information regarding setting the -default font path. -.sp -.TP 8 -.BI "-configfile " filename -Specify the configuration file that should be read. Note that if the -.B \-display -command-line option is used, then the configuration file will be -ignored. -.sp -.TP 8 -.BI "-config " name -Specify a configuration to use. The -.I name -will be the name following the -.B virtual -keyword in the configuration file. -.sp -.TP 8 -.BI "-stat " "interval screens" -This option enables the display of performance statistics. The interval -is in seconds. The screens is a count of the number of back-end screens -for which data is printed each interval. Specifying 0 for screens will -display data for all screens. -.sp -For each screen, the following information is printed: the screen -number, an absolute count of the number of XSync() calls made -(SyncCount), the rate of these calls during the previous interval -(Sync/s), the average round-trip time (in microseconds) of the last 10 -XSync() calls (avSync), the maximum round-trip time (in microseconds) of -the last 10 XSync calls (mxSync), the average number of XSync() requests -that were pending but not yet processed for each of the last 10 -processed XSync() calls, the maximum number of XSync() requests that -were pending but not yet processed for each of the last 10 processed -XSync() calls, and a histogram showing the distribution of the times of -all of the XSync() calls that were made during the previous interval. -.sp -(The length of the moving average and the number and value of histogram -bins are configurable at compile time in the -.B dmxstat.h -header file.) -.sp -.TP 8 -.BI "-syncbatch " interval -This option sets the -.I interval -in milliseconds for XSync() batching. An -.I interval -less than or equal to 0 will disable XSync() batching. The default -.I interval -is 100 ms. -.sp -.TP 8 -.BI "-nooffscreenopt" -This option disables the offscreen optimization. Since the lazy window -creation optimization requires the offscreen optimization to be enabled, -this option will also disable the lazy window creation optimization. -.sp -.TP 8 -.BI "-nowindowopt" -This option disables the lazy window creation optimization. -.sp -.TP 8 -.BI "-nosubdivprims" -This option disables the primitive subdivision optimization. -.sp -.TP 8 -.BI "-noxkb" -Disable use of the XKB extension for communication with the back end -displays. (Combine with -.B "-kb" -to disable all use of XKB.) -.sp -.TP 8 -.BI "-depth " int -This option sets the root window's default depth. When choosing a -default visual from those available on the back-end X server, the first -visual with that matches the depth specified is used. -.sp -This option can be combined with the -.BI "-cc" -option, which specifies the default color visual class, to force the use -of a specific depth and color class for the root window. -.sp -.TP 8 -.BI "-norender" -This option disables the RENDER extension. -.sp -.TP 8 -.BI "-noglxproxy" -This option disables GLX proxy -- the build-in GLX extension -implementation that is DMX aware. -.sp -.TP 8 -.BI "-noglxswapgroup" -This option disables the swap group and swap barrier extensions in GLX -proxy. -.sp -.TP 8 -.BI "-glxsyncswap" -This option enables synchronization after a swap buffers call by waiting -until all X protocol has been processed. When a client issues a -glXSwapBuffers request, Xdmx relays that request to each back-end X -server, and those requests are buffered along with all other protocol -requests. However, in systems that have large network buffers, this -buffering can lead to the set of back-end X servers handling the swap -buffers request asynchronously. With this option, an XSync() request is -issued to each back-end X server after sending the swap buffers request. -The XSync() requests will flush all buffered protocol (including the -swap buffers requests) and wait until the back-end X servers have -processed those requests before continuing. This option does not wait -until all GL commands have been processed so there might be previously -issued commands that are still being processed in the GL pipe when the -XSync() request returns. See the -.BI "-glxfinishswap" -option below if Xdmx should wait until the GL commands have been -processed. -.sp -.TP 8 -.BI "-glxfinishswap" -This option enables synchronization after a swap buffers call by waiting -until all GL commands have been completed. It is similar to the -.BI "-glxsyncswap" -option above; however, instead of issuing an XSync(), it issues a -glFinish() request to each back-end X server after sending the swap -buffers requests. The glFinish() request will flush all buffered -protocol requests, process both X and GL requests, and wait until all -previously called GL commands are complete before returning. -.sp -.TP 8 -.BI "-ignorebadfontpaths" -This option ignores font paths that are not available on all back-end -servers by removing the bad font path(s) from the default font path -list. If no valid font paths are left after removing the bad paths, an -error to that effect is printed in the log. -.sp -.TP 8 -.BI "-addremovescreens" -This option enables the dynamic addition and removal of screens, which -is disabled by default. Note that GLXProxy and Render do not yet -support dynamic addition and removal of screens, and must be disabled -via the -.BI "-noglxproxy" -and -.BI "-norender" -command line options described above. -.sp -.TP 8 -.BI "-param" -This option specifies parameters on the command line. Currently, only -parameters dealing with XKEYBOARD configuration are supported. These -parameters apply only to the core keyboard. Parameter values are -installation-dependent. Please see -.I /usr/X11R6/lib/X11/xkb -or a similar directory for complete information. -.RS -.TP 8 -.B XkbRules -Defaults to "xfree86". Other values may include "sgi" and "sun". -.sp -.TP 8 -.B XkbModel -Defaults to "pc101". When used with "xfree86" rules, other values may -include "pc102", "pc104", "pc105", "microsoft", and many others. When -used with "sun" rules, other values may include "type4" and "type5". -.sp -.TP 8 -.B XkbLayout -Defaults to "us". Other country codes and "dvorak" are usually -available. -.sp -.TP 8 -.B XkbVariant -Defaults to "". -.sp -.TP 8 -.B XkbOptions -Defaults to "". -.RE -.SH "CONFIGURATION FILE GRAMMAR" -The following words and tokens are reserved: -.RS -.B virtual -.B display -.B wall -.B option -.B param -.B { -.B } -.B ; -.B # -.RE -.PP -Comments start with a -.B # -mark and extend to the end of the line. They may appear anywhere. If a -configuration file is read into -.BR xdmxconfig , -the comments in that file will be preserved, but will not be editable. -.PP -The grammar is as follows: -.RS -virtual-list ::= [ virtual-list ] | virtual - -virtual ::= -.B virtual -[ name ] [ dim ] -.B { -dw-list -.B } - -dw-list ::= [ dw-list ] | dw - -dw ::= display | wall | option - -display ::= -.B display -name [ geometry ] [ / geometry ] [ origin ] -.B ; - -wall ::= -.B wall -[ dim ] [ dim ] name-list -.B ; - -option ::= -.B option -name-list -.B ; - -param ::= -.B param -name-list -.B ; - -param ::= -.B param { -param-list -.B } - -param-list ::= [ param-list ] | name-list -.B ; - -name-list ::= [ name-list ] | name - -name ::= string | double-quoted-string - -dim ::= integer -.B x -integer - -geometry ::= [ integer -.B x -integer ] [ signed-integer signed-integer ] - -origin ::= -.B @ -integer -.B x -integer -.RE -.PP -The name following -.B virtual -is used as an identifier for the configuration, and may be passed to -.B Xdmx -using the -.B \-config -command line option. The name of a display should be standard X display -name, although no checking is performed (e.g., "machine:0"). -.PP -For names, double quotes are optional unless the name is reserved or -contains spaces. -.PP -The first dimension following -.B wall -is the dimension for tiling (e.g., 2x4 or 4x4). The second dimension -following -.B wall -is the dimension of each display in the wall (e.g., 1280x1024). -.PP -The first geometry following -.B display -is the geometry of the screen window on the backend server. The second -geometry, which is always preceeded by a slash, is the geometry of the -root window. By default, the root window has the same geometry as the -screen window. -.PP -The -.B option -line can be used to specify any command-line options (e.g., -.BR \-input ). -(It cannot be used to specify the name of the front-end display.) The -option line is processed once at server startup, just line command line -options. This behavior may be unexpected. -.SH "CONFIGURATION FILE EXAMPLES" -Two displays being used for a desktop may be specified in any of the -following formats: -.RS -.nf -virtual example0 { - display d0:0 1280x1024 @0x0; - display d1:0 1280x1024 @1280x0; -} -.sp -virtual example1 { - display d0:0 1280x1024; - display d1:0 @1280x0; -} -.sp -virtual example2 { - display "d0:0"; - display "d1:0" @1280x0; -} -.sp -virtual example3 { wall 2x1 d0:0 d1:0; } -.fi -.RE -A 4x4 wall of 16 total displays could be specified as follows (if no -tiling dimension is specified, an approximate square is used): -.RS -.nf -virtual example4 { - wall d0:0 d1:0 d2:0 d3:0 - d4:0 d5:0 d6:0 d7:0 - d8:0 d9:0 da:0 db:0 - dc:0 dd:0 de:0 df:0; -} -.fi -.RE -.SH "FONT PATHS" -The font path used by the -.I Xdmx -front-end server will be propagated to each back-end server,which -requires that each back-end server have access to the exact same font -paths as the front-end server. This can be most easily handled by -either using a font server (e.g., xfs) or by remotely mounting the font -paths on each back-end server, and then setting the -.I Xdmx -server's default font path with the --I "-fontpath" -command line option described above. -.PP -For example, if you specify a font path with the following command line: -.RS -Xdmx :1 -display d0:0 -fontpath /usr/fonts/75dpi/ -fontpath /usr/fonts/Type1/ +xinerama -.RE -Then, /usr/fonts/75dpi/ and /usr/fonts/Type1/ must be valid font paths -on the -.I Xdmx -server and all back-end server, which is d0 in this example. -.PP -Font servers can also be specified with the -.I "-fontpath" -option. For example, let's assume that a properly configured font -server is running on host d0. Then, the following command line -.RS -Xdmx :1 -display d0:0 -display d1:0 -fontpath tcp/d0:7100 +xinerama -.RE -will initialize the front-end -.I Xdmx -server and each of the back-end servers to use the font server on d0. -.PP -Some fonts might not be supported by either the front-end or the -back-end servers. For example, let's assume the front-end -.I Xdmx -server includes support Type1 fonts, but one of the back-end servers -does not. Let's also assume that the default font path for -.I Xdmx -includes Type1 fonts in its font path. Then, when -.I Xdmx -initializes the default font path to load the default font, the font -path that includes Type1 fonts (along with the other default font paths -that are used by the -.I Xdmx -server) is sent to the back-end server that cannot handle Type1 fonts. -That back-end server then rejects the font path and sends an error back -to the -.I Xdmx -server. -.I Xdmx -then prints an error message and exits because it failed to set the -default font path and was unable load the default font. -.PP -To fix this error, the offending font path must be removed from the -default font path by using a different -.I "-fontpath" -command line option. -.PP -The -.I "-fontpath" -option can also be added to the configuration file as described above. -.SH "COMMAND-LINE EXAMPLES" -The back-end machines are d0 and d1, core input is from the pointer and -keyboard attached to d0, clients will refer to :1 when opening windows: -.RS -Xdmx :1 -display d0:0 -display d1:0 +xinerama -.RE -.PP -As above, except with core input from d1: -.RS -Xdmx :1 -display d0:0 -display d1:0 -input d1:0 +xinerama -.RE -.PP -As above, except with core input from a console window on the local -display: -.RS -Xdmx :1 -display d0:0 -display d1:0 -input :0 +xinerama -.RE -.PP -As above, except with core input from the local keyboard and mouse: -.RS -Xdmx :1 -display d0:0 -display d1:0 -input local,kbd,ps2 +xinerama -.RE -Note that local input can be used under Linux while another X session is -running on :0 (assuming the user can access the Linux console tty and -mouse devices): a new (blank) VC will be used for keyboard input on the -local machine and the Ctrl-Alt-F* sequence will be available to change -to another VC (possibly back to another X session running on the local -machine). Using Ctrl-Alt-Backspace on the blank VC will terminate the -Xdmx session and return to the original VC. -.PP -This example uses the configuration file shown in the previous section: -.RS -Xdmx :1 -input :0 +xinerama -configfile filename -config example2 -.RE -With this configuration file line: -.RS -option -input :0 +xinerama; -.RE -the command line can be shortened to: -.RS -Xdmx :1 -configfile filename -config example2 -.RE -.SH "USING THE USB DEVICE DRIVERS" -.P -The USB device drivers use the devices called -.IR /dev/input/event0 ", " /dev/input/event1 ", etc." -under Linux. These devices are driven using the -.I evdev -Linux kernel module, which is part of the hid suite. Please note that -if you load the -.I mousedev -or -.I kbddev -Linux kernel modules, then USB devices will appear as core Linux input -devices and you will not be able to select between using the device only -as an -.I Xdmx -core device or an -.I Xdmx -XInput extension device. Further, you may be unable to unload the -.I mousedev -Linux kernel module if -.I XFree86 -is configured to use -.I /dev/input/mice -as an input device (this is quite helpful for laptop users and is set up -by default under some Linux distributions, but should be changed if USB -devices are to be used with -.IR Xdmx ). -.PP -The USB device drivers search through the Linux devices for the first -mouse, keyboard, or non-mouse-non-keyboard Linux device and use that -device. -.SH "KEYBOARD INITIALIZATION" -.PP -If -.I Xdmx -was invoked with -.I \-xkb -or was -.B not -compiled to use the XKEYBOARD extension, then a keyboard on a backend or -console will be initialized using the map that the host X server -provides. -.PP -If the XKEYBOARD extension is used for both -.I Xdmx -and the host X server for the keyboard (i.e., the backend or console X -server), then the type of the keyboard will -be obtained from the host X server and the keyboard under -.I Xdmx -will be initialized with that information. Otherwise, the default type -of keyboard will be initialized. In both cases, the map from the host X -server will -.B not -be used. This means that different initial behavior may be noted with -and without XKEYBOARD. Consistent and expected results will be obtained -by running XKEYBOARD on all servers and by avoiding the use of -.I xmodmap -on the backend or console X servers prior to starting -.IR Xdmx . -.PP -If -.I \-xkbmap -is specified on the -.I Xdmx -command line, then that map will currently be used for all keyboards. -.SH "MULTIPLE CORE KEYBOARDS" -X was not designed to support multiple core keyboards. However, -.I Xdmx -provides some support for multiple core keyboards. Best results will be -obtained if all of the keyboards are of the same type and are using the -same keyboard map. Because the X server passes raw key code information -to the X client, key symbols for keyboards with different key maps would -be different if the key code for each keyboard was sent without -translation to the client. Therefore, -.I Xdmx -will attempt to translate the key code from a core keyboard to the key -code for the key with the same key symbol of the -.B first -core keyboard that was loaded. If the key symbol appears in both maps, -the results will be expected. Otherwise, the second core keyboard will -return a NoSymbol key symbol for some keys that would have been -translated if it was the first core keyboard. -.ig -.SH ENVIRONMENT -.. -.ig -.SH FILES -.. -.SH "SEE ALSO" -.BR DMX "(3X), " X "(__miscmansuffix__), " Xserver "(1), " xdmxconfig "(1), " -.BR vdltodmx "(1), " xfs "(1), " xkbcomp (1) -.SH AUTHORS -Kevin E. Martin -.I , -David H. Dawes -.I , -and -Rickard E. (Rik) Faith -.IR . -.PP -Portions of -.I Xdmx -are based on code from The XFree86 Project -.RI ( http://www.xfree86.org ) -and X.Org -.RI ( http://www.x.org ). diff --git a/nx-X11/programs/Xserver/hw/dmx/config/Canvas.c b/nx-X11/programs/Xserver/hw/dmx/config/Canvas.c deleted file mode 100644 index 4dccd7382..000000000 --- a/nx-X11/programs/Xserver/hw/dmx/config/Canvas.c +++ /dev/null @@ -1,160 +0,0 @@ -/* $XFree86$ */ -/* - * Copyright 1987, 1998 The Open Group - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation. - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of The Open Group shall not be - * used in advertising or otherwise to promote the sale, use or other dealings - * in this Software without prior written authorization from The Open Group. - */ - -/* - * Copyright 2002 Red Hat Inc., Durham, North Carolina. - * - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation on the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial - * portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -/* - * Authors: - * Rickard E. (Rik) Faith - * - * This file was originally taken from xc/lib/Xaw/Template.c - */ - -#include -#include -#include "CanvasP.h" - -static void CanvasInitialize(Widget request, Widget w, - ArgList args, Cardinal *num_args) -{ -} - -static void CanvasExpose(Widget w, XEvent *event, Region region) -{ - CanvasExposeDataRec data; - - data.w = w; - data.event = event; - data.region = region; - - if (!XtIsRealized(w)) return; - XtCallCallbacks(w, XtNcanvasExposeCallback, (XtPointer)&data); -} - -static void CanvasResize(Widget w) -{ - if (!XtIsRealized(w)) return; - XtCallCallbacks(w, XtNcanvasResizeCallback, (XtPointer)w); -} - -static void CanvasAction(Widget w, XEvent *event, - String *params, Cardinal *num_params) -{ - XtCallCallbacks(w, XtNcallback, (XtPointer)event); -} - -#define offset(field) XtOffsetOf(CanvasRec, canvas.field) -static XtResource resources[] = { - { XtNcallback, XtCCallback, XtRCallback, - sizeof(XtCallbackList), offset(input_callback), XtRCallback, NULL }, - { XtNcanvasExposeCallback, XtCcanvasExposeCallback, XtRCallback, - sizeof(XtCallbackList), offset(expose_callback), XtRCallback, NULL }, - { XtNcanvasResizeCallback, XtCcanvasResizeCallback, XtRCallback, - sizeof(XtCallbackList), offset(resize_callback), XtRCallback, NULL }, -}; -#undef offset - -static XtActionsRec actions[] = -{ - {"canvas", CanvasAction}, -}; - -static char translations[] = -": canvas()\n\ -: canvas()\n\ -: canvas()\n\ -: canvas()\n\ -" -; - -#define Superclass (&widgetClassRec) -CanvasClassRec canvasClassRec = { - /* core */ - { - (WidgetClass)Superclass, /* superclass */ - "Canvas", /* class_name */ - sizeof(CanvasRec), /* widget_size */ - NULL, /* class_initialize */ - NULL, /* class_part_initialize */ - False, /* class_inited */ - CanvasInitialize, /* initialize */ - NULL, /* initialize_hook */ - XtInheritRealize, /* realize */ - actions, /* actions */ - XtNumber(actions), /* num_actions */ - resources, /* resources */ - XtNumber(resources), /* num_resources */ - NULLQUARK, /* xrm_class */ - True, /* compress_motion */ - True, /* compress_exposure */ - True, /* compress_enterleave */ - False, /* visible_interest */ - NULL, /* destroy */ - CanvasResize, /* resize */ - CanvasExpose, /* expose */ - NULL, /* set_values */ - NULL, /* set_values_hook */ - XtInheritSetValuesAlmost, /* set_values_almost */ - NULL, /* get_values_hook */ - NULL, /* accept_focus */ - XtVersion, /* version */ - NULL, /* callback_private */ - translations, /* tm_table */ - XtInheritQueryGeometry, /* query_geometry */ - XtInheritDisplayAccelerator, /* display_accelerator */ - NULL, /* extension */ - }, - /* canvas */ - { - NULL, /* extension */ - } -}; - -WidgetClass canvasWidgetClass = (WidgetClass)&canvasClassRec; diff --git a/nx-X11/programs/Xserver/hw/dmx/config/Canvas.h b/nx-X11/programs/Xserver/hw/dmx/config/Canvas.h deleted file mode 100644 index a36851a6d..000000000 --- a/nx-X11/programs/Xserver/hw/dmx/config/Canvas.h +++ /dev/null @@ -1,56 +0,0 @@ -/* $XFree86$ */ -/* - -Copyright 1987, 1998 The Open Group -Copyright 2002 Red Hat Inc., Durham, North Carolina. - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ - -/* - * Authors: - * Rickard E. (Rik) Faith - * - * This file was originally taken from xc/lib/Xaw/Template.h - */ - -#ifndef _Canvas_h -#define _Canvas_h - -#include - -#define XtNcanvasExposeCallback "canvasExposeCallback" -#define XtCcanvasExposeCallback "CanvasExposeCallback" -#define XtNcanvasResizeCallback "canvasResizeCallback" -#define XtCcanvasResizeCallback "CanvasResizeCallback" - -typedef struct _CanvasClassRec *CanvasWidgetClass; -typedef struct _CanvasRec *CanvasWidget; -extern WidgetClass canvasWidgetClass; - -typedef struct _CanvasExposeDataRec { - Widget w; - XEvent *event; - Region region; -} CanvasExposeDataRec, *CanvasExposeDataPtr; - -#endif /* _Canvas_h */ diff --git a/nx-X11/programs/Xserver/hw/dmx/config/CanvasP.h b/nx-X11/programs/Xserver/hw/dmx/config/CanvasP.h deleted file mode 100644 index 98f95b94e..000000000 --- a/nx-X11/programs/Xserver/hw/dmx/config/CanvasP.h +++ /dev/null @@ -1,66 +0,0 @@ -/* $XFree86$ */ -/* - -Copyright 1987, 1998 The Open Group -Copyright 2002 Red Hat Inc., Durham, North Carolina. - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ - -/* - * Authors: - * Rickard E. (Rik) Faith - * - * This file was originally taken from xc/lib/Xaw/TemplateP.h - */ - -#ifndef _CanvasP_h -#define _CanvasP_h - -#include "Canvas.h" - -/* include superclass private header file */ -#include - -typedef struct { - XtPointer extension; -} CanvasClassPart; - -typedef struct _CanvasClassRec { - CoreClassPart core_class; - CanvasClassPart canvas_class; -} CanvasClassRec; - -extern CanvasClassRec canvasClassRec; - -typedef struct { - XtCallbackList input_callback; - XtCallbackList expose_callback; - XtCallbackList resize_callback; -} CanvasPart; - -typedef struct _CanvasRec { - CorePart core; - CanvasPart canvas; -} CanvasRec; - -#endif /* _CanvasP_h */ diff --git a/nx-X11/programs/Xserver/hw/dmx/config/Imakefile b/nx-X11/programs/Xserver/hw/dmx/config/Imakefile deleted file mode 100644 index 08039c03e..000000000 --- a/nx-X11/programs/Xserver/hw/dmx/config/Imakefile +++ /dev/null @@ -1,101 +0,0 @@ -XCOMM $XFree86$ - -#include -#include - -YFLAGS = -d - -LIBSRCS = parser.c scanner.c dmxparse.c dmxprint.c dmxcompat.c dmxconfig.c -LIBOBJS = parser.o scanner.o dmxparse.o dmxprint.o dmxcompat.o dmxconfig.o - -#if !BuildServersOnly -CONFIGSRCS = xdmxconfig.c dmxlog.c Canvas.c -CONFIGOBJS = xdmxconfig.o dmxlog.o Canvas.o - -COMPATSRCS = vdltodmx.c -COMPATOBJS = vdltodmx.o - -TESTSRCS = dmxtodmx.c -TESTOBJS = dmxtodmx.o -#endif - -SRCS = $(LIBSRCS) $(CONFIGSRCS) $(COMPATSRCS) $(TESTSRCS) -OBJS = $(LIBOBJS) $(CONFIGOBJS) $(COMPATOBJS) $(TESTOBJS) - -#if !BuildServersOnly -EXES = xdmxconfig vdltodmx dmxtodmx -#endif - -LOCAL_LIBRARIES = -L. -ldmxconfig - -#include - -INCLUDES = -I. -I.. -I$(XBUILDINCDIR) -I$(FONTINCSRC) -I../../../mi \ - -I../../../include -I../../../render -I$(EXTINCSRC) - -DEFINES = $(OS_DEFINES) $(EXT_DEFINES) -DDMX_LOG_STANDALONE $(DMX_DEFINES) - -all:: - -LexFile(scanner) -YaccFile(parser,$(YFLAGS)) - -#if HasGcc3 -XCOMM These rules remove some of the default warnings and, therefore, the -XCOMM clutter from the compiler output. Only do this for GCC 3, since the -XCOMM undef warning was added in 2.8. (The warnings are harmless, so be -XCOMM conservative in their removal.) -SpecialCObjectRule(parser,parser.h,-Wno-undef) -SpecialCObjectRule(scanner,parser.h,-Wno-undef -Wno-unused-function -Wno-unused-label -Wno-unused-variable) -#endif - -NormalLibraryObjectRule() -NormalLibraryTarget(dmxconfig,$(LIBOBJS)) - -#if !BuildServersOnly -NormalProgramTarget(xdmxconfig,$(CONFIGOBJS),\ - libdmxconfig.a XawClientDepLibs $(DEPXTOOLLIB),\ - $(LOCAL_LIBRARIES) XawClientLibs $(XTOOLLIB),NullParameter) -AllTarget(ProgramTargetName(xdmxconfig)) - -NormalProgramTarget(vdltodmx,$(COMPATOBJS),libdmxconfig.a,\ - $(LOCAL_LIBRARIES),NullParameter) -AllTarget(ProgramTargetName(vdltodmx)) - -NormalProgramTarget(dmxtodmx,$(TESTOBJS),libdmxconfig.a,\ - $(LOCAL_LIBRARIES),NullParameter) -AllTarget(ProgramTargetName(dmxtodmx)) - -LinkSourceFile(dmxlog.c,..) - -InstallProgram(dmxtodmx,$(BINDIR)) -InstallProgram(vdltodmx,$(BINDIR)) -InstallProgram(xdmxconfig,$(BINDIR)) - -InstallManPage(dmxtodmx,$(MANDIR)) -InstallManPage(vdltodmx,$(MANDIR)) -InstallManPage(xdmxconfig,$(MANDIR)) -#endif - -DependTarget() - -#if !BuildServersOnly -test: $(EXES) - @for i in test-*.in; do \ - b=`echo $$i | sed 's,.in$$,,'` \ - export b; \ - (./dmxtodmx < $$i > $$b.tmp 2>&1; exit 0); \ - if cmp -s ./$$b.out ./$$b.tmp; \ - then echo PASSED $$b; rm -f $$b.tmp; \ - else echo "FAILED $$b **********"; \ - fi \ - done - -test-update: - @for i in test-*.in; do \ - b=`echo $$i | sed 's,.in$$,,'` \ - export b; \ - echo Writing $$b.out; \ - (./dmxtodmx < $$i > $$b.out 2>&1; exit 0) \ - done -#endif diff --git a/nx-X11/programs/Xserver/hw/dmx/config/TODO b/nx-X11/programs/Xserver/hw/dmx/config/TODO deleted file mode 100644 index 2998ff4a0..000000000 --- a/nx-X11/programs/Xserver/hw/dmx/config/TODO +++ /dev/null @@ -1,7 +0,0 @@ -Fri May 31 13:20:17 2002 - -1) Sanitize values from input boxes. - -2) Add canvas colors to cavas widget resources or to command-line options. - -3) Add ability to edit option line(s) and wall. diff --git a/nx-X11/programs/Xserver/hw/dmx/config/dmxcompat.c b/nx-X11/programs/Xserver/hw/dmx/config/dmxcompat.c deleted file mode 100644 index 3681e8aa2..000000000 --- a/nx-X11/programs/Xserver/hw/dmx/config/dmxcompat.c +++ /dev/null @@ -1,237 +0,0 @@ -/* $XFree86$ */ -/* - * Copyright 2002 Red Hat Inc., Durham, North Carolina. - * - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation on the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial - * portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -/* - * Authors: - * Rickard E. (Rik) Faith - */ - -/** \file - * This file provides some compatibility support for reading VDL files - * that are used by xmovie - * (http://www.llnl.gov/icc/sdd/img/xmovie/xmovie.shtml). - * - * This file is not used by the DMX server. - */ - -#ifdef HAVE_DMX_CONFIG_H -#include -#endif - -#include "dmxconfig.h" -#include "dmxparse.h" -#include "dmxcompat.h" -#include "parser.h" -#include -#include -#include -#include - -static int dmxVDLReadLine(FILE *str, char *buf, int len) -{ - if (fgets(buf, len, str)) return strlen(buf); - return 0; -} - -static int dmxVDLCount(const char *buf) -{ - return strtol(buf, NULL, 10); -} - -static void dmxVDLVirtualEntry(const char *buf, - char *name, int *len, - int *x, int *y) -{ - char *end; - const char *s; - char *d; - int start; - - *x = strtol(buf, &end, 10); - *y = strtol(end, &end, 10); - - for (s = end, d = name, start = 1; *s && *s != '['; ++s) { - if (start && isspace(*s)) continue; - *d++ = *s; - start = 0; - } - *d = '\0'; - while (d > name && isspace(d[-1])) *--d = '\0'; /* remove trailing space */ - *len = strlen(name); -} - -static void dmxVDLDisplayEntry(const char *buf, - char *name, int *len, - int *x, int *y, - int *xoff, int *yoff, - int *xorig, int *yorig) -{ - const char *pt; - char *end; - - pt = strchr(buf, ' '); - strncpy(name, buf, pt-buf); - name[pt-buf] = '\0'; - *len = strlen(name); - - *x = strtol(pt, &end, 10); - *y = strtol(end, &end, 10); - *xorig = strtol(end, &end, 10); - *yorig = strtol(end, &end, 10); - *xoff = strtol(end, &end, 10); - *yoff = strtol(end, NULL, 10); -} - -/** Read from the VDL format \a filename and return a newly allocated \a - * DMXConfigEntryPtr */ -DMXConfigEntryPtr dmxVDLRead(const char *filename) -{ - FILE *str; - char buf[2048]; /* RATS: Use ok */ - char *pt; - int lineno = 0; - DMXConfigEntryPtr entry = NULL; - DMXConfigVirtualPtr virtual = NULL; - DMXConfigSubPtr sub = NULL; - DMXConfigDisplayPtr display = NULL; - DMXConfigFullDimPtr fdim = NULL; - int vcount = 0; - int dcount = 0; - int icount = 0; - int x, y, xoff, yoff, xorig, yorig; - char name[2048]; /* RATS: Use ok */ - const char *tmp; - int len; - enum { - simulateFlag, - virtualCount, - virtualEntry, - displayCount, - displayEntry, - ignoreCount, - ignoreEntry - } state = simulateFlag; - - if (!filename) str = stdin; - else str = fopen(filename, "r"); - if (!str) return NULL; - - while (dmxVDLReadLine(str, buf, sizeof(buf))) { - DMXConfigCommentPtr comment = NULL; - - ++lineno; - for (pt = buf; *pt; pt++) - if (*pt == '\r' || *pt == '\n') { - *pt = '\0'; - break; - } - if (buf[0] == '#') { - tmp = dmxConfigCopyString(buf + 1, strlen(buf + 1)); - comment = dmxConfigCreateComment(T_COMMENT, lineno, tmp); - entry = dmxConfigAddEntry(entry, dmxConfigComment, comment, NULL); - continue; - } - switch (state) { - case simulateFlag: - state = virtualCount; - break; - case virtualCount: - vcount = dmxVDLCount(buf); - state = virtualEntry; - break; - case virtualEntry: - len = sizeof(name); - dmxVDLVirtualEntry(buf, name, &len, &x, &y); - tmp = dmxConfigCopyString(name, len); - virtual = dmxConfigCreateVirtual(NULL, - dmxConfigCreateString(T_STRING, - lineno, - NULL, - tmp), - dmxConfigCreatePair(T_DIMENSION, - lineno, - NULL, - x, y, 0, 0), - NULL, NULL, NULL); - state = displayCount; - break; - case displayCount: - dcount = dmxVDLCount(buf); - state = displayEntry; - break; - case displayEntry: - dmxVDLDisplayEntry(buf, name, &len, &x, &y, &xoff, &yoff, - &xorig, &yorig); - tmp = dmxConfigCopyString(name, len); - fdim = dmxConfigCreateFullDim( - dmxConfigCreatePartDim( - dmxConfigCreatePair(T_DIMENSION, - lineno, - NULL, - x, y, 0, 0), - dmxConfigCreatePair(T_OFFSET, - lineno, - NULL, - xoff, yoff, - xoff, yoff)), - NULL); - display = dmxConfigCreateDisplay(NULL, - dmxConfigCreateString(T_STRING, - lineno, - NULL, - tmp), - fdim, - dmxConfigCreatePair(T_ORIGIN, - lineno, - NULL, - xorig, yorig, - 0, 0), - NULL); - sub = dmxConfigAddSub(sub, dmxConfigSubDisplay(display)); - if (!--dcount) { - state = ignoreCount; - virtual->subentry = sub; - entry = dmxConfigAddEntry(entry, - dmxConfigVirtual, - NULL, - virtual); - virtual = NULL; - sub = NULL; - } - break; - case ignoreCount: - icount = dmxVDLCount(buf); - state = ignoreEntry; - break; - case ignoreEntry: - if (!--icount) state = virtualEntry; - break; - } - } - return entry; -} diff --git a/nx-X11/programs/Xserver/hw/dmx/config/dmxcompat.h b/nx-X11/programs/Xserver/hw/dmx/config/dmxcompat.h deleted file mode 100644 index 416ec7873..000000000 --- a/nx-X11/programs/Xserver/hw/dmx/config/dmxcompat.h +++ /dev/null @@ -1,45 +0,0 @@ -/* $XFree86$ */ -/* - * Copyright 2002 Red Hat Inc., Durham, North Carolina. - * - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation on the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial - * portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -/* - * Authors: - * Rickard E. (Rik) Faith - * - */ - -/** \file - * Interface to VDL compatibility support. \see dmxcompat.c - * - * This file is not used by the DMX server. - */ - -#ifndef _DMXCOMPAT_H_ -#define _DMXCOMPAT_H_ - -extern DMXConfigEntryPtr dmxVDLRead(const char *filename); -#endif diff --git a/nx-X11/programs/Xserver/hw/dmx/config/dmxconfig.c b/nx-X11/programs/Xserver/hw/dmx/config/dmxconfig.c deleted file mode 100644 index 353ce11db..000000000 --- a/nx-X11/programs/Xserver/hw/dmx/config/dmxconfig.c +++ /dev/null @@ -1,499 +0,0 @@ -/* $XFree86$ */ -/* - * Copyright 2002-2003 Red Hat Inc., Durham, North Carolina. - * - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation on the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial - * portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -/* - * Authors: - * Rickard E. (Rik) Faith - * - */ - -/** \file - * Provides interface for reading DMX configuration files and for - * combining that information with command-line configuration parameters. */ - - -#ifdef HAVE_DMX_CONFIG_H -#include -#endif - -#include "dmx.h" -#include "dmxinput.h" -#include "dmxconfig.h" -#include "dmxparse.h" -#include "dmxlog.h" -#include "dmxcb.h" -#include "dmxstat.h" -#include "parser.h" - -extern int yyparse(void); -extern FILE *yyin; - -static char *dmxXkbRules; -static char *dmxXkbModel; -static char *dmxXkbLayout; -static char *dmxXkbVariant; -static char *dmxXkbOptions; - -/** Stores lists of configuration information. */ -typedef struct DMXConfigListStruct { - const char *name; - struct DMXConfigListStruct *next; -} DMXConfigList, *DMXConfigListPtr; - -/** This stucture stores the parsed configuration information. */ -typedef struct DMXConfigCmdStruct { - const char *filename; - const char *config; - DMXConfigList *displays; - DMXConfigList *inputs; - DMXConfigList *xinputs; -} DMXConfigCmd, *DMXConfigCmdPtr; - -DMXConfigEntryPtr dmxConfigEntry; -static DMXConfigCmd dmxConfigCmd; - -static int dmxDisplaysFromCommandLine; - -/** Make a note that \a display is the name of an X11 display that - * should be initialized as a backend (output) display. Called from - * #ddxProcessArgument. */ -void dmxConfigStoreDisplay(const char *display) -{ - DMXConfigListPtr entry = malloc(sizeof(*entry)); - entry->name = strdup(display); - entry->next = NULL; - if (!dmxConfigCmd.displays) dmxConfigCmd.displays = entry; - else { - DMXConfigList *pt; - for (pt = dmxConfigCmd.displays; pt->next; pt = pt->next); - if (!pt) - dmxLog(dmxFatal, "dmxConfigStoreDisplay: end of list non-NULL\n"); - pt->next = entry; - } - ++dmxDisplaysFromCommandLine; -} - -/** Make a note that \a input is the name of an X11 display that should - * be used for input (either a backend or a console input device). */ -void dmxConfigStoreInput(const char *input) -{ - DMXConfigListPtr entry = malloc(sizeof(*entry)); - entry->name = strdup(input); - entry->next = NULL; - if (!dmxConfigCmd.inputs) dmxConfigCmd.inputs = entry; - else { - DMXConfigList *pt; - for (pt = dmxConfigCmd.inputs; pt->next; pt = pt->next); - if (!pt) - dmxLog(dmxFatal, "dmxConfigStoreInput: end of list non-NULL\n"); - pt->next = entry; - } -} - -/** Make a note that \a input is the name of an X11 display that should - * be used for input from XInput extension devices. */ -void dmxConfigStoreXInput(const char *input) -{ - DMXConfigListPtr entry = malloc(sizeof(*entry)); - entry->name = strdup(input); - entry->next = NULL; - if (!dmxConfigCmd.xinputs) dmxConfigCmd.xinputs = entry; - else { - DMXConfigList *pt; - for (pt = dmxConfigCmd.xinputs; pt->next; pt = pt->next); - if (!pt) - dmxLog(dmxFatal, "dmxConfigStoreXInput: end of list non-NULL\n"); - pt->next = entry; - } -} - -/** Make a note that \a file is the configuration file. */ -void dmxConfigStoreFile(const char *file) -{ - if (dmxConfigCmd.filename) - dmxLog(dmxFatal, "Only one -configfile allowed\n"); - dmxConfigCmd.filename = strdup(file); -} - -/** Make a note that \a config should be used as the configuration for - * current instantiation of the DMX server. */ -void dmxConfigStoreConfig(const char *config) -{ - if (dmxConfigCmd.config) dmxLog(dmxFatal, "Only one -config allowed\n"); - dmxConfigCmd.config = strdup(config); -} - -static int dmxConfigReadFile(const char *filename, int debug) -{ - FILE *str; - - if (!(str = fopen(filename, "r"))) return -1; - dmxLog(dmxInfo, "Reading configuration file \"%s\"\n", filename); - yyin = str; - yydebug = debug; - yyparse(); - fclose(str); - return 0; -} - -static const char *dmxConfigMatch(const char *target, DMXConfigEntryPtr entry) -{ - DMXConfigVirtualPtr v = entry->virtual; - const char *name = NULL; - - if (v && v->name) name = v->name; - - if (v && !dmxConfigCmd.config) return v->name ? v->name : ""; - if (!name) return NULL; - if (!strcmp(name, target)) return name; - return NULL; -} - -static DMXScreenInfo *dmxConfigAddDisplay(const char *name, - int scrnWidth, int scrnHeight, - int scrnX, int scrnY, - int scrnXSign, int scrnYSign, - int rootWidth, int rootHeight, - int rootX, int rootY, - int rootXSign, int rootYSign) -{ - DMXScreenInfo *dmxScreen; - - if (!(dmxScreens = realloc(dmxScreens, - (dmxNumScreens+1) * sizeof(*dmxScreens)))) - dmxLog(dmxFatal, - "dmxConfigAddDisplay: realloc failed for screen %d (%s)\n", - dmxNumScreens, name); - - dmxScreen = &dmxScreens[dmxNumScreens]; - memset(dmxScreen, 0, sizeof(*dmxScreen)); - dmxScreen->name = name; - dmxScreen->index = dmxNumScreens; - dmxScreen->scrnWidth = scrnWidth; - dmxScreen->scrnHeight = scrnHeight; - dmxScreen->scrnX = scrnX; - dmxScreen->scrnY = scrnY; - dmxScreen->scrnXSign = scrnXSign; - dmxScreen->scrnYSign = scrnYSign; - dmxScreen->rootWidth = rootWidth; - dmxScreen->rootHeight = rootHeight; - dmxScreen->rootX = rootX; - dmxScreen->rootY = rootY; - dmxScreen->stat = dmxStatAlloc(); - ++dmxNumScreens; - return dmxScreen; -} - -DMXInputInfo *dmxConfigAddInput(const char *name, int core) -{ - DMXInputInfo *dmxInput; - - if (!(dmxInputs = realloc(dmxInputs, - (dmxNumInputs+1) * sizeof(*dmxInputs)))) - dmxLog(dmxFatal, - "dmxConfigAddInput: realloc failed for input %d (%s)\n", - dmxNumInputs, name); - - dmxInput = &dmxInputs[dmxNumInputs]; - - memset(dmxInput, 0, sizeof(*dmxInput)); - dmxInput->name = name; - dmxInput->inputIdx = dmxNumInputs; - dmxInput->scrnIdx = -1; - dmxInput->core = core; - ++dmxNumInputs; - return dmxInput; -} - -static void dmxConfigCopyFromDisplay(DMXConfigDisplayPtr d) -{ - DMXScreenInfo *dmxScreen; - - dmxScreen = dmxConfigAddDisplay(d->name, - d->scrnWidth, d->scrnHeight, - d->scrnX, d->scrnY, - d->scrnXSign, d->scrnYSign, - d->rootWidth, d->rootHeight, - d->rootX, d->rootY, - d->rootXSign, d->rootXSign); - dmxScreen->where = PosAbsolute; - dmxScreen->whereX = d->rootXOrigin; - dmxScreen->whereY = d->rootYOrigin; -} - -static void dmxConfigCopyFromWall(DMXConfigWallPtr w) -{ - DMXConfigStringPtr pt; - DMXScreenInfo *dmxScreen; - int edge = dmxNumScreens; - int last = dmxNumScreens; - - if (!w->xwall && !w->ywall) { /* Try to make it square */ - int count; - for (pt = w->nameList, count = 0; pt; pt = pt->next) ++count; - w->xwall = sqrt(count) + .5; - } - - for (pt = w->nameList; pt; pt = pt->next) { - dmxScreen = dmxConfigAddDisplay(pt->string, w->width, w->height, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - if (pt == w->nameList) { /* Upper left */ - dmxScreen->where = PosAbsolute; - dmxScreen->whereX = 0; - dmxScreen->whereY = 0; - } else if (w->xwall) { /* Tile left to right, then top to bottom */ - if (!((dmxNumScreens-1) % w->xwall)) { - dmxScreen->where = PosBelow; - dmxScreen->whereRefScreen = edge; - edge = dmxNumScreens-1; - } else { - dmxScreen->where = PosRightOf; - dmxScreen->whereRefScreen = last; - } - } else { /* Tile top to bottom, then left to right */ - if (!((dmxNumScreens-1) % w->ywall)) { - dmxScreen->where = PosRightOf; - dmxScreen->whereRefScreen = edge; - edge = dmxNumScreens-1; - } else { - dmxScreen->where = PosBelow; - dmxScreen->whereRefScreen = last; - } - - } - last = dmxNumScreens-1; - if (dmxScreen->where == PosAbsolute) - dmxLog(dmxInfo, "Added %s at %d %d\n", - pt->string, dmxScreen->whereX, dmxScreen->whereY); - else - dmxLog(dmxInfo, "Added %s %s %s\n", - pt->string, - dmxScreen->where == PosBelow ? "below" : "right of", - dmxScreens[dmxScreen->whereRefScreen].name); - } -} - -static void dmxConfigCopyFromOption(DMXConfigOptionPtr o) -{ - DMXConfigStringPtr pt; - int argc = 0; - char **argv = NULL; - - if (serverGeneration != 1) return; /* FIXME: only do once, for now */ - if (!o || !o->string) return; - for (pt = o->option; pt; pt = pt->next) { - if (pt->string) { - ++argc; - argv = realloc(argv, (argc+1) * sizeof(*argv)); - argv[argc] = (char *)pt->string; - } - } - argv[0] = NULL; - ProcessCommandLine(argc+1, argv); - free(argv); -} - -static void dmxConfigCopyFromParam(DMXConfigParamPtr p) -{ - const char **argv; - int argc; - - if ((argv = dmxConfigLookupParam(p, "xkbrules", &argc)) && argc == 2) { - dmxConfigSetXkbRules(argv[1]); - } else if ((argv = dmxConfigLookupParam(p, "xkbmodel", &argc)) - && argc == 2) { - dmxConfigSetXkbModel(argv[1]); - } else if ((argv = dmxConfigLookupParam(p, "xkblayout", &argc)) - && argc == 2) { - dmxConfigSetXkbLayout(argv[1]); - } else if ((argv = dmxConfigLookupParam(p, "xkbvariant", &argc)) - && argc == 2) { - dmxConfigSetXkbVariant(argv[1]); - } else if ((argv = dmxConfigLookupParam(p, "xkboptions", &argc)) - && argc == 2) { - dmxConfigSetXkbOptions(argv[1]); - } -} - -static void dmxConfigCopyData(DMXConfigVirtualPtr v) -{ - DMXConfigSubPtr sub; - - if (v->dim) dmxSetWidthHeight(v->dim->x, v->dim->y); - else dmxSetWidthHeight(0, 0); - for (sub = v->subentry; sub; sub = sub->next) { - switch (sub->type) { - case dmxConfigDisplay: dmxConfigCopyFromDisplay(sub->display); break; - case dmxConfigWall: dmxConfigCopyFromWall(sub->wall); break; - case dmxConfigOption: dmxConfigCopyFromOption(sub->option); break; - case dmxConfigParam: dmxConfigCopyFromParam(sub->param); break; - default: - dmxLog(dmxFatal, - "dmxConfigCopyData: not a display, wall, or value\n"); - } - } -} - -static void dmxConfigFromCommandLine(void) -{ - DMXConfigListPtr pt; - - dmxLog(dmxInfo, "Using configuration from command line\n"); - for (pt = dmxConfigCmd.displays; pt; pt = pt->next) { - DMXScreenInfo *dmxScreen = dmxConfigAddDisplay(pt->name, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0); - if (dmxNumScreens == 1) { - dmxScreen->where = PosAbsolute; - dmxScreen->whereX = 0; - dmxScreen->whereY = 0; - dmxLog(dmxInfo, "Added %s at %d %d\n", - dmxScreen->name, dmxScreen->whereX, dmxScreen->whereY); - } else { - dmxScreen->where = PosRightOf; - dmxScreen->whereRefScreen = dmxNumScreens - 2; - if (dmxScreen->whereRefScreen < 0) dmxScreen->whereRefScreen = 0; - dmxLog(dmxInfo, "Added %s %s %s\n", - dmxScreen->name, - dmxScreen->where == PosBelow ? "below" : "right of", - dmxScreens[dmxScreen->whereRefScreen].name); - } - } -} - -static void dmxConfigFromConfigFile(void) -{ - DMXConfigEntryPtr pt; - const char *name; - - for (pt = dmxConfigEntry; pt; pt = pt->next) { - /* FIXME -- if an input is specified, use it */ - if (pt->type != dmxConfigVirtual) continue; - if ((name = dmxConfigMatch(dmxConfigCmd.config, pt))) { - dmxLog(dmxInfo, "Using configuration \"%s\"\n", name); - dmxConfigCopyData(pt->virtual); - return; - } - } - dmxLog(dmxFatal, "Could not find configuration \"%s\" in \"%s\"\n", - dmxConfigCmd.config, dmxConfigCmd.filename); -} - -static void dmxConfigConfigInputs(void) -{ - DMXConfigListPtr pt; - - if (dmxNumInputs) return; - - if (dmxConfigCmd.inputs) { /* Use command line */ - for (pt = dmxConfigCmd.inputs; pt; pt = pt->next) - dmxConfigAddInput(pt->name, TRUE); - } else if (dmxNumScreens) { /* Use first display */ - dmxConfigAddInput(dmxScreens[0].name, TRUE); - } else { /* Use dummy */ - dmxConfigAddInput("dummy", TRUE); - } - - if (dmxConfigCmd.xinputs) { /* Non-core devices from command line */ - for (pt = dmxConfigCmd.xinputs; pt; pt = pt->next) - dmxConfigAddInput(pt->name, FALSE); - } -} - -/** Set up the appropriate global variables so that the DMX server will - * be initialized using the configuration specified in the config file - * and on the command line. */ -void dmxConfigConfigure(void) -{ - if (dmxConfigEntry) { - dmxConfigFreeEntry(dmxConfigEntry); - dmxConfigEntry = NULL; - } - if (dmxConfigCmd.filename) { - if (dmxConfigCmd.displays) - dmxLog(dmxWarning, - "Using configuration file \"%s\" instead of command line\n", - dmxConfigCmd.filename); - dmxConfigReadFile(dmxConfigCmd.filename, 0); - dmxConfigFromConfigFile(); - } else { - if (dmxConfigCmd.config) - dmxLog(dmxWarning, - "Configuration name (%s) without configuration file\n", - dmxConfigCmd.config); - dmxConfigFromCommandLine(); - } - dmxConfigConfigInputs(); -} - -/** This function determines the number of displays we WILL have and - * sets MAXSCREENS to that value. This is difficult since the number - * depends on the command line (which is easy to count) or on the config - * file, which has to be parsed. */ -void dmxConfigSetMaxScreens(void) -{ - static int processing = 0; - - if (processing) return; /* Prevent reentry via ProcessCommandLine */ - processing = 1; - if (dmxConfigCmd.filename) { - if (!dmxNumScreens) - dmxConfigConfigure(); -#ifndef MAXSCREENS - SetMaxScreens(dmxNumScreens); -#endif - } else -#ifndef MAXSCREENS - SetMaxScreens(dmxDisplaysFromCommandLine); -#endif - processing = 0; -} - -/** This macro is used to generate the following access methods: - * - dmxConfig{Set,Get}rules - * - dmxConfig{Set,Get}model - * - dmxConfig{Set,Get}layout - * - dmxConfig{Set,Get}variant - * - dmxConfig{Set,Get}options - * These methods are used to read and write information about the keyboard. */ - -#define GEN(param,glob,def) \ - void dmxConfigSet##glob(const char *param) { \ - if (dmx##glob) free((void *)dmx##glob); \ - dmx##glob = strdup(param); \ - } \ - char *dmxConfigGet##glob(void) { \ - return (char *)(dmx##glob ? dmx##glob : def); \ - } - -GEN(rules, XkbRules, DMX_DEFAULT_XKB_RULES) -GEN(model, XkbModel, DMX_DEFAULT_XKB_MODEL) -GEN(layout, XkbLayout, DMX_DEFAULT_XKB_LAYOUT) -GEN(variant, XkbVariant, DMX_DEFAULT_XKB_VARIANT) -GEN(options, XkbOptions, DMX_DEFAULT_XKB_OPTIONS) - diff --git a/nx-X11/programs/Xserver/hw/dmx/config/dmxconfig.h b/nx-X11/programs/Xserver/hw/dmx/config/dmxconfig.h deleted file mode 100644 index b5c0c1f1c..000000000 --- a/nx-X11/programs/Xserver/hw/dmx/config/dmxconfig.h +++ /dev/null @@ -1,65 +0,0 @@ -/* $XFree86$ */ -/* - * Copyright 2002 Red Hat Inc., Durham, North Carolina. - * - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation on the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial - * portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -/* - * Authors: - * Rickard E. (Rik) Faith - * - */ - -/** \file - * Interface for DMX configuration file support. \see dmxconfig.c */ - -#ifndef _DMXCONFIG_H_ -#define _DMXCONFIG_H_ -#define DMX_DEFAULT_XKB_RULES "xfree86" -#define DMX_DEFAULT_XKB_MODEL "pc101" -#define DMX_DEFAULT_XKB_LAYOUT "us" -#define DMX_DEFAULT_XKB_VARIANT NULL -#define DMX_DEFAULT_XKB_OPTIONS NULL - -extern void dmxConfigStoreDisplay(const char *display); -extern void dmxConfigStoreInput(const char *input); /* Core devices */ -extern void dmxConfigStoreXInput(const char *input); /* Non-core devices */ -extern void dmxConfigStoreFile(const char *file); -extern void dmxConfigStoreConfig(const char *config); -extern void dmxConfigConfigure(void); -extern void dmxConfigSetMaxScreens(void); - -extern void dmxConfigSetXkbRules(const char *rules); -extern void dmxConfigSetXkbModel(const char *model); -extern void dmxConfigSetXkbLayout(const char *layout); -extern void dmxConfigSetXkbVariant(const char *variant); -extern void dmxConfigSetXkbOptions(const char *options); - -extern char *dmxConfigGetXkbRules(void); -extern char *dmxConfigGetXkbModel(void); -extern char *dmxConfigGetXkbLayout(void); -extern char *dmxConfigGetXkbVariant(void); -extern char *dmxConfigGetXkbOptions(void); -#endif diff --git a/nx-X11/programs/Xserver/hw/dmx/config/dmxparse.c b/nx-X11/programs/Xserver/hw/dmx/config/dmxparse.c deleted file mode 100644 index 1acb6d13e..000000000 --- a/nx-X11/programs/Xserver/hw/dmx/config/dmxparse.c +++ /dev/null @@ -1,611 +0,0 @@ -/* $XFree86$ */ -/* - * Copyright 2002 Red Hat Inc., Durham, North Carolina. - * - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation on the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial - * portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -/* - * Authors: - * Rickard E. (Rik) Faith - * - */ - -/** \file - * - * This file provides support routines and helper functions to be used - * by the DMX configuration file parser. - * - * Because the DMX configuration file parsing should be capable of being - * used in a stand-alone fashion (i.e., independent from the DMX server - * source tree), no dependencies on other DMX routines are made. */ - -#ifdef HAVE_DMX_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include "dmxparse.h" - -/** A general error logging routine that does not depend on the dmxLog - * functions. */ -void dmxConfigLog(const char *format, ...) -{ - va_list args; - - va_start(args, format); - vprintf(format, args); /* RATS: All calls to dmxConfigLog from - * dmxparse.c and dmxprint.c use a - * trusted format. */ - va_end(args); -} - -void *dmxConfigAlloc(unsigned long bytes) -{ - void *area = malloc(bytes); - if (!area) { - dmxConfigLog("dmxConfigAlloc: out of memory\n"); - return NULL; - } - memset(area, 0, bytes); - return area; -} - -void *dmxConfigRealloc(void *orig, unsigned long orig_bytes, - unsigned long bytes) -{ - unsigned char *area = realloc(orig, bytes); - if (!area) { - dmxConfigLog("dmxConfigRealloc: out of memory\n"); - return NULL; - } - memset(area + orig_bytes, 0, bytes - orig_bytes); - return area; -} - -const char *dmxConfigCopyString(const char *string, int length) -{ - char *copy; - - if (!length) length = strlen(string); - copy = dmxConfigAlloc(length + 1); - if (length) strncpy(copy, string, length); - copy[length] = '\0'; - return copy; -} - -void dmxConfigFree(void *area) -{ - if (area) free(area); -} - -DMXConfigTokenPtr dmxConfigCreateToken(int token, int line, - const char *comment) -{ - DMXConfigTokenPtr pToken = dmxConfigAlloc(sizeof(*pToken)); - pToken->token = token; - pToken->line = line; - pToken->comment = comment; - return pToken; -} - -void dmxConfigFreeToken(DMXConfigTokenPtr p) -{ - if (!p) return; - dmxConfigFree((void *)p->comment); - dmxConfigFree(p); -} - -DMXConfigStringPtr dmxConfigCreateString(int token, int line, - const char *comment, - const char *string) -{ - DMXConfigStringPtr pString = dmxConfigAlloc(sizeof(*pString)); - - pString->token = token; - pString->line = line; - pString->comment = comment; - pString->string = string; - return pString; -} - -void dmxConfigFreeString(DMXConfigStringPtr p) -{ - DMXConfigStringPtr next; - - if (!p) return; - do { - next = p->next; - dmxConfigFree((void *)p->comment); - dmxConfigFree((void *)p->string); - dmxConfigFree(p); - } while ((p = next)); -} - -DMXConfigNumberPtr dmxConfigCreateNumber(int token, int line, - const char *comment, - int number) -{ - DMXConfigNumberPtr pNumber = dmxConfigAlloc(sizeof(*pNumber)); - - pNumber->token = token; - pNumber->line = line; - pNumber->comment = comment; - pNumber->number = number; - return pNumber; -} - -void dmxConfigFreeNumber(DMXConfigNumberPtr p) -{ - if (!p) return; - dmxConfigFree((void *)p->comment); - dmxConfigFree(p); -} - -DMXConfigPairPtr dmxConfigCreatePair(int token, int line, - const char *comment, - int x, int y, - int xsign, int ysign) -{ - DMXConfigPairPtr pPair = dmxConfigAlloc(sizeof(*pPair)); - - pPair->token = token; - pPair->line = line; - pPair->comment = comment; - pPair->x = x; - pPair->y = y; - pPair->xsign = (xsign < 0) ? -1 : 1; - pPair->ysign = (ysign < 0) ? -1 : 1; - return pPair; -} - -void dmxConfigFreePair(DMXConfigPairPtr p) -{ - if (!p) return; - dmxConfigFree((void *)p->comment); - dmxConfigFree(p); -} - -DMXConfigCommentPtr dmxConfigCreateComment(int token, int line, - const char *comment) -{ - DMXConfigCommentPtr pComment = dmxConfigAlloc(sizeof(*pComment)); - - pComment->token = token; - pComment->line = line; - pComment->comment = comment; - return pComment; -} - -void dmxConfigFreeComment(DMXConfigCommentPtr p) -{ - if (!p) return; - dmxConfigFree((void *)p->comment); - dmxConfigFree(p); -} - -DMXConfigPartDimPtr dmxConfigCreatePartDim(DMXConfigPairPtr pDim, - DMXConfigPairPtr pOffset) -{ - DMXConfigPartDimPtr pPart = dmxConfigAlloc(sizeof(*pPart)); - pPart->dim = pDim; - pPart->offset = pOffset; - return pPart; -} - -void dmxConfigFreePartDim(DMXConfigPartDimPtr p) -{ - if (!p) return; - dmxConfigFreePair(p->dim); - dmxConfigFreePair(p->offset); - dmxConfigFree(p); -} - -DMXConfigFullDimPtr dmxConfigCreateFullDim(DMXConfigPartDimPtr pScrn, - DMXConfigPartDimPtr pRoot) -{ - DMXConfigFullDimPtr pFull = dmxConfigAlloc(sizeof(*pFull)); - pFull->scrn = pScrn; - pFull->root = pRoot; - return pFull; -} - -void dmxConfigFreeFullDim(DMXConfigFullDimPtr p) -{ - if (!p) return; - dmxConfigFreePartDim(p->scrn); - dmxConfigFreePartDim(p->root); - dmxConfigFree(p); -} - -DMXConfigDisplayPtr dmxConfigCreateDisplay(DMXConfigTokenPtr pStart, - DMXConfigStringPtr pName, - DMXConfigFullDimPtr pDim, - DMXConfigPairPtr pOrigin, - DMXConfigTokenPtr pEnd) -{ - DMXConfigDisplayPtr pDisplay = dmxConfigAlloc(sizeof(*pDisplay)); - - memset(pDisplay, 0, sizeof(*pDisplay)); - - pDisplay->start = pStart; - pDisplay->dname = pName; - pDisplay->dim = pDim; - pDisplay->origin = pOrigin; - pDisplay->end = pEnd; - - pDisplay->name = pName ? pName->string : NULL; - pDisplay->rootXOrigin = pOrigin ? pOrigin->x : 0; - pDisplay->rootYOrigin = pOrigin ? pOrigin->y : 0; - - if (pDim && pDim->scrn && pDim->scrn->dim) { - pDisplay->scrnWidth = pDim->scrn->dim->x; - pDisplay->scrnHeight = pDim->scrn->dim->y; - } - if (pDim && pDim->scrn && pDim->scrn->offset) { - pDisplay->scrnX = pDim->scrn->offset->x; - pDisplay->scrnY = pDim->scrn->offset->y; - pDisplay->scrnXSign = pDim->scrn->offset->xsign; - pDisplay->scrnYSign = pDim->scrn->offset->ysign; - } - - if (pDim && pDim->root) { - if (pDim->root->dim) { - pDisplay->rootWidth = pDim->root->dim->x; - pDisplay->rootHeight = pDim->root->dim->y; - } - if (pDim->root->offset) { - pDisplay->rootX = pDim->root->offset->x; - pDisplay->rootY = pDim->root->offset->y; - pDisplay->rootXSign = pDim->root->offset->xsign; - pDisplay->rootYSign = pDim->root->offset->ysign; - } - } else { /* If no root specification, copy width - * and height from scrn -- leave offset - * as zero, since it is relative to - * scrn. */ - pDisplay->rootWidth = pDisplay->scrnWidth; - pDisplay->rootHeight = pDisplay->scrnHeight; - } - - - return pDisplay; -} - -void dmxConfigFreeDisplay(DMXConfigDisplayPtr p) -{ - if (!p) return; - dmxConfigFreeToken(p->start); - dmxConfigFreeString(p->dname); - dmxConfigFreeFullDim(p->dim); - dmxConfigFreeToken(p->end); - dmxConfigFree(p); -} - -DMXConfigWallPtr dmxConfigCreateWall(DMXConfigTokenPtr pStart, - DMXConfigPairPtr pWallDim, - DMXConfigPairPtr pDisplayDim, - DMXConfigStringPtr pNameList, - DMXConfigTokenPtr pEnd) -{ - DMXConfigWallPtr pWall = dmxConfigAlloc(sizeof(*pWall)); - - pWall->start = pStart; - pWall->wallDim = pWallDim; - pWall->displayDim = pDisplayDim; - pWall->nameList = pNameList; - pWall->end = pEnd; - - pWall->width = pDisplayDim ? pDisplayDim->x : 0; - pWall->height = pDisplayDim ? pDisplayDim->y : 0; - pWall->xwall = pWallDim ? pWallDim->x : 0; - pWall->ywall = pWallDim ? pWallDim->y : 0; - - return pWall; -} - -void dmxConfigFreeWall(DMXConfigWallPtr p) -{ - if (!p) return; - dmxConfigFreeToken(p->start); - dmxConfigFreePair(p->wallDim); - dmxConfigFreePair(p->displayDim); - dmxConfigFreeString(p->nameList); - dmxConfigFreeToken(p->end); - dmxConfigFree(p); -} - -DMXConfigOptionPtr dmxConfigCreateOption(DMXConfigTokenPtr pStart, - DMXConfigStringPtr pOption, - DMXConfigTokenPtr pEnd) -{ - int length = 0; - int offset = 0; - DMXConfigStringPtr p; - DMXConfigOptionPtr option = dmxConfigAlloc(sizeof(*option)); - - for (p = pOption; p; p = p->next) { - if (p->string) length += strlen(p->string) + 1; - } - - option->string = dmxConfigAlloc(length + 1); - - for (p = pOption; p; p = p->next) { - if (p->string) { - int len = strlen(p->string); - strncpy(option->string + offset, p->string, len); - offset += len; - if (p->next) option->string[offset++] = ' '; - } - } - option->string[offset] = '\0'; - - option->start = pStart; - option->option = pOption; - option->end = pEnd; - - return option; -} - -void dmxConfigFreeOption(DMXConfigOptionPtr p) -{ - if (!p) return; - if (p->string) free(p->string); - dmxConfigFreeToken(p->start); - dmxConfigFreeString(p->option); - dmxConfigFreeToken(p->end); - dmxConfigFree(p); -} - -const char **dmxConfigLookupParam(DMXConfigParamPtr p, const char *key, - int *argc) -{ - DMXConfigParamPtr pt; - - for (pt = p; pt; pt = pt->next) { - if (pt->argv && !strcasecmp(pt->argv[0], key)) { - *argc = pt->argc; - return pt->argv; - } - } - *argc = 0; - return NULL; -} - -DMXConfigParamPtr dmxConfigCreateParam(DMXConfigTokenPtr pStart, - DMXConfigTokenPtr pOpen, - DMXConfigStringPtr pParam, - DMXConfigTokenPtr pClose, - DMXConfigTokenPtr pEnd) -{ - DMXConfigParamPtr param = dmxConfigAlloc(sizeof(*param)); - DMXConfigStringPtr pt; - - param->argc = 0; - param->argv = NULL; - for (pt = pParam; pt; pt = pt->next) { - if (pt->string) { - param->argv = realloc(param->argv, - (param->argc+2) * sizeof(*param->argv)); - param->argv[param->argc] = pt->string; - ++param->argc; - } - } - if (param->argv) param->argv[param->argc] = NULL; - - param->start = pStart; - param->open = pOpen; - param->param = pParam; - param->close = pClose; - param->end = pEnd; - - return param; -} - -void dmxConfigFreeParam(DMXConfigParamPtr p) -{ - DMXConfigParamPtr next; - - if (!p) return; - do { - next = p->next; - dmxConfigFreeToken(p->start); - dmxConfigFreeToken(p->open); - dmxConfigFreeString(p->param); - dmxConfigFreeToken(p->close); - dmxConfigFreeToken(p->end); - dmxConfigFree(p->argv); - dmxConfigFree(p); - } while ((p = next)); -} - -DMXConfigSubPtr dmxConfigCreateSub(DMXConfigType type, - DMXConfigCommentPtr comment, - DMXConfigDisplayPtr display, - DMXConfigWallPtr wall, - DMXConfigOptionPtr option, - DMXConfigParamPtr param) -{ - DMXConfigSubPtr pSub = dmxConfigAlloc(sizeof(*pSub)); - pSub->type = type; - switch (type) { - case dmxConfigComment: pSub->comment = comment; break; - case dmxConfigDisplay: pSub->display = display; break; - case dmxConfigWall: pSub->wall = wall; break; - case dmxConfigOption: pSub->option = option; break; - case dmxConfigParam: pSub->param = param; break; - default: dmxConfigLog("Type %d not supported in subentry\n", type); break; - } - return pSub; -} - -void dmxConfigFreeSub(DMXConfigSubPtr sub) -{ - DMXConfigSubPtr pt; - - for (pt = sub; pt; pt = pt->next) { - switch (pt->type) { - case dmxConfigComment: dmxConfigFreeComment(pt->comment); break; - case dmxConfigDisplay: dmxConfigFreeDisplay(pt->display); break; - case dmxConfigWall: dmxConfigFreeWall(pt->wall); break; - case dmxConfigOption: dmxConfigFreeOption(pt->option); break; - case dmxConfigParam: dmxConfigFreeParam(pt->param); break; - default: - dmxConfigLog("Type %d not supported in subentry\n", pt->type); - break; - } - } - dmxConfigFree(sub); -} - -DMXConfigSubPtr dmxConfigSubComment(DMXConfigCommentPtr comment) -{ - return dmxConfigCreateSub(dmxConfigComment, comment, NULL, NULL, NULL, - NULL); -} - -DMXConfigSubPtr dmxConfigSubDisplay(DMXConfigDisplayPtr display) -{ - return dmxConfigCreateSub(dmxConfigDisplay, NULL, display, NULL, NULL, - NULL); -} - -DMXConfigSubPtr dmxConfigSubWall(DMXConfigWallPtr wall) -{ - return dmxConfigCreateSub(dmxConfigWall, NULL, NULL, wall, NULL, NULL); -} - -DMXConfigSubPtr dmxConfigSubOption(DMXConfigOptionPtr option) -{ - return dmxConfigCreateSub(dmxConfigOption, NULL, NULL, NULL, option, NULL); -} - -DMXConfigSubPtr dmxConfigSubParam(DMXConfigParamPtr param) -{ - return dmxConfigCreateSub(dmxConfigParam, NULL, NULL, NULL, NULL, param); -} - -extern DMXConfigSubPtr dmxConfigAddSub(DMXConfigSubPtr head, - DMXConfigSubPtr sub) -{ - DMXConfigSubPtr pt; - - if (!head) return sub; - for (pt = head; pt->next; pt = pt->next); - pt->next = sub; - return head; -} - -DMXConfigVirtualPtr dmxConfigCreateVirtual(DMXConfigTokenPtr pStart, - DMXConfigStringPtr pName, - DMXConfigPairPtr pDim, - DMXConfigTokenPtr pOpen, - DMXConfigSubPtr pSubentry, - DMXConfigTokenPtr pClose) -{ - DMXConfigVirtualPtr pVirtual = dmxConfigAlloc(sizeof(*pVirtual)); - - pVirtual->start = pStart; - pVirtual->vname = pName; - pVirtual->dim = pDim; - pVirtual->open = pOpen; - pVirtual->subentry = pSubentry; - pVirtual->close = pClose; - - pVirtual->name = pName ? pName->string : NULL; - pVirtual->width = pDim ? pDim->x : 0; - pVirtual->height = pDim ? pDim->y : 0; - - return pVirtual; -} - -void dmxConfigFreeVirtual(DMXConfigVirtualPtr virtual) -{ - dmxConfigFreeToken(virtual->start); - dmxConfigFreeString(virtual->vname); - dmxConfigFreePair(virtual->dim); - dmxConfigFreeToken(virtual->open); - dmxConfigFreeSub(virtual->subentry); - dmxConfigFreeToken(virtual->close); - dmxConfigFree(virtual); -} - -DMXConfigEntryPtr dmxConfigCreateEntry(DMXConfigType type, - DMXConfigCommentPtr comment, - DMXConfigVirtualPtr virtual) -{ - DMXConfigEntryPtr pEntry = dmxConfigAlloc(sizeof(*pEntry)); - pEntry->type = type; - switch (type) { - case dmxConfigComment: pEntry->comment = comment; break; - case dmxConfigVirtual: pEntry->virtual = virtual; break; - default: dmxConfigLog("Type %d not supported in entry\n", type); break; - } - return pEntry; -} - -void dmxConfigFreeEntry(DMXConfigEntryPtr entry) -{ - DMXConfigEntryPtr pt; - - for (pt = entry; pt; pt = pt->next) { - switch (pt->type) { - case dmxConfigComment: dmxConfigFreeComment(pt->comment); break; - case dmxConfigVirtual: dmxConfigFreeVirtual(pt->virtual); break; - default: - dmxConfigLog("Type %d not supported in entry\n", pt->type); - break; - } - } - dmxConfigFree(entry); -} - -DMXConfigEntryPtr dmxConfigAddEntry(DMXConfigEntryPtr head, - DMXConfigType type, - DMXConfigCommentPtr comment, - DMXConfigVirtualPtr virtual) -{ - DMXConfigEntryPtr child = dmxConfigCreateEntry(type, comment, virtual); - DMXConfigEntryPtr pt; - - if (!head) return child; - - for (pt = head; pt->next; pt = pt->next); - pt->next = child; - - return head; -} - -DMXConfigEntryPtr dmxConfigEntryComment(DMXConfigCommentPtr comment) -{ - return dmxConfigCreateEntry(dmxConfigComment, comment, NULL); -} - -DMXConfigEntryPtr dmxConfigEntryVirtual(DMXConfigVirtualPtr virtual) -{ - return dmxConfigCreateEntry(dmxConfigVirtual, NULL, virtual); -} diff --git a/nx-X11/programs/Xserver/hw/dmx/config/dmxparse.h b/nx-X11/programs/Xserver/hw/dmx/config/dmxparse.h deleted file mode 100644 index 8ea84f4e3..000000000 --- a/nx-X11/programs/Xserver/hw/dmx/config/dmxparse.h +++ /dev/null @@ -1,298 +0,0 @@ -/* $XFree86$ */ -/* - * Copyright 2002 Red Hat Inc., Durham, North Carolina. - * - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation on the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial - * portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -/* - * Authors: - * Rickard E. (Rik) Faith - * - */ - -/** \file - * Interface to DMX configuration file parser. \see dmxparse.c */ - -#ifndef _DMXPARSE_H_ -#define _DMXPARSE_H_ - -#include /* For FILE */ - -/** Stores tokens not stored in other structures (e.g., keywords and ;) */ -typedef struct _DMXConfigToken { - int token; - int line; - const char *comment; -} DMXConfigToken, *DMXConfigTokenPtr; - -/** Stores parsed strings. */ -typedef struct _DMXConfigString { - int token; - int line; - const char *comment; - const char *string; - struct _DMXConfigString *next; -} DMXConfigString, *DMXConfigStringPtr; - -/** Stores parsed numbers. */ -typedef struct _DMXConfigNumber { - int token; - int line; - const char *comment; - int number; -} DMXConfigNumber, *DMXConfigNumberPtr; - -/** Stores parsed pairs (e.g., x y) */ -typedef struct _DMXConfigPair { - int token; - int line; - const char *comment; - int x; - int y; - int xsign; - int ysign; -} DMXConfigPair, *DMXConfigPairPtr; - -/** Stores parsed comments not stored with a token. */ -typedef struct _DMXConfigComment { - int token; - int line; - const char *comment; -} DMXConfigComment, *DMXConfigCommentPtr; - -typedef enum { - dmxConfigComment, - dmxConfigVirtual, - dmxConfigDisplay, - dmxConfigWall, - dmxConfigOption, - dmxConfigParam -} DMXConfigType; - -/** Stores a geometry specification. */ -typedef struct _DMXConfigPartDim { - DMXConfigPairPtr dim; - DMXConfigPairPtr offset; -} DMXConfigPartDim, *DMXConfigPartDimPtr; - -/** Stores a pair of geometry specifications. */ -typedef struct _DMXConfigFullDim { - DMXConfigPartDimPtr scrn; - DMXConfigPartDimPtr root; -} DMXConfigFullDim, *DMXConfigFullDimPtr; - -/** Stores parsed display information. */ -typedef struct _DMXConfigDisplay { - /* Summary information */ - const char *name; - /* Screen Window Geometry */ - int scrnWidth, scrnHeight; - int scrnX, scrnY; - int scrnXSign, scrnYSign; - /* Root Window Geometry */ - int rootWidth, rootHeight; - int rootX, rootY; - int rootXSign, rootYSign; - /* Origin in global space */ - int rootXOrigin, rootYOrigin; - - /* Raw configuration information */ - DMXConfigTokenPtr start; - DMXConfigStringPtr dname; - DMXConfigFullDimPtr dim; - DMXConfigPairPtr origin; - DMXConfigTokenPtr end; -} DMXConfigDisplay, *DMXConfigDisplayPtr; - -/** Stores parsed wall information. */ -typedef struct _DMXConfigWall { - /* Summary information */ - int width, height; /* dimensions of displays */ - int xwall, ywall; /* dimensions of wall, in tiles */ - - - /* Raw configuration informaiton */ - DMXConfigTokenPtr start; - DMXConfigPairPtr wallDim; - DMXConfigPairPtr displayDim; - DMXConfigStringPtr nameList; - DMXConfigTokenPtr end; -} DMXConfigWall, *DMXConfigWallPtr; - -/** Stores parsed option information. */ -typedef struct _DMXConfigOption { - /* Summary information */ - char *string; - - /* Raw configuration informaiton */ - DMXConfigTokenPtr start; - DMXConfigStringPtr option; - DMXConfigTokenPtr end; -} DMXConfigOption, *DMXConfigOptionPtr; - -/** Stores parsed param information. */ -typedef struct _DMXConfigParam { - int argc; - const char **argv; - - DMXConfigTokenPtr start; - DMXConfigTokenPtr open; - DMXConfigStringPtr param; - DMXConfigTokenPtr close; - DMXConfigTokenPtr end; /* Either open/close OR end */ - struct _DMXConfigParam *next; -} DMXConfigParam, *DMXConfigParamPtr; - -/** Stores options under an entry (subentry). */ -typedef struct _DMXConfigSub { - DMXConfigType type; - DMXConfigCommentPtr comment; - DMXConfigDisplayPtr display; - DMXConfigWallPtr wall; - DMXConfigOptionPtr option; - DMXConfigParamPtr param; - struct _DMXConfigSub *next; -} DMXConfigSub, *DMXConfigSubPtr; - -/** Stores parsed virtual information. */ -typedef struct _DMXConfigVirtual { - /* Summary information */ - const char *name; - int width, height; - - /* Raw configuration information */ - DMXConfigTokenPtr start; - DMXConfigStringPtr vname; - DMXConfigPairPtr dim; - DMXConfigTokenPtr open; - DMXConfigSubPtr subentry; - DMXConfigTokenPtr close; -} DMXConfigVirtual, *DMXConfigVirtualPtr; - -/** Heads entry storage. */ -typedef struct _DMXConfigEntry { - DMXConfigType type; - DMXConfigCommentPtr comment; - DMXConfigVirtualPtr virtual; - struct _DMXConfigEntry *next; -} DMXConfigEntry, *DMXConfigEntryPtr; - -extern DMXConfigEntryPtr dmxConfigEntry; - -extern int yylex(void); -extern int yydebug; -extern void yyerror(const char *message); - -extern void dmxConfigLog(const char *format, ...); -extern void *dmxConfigAlloc(unsigned long bytes); -extern void *dmxConfigRealloc(void *orig, - unsigned long orig_bytes, - unsigned long bytes); -extern const char *dmxConfigCopyString(const char *string, - int length); -extern void dmxConfigFree(void *area); -extern DMXConfigTokenPtr dmxConfigCreateToken(int token, int line, - const char *comment); -extern void dmxConfigFreeToken(DMXConfigTokenPtr p); -extern DMXConfigStringPtr dmxConfigCreateString(int token, int line, - const char *comment, - const char *string); -extern void dmxConfigFreeString(DMXConfigStringPtr p); -extern DMXConfigNumberPtr dmxConfigCreateNumber(int token, int line, - const char *comment, - int number); -extern void dmxConfigFreeNumber(DMXConfigNumberPtr p); -extern DMXConfigPairPtr dmxConfigCreatePair(int token, int line, - const char *comment, - int x, int y, - int xsign, int ysign); -extern void dmxConfigFreePair(DMXConfigPairPtr p); -extern DMXConfigCommentPtr dmxConfigCreateComment(int token, int line, - const char *comment); -extern void dmxConfigFreeComment(DMXConfigCommentPtr p); -extern DMXConfigPartDimPtr dmxConfigCreatePartDim(DMXConfigPairPtr pDim, - DMXConfigPairPtr pOffset); -extern void dmxConfigFreePartDim(DMXConfigPartDimPtr p); -extern DMXConfigFullDimPtr dmxConfigCreateFullDim(DMXConfigPartDimPtr pScrn, - DMXConfigPartDimPtr pRoot); -extern void dmxConfigFreeFullDim(DMXConfigFullDimPtr p); -extern DMXConfigDisplayPtr dmxConfigCreateDisplay(DMXConfigTokenPtr pStart, - DMXConfigStringPtr pName, - DMXConfigFullDimPtr pDim, - DMXConfigPairPtr pOrigin, - DMXConfigTokenPtr pEnd); -extern void dmxConfigFreeDisplay(DMXConfigDisplayPtr p); -extern DMXConfigWallPtr dmxConfigCreateWall(DMXConfigTokenPtr pStart, - DMXConfigPairPtr pWallDim, - DMXConfigPairPtr pDisplayDim, - DMXConfigStringPtr pNameList, - DMXConfigTokenPtr pEnd); -extern void dmxConfigFreeWall(DMXConfigWallPtr p); -extern DMXConfigOptionPtr dmxConfigCreateOption(DMXConfigTokenPtr pStart, - DMXConfigStringPtr pOption, - DMXConfigTokenPtr pEnd); -extern void dmxConfigFreeOption(DMXConfigOptionPtr p); -extern DMXConfigParamPtr dmxConfigCreateParam(DMXConfigTokenPtr pStart, - DMXConfigTokenPtr pOpen, - DMXConfigStringPtr pParam, - DMXConfigTokenPtr pClose, - DMXConfigTokenPtr pEnd); -extern void dmxConfigFreeParam(DMXConfigParamPtr p); -extern const char **dmxConfigLookupParam(DMXConfigParamPtr p, - const char *key, - int *argc); -extern DMXConfigSubPtr dmxConfigCreateSub(DMXConfigType type, - DMXConfigCommentPtr comment, - DMXConfigDisplayPtr display, - DMXConfigWallPtr wall, - DMXConfigOptionPtr option, - DMXConfigParamPtr param); -extern void dmxConfigFreeSub(DMXConfigSubPtr sub); -extern DMXConfigSubPtr dmxConfigSubComment(DMXConfigCommentPtr comment); -extern DMXConfigSubPtr dmxConfigSubDisplay(DMXConfigDisplayPtr display); -extern DMXConfigSubPtr dmxConfigSubWall(DMXConfigWallPtr wall); -extern DMXConfigSubPtr dmxConfigSubOption(DMXConfigOptionPtr option); -extern DMXConfigSubPtr dmxConfigSubParam(DMXConfigParamPtr param); -extern DMXConfigSubPtr dmxConfigAddSub(DMXConfigSubPtr head, - DMXConfigSubPtr sub); -extern DMXConfigVirtualPtr dmxConfigCreateVirtual(DMXConfigTokenPtr pStart, - DMXConfigStringPtr pName, - DMXConfigPairPtr pDim, - DMXConfigTokenPtr pOpen, - DMXConfigSubPtr pSubentry, - DMXConfigTokenPtr pClose); -extern void dmxConfigFreeVirtual(DMXConfigVirtualPtr virtual); -extern DMXConfigEntryPtr dmxConfigCreateEntry(DMXConfigType type, - DMXConfigCommentPtr comment, - DMXConfigVirtualPtr virtual); -extern void dmxConfigFreeEntry(DMXConfigEntryPtr entry); -extern DMXConfigEntryPtr dmxConfigAddEntry(DMXConfigEntryPtr head, - DMXConfigType type, - DMXConfigCommentPtr comment, - DMXConfigVirtualPtr virtual); -extern DMXConfigEntryPtr dmxConfigEntryComment(DMXConfigCommentPtr comment); -extern DMXConfigEntryPtr dmxConfigEntryVirtual(DMXConfigVirtualPtr virtual); - -#endif diff --git a/nx-X11/programs/Xserver/hw/dmx/config/dmxprint.c b/nx-X11/programs/Xserver/hw/dmx/config/dmxprint.c deleted file mode 100644 index ed3fc213d..000000000 --- a/nx-X11/programs/Xserver/hw/dmx/config/dmxprint.c +++ /dev/null @@ -1,456 +0,0 @@ -/* $XFree86$ */ -/* - * Copyright 2002 Red Hat Inc., Durham, North Carolina. - * - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation on the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial - * portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -/* - * Authors: - * Rickard E. (Rik) Faith - * - */ - -/** \file - * - * This file provides support routines and helper functions to be used - * to pretty-print DMX configurations. - * - * Because the DMX configuration file parsing should be capable of being - * used in a stand-alone fashion (i.e., independent from the DMX server - * source tree), no dependencies on other DMX routines are made. */ - -#ifdef HAVE_DMX_CONFIG_H -#include -#endif - -#include "dmxconfig.h" -#include "dmxparse.h" -#include "dmxprint.h" -#include "parser.h" -#include -#include -#include - -static FILE *str = NULL; -static int indent = 0; -static int pos = 0; - -/** Stack of indentation information used for pretty-printing - * configuration information. */ -static struct stack { - int base; - int comment; - int step; - struct stack *next; -} *stack, initialStack = { 0, 0, 4, NULL }; - -static void dmxConfigIndent(void) -{ - int i; - if (indent < 0) indent = 0; - if (indent > 40) indent = 40; - for (i = 0; i < indent; i++) fprintf(str, " "); -} - -static void dmxConfigNewline(void) -{ - if (pos) fprintf(str, "\n"); - pos = 0; -} - -static void dmxConfigPushState(int base, int comment, int step) -{ - struct stack *new = dmxConfigAlloc(sizeof(*new)); - new->base = base; - new->comment = comment; - new->step = step; - new->next = stack; - stack = new; - indent = base; - dmxConfigNewline(); -} - -static void dmxConfigPushComment(void) -{ - if (stack) indent = stack->comment; -} - -static void dmxConfigPushStep(void) -{ - if (stack) indent = stack->step; -} - -static void dmxConfigPopState(void) -{ - struct stack *old = stack; - - if (!stack) return; - indent = old->base; - stack = old->next; - if (!stack) dmxConfigLog("Stack underflow\n"); - dmxConfigFree(old); - dmxConfigNewline(); -} - -static void dmxConfigOutput(int addSpace, int doNewline, const char *comment, - const char *format, ...) -{ - va_list args; - - if (!pos) dmxConfigIndent(); - else if (addSpace) fprintf(str, " "); - - if (format) { - va_start(args, format); - /* RATS: This hasn't been audited -- it - * could probably result in a buffer - * overflow. */ - pos += vfprintf(str, format, args); /* assumes no newlines! */ - va_end(args); - } - - if (comment) { - if (pos) fprintf(str, " "); - pos += fprintf(str, "#%s", comment); - dmxConfigNewline(); - dmxConfigPushComment(); - } else if (doNewline) dmxConfigNewline(); -} - -static void dmxConfigPrintComment(DMXConfigCommentPtr p) -{ - dmxConfigOutput(1, 1, p->comment, NULL); -} - -static void dmxConfigPrintTokenFlag(DMXConfigTokenPtr p, int flag) -{ - if (!p) return; - switch (p->token) { - case T_VIRTUAL: - dmxConfigPushState(0, 4, 4); - dmxConfigOutput(0, 0, p->comment, "virtual"); - break; - case T_DISPLAY: - dmxConfigPushState(4, 12, 16); - dmxConfigOutput(0, 0, p->comment, "display"); - break; - case T_WALL: - dmxConfigPushState(4, 12, 16); - dmxConfigOutput(0, 0, p->comment, "wall"); - break; - case T_OPTION: - dmxConfigPushState(4, 12, 16); - dmxConfigOutput(0, 0, p->comment, "option"); - break; - case T_PARAM: - dmxConfigPushState(4, 8, 12); - dmxConfigOutput(0, 0, p->comment, "param"); - break; - case ';': - dmxConfigOutput(0, 1, p->comment, ";"); - if (flag) dmxConfigPopState(); - break; - case '{': - dmxConfigOutput(1, 1, p->comment, "{"); - dmxConfigPushStep(); - break; - case '}': - if (flag) dmxConfigPopState(); - dmxConfigOutput(0, 1, p->comment, "}"); - break; - case '/': - dmxConfigOutput(1, 0, NULL, "/"); - break; - default: - dmxConfigLog("unknown token %d on line %d\n", p->token, p->line); - } -} - -static void dmxConfigPrintToken(DMXConfigTokenPtr p) -{ - dmxConfigPrintTokenFlag(p, 1); -} - -static void dmxConfigPrintTokenNopop(DMXConfigTokenPtr p) -{ - dmxConfigPrintTokenFlag(p, 0); -} - -static int dmxConfigPrintQuotedString(const char *s) -{ - const char *pt; - - if (!s || !s[0]) return 1; /* Quote empty string */ - for (pt = s; *pt; ++pt) if (isspace(*pt)) return 1; - return 0; -} - -static void dmxConfigPrintString(DMXConfigStringPtr p, int quote) -{ - DMXConfigStringPtr pt; - - if (!p) return; - for (pt = p; pt; pt = pt->next) { - if (quote && dmxConfigPrintQuotedString(pt->string)) { - dmxConfigOutput(1, 0, pt->comment, "\"%s\"", - pt->string ? pt->string : ""); - } else - dmxConfigOutput(1, 0, pt->comment, "%s", - pt->string ? pt->string : ""); - } -} - -static int dmxConfigPrintPair(DMXConfigPairPtr p, int addSpace) -{ - const char *format = NULL; - - if (!p) return 0; - switch (p->token) { - case T_ORIGIN: format = "@%dx%d"; break; - case T_DIMENSION: format = "%dx%d"; break; - case T_OFFSET: format = "%c%d%c%d"; break; - } - if (p->token == T_OFFSET) { - if (!p->comment && !p->x && !p->y && p->xsign >= 0 && p->ysign >= 0) - return 0; - dmxConfigOutput(addSpace, 0, p->comment, format, - p->xsign < 0 ? '-' : '+', p->x, - p->ysign < 0 ? '-' : '+', p->y); - } else { - if (!p->comment && !p->x && !p->y) return 0; - dmxConfigOutput(addSpace, 0, p->comment, format, p->x, p->y); - } - return 1; -} - -static void dmxConfigPrintDisplay(DMXConfigDisplayPtr p) -{ - DMXConfigToken dummyStart = { T_DISPLAY, 0, NULL }; - DMXConfigToken dummyEnd = { ';', 0, NULL }; - DMXConfigToken dummySep = { '/', 0, NULL }; - DMXConfigString dummyName = { T_STRING, 0, NULL, NULL, NULL }; - DMXConfigPair dummySDim = { T_DIMENSION, 0, NULL, 0, 0, 0, 0 }; - DMXConfigPair dummySOffset = { T_OFFSET, 0, NULL, 0, 0, 0, 0 }; - DMXConfigPair dummyRDim = { T_DIMENSION, 0, NULL, 0, 0, 0, 0 }; - DMXConfigPair dummyROffset = { T_OFFSET, 0, NULL, 0, 0, 0, 0 }; - DMXConfigPair dummyOrigin = { T_ORIGIN, 0, NULL, 0, 0, 0, 0 }; - int output; - - if (p->dname) p->dname->string = p->name; - else dummyName.string = p->name; - - if (p->dim && p->dim->scrn && p->dim->scrn->dim) { - p->dim->scrn->dim->x = p->scrnWidth; - p->dim->scrn->dim->y = p->scrnHeight; - } else { - dummySDim.x = p->scrnWidth; - dummySDim.y = p->scrnHeight; - } - - if (p->dim && p->dim->scrn && p->dim->scrn->offset) { - p->dim->scrn->offset->x = p->scrnX; - p->dim->scrn->offset->y = p->scrnY; - } else { - dummySOffset.x = p->scrnX; - dummySOffset.y = p->scrnY; - } - - if (p->dim && p->dim->root && p->dim->root->dim) { - p->dim->root->dim->x = p->rootWidth; - p->dim->root->dim->y = p->rootHeight; - } else { - dummyRDim.x = p->rootWidth; - dummyRDim.y = p->rootHeight; - } - - if (p->dim && p->dim->root && p->dim->root->offset) { - p->dim->root->offset->x = p->rootX; - p->dim->root->offset->y = p->rootY; - } else { - dummyROffset.x = p->rootX; - dummyROffset.y = p->rootY; - } - - if (p->origin) { - p->origin->x = p->rootXOrigin, p->origin->y = p->rootYOrigin; - p->origin->xsign = p->rootXSign, p->origin->ysign = p->rootYSign; - } else { - dummyOrigin.x = p->rootXOrigin, dummyOrigin.y = p->rootYOrigin; - dummyOrigin.xsign = p->rootXSign, dummyOrigin.ysign = p->rootYSign; - } - - dmxConfigPrintToken(p->start ? p->start : &dummyStart); - dmxConfigPrintString(p->dname ? p->dname : &dummyName, 1); - - if (p->dim && p->dim->scrn && p->dim->scrn->dim) - output = dmxConfigPrintPair(p->dim->scrn->dim, 1); - else - output = dmxConfigPrintPair(&dummySDim, 1); - if (p->dim && p->dim->scrn && p->dim->scrn->offset) - dmxConfigPrintPair(p->dim->scrn->offset, !output); - else - dmxConfigPrintPair(&dummySOffset, !output); - - if (p->scrnWidth != p->rootWidth - || p->scrnHeight != p->rootHeight - || p->rootX - || p->rootY) { - dmxConfigPrintToken(&dummySep); - if (p->dim && p->dim->root && p->dim->root->dim) - output = dmxConfigPrintPair(p->dim->root->dim, 1); - else - output = dmxConfigPrintPair(&dummyRDim, 1); - if (p->dim && p->dim->root && p->dim->root->offset) - dmxConfigPrintPair(p->dim->root->offset, !output); - else - dmxConfigPrintPair(&dummyROffset, !output); - } - - dmxConfigPrintPair(p->origin ? p->origin : &dummyOrigin, 1); - dmxConfigPrintToken(p->end ? p->end : &dummyEnd); -} - -static void dmxConfigPrintWall(DMXConfigWallPtr p) -{ - dmxConfigPrintToken(p->start); - dmxConfigPrintPair(p->wallDim, 1); - dmxConfigPrintPair(p->displayDim, 1); - dmxConfigPrintString(p->nameList, 1); - dmxConfigPrintToken(p->end); -} - -static void dmxConfigPrintOption(DMXConfigOptionPtr p) -{ - DMXConfigToken dummyStart = { T_OPTION, 0, NULL }; - DMXConfigString dummyOption = { T_STRING, 0, NULL, NULL, NULL }; - DMXConfigToken dummyEnd = { ';', 0, NULL }; - - dummyOption.string = p->string; - - dmxConfigPrintToken(p->start ? p->start : &dummyStart); - dmxConfigPrintString(&dummyOption, 0); - dmxConfigPrintToken(p->end ? p->end : &dummyEnd); -} - -static void dmxConfigPrintParam(DMXConfigParamPtr p) -{ - if (!p) return; - if (p->start) { - if (p->open && p->close) { - dmxConfigPrintToken(p->start); - dmxConfigPrintToken(p->open); - dmxConfigPrintParam(p->next); - dmxConfigPrintToken(p->close); - } else if (p->end && p->param) { - dmxConfigPrintToken(p->start); - dmxConfigPrintString(p->param, 1); - dmxConfigPrintToken(p->end); - } else - dmxConfigLog("dmxConfigPrintParam: cannot handle format (a)\n"); - } else if (p->end && p->param) { - dmxConfigPrintString(p->param, 1); - dmxConfigPrintTokenNopop(p->end); - dmxConfigPrintParam(p->next); - } else - dmxConfigLog("dmxConfigPrintParam: cannot handle format (b)\n"); -} - -static void dmxConfigPrintSub(DMXConfigSubPtr p) -{ - DMXConfigSubPtr pt; - - if (!p) return; - for (pt = p; pt; pt = pt->next) { - switch (pt->type) { - case dmxConfigComment: dmxConfigPrintComment(pt->comment); break; - case dmxConfigDisplay: dmxConfigPrintDisplay(pt->display); break; - case dmxConfigWall: dmxConfigPrintWall(pt->wall); break; - case dmxConfigOption: dmxConfigPrintOption(pt->option); break; - case dmxConfigParam: dmxConfigPrintParam(pt->param); break; - default: - dmxConfigLog("dmxConfigPrintSub:" - " cannot handle type %d in subentry\n", pt->type); - } - } -} - -static void dmxConfigPrintVirtual(DMXConfigVirtualPtr p) -{ - DMXConfigToken dummyStart = { T_VIRTUAL, 0, NULL }; - DMXConfigToken dummyOpen = { '{', 0, NULL }; - DMXConfigToken dummyClose = { '}', 0, NULL }; - DMXConfigString dummyName = { T_STRING, 0, NULL, NULL, NULL }; - DMXConfigPair dummyDim = { T_DIMENSION, 0, NULL, 0, 0 }; - - if (p->vname) p->vname->string = p->name; - else dummyName.string = p->name; - - if (p->dim) p->dim->x = p->width, p->dim->y = p->height; - else dummyDim.x = p->width, dummyDim.y = p->height; - - - dmxConfigPrintToken(p->start ? p->start : &dummyStart); - dmxConfigPrintString(p->vname ? p->vname : &dummyName, 1); - dmxConfigPrintPair(p->dim ? p->dim : &dummyDim, 1); - dmxConfigPrintToken(p->open ? p->open : &dummyOpen); - dmxConfigPrintSub(p->subentry); - dmxConfigPrintToken(p->close ? p->close : &dummyClose); -} - -/** The configuration information in \a entry will be pretty-printed to - * the \a stream. If \a stream is NULL, then stdout will be used. */ -void dmxConfigPrint(FILE *stream, DMXConfigEntryPtr entry) -{ - DMXConfigEntryPtr pt; - - if (!stream) str = stdout; - else str = stream; - - stack = &initialStack; - - for (pt = entry; pt; pt = pt->next) { - switch (pt->type) { - case dmxConfigComment: dmxConfigPrintComment(pt->comment); break; - case dmxConfigVirtual: dmxConfigPrintVirtual(pt->virtual); break; - default: - dmxConfigLog("dmxConfigPrint: cannot handle type %d in entry\n", - pt->type); - } - } - if (pos) dmxConfigNewline(); -} - -/** The configuration information in \a p will be pretty-printed to the - * \a stream. If \a stream is NULL, then stdout will be used. */ -void dmxConfigVirtualPrint(FILE *stream, DMXConfigVirtualPtr p) -{ - if (!stream) str = stdout; - else str = stream; - - stack = &initialStack; - - dmxConfigPrintVirtual(p); - if (pos) dmxConfigNewline(); -} diff --git a/nx-X11/programs/Xserver/hw/dmx/config/dmxprint.h b/nx-X11/programs/Xserver/hw/dmx/config/dmxprint.h deleted file mode 100644 index b68c29620..000000000 --- a/nx-X11/programs/Xserver/hw/dmx/config/dmxprint.h +++ /dev/null @@ -1,44 +0,0 @@ -/* $XFree86$ */ -/* - * Copyright 2002 Red Hat Inc., Durham, North Carolina. - * - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation on the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial - * portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -/* - * Authors: - * Rickard E. (Rik) Faith - * - */ - -/** \file - * Interface to DMX configuration file pretty-printer. \see dmxprint.c */ - -#ifndef _DMXPRINT_H_ -#define _DMXPRINT_H_ - -void dmxConfigPrint(FILE *str, DMXConfigEntryPtr entry); -void dmxConfigVirtualPrint(FILE *str, DMXConfigVirtualPtr p); - -#endif diff --git a/nx-X11/programs/Xserver/hw/dmx/config/dmxtodmx.c b/nx-X11/programs/Xserver/hw/dmx/config/dmxtodmx.c deleted file mode 100644 index 706c49908..000000000 --- a/nx-X11/programs/Xserver/hw/dmx/config/dmxtodmx.c +++ /dev/null @@ -1,50 +0,0 @@ -/* $XFree86$ */ -/* - * Copyright 2002 Red Hat Inc., Durham, North Carolina. - * - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation on the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial - * portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -/* - * Authors: - * Rickard E. (Rik) Faith - * - * This is a simple filter for testing. - */ - -#include "dmxconfig.h" -#include "dmxparse.h" -#include "dmxprint.h" -#include "dmxcompat.h" - -extern int yyparse(void); -extern FILE *yyin; - -int main(int argc, char **argv) -{ - yydebug = 0; - yyparse(); - dmxConfigPrint(stdout, dmxConfigEntry); - return 0; -} diff --git a/nx-X11/programs/Xserver/hw/dmx/config/dmxtodmx.man b/nx-X11/programs/Xserver/hw/dmx/config/dmxtodmx.man deleted file mode 100644 index 68c7f5b40..000000000 --- a/nx-X11/programs/Xserver/hw/dmx/config/dmxtodmx.man +++ /dev/null @@ -1,41 +0,0 @@ -.\" $XFree86$ -.\" Copyright 2002 Red Hat Inc., Durham, North Carolina. -.\" All Rights Reserved. -.\" -.\" Permission is hereby granted, free of charge, to any person obtaining -.\" a copy of this software and associated documentation files (the -.\" "Software"), to deal in the Software without restriction, including -.\" without limitation on the rights to use, copy, modify, merge, -.\" publish, distribute, sublicense, and/or sell copies of the Software, -.\" and to permit persons to whom the Software is furnished to do so, -.\" subject to the following conditions: -.\" -.\" The above copyright notice and this permission notice (including the -.\" next paragraph) shall be included in all copies or substantial -.\" portions of the Software. -.\" -.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -.\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -.\" NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS -.\" BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -.\" ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -.\" CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -.\" SOFTWARE. -.\" -.\" Authors: -.\" Rickard E. (Rik) Faith -.\" -.TH dmxtodmx 1 __vendorversion__ -.SH NAME -dmxtodmx - dmx configuration file parser and printer -.SH SYNOPSIS -.B dmxtodmx -.SH DESCRIPTION -.I dmxtodmx -reads the standard input, parsing a configuration file for the -.I Xdmx -distributed multi-head X server. After a successful parse, the file is -pretty-printed to standard output. -.SH "SEE ALSO" -Xdmx(1), vdltodmx(1), xdmxconfig(1) diff --git a/nx-X11/programs/Xserver/hw/dmx/config/parser.y b/nx-X11/programs/Xserver/hw/dmx/config/parser.y deleted file mode 100644 index ac2441017..000000000 --- a/nx-X11/programs/Xserver/hw/dmx/config/parser.y +++ /dev/null @@ -1,226 +0,0 @@ -/* $XFree86$ */ -/* - * Copyright 2002-2003 Red Hat Inc., Durham, North Carolina. - * - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation on the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial - * portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -/* - * Authors: - * Rickard E. (Rik) Faith - * - */ - -%{ -#ifdef HAVE_DMX_CONFIG_H -#include -#endif - -#include "dmxparse.h" -#include -#include -#define YYDEBUG 1 -#define YYERROR_VERBOSE -#define YY_USE_PROTOS - -DMXConfigEntryPtr dmxConfigEntry = NULL; -#define APPEND(type, h, t) \ -{ \ - type pt; \ - for (pt = h; pt->next; pt = pt->next); \ - pt->next = t; \ -} -%} - -%union { - DMXConfigTokenPtr token; - DMXConfigStringPtr string; - DMXConfigNumberPtr number; - DMXConfigPairPtr pair; - DMXConfigFullDimPtr fdim; - DMXConfigPartDimPtr pdim; - DMXConfigDisplayPtr display; - DMXConfigWallPtr wall; - DMXConfigOptionPtr option; - DMXConfigParamPtr param; - DMXConfigCommentPtr comment; - DMXConfigSubPtr subentry; - DMXConfigVirtualPtr virtual; - DMXConfigEntryPtr entry; -} - - /* Terminals */ -%token '{' '}' ';' '/' T_VIRTUAL T_DISPLAY T_WALL T_OPTION T_PARAM -%token T_STRING -%token T_DIMENSION T_OFFSET T_ORIGIN -%token T_COMMENT T_LINE_COMMENT - - /* Non-termials */ -%type Display Wall Terminal Open Close -%type NameList Name -%type Dimension Offset Origin -%type PartialDim -%type FullDim -%type DisplayEntry -%type